14#include "mmg/mmg2d/libmmg2df.h"
16 mmg5_data_ptr_t :: mesh
17 mmg5_data_ptr_t :: sol,mmgmet
18 INTEGER :: ier,argc,i,j,opt
20 CHARACTER(len=300) :: exec_name,filename,fileout
22 print*,
" -- 2D MESH GENERATION FOR VISUALIZATION"
24 argc = command_argument_count();
25 CALL get_command_argument(0, exec_name)
29 print*,
" Usage: ",trim(adjustl(exec_name)),&
30 " input_file_name output_file_name" &
31 " Generation of a triangular mesh for solution vizualisation (at VTK &
32 & file format) from a Medit mesh file containing only points and the &
33 & associated solution file."
38 CALL get_command_argument(1, filename)
39 CALL get_command_argument(2, fileout)
54 CALL mmg2d_init_mesh(mmg5_arg_start, &
55 mmg5_arg_ppmesh,mmgmesh,mmg5_arg_ppmet,mmgmet, &
65 CALL mmg2d_loadmesh(mesh,trim(adjustl(filename)),&
66 len(trim(adjustl(filename))),ier)
67 IF ( ier /= 1 )
CALL exit(102)
69 CALL mmg2d_loadsol(mesh,sol,trim(adjustl(filename)),&
70 len(trim(adjustl(filename))),ier)
71 IF ( ier /= 1 )
CALL exit(103)
75 CALL mmg2d_set_iparameter(mesh,mmgmet,mmg2d_iparam_noinsert,1,ier);
76 IF ( ier /= 1 )
CALL exit(104)
78 CALL mmg2d_set_iparameter(mesh,mmgmet,mmg2d_iparam_noswap,1,ier);
79 IF ( ier /= 1 )
CALL exit(105)
81 CALL mmg2d_set_iparameter(mesh,mmgmet,mmg2d_iparam_nomove,1,ier);
82 IF ( ier /= 1 )
CALL exit(106)
84 CALL mmg2d_mmg2dmesh(mesh,mmgmet,ier)
85 IF ( ier /= mmg5_success )
CALL exit(200)
92 CALL mmg2d_savevtkmesh(mesh,sol,trim(adjustl(fileout)),len(trim(adjustl(fileout))),ier)
93 IF ( ier /= 1 )
CALL exit(300)
96 CALL mmg2d_free_all(mmg5_arg_start, &
97 mmg5_arg_ppmesh,mesh,mmg5_arg_ppmet,mmgmet, &
int main(int argc, char *argv[])