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, &
91 CALL mmgs_set_iparameter(mmgmesh,0_8,mmgs_iparam_iso, 1_immg,ier)
92 IF ( ier == 0 )
CALL exit(101)
95 CALL mmgs_set_dparameter(mmgmesh,0_8,mmgs_dparam_hsiz, 0.5d0,ier)
96 IF ( ier == 0 )
CALL exit(101)
103 CALL mmgs_loadmesh(mmgmesh,trim(adjustl(inname)),&
104 len(trim(adjustl(inname))),ier)
105 IF ( ier == 0 )
CALL exit(102)
112 CALL mmgs_loadsol(mmgmesh,mmgls,trim(adjustl(lsname)),&
113 len(trim(adjustl(lsname))),ier)
119 CALL mmgs_chk_meshdata(mmgmesh,mmgls,ier)
120 IF ( ier /= 1 )
CALL exit(105)
125 CALL mmgs_mmgsls(mmgmesh,mmgls,%val(0_8),ier)
127 IF ( ier == mmg5_strongfailure )
THEN
128 print*,
"BAD ENDING OF MMGSLIB: UNABLE TO SAVE MESH"
130 ELSE IF ( ier == mmg5_lowfailure )
THEN
131 print*,
"BAD ENDING OF MMGSLIB"
141 CALL mmgs_savemesh(mmgmesh,trim(adjustl(outname)),&
142 len(trim(adjustl(outname))),ier)
148 CALL mmgs_free_all(mmg5_arg_start, &
149 mmg5_arg_ppmesh,mmgmesh,mmg5_arg_ppls,mmgls, &
int main(int argc, char *argv[])