The object YACS contains every definition that allows the creation of a schema. This schema will drive the alternation of the computation of a physical modelization over a mesh and the adaptation of the mesh for the computation. This alternation is driven by some criteria for the convergence.
Note
To read an exhaustive description of any part of the schema, see YACS
The automatic creation of the schema is going to be made in three phases.
A name of schema is automatically proposed: YACS_1, YACS_2, etc. This name can be modified. He must not have been already used for another schema.
The file containing the script which allows to launch the calculation connected to the physical modelling is supplied here. It is a script python who has to respect the following rules:
If they are necessary for the creation of the class, we can supply arguments under the shape:
In return:
Example for the script:
argu = ["--rep_calc=" + rep_calc)]
argu.append("--num=%d" % numCalc)
argu.append("--mesh_file=" + MeshFile)
Script_A = Script(argu)
error, message, dico_resu = Script_A.compute ()
The directory will countain all the files producted by the computations. By default, nothing is suggested. The choice is made either by giving a name into the text zone or by a selection through the search window.
The initial mesh must be stored into a MED file. It is the very first mesh that is used to solve the physical problem. The name of the file is choosen either by giving a name into the text zone or by a selection through the search window.
Two types of schemas are proposed: constant or variable.
The default choice, ‘constant’, alternate a computation that is always the same and a mesh adaptation: from a computation to another one, the only part that is changed is the mesh. All the rest is identical. For example, in case the calculation would model a transient phenomenon, it is always the completeness of the transient phenomenon that is taken into account.
The option ‘variable’ is inactive today.
By default, the schema is saved into the file schema.xml in the directory of the case that is under the schema. If the file is deleted, it can be rewritten by the mouse option Write.
The object browser contains the created schemas, identified by their names. They can be edited. Under every schema, there is a link to the case and the reference to the xml file that is written. This file can be read.
Look The schema YACS
The schema that is produced by this procedure can be imported into the module YACS. It can be executed without any modification. It this case, the stop into the loop is done:
By default, the maximal number of iterations is equal to 5 and the test for the convergence is satisfied if the variable varies less than one per a thousand in a relative value, between two successive iterations. These tests can be modified.
These tests ares done into the node “Analyse” of the schema, as described in YACS.
The maximal number of iterations is given by the variable NbCalcMax:
NbCalcMax = 5
The value for the test is saved in a list all along the calculations:
valeur_v = dico_resu["V_TEST"]
if NumCalc == 0 :
resu1 = [valeur_v]
else :
resu1.append(valeur_v)
and the test is calculated after the second iteration:
solu_m1 = resu1[-2]
rap = ( resu1[-1] - solu_m1 ) / solu_m1
if abs(rap) < 0.001 :
MessInfo = ""
Error = -9999
break
If this test is modified, it must be done here. But the instructions when it is converged must be kept to guarantee a good execution:
MessInfo = ""
Error = -9999
break
A user’s guide for schemas with Code_Aster is available here: A schema YACS for Code_Aster.