example ===== We will take a good look at the command files associated with the test cases zzzz121a, b, c, c, d, e, f and zzzz175a, b. They express mesh adaptation processes either by sequencing commands or in the form of a loop in Python language. Here is an example of configuring the macro command. .. code-block:: text MACR_ADAP_MAIL ( ADAPTATION = 'RAFF_DERA', MAILLAGE_N = min, MAILLAGE_NP1 = CO ("better"), RESULTAT_N = stir, NOM_CHAM = 'QIRE_ELEM', NOM_CMP = 'ERREST' NUME_ORDRE = 3, CRIT_RAFF_PE = 0.01, CRIT_DERA_PE = 0.25, NIVE_MAX = 5 MAJ_CHAM = _F ( RESULTAT = money, NOM_CHAM = 'TEMP', TYPE_CHAM = 'NOEU_TEMP_R', INST = 12.5, CHAM_MAJ = CO ("tempeux") ), QUALITE = 'OUI', ) This sequence will adapt the mesh contained in the MUN concept and restore a mesh concept with a better name. The adaptation is done by free refinement and de-refinement, according to the field contained in field QIRE_ELEM of the remeun result, at the 3rd moment; the component used is ERREST. The meshes will be classified according to their decreasing level of error. The first% will be refined; the last 25% will be candidates for deraffination. No mesh in the final mesh should be the result of more than 5 refinements. The field TEMP of the rethun result at time 12.5 is expressed on the mun mesh. It will be expressed on the mesh better in the form of the temperature field at the temperate nodes. A summary of the quality of the meshes of the new mesh is produced. The interpenetration of the meshes is not controlled. Here is an example of the table showing the distribution of the field controlling the adaptation of the mesh. .. csv-table:: "************************************************************ *Field driving the adaption* *Value out of the 936 triangles* ************************************************************ *Minimum: 0.35358E-05 Maximum: 0.33395E-03* *Average: 0.66371E-04 Standard deviation: 0.51323E-04* ************************************************************ *Distribution function* *Values* Number of meshes* *Mini < < Maxi* per class *cumulative* * *10**-4 *in%. number* in%. number * ************************************************************ *0.000 < 0.170* 11.65. 109 *11.65. 109* *0.170 < 0.340* 21.15. 198 *32.80. 307* *0.340 < 0.510* 15.60. 146 *48.40. 453* *0.510 < 0.680* 12.71. 119 *61.11. 572* *0.680 < 0.850* 10.79. 101 *71.90. 673* *0.850 < 1.020* 7.37. 69 *79.27. 742* *1.020 < 1.190* 6.30. 59 *85.58. 801* *1.190 < 1.360* 4.59. 43 *90.17. 844* *1.360 < 1.530* 2.35. 22 *92.52. 866* *1.530 < 1.700* 1.50. 14 *94.02. 880* *1,700 < 1,870* 2.24. 21 *96.26. 901* *1.870 < 2.040* 1.39. 13 *97.65. 914* *2,040 < 2,210* 1.50. 14 *99.15. 928* *2.210 < 2.380* 0.43. 4 *99.57. 932* *2.380 < 2.550* 0.21. 2 *99.79. 934* *2.550 < 2.720* 0.00. 0 *99.79. 934* *2.720 < 2.890* 0.00. 00 *99.79. 934* *2.890 < 3.060* 0.00. 0 *99.79. 934* *3.060 < 3.230* 0.00. 00 *99.79. 934* *3.230 < 3.400* 0.21. 2 *100.00. 936* ************************************************************" The diagnosis on the distribution of the field driving the mesh adaptation first recalls the extreme values encountered in the current calculation. Here the minimum is 0.353585x10-5 and the maximum is 0.33395x10-3. We specify the mean value, 0.66371x10-4, and the standard deviation, 0.51323x10-4. Next, the distribution by equidistant slice is presented starting from the optimum value, 0. We can see that for 880 triangles, the field value is less than 1.70x10-4, or 94.02% of the total number of triangles. Then, for 21 triangles the field value is between 1.70x10-4 and 1.87x10-4, or 2.24% of the total number of triangles. Cumulatively, we therefore see that for 901= 880 + 21 triangles, the field value is less than 1.87x10-4, or 96.26% of the total. And so on. For example, for 99.79% of cells, the field value is less than 2.55x10-4. .. image:: images/100000000000038C0000027CCFBF9B92587A26D1.png :width: 6.2992in :height: 4.4098in .. _RefImage_100000000000038C0000027CCFBF9B92587A26D1.png: In the preceding figure, we can see the representation in the form of a histogram of the percentages of cells in each of the value ranges concerned. As can also be seen in the previous table, it can be seen that very few cells concentrate the high values. By visualizing a representation of the cumulative percentage of cells in a given value range, we have the following figure. .. image:: images/1000000000000393000002974145C471FA3E8626.png :width: 6.889in :height: 4.9909in .. _RefImage_1000000000000393000002974145C471FA3E8626.png: From this distribution of values, we can deduce two consequences on refinement strategies. If we ask for refinement on a criterion relating to the value of the field, keyword CRIT_RAFF_REL, this is equivalent to selecting the meshes the elements that are to the right of the vertical line passing through this criterion. For example, if we ask CRIT_RAFF_REL = 0.77, we will select all the meshes whose error is greater than 0.35358x10-5 + 0.77x (0.33395x10-3-0.35358x10-5), or 2.58x10-3. We note that this corresponds to very few cells: only 2 exceed this value, i.e. 0.21% of the total. We had the impression of requiring significant refinement, 0.77 or a quarter *roughly*, but in fact we are refining almost nothing. If we ask for a refinement on a percentage of cells, keyword CRIT_RAFF_PE, this is equivalent to selecting the cells that are above the horizontal line passing through this criterion. For example, if we ask CRIT_RAFF_PE = 0.10, we will select the 10% worst mesh, i.e. 93 stitches. It is the 90% horizontal line. Among these meshes, the "least worst" have a value less than 1.36x10-4, i.e. 40% of the maximum value. It is quite effective since we will have trapped the big differences. The consequence of these remarks is that it is necessary to do an initial analysis of the distribution of field values before choosing the type and values of the refinement criteria. It is in fact useless, even expensive in terms of increasing the mesh size, to refine in areas where the field is not very strong. The adaptation will be all the more effective if the high-value meshes have been reduced until a balance is obtained in the mesh.