3. Description of a mesh adaptation#

3.1. General diagram of an adaptation#

The general principle of a calculation with mesh adaptation is as follows:

Stage 1:

Reading the initial mesh, M0 Defining the materials

Stage 2:

  • definition of the model, of the loads on this M0

mesh - calculation producing a result RESU0 - possible calculation of a field driving the refinement, CHAMP0

This initial phase is the standard phase of any calculation.

Stage 3:

Adaptation of the M0 mesh. A new mesh, M 1, is recovered

Stage 4:

  • definition of the model, of the loads on the M1 mesh,

  • calculation producing a result RESU1,

  • possible calculation of a field controlling the refinement, CHAMP1.

Phase 4 is similar to phase 2. The only thing that has changed is the mesh. Therefore, all the concepts that depend on it must be taken up again. Today, there is no possibility to reuse old concepts or to destroy them automatically.

Then, you can continue, as many times as you want, the phase 3/phase 4 tandem. This is done either by duplicating the instructions or by writing a python loop.

See reference [bib1] for a general overview of mesh adaptation and HOMARD, with examples.

3.2. How the macro control works#

Phase 3 carries out the adaptation of the mesh. It is activated by the macro command MACR_ADAP_MAIL, described in this document. Its main argument is the name of the concept of the current mesh and the name that will be given to the concept of the future mesh. The other mandatory data is the type of adaptation you want: free refinement or deraffination, that is to say according to the values that a field takes on the mesh cells, or a geometric zone, or uniform refinement or deraffination, i.e. all the cells are treated in the same way.

The other data then depends on the options selected.

In addition to the adaptation, HOMARD can provide, on request, reports on the quality or diameter of the mesh cells of the mesh, the connectivity of the calculation domain, the characteristic sizes, the over-stressed elements or a check on the non-interpenetration of the cells. This information is obtained by activating the associated keywords. We will take a good look at the command MACR_INFO_MAIL [U7.03.02] which allows you to obtain all this information, regardless of any calculation.

3.3. A few comments#

The adapted mesh contains the same groups as the input mesh, with the following rule: a group defines the same geometric location in both meshes.

  • Using a group of nodes is the same as defining specific locations. The group in the adapted mesh will be the list of the same nodes, no more, no less, to represent the same points; only their numbers will eventually have changed.

  • Using a group of segments is the same as defining lines. The group in the adapted mesh will be the list of segments that represent the same lines. Depending on the mode of adaptation, these segments will either be the same, to the nearest number, or the halves of the initial segments.

  • Using a group of triangles and/or quadrangles is the same as defining surfaces. The group in the adapted mesh will be the list of triangles and/or quadrangles that represent the same surfaces. Depending on the mode of adaptation, these cells will be either the same, to the nearest number, or the fractions of the initial 2D cells.

  • Likewise, using a group of 3D elements is the same as defining volumes. The group in the adapted mesh will be the list of 3D meshes that represent the same volumes. Depending on the mode of adaptation, these cells will be either the same, to the nearest number, or the fractions of the initial 3D cells.

The consequence is as follows. The loads of the mechanical or thermal calculation must exclusively be defined by groups of the dimension consistent with the phenomenon that one wants to model.

Any other operation will lead to an error in the calculation on the adapted mesh. Using meshes defined by their number is impossible because the numbering will change. Using groups of knots or meshes of the wrong size will not fully describe the location.

For a more detailed and illustrated explanation, see:

https://www.code-aster.org/outils/homard/usage/regles.fr.htm#CL

When you want to adapt a mesh several times in a row, it is essential to respect the mesh chain. At the first iteration, the input mesh of MACR_ADAP_MAIL is the initial mesh of the case we are treating. Then the input mesh of a MACR_ADAP_MAIL should be the output mesh of the previous MACR_ADAP_MAIL. Attention: it is not enough to give a mesh that is formally the same, following a copy for example. It is imperative to provide the same concept (see also IDENTIFICATION). If we do not do this, we will lose the history of mesh refinement and it will be impossible to deraffine later. Worse, since HOMARD is no longer aware of the additional cuts that have been introduced to ensure compliance, we will be forced to cut meshes by greatly degrading their quality. If this bad data entry occurs, an alarm is issued.

Mesh adaptation is possible in POURSUITE mode. The data required for recovery is automatically archived and then re-read in the database storage directory required to*Code_Aster*. Using HOMARD in pursuit is therefore done in the same way as using Code_Aster in pursuit.

In general, the essential impressions provided by HOMARD are inserted into the « mess » file during execution. In the event of an error or in information mode 3 or 4, more detailed impressions take place.