48#include "mmg/mmgs/libmmgs.h"
50int main(
int argc,
char *argv[]) {
54 char *inname, *outname1, *outname2;
56 fprintf(stdout,
" -- TEST MMGSLIB \n");
59 printf(
" Usage: %s filein fileout1 fileout2 \n",argv[0]);
64 inname = (
char *) calloc(strlen(argv[1]) + 1,
sizeof(
char));
65 if ( inname == NULL ) {
66 perror(
" ## Memory problem: calloc");
69 strcpy(inname,argv[1]);
71 outname1 = (
char *) calloc(strlen(argv[2]) + 1,
sizeof(
char));
72 if ( outname1 == NULL ) {
73 perror(
" ## Memory problem: calloc");
76 strcpy(outname1,argv[2]);
78 outname2 = (
char *) calloc(strlen(argv[3]) + 1,
sizeof(
char));
79 if ( outname2 == NULL ) {
80 perror(
" ## Memory problem: calloc");
83 strcpy(outname2,argv[3]);
103 if (
MMGS_loadMesh(mmgMesh,inname) != 1 ) exit(EXIT_FAILURE);
150 fprintf(stdout,
"BAD ENDING OF MMGSLIB: UNABLE TO SAVE MESH\n");
153 fprintf(stdout,
"BAD ENDING OF MMGSLIB\n");
204 fprintf(stdout,
"BAD ENDING OF MMGSLIB: UNABLE TO SAVE MESH\n");
207 fprintf(stdout,
"BAD ENDING OF MMGSLIB\n");
int MMGS_Set_iparameter(MMG5_pMesh mesh, MMG5_pSol sol, int iparam, MMG5_int val)
set an integer parameter of the remesher
int MMGS_Set_localParameter(MMG5_pMesh mesh, MMG5_pSol sol, int typ, MMG5_int ref, double hmin, double hmax, double hausd)
set a local parameter
int MMGS_Init_mesh(const int starter,...)
Initialize a mesh structure and optionally the associated solution and metric structures.
int MMGS_Free_all(const int starter,...)
Deallocations before return.
int MMGS_Chk_meshData(MMG5_pMesh mesh, MMG5_pSol met)
Check if the numbers of given entities match with mesh and solution size and check mesh data.
int MMGS_Set_dparameter(MMG5_pMesh mesh, MMG5_pSol sol, int dparam, double val)
set a real-valued parameter of the remesher
program main
Example for using mmglib (basic use)
int MMGS_loadSol(MMG5_pMesh mesh, MMG5_pSol met, const char *filename)
Load a metric field (or other solution) in medit's .sol format.
int MMGS_saveMesh(MMG5_pMesh mesh, const char *filename)
Save a mesh in .mesh or .meshb format.
int MMGS_saveSol(MMG5_pMesh mesh, MMG5_pSol met, const char *filename)
Write an isotropic or anisotropic metric in medit file format.
int MMGS_loadMesh(MMG5_pMesh mesh, const char *filename)
Load a mesh (in .mesh/.mesb format) from file.
int MMGS_mmgslib(MMG5_pMesh mesh, MMG5_pSol met)
Main "program" for mesh adaptation.
@ MMGS_IPARAM_numberOfLocalParam
#define MMG5_STRONGFAILURE