19#include "mmg/mmg2d/libmmg2d.h"
21int main(
int argc,
char *argv[]) {
28 fprintf(stdout,
" -- TEST MMG2DMESH \n");
32 printf(
" Usage: %s filein fileout \n",argv[0]);
37 filename = (
char *) calloc(strlen(argv[1]) + 1,
sizeof(char));
39 perror(
" ## Memory problem: calloc");
44 outname = (
char *) calloc(strlen(argv[2]) + 1,
sizeof(char));
45 if ( outname == NULL ) {
46 perror(
" ## Memory problem: calloc");
49 strcpy(outname,argv[2]);
84 fprintf(stdout,
"BAD ENDING OF MMG2DMESH: UNABLE TO SAVE MESH\n");
87 fprintf(stdout,
"BAD ENDING OF MMG2DMESH\n");
int MMG2D_Init_mesh(const int starter,...)
Initialize a mesh structure and optionally the associated solution and metric structures.
int MMG2D_Set_iparameter(MMG5_pMesh mesh, MMG5_pSol sol, int iparam, MMG5_int val)
Set integer parameter iparam to value val.
int MMG2D_Set_dparameter(MMG5_pMesh mesh, MMG5_pSol sol, int dparam, double val)
Set double parameter dparam to value val.
int MMG2D_Free_all(const int starter,...)
Deallocations before return.
MMG5_pMesh char * filename
program main
Example for using mmglib (basic use)
int MMG2D_saveMesh(MMG5_pMesh mesh, const char *filename)
Save a mesh in .mesh/.meshb format.
int MMG2D_saveSol(MMG5_pMesh mesh, MMG5_pSol sol, const char *filename)
Save metric field in medit solution file format.
int MMG2D_loadMesh(MMG5_pMesh mesh, const char *filename)
Load a mesh (in .mesh/.mesb format) from file.
int MMG2D_mmg2dmesh(MMG5_pMesh mesh, MMG5_pSol met)
Main "program" for the mesh generation library.
#define MMG5_STRONGFAILURE