48#include "mmg/mmgs/libmmgs.h"
50int main(
int argc,
char *argv[]) {
54 char *inname,*lsname,*outname;
56 fprintf(stdout,
" -- TEST MMGSLS \n");
59 printf(
" Usage: %s meshfile lsfile meshout\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 lsname = (
char *) calloc(strlen(argv[2]) + 1,
sizeof(char));
72 if ( lsname == NULL ) {
73 perror(
" ## Memory problem: calloc");
76 strcpy(lsname,argv[2]);
79 outname = (
char *) calloc(strlen(argv[3]) + 1,
sizeof(char));
80 if ( outname == NULL ) {
81 perror(
" ## Memory problem: calloc");
84 strcpy(outname,argv[3]);
121 if (
MMGS_loadMesh(mmgMesh,inname) != 1 ) exit(EXIT_FAILURE);
145 fprintf(stdout,
"BAD ENDING OF MMGSLS: UNABLE TO SAVE MESH\n");
148 fprintf(stdout,
"BAD ENDING OF MMGSLS\n");
int MMGS_Set_iparameter(MMG5_pMesh mesh, MMG5_pSol sol, int iparam, MMG5_int val)
set an integer parameter of the remesher
int MMGS_Init_mesh(const int starter,...)
Initialize a mesh structure and optionally the associated solution and metric structures.
int MMGS_Free_all(const int starter,...)
Deallocations before return.
int MMGS_Chk_meshData(MMG5_pMesh mesh, MMG5_pSol met)
Check if the numbers of given entities match with mesh and solution size and check mesh data.
program main
Example for using mmglib (basic use)
int MMGS_loadSol(MMG5_pMesh mesh, MMG5_pSol met, const char *filename)
Load a metric field (or other solution) in medit's .sol format.
int MMGS_saveMesh(MMG5_pMesh mesh, const char *filename)
Save a mesh in .mesh or .meshb format.
int MMGS_saveSol(MMG5_pMesh mesh, MMG5_pSol met, const char *filename)
Write an isotropic or anisotropic metric in medit file format.
int MMGS_loadMesh(MMG5_pMesh mesh, const char *filename)
Load a mesh (in .mesh/.mesb format) from file.
int MMGS_mmgsls(MMG5_pMesh mesh, MMG5_pSol sol, MMG5_pSol umet)
Main "program" for level-set discretization.
#define MMG5_STRONGFAILURE