45#include "mmg/mmg3d/libmmg3df.h"
47 mmg5_data_ptr_t :: mmgmesh
48 mmg5_data_ptr_t :: mmgls,mmgmet
50 INTEGER(MMG5F_INT) :: k,np
51 CHARACTER(len=300) :: exec_name,inname,outname,lsname
53 INTEGER,
PARAMETER :: immg = mmg5f_int
55 WRITE(*,*)
" -- TEST MMG3DLIB"
57 argc = command_argument_count();
58 CALL get_command_argument(0, exec_name)
61 print*,
" Usage: ",trim(exec_name),
" meshfile lsfile meshout"
66 CALL get_command_argument(1, inname)
67 CALL get_command_argument(2, lsname)
68 CALL get_command_argument(3, outname)
85 CALL mmg3d_init_mesh(mmg5_arg_start, &
86 mmg5_arg_ppmesh,mmgmesh,mmg5_arg_ppls,mmgls, &
87 mmg5_arg_ppmet,mmgmet, &
93 CALL mmg3d_set_iparameter(mmgmesh,mmgls,mmg3d_iparam_iso, 1_immg,ier)
94 IF ( ier == 0 )
CALL exit(101)
101 CALL mmg3d_loadmesh(mmgmesh,trim(adjustl(inname)),&
102 len(trim(adjustl(inname))),ier)
103 IF ( ier == 0 )
CALL exit(102)
110 CALL mmg3d_loadsol(mmgmesh,mmgls,trim(adjustl(lsname)),&
111 len(trim(adjustl(lsname))),ier)
121 CALL mmg3d_get_meshsize(mmgmesh,np,%val(0_immg),%val(0_immg),&
122 %val(0_immg),%val(0_immg),%val(0_immg),ier)
128 CALL mmg3d_set_solsize(mmgmesh,mmgmet,mmg5_vertex,np,mmg5_tensor,ier)
137 CALL mmg3d_set_tensorsol(mmgmet,10.d0,0.d0,0.d0,1.d0,0.d0,1.d0,k,ier)
144 CALL mmg3d_chk_meshdata(mmgmesh,mmgls,ier)
145 IF ( ier /= 1 )
CALL exit(105)
151 CALL mmg3d_mmg3dls(mmgmesh,mmgls,mmgmet,ier)
153 IF ( ier == mmg5_strongfailure )
THEN
154 print*,
"BAD ENDING OF MMG3DLIB: UNABLE TO SAVE MESH"
156 ELSE IF ( ier == mmg5_lowfailure )
THEN
157 print*,
"BAD ENDING OF MMG3DLIB"
167 CALL mmg3d_savemesh(mmgmesh,trim(adjustl(outname)),&
168 len(trim(adjustl(outname))),ier)
174 CALL mmg3d_savesol(mmgmesh,mmgmet,trim(adjustl(outname)),&
175 len(trim(adjustl(outname))),ier)
181 CALL mmg3d_free_all(mmg5_arg_start, &
182 mmg5_arg_ppmesh,mmgmesh,mmg5_arg_ppls,mmgls, &
183 mmg5_arg_ppmet,mmgmet, &
int main(int argc, char *argv[])