7. Files fixed#

Order catalog:

from.commons import*
from.. language.DataStructure import*
from.. language.Syntax import*


MODI_MAIL = OPER (
    name=" MODI_MAIL ",
    op=190,
    sd_prod=mesh_sdaster,
    fr=tr ("Modifying a mesh by translation"),
    reentrant="o: MAILLAGE ",
    use= SIMP (status="c", typ=CO),
    MAILLAGE = SIMP (status="o", typ=mesh_sdaster),
    TRANSLATION = FACT (status="o", VECTEUR = SIMP (status="o", typ="R", min=2, max=3)),
    INFO = SIMP (status="f", typ="I", default=1, into =( 1, 2)),
)

Bibfor/op/op0190.f90 command routine:

subroutine op0190 ()
    Implicit none

#include "asterc/getfac.h"
#include "asterc/getres.h"
#include "asterfort/as_allocate.h"
#include "asterfort/as_deallocate.h"
#include "asterfort/assert.h"
#include "asterfort/dismoi.h"
#include "asterfort/getvid.h"
#include "asterfort/getvr8.h"
#include "asterfort/jedema.h"
#include "asterfort/jemarq.h"
#include "asterfort/jeveuo.h"

    character (len=8):: mesh, result
    character (len=16):: concept, cmd name
    character (len=19): chord
    character (len=24):: vect_core
    integer: i, j, iret, dim, nbocc, nbnodes
    real (kind=8), pointer:: vect (:) => null ()
    real (kind=8):: transl (3)
    real (kind=8), pointer:: coordinate (:) => null ()

    Call jemarq ()

! Read the input mesh name: mesh_sdaster, see d6.03.01, §2.1.1
    call getvid (" "," MAILLAGE ", scal=mesh, nbret=iret)
    ASSERT (iret = 1)

! Read the mesh result (must be identical to the input), see d6.03.01, §2.1.5
    call parameters (result, concept, cmd name)
    ASSERT (result == mesh)

! check that TRANSLATION exists, see d6.03.01, §2.1.6
    call getfac ('TRANSLATION', nbocc)
    ASSERT (bocc=1)

! Get the size of the translation vector for a dynamic allocation, see d6.03.01, §2.1.1
    call getvr8 (" TRANSLATION "," VECTEUR ", iocc=1, nbval=0, nbret=dim)
    Sun = -Sun
    ASSERT (2 <= dim.and. dim <= 3)
! Allocate the vector of size 'dim'
    AS_ALLOCATE (vr=vect, size=dim)
! Read the translation vector values
    call getvr8 (" TRANSLATION "," VECTEUR ", iocc=1, nbval=dim, vect=vect)

! Name of the Jeveux vector containing the coordinates of the mesh
! See d4.06.01 for the COORDO object and d4.06.05 for its VALE vector
    chord=mesh//". COORDO"
    vect_core=chcoord//". VALE"

! Get the address and the size of this vector
    call jeveuo (vect_cored, 'E', vr=cored)
    call tell me ('NB_NO_MAILLA', mesh, 'MAILLAGE', repi=nbnodes)

! Translate the mesh
    transl = 0.d0
    transl = vect
! Loop on the Nodes
    do i = 1, nbnodes
! Always 3 coordinates in. COORDO
        Do j = 1, 3
            coordinate ((i-1) *3+j) = coordinate ((i-1)*3+j) +transl (j)
        End Do
    End Do

    AS_DEALLOCATE (vr=vect)

    Call Jedema ()
End subroutine