44#include "mmg/mmg2d/libmmg2df.h"
46 mmg5_data_ptr_t :: mmgmesh
47 mmg5_data_ptr_t :: mmgls,mmgmet
49 CHARACTER(len=300) :: exec_name,inname,outname,lsname
51 INTEGER,
PARAMETER :: immg = mmg5f_int
53 WRITE(*,*)
" -- TEST MMG2DLIB"
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)
81 CALL mmg2d_init_mesh(mmg5_arg_start, &
82 mmg5_arg_ppmesh,mmgmesh,mmg5_arg_ppls,mmgls, &
83 mmg5_arg_ppmet,mmgmet, &
89 CALL mmg2d_set_iparameter(mmgmesh,%val(0_8),mmg2d_iparam_iso, 1_immg,ier)
90 IF ( ier == 0 )
CALL exit(101)
93 CALL mmg2d_set_dparameter(mmgmesh,%val(0_8),mmg2d_dparam_hsiz, 0.1d0,ier)
94 IF ( ier == 0 )
CALL exit(101)
101 CALL mmg2d_loadmesh(mmgmesh,trim(adjustl(inname)),&
102 len(trim(adjustl(inname))),ier)
103 IF ( ier == 0 )
CALL exit(102)
110 CALL mmg2d_loadsol(mmgmesh,mmgls,trim(adjustl(lsname)),&
111 len(trim(adjustl(lsname))),ier)
117 CALL mmg2d_chk_meshdata(mmgmesh,mmgls,ier)
118 IF ( ier /= 1 )
CALL exit(105)
123 CALL mmg2d_mmg2dls(mmgmesh,mmgls,%val(0_8),ier)
125 IF ( ier == mmg5_strongfailure )
THEN
126 print*,
"BAD ENDING OF MMG2DLIB: UNABLE TO SAVE MESH"
128 ELSE IF ( ier == mmg5_lowfailure )
THEN
129 print*,
"BAD ENDING OF MMG2DLIB"
139 CALL mmg2d_savemesh(mmgmesh,trim(adjustl(outname)),&
140 len(trim(adjustl(outname))),ier)
146 CALL mmg2d_savesol(mmgmesh,mmgmet,trim(adjustl(outname)),&
147 len(trim(adjustl(outname))),ier)
153 CALL mmg2d_free_all(mmg5_arg_start, &
154 mmg5_arg_ppmesh,mmgmesh,mmg5_arg_ppls,mmgls, &
155 mmg5_arg_ppmet,mmgmet, &
int main(int argc, char *argv[])