44#include "mmg/mmgs/libmmgsf.h"
46 mmg5_data_ptr_t :: mmgmesh
47 mmg5_data_ptr_t :: mmgls
49 CHARACTER(len=300) :: exec_name,inname,outname,lsname
52 INTEGER,
PARAMETER :: immg = mmg5f_int
54 WRITE(*,*)
" -- TEST MMGSLIB"
56 argc = command_argument_count();
57 CALL get_command_argument(0, exec_name)
60 print*,
" Usage: ",trim(exec_name),
" meshfile lsfile meshout"
65 CALL get_command_argument(1, inname)
66 CALL get_command_argument(2, lsname)
67 CALL get_command_argument(3, outname)
81 CALL mmgs_init_mesh(mmg5_arg_start, &
82 mmg5_arg_ppmesh,mmgmesh,mmg5_arg_ppls,mmgls, &
92 CALL mmgs_set_iparameter(mmgmesh,0_8,mmgs_iparam_iso, 1_immg,ier)
93 IF ( ier == 0 )
CALL exit(101)
96 CALL mmgs_set_iparameter(mmgmesh,0_8,mmgs_iparam_optim, 1_immg,ier)
97 IF ( ier == 0 )
CALL exit(101)
100 CALL mmgs_set_iparameter(mmgmesh,0_8,mmgs_iparam_anisosize, 1_immg,ier)
101 IF ( ier == 0 )
CALL exit(101)
108 CALL mmgs_loadmesh(mmgmesh,trim(adjustl(inname)),&
109 len(trim(adjustl(inname))),ier)
110 IF ( ier == 0 )
CALL exit(102)
117 CALL mmgs_loadsol(mmgmesh,mmgls,trim(adjustl(lsname)),&
118 len(trim(adjustl(lsname))),ier)
124 CALL mmgs_chk_meshdata(mmgmesh,mmgls,ier)
125 IF ( ier /= 1 )
CALL exit(105)
131 CALL mmgs_mmgsls(mmgmesh,mmgls,%val(0_8),ier)
133 IF ( ier == mmg5_strongfailure )
THEN
134 print*,
"BAD ENDING OF MMGSLIB: UNABLE TO SAVE MESH"
136 ELSE IF ( ier == mmg5_lowfailure )
THEN
137 print*,
"BAD ENDING OF MMGSLIB"
147 CALL mmgs_savemesh(mmgmesh,trim(adjustl(outname)),&
148 len(trim(adjustl(outname))),ier)
154 CALL mmgs_free_all(mmg5_arg_start, &
155 mmg5_arg_ppmesh,mmgmesh,mmg5_arg_ppls,mmgls, &
int main(int argc, char *argv[])