44#include "mmg/mmgs/libmmgsf.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 MMGSLIB"
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 mmgs_init_mesh(mmg5_arg_start, &
81 mmg5_arg_ppmesh,mmgmesh,mmg5_arg_ppls,mmgls, &
82 mmg5_arg_ppmet,mmgmet, &
88 CALL mmgs_set_iparameter(mmgmesh,0_8,mmgs_iparam_iso, 1_immg,ier)
89 IF ( ier == 0 )
CALL exit(101)
92 CALL mmgs_set_dparameter(mmgmesh,0_8,mmgs_dparam_hsiz, 0.5d0,ier)
93 IF ( ier == 0 )
CALL exit(101)
100 CALL mmgs_loadmesh(mmgmesh,trim(adjustl(inname)),&
101 len(trim(adjustl(inname))),ier)
102 IF ( ier == 0 )
CALL exit(102)
109 CALL mmgs_loadsol(mmgmesh,mmgls,trim(adjustl(lsname)),&
110 len(trim(adjustl(lsname))),ier)
116 CALL mmgs_chk_meshdata(mmgmesh,mmgls,ier)
117 IF ( ier /= 1 )
CALL exit(105)
122 CALL mmgs_mmgsls(mmgmesh,mmgls,mmgmet,ier)
124 IF ( ier == mmg5_strongfailure )
THEN
125 print*,
"BAD ENDING OF MMGSLIB: UNABLE TO SAVE MESH"
127 ELSE IF ( ier == mmg5_lowfailure )
THEN
128 print*,
"BAD ENDING OF MMGSLIB"
138 CALL mmgs_savemesh(mmgmesh,trim(adjustl(outname)),&
139 len(trim(adjustl(outname))),ier)
145 CALL mmgs_savesol(mmgmesh,mmgmet,trim(adjustl(outname)),&
146 len(trim(adjustl(outname))),ier)
152 CALL mmgs_free_all(mmg5_arg_start, &
153 mmg5_arg_ppmesh,mmgmesh,mmg5_arg_ppls,mmgls, &
154 mmg5_arg_ppmet,mmgmet, &
int main(int argc, char *argv[])