44#include "mmg/mmg3d/libmmg3df.h"
46 mmg5_data_ptr_t :: mmgmesh
47 mmg5_data_ptr_t :: mmgls
49 CHARACTER(len=300) :: exec_name,inname,outname,lsname
51 INTEGER,
PARAMETER :: immg = mmg5f_int
53 WRITE(*,*)
" -- TEST MMG3DLIB"
55 argc = command_argument_count();
56 CALL get_command_argument(0, exec_name)
59 print*,
" Usage: ",trim(exec_name),
" meshfile lsfile meshout"
64 CALL get_command_argument(1, inname)
65 CALL get_command_argument(2, lsname)
66 CALL get_command_argument(3, outname)
80 CALL mmg3d_init_mesh(mmg5_arg_start, &
81 mmg5_arg_ppmesh,mmgmesh,mmg5_arg_ppls,mmgls, &
90 CALL mmg3d_set_iparameter(mmgmesh,0_8,mmg3d_iparam_iso, 1_immg,ier)
91 IF ( ier == 0 )
CALL exit(101)
94 CALL mmg3d_set_iparameter(mmgmesh,0_8,mmg3d_iparam_optim, 1_immg,ier)
95 IF ( ier == 0 )
CALL exit(101)
98 CALL mmg3d_set_iparameter(mmgmesh,0_8,mmg3d_iparam_anisosize, 1_immg,ier)
99 IF ( ier == 0 )
CALL exit(101)
106 CALL mmg3d_loadmesh(mmgmesh,trim(adjustl(inname)),&
107 len(trim(adjustl(inname))),ier)
108 IF ( ier == 0 )
CALL exit(102)
115 CALL mmg3d_loadsol(mmgmesh,mmgls,trim(adjustl(lsname)),&
116 len(trim(adjustl(lsname))),ier)
122 CALL mmg3d_chk_meshdata(mmgmesh,mmgls,ier)
123 IF ( ier /= 1 )
CALL exit(105)
128 CALL mmg3d_mmg3dls(mmgmesh,mmgls,%val(0_8),ier)
130 IF ( ier == mmg5_strongfailure )
THEN
131 print*,
"BAD ENDING OF MMG3DLIB: UNABLE TO SAVE MESH"
133 ELSE IF ( ier == mmg5_lowfailure )
THEN
134 print*,
"BAD ENDING OF MMG3DLIB"
144 CALL mmg3d_savemesh(mmgmesh,trim(adjustl(outname)),&
145 len(trim(adjustl(outname))),ier)
151 CALL mmg3d_free_all(mmg5_arg_start, &
152 mmg5_arg_ppmesh,mmgmesh,mmg5_arg_ppls,mmgls, &
int main(int argc, char *argv[])