49#include "mmg/mmg3d/libmmg3d.h"
51int main(
int argc,
char *argv[]) {
57 fprintf(stdout,
" -- TEST MMG3DLIB \n");
59 printf(
" Usage: %s fileout \n",argv[0]);
64 outname = (
char *) calloc(strlen(argv[1]) + 1,
sizeof(char));
65 if ( outname == NULL ) {
66 perror(
" ## Memory problem: calloc");
69 strcpy(outname,argv[1]);
140 for(k=1 ; k<=12 ; k++) {
160 fprintf(stdout,
"BAD ENDING OF MMG3DLIB: UNABLE TO SAVE MESH\n");
163 fprintf(stdout,
"BAD ENDING OF MMG3DLIB\n");
176 if (
MMG3D_saveSol(mmgMesh,mmgSol,outname) !=1 ) exit(EXIT_FAILURE);
int MMG3D_Init_mesh(const int starter,...)
Initialize a mesh structure and optionally the associated solution and metric structures.
void MMG3D_Set_handGivenMesh(MMG5_pMesh mesh)
Finish providing mesh data without using the API functions.
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.
int MMG3D_Set_meshSize(MMG5_pMesh mesh, MMG5_int np, MMG5_int ne, MMG5_int nprism, MMG5_int nt, MMG5_int nquad, MMG5_int na)
Set the number of vertices, tetrahedra, prisms, triangles, quadrilaterals, and edges of a mesh.
int MMG3D_Set_solSize(MMG5_pMesh mesh, MMG5_pSol sol, int typEntity, MMG5_int np, int typSol)
Initialize a solution field.
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_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