15#include "mmg/libmmgf.h"
17 mmg5_data_ptr_t :: mmgmesh
18 mmg5_data_ptr_t :: mmgsol
20 CHARACTER(len=350) :: tdfile,tdfileout, bdfile, bdfileout,exec_name,fileout
22 WRITE(*,*)
" -- TEST MMGLIB"
24 argc = command_argument_count();
25 CALL get_command_argument(0, exec_name)
28 print*,argc,
" Usage: ",trim(exec_name),&
29 " 2d_file_name 3d_file_name output_file_name"
34 CALL get_command_argument(1, bdfile)
35 CALL get_command_argument(2, tdfile)
36 CALL get_command_argument(3, fileout)
52 CALL mmg2d_init_mesh(mmg5_arg_start, &
53 mmg5_arg_ppmesh,mmgmesh,mmg5_arg_ppmet,mmgsol, &
61 CALL mmg2d_loadmesh(mmgmesh,trim(adjustl(bdfile)),&
62 len(trim(adjustl(bdfile))),ier)
63 IF ( ier /= 1 )
CALL exit(102)
68 CALL mmg2d_loadsol(mmgmesh,mmgsol,trim(adjustl(bdfile)),len(trim(adjustl(bdfile))),ier)
77 CALL mmg2d_mmg2dlib(mmgmesh,mmgsol,ier)
79 IF ( ier == mmg5_strongfailure )
THEN
80 print*,
"BAD ENDING OF MMG2DLIB: UNABLE TO SAVE MESH"
82 ELSE IF ( ier == mmg5_lowfailure )
THEN
83 print*,
"BAD ENDING OF MMG2DLIB"
93 CALL mmg2d_savemesh(mmgmesh,trim(adjustl(fileout)) //
".2d.mesh",&
94 len(trim(adjustl(fileout)) //
".2d.mesh"),ier)
102 CALL mmg2d_savesol(mmgmesh,mmgsol,trim(adjustl(fileout)) //
".2d.mesh",&
103 len(trim(adjustl(fileout)) //
".2d.mesh"),ier)
109 CALL mmg2d_free_all(mmg5_arg_start, &
110 mmg5_arg_ppmesh,mmgmesh,mmg5_arg_ppmet,mmgsol, &
127 CALL mmgs_init_mesh(mmg5_arg_start, &
128 mmg5_arg_ppmesh,mmgmesh,mmg5_arg_ppmet,mmgsol, &
136 CALL mmgs_loadmesh(mmgmesh,trim(adjustl(tdfile)),&
137 len(trim(adjustl(tdfile))),ier);
138 IF ( ier /= 1 )
CALL exit(102)
145 CALL mmgs_loadsol(mmgmesh,mmgsol,trim(adjustl(tdfile)),&
146 len(trim(adjustl(tdfile))),ier);
152 CALL mmgs_chk_meshdata(mmgmesh,mmgsol,ier)
153 IF ( ier /=1 )
CALL exit(105)
157 CALL mmgs_mmgslib(mmgmesh,mmgsol,ier)
159 IF ( ier == mmg5_strongfailure )
THEN
160 print*,
"BAD ENDING OF MMGSLIB: UNABLE TO SAVE MESH"
162 ELSE IF ( ier == mmg5_lowfailure )
THEN
163 print*,
"BAD ENDING OF MMGSLIB"
173 CALL mmgs_savemesh(mmgmesh,trim(adjustl(fileout)) //
".s.mesh",&
174 len(trim(adjustl(fileout)) //
".s.mesh"),ier);
180 CALL mmgs_savesol(mmgmesh,mmgsol,trim(adjustl(fileout))//
".s.sol",&
181 len(trim(adjustl(fileout))//
".s.sol"),ier);
187 CALL mmgs_free_all(mmg5_arg_start, &
188 mmg5_arg_ppmesh,mmgmesh,mmg5_arg_ppmet,mmgsol, &
205 CALL mmg3d_init_mesh(mmg5_arg_start, &
206 mmg5_arg_ppmesh,mmgmesh,mmg5_arg_ppmet,mmgsol, &
214 CALL mmg3d_loadmesh(mmgmesh,trim(adjustl(tdfile)),&
215 len(trim(adjustl(tdfile))),ier)
216 IF ( ier /= 1 )
CALL exit(102)
223 CALL mmg3d_loadsol(mmgmesh,mmgsol,trim(adjustl(tdfile)),len(trim(adjustl(tdfile))),ier)
229 CALL mmg3d_chk_meshdata(mmgmesh,mmgsol,ier)
230 IF ( ier /= 1 )
CALL exit(105)
234 CALL mmg3d_mmg3dlib(mmgmesh,mmgsol,ier)
236 IF ( ier == mmg5_strongfailure )
THEN
237 print*,
"BAD ENDING OF MMG3DLIB: UNABLE TO SAVE MESH"
239 ELSE IF ( ier == mmg5_lowfailure )
THEN
240 print*,
"BAD ENDING OF MMG3DLIB"
250 CALL mmg3d_savemesh(mmgmesh,trim(adjustl(fileout)) //
".3d.mesh",&
251 len(trim(adjustl(fileout)) //
".3d.mesh"),ier)
257 CALL mmg3d_savesol(mmgmesh,mmgsol,trim(adjustl(fileout)) //
".3d.sol",&
258 len(trim(adjustl(fileout)) //
".3d.sol"),ier)
265 CALL mmg3d_free_all(mmg5_arg_start, &
266 mmg5_arg_ppmesh,mmgmesh,mmg5_arg_ppmet,mmgsol, &
int main(int argc, char *argv[])