48#include "mmg/mmgs/libmmgs.h"
50int main(
int argc,
char *argv[]) {
55 char *inname,*outname,*lsname;
57 fprintf(stdout,
" -- TEST MMGSLS \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]);
116 if (
MMGS_loadMesh(mmgMesh,inname) != 1 ) exit(EXIT_FAILURE);
137 for(k=1 ; k<=np ; k++) {
155 fprintf(stdout,
"BAD ENDING OF MMGSLS: UNABLE TO SAVE MESH\n");
158 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_Get_meshSize(MMG5_pMesh mesh, MMG5_int *np, MMG5_int *nt, MMG5_int *na)
Get the number of vertices, triangles, and edges of the mesh.
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_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 MMGS_Set_solSize(MMG5_pMesh mesh, MMG5_pSol sol, int typEntity, MMG5_int np, int typSol)
Initialize an array of solution fields: set dimension, types and number of fields.
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