48#include "mmg/mmg3d/libmmg3d.h"
50int main(
int argc,
char *argv[]) {
55 char *inname,*outname,*lsname;
57 fprintf(stdout,
" -- TEST MMG3DLS \n");
60 printf(
" Usage: %s meshfile lsfile fileout\n",argv[0]);
65 inname = (
char *) calloc(strlen(argv[1]) + 1,
sizeof(char));
66 if ( inname == NULL ) {
67 perror(
" ## Memory problem: calloc");
70 strcpy(inname,argv[1]);
73 lsname = (
char *) calloc(strlen(argv[2]) + 1,
sizeof(char));
74 if ( lsname == NULL ) {
75 perror(
" ## Memory problem: calloc");
78 strcpy(lsname,argv[2]);
80 outname = (
char *) calloc(strlen(argv[3]) + 1,
sizeof(char));
81 if ( outname == NULL ) {
82 perror(
" ## Memory problem: calloc");
85 strcpy(outname,argv[3]);
131 if (
MMG3D_Get_meshSize(mmgMesh,&np,NULL,NULL,NULL,NULL,NULL) !=1 ) exit(EXIT_FAILURE);
137 for(k=1 ; k<=np ; k++) {
155 fprintf(stdout,
"BAD ENDING OF MMG3DLS: UNABLE TO SAVE MESH\n");
158 fprintf(stdout,
"BAD ENDING OF MMG3DLS\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_Set_tensorSol(MMG5_pSol met, double m11, double m12, double m13, double m22, double m23, double m33, MMG5_int pos)
Set a single element of a tensor solution structure.
int MMG3D_Get_meshSize(MMG5_pMesh mesh, MMG5_int *np, MMG5_int *ne, MMG5_int *nprism, MMG5_int *nt, MMG5_int *nquad, MMG5_int *na)
Get the number of vertices, tetrahedra, prisms, triangles, quadrilaterals and edges of the mesh.
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
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_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_mmg3dls(MMG5_pMesh mesh, MMG5_pSol sol, MMG5_pSol umet)
Main "program" for the level-set discretization library.
#define MMG5_STRONGFAILURE