49#include "mmg/mmg3d/libmmg3d.h"
51int main(
int argc,
char *argv[]) {
57 fprintf(stdout,
" -- TEST MMG3DLIB \n");
60 printf(
" Usage: %s filein fileout \n",argv[0]);
65 filename = (
char *) calloc(strlen(argv[1]) + 1,
sizeof(char));
67 perror(
" ## Memory problem: calloc");
72 fileout = (
char *) calloc(strlen(argv[2]) + 1,
sizeof(char));
73 if ( fileout == NULL ) {
74 perror(
" ## Memory problem: calloc");
77 strcpy(fileout,argv[2]);
120 fprintf(stdout,
"BAD ENDING OF MMG3DLIB: UNABLE TO SAVE MESH\n");
123 fprintf(stdout,
"BAD ENDING OF MMG3DLIB\n");
133 fprintf(stdout,
"UNABLE TO SAVE MESH\n");
139 fprintf(stdout,
"UNABLE TO SAVE SOL\n");
int MMG3D_Init_mesh(const int starter,...)
Initialize a mesh structure and optionally the associated solution and metric structures.
int MMG3D_Chk_meshData(MMG5_pMesh mesh, MMG5_pSol met)
Check if the number of given entities match with mesh and sol size.
int MMG3D_Free_all(const int starter,...)
Deallocations before return.
MMG5_pMesh char * filename
program main
Example for using mmglib (basic use)
int MMG3D_saveMesh(MMG5_pMesh mesh, const char *filename)
Save a mesh in .mesh/.meshb format.
int MMG3D_loadSol(MMG5_pMesh mesh, MMG5_pSol met, const char *filename)
Load a metric field (or other solution).
int MMG3D_loadMesh(MMG5_pMesh mesh, const char *filename)
Load a mesh (in .mesh/.mesb format) from file.
int MMG3D_saveSol(MMG5_pMesh mesh, MMG5_pSol met, const char *filename)
Write isotropic or anisotropic metric.
int MMG3D_mmg3dlib(MMG5_pMesh mesh, MMG5_pSol met)
Main "program" for the mesh adaptation library.
#define MMG5_STRONGFAILURE