48#include "mmg/mmg3d/libmmg3d.h"
50int main(
int argc,
char *argv[]) {
54 char *inname, *outname1, *outname2;
56 fprintf(stdout,
" -- TEST MMG3DLIB \n");
59 printf(
" Usage: %s filein fileout1 filout2 \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]);
153 fprintf(stdout,
"BAD ENDING OF MMG3DLIB: UNABLE TO SAVE MESH\n");
156 fprintf(stdout,
"BAD ENDING OF MMG3DLIB\n");
205 fprintf(stdout,
"BAD ENDING OF MMG3DLIB: UNABLE TO SAVE MESH\n");
208 fprintf(stdout,
"BAD ENDING OF MMG3DLIB\n");
215 for ( k=1; k<=mmgSol->
np; k++ ) {
222 fprintf(stdout,
"BAD ENDING OF MMG3DLIB: UNABLE TO SAVE MESH\n");
225 fprintf(stdout,
"BAD ENDING OF MMG3DLIB\n");
int MMG3D_Init_mesh(const int starter,...)
Initialize a mesh structure and optionally the associated solution and metric structures.
int MMG3D_Set_dparameter(MMG5_pMesh mesh, MMG5_pSol sol, int dparam, double val)
set a real-valued parameter of the remesher
int MMG3D_Set_localParameter(MMG5_pMesh mesh, MMG5_pSol sol, int typ, MMG5_int ref, double hmin, double hmax, double hausd)
set a local parameter
int MMG3D_Set_scalarSol(MMG5_pSol met, double s, MMG5_int pos)
Set a single element of a scalar solution structure.
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_iparameter(MMG5_pMesh mesh, MMG5_pSol sol, int iparam, MMG5_int val)
set an integer parameter of the remesher
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.
@ MMG3D_IPARAM_numberOfLocalParam
#define MMG5_STRONGFAILURE