1. Objective of the exercise#

We propose to create a new command that allows the translation of a mesh of a 2D or 3D vector.

Here is the intended use case:

mesh = LIRE_MAILLAGE (FORMAT =" ASTER ")

mesh = MODI_MAIL (reuse=mesh, MAILLAGE =mesh, =mesh, TRANSLATION =_F (VECTEUR =( 1.0, 2.5, 4.0)))

We use a cube of one unit of length. After translation, we check the maximum number of coordinates in each direction. For the purposes of this exercise, we can consider that it is enough!

# check that the coordinates were changed correctly
chcore= CREA_CHAMP (TYPE_CHAM =" NOEU_GEOM_R ", OPERATION =", =" EXTR ", MAILLAGE =mesh, NOM_CHAM =" GEOMETRIE ")

TEST_RESU (
    CHAM_NO =(
        _F (CHAM_GD =chcoord, TYPE_TEST =" MAX ", NOM_CMP =", X", VALE_CALC =2.0),
        _F (CHAM_GD =chcored, TYPE_TEST =" MAX ", NOM_CMP =", =" Y", VALE_CALC =3.5),
        _F (CHAM_GD =chcoord, TYPE_TEST =" MAX ", NOM_CMP =", =" Z", VALE_CALC =5.0),
    )
)

It is a good practice to start a development by writing the layout data and therefore the test case that we want to arrive at, even if it is only a draft.

A test case should be:

  • small in size (a few seconds of time CPU, mesh with the minimum number of meshes);

  • easy to understand (few lines) and should cover a single feature (elementary test), all configurations and keywords;

  • example: should not trigger alarms (by default, an alarm in a test case produced an error);

  • documented: in the validation manual.