Mmg
Simplicial remeshers (mesh adaptation, isovalue discretization, lagrangian movement)
main.c File Reference
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <string.h>
#include <ctype.h>
#include <math.h>
#include <float.h>
#include "mmg/mmgs/libmmgs.h"
Include dependency graph for main.c:

Go to the source code of this file.

Macros

#define MAX0(a, b)
 
#define MAX3(a, b, c)
 

Functions

int main (int argc, char *argv[])
 

Macro Definition Documentation

◆ MAX0

#define MAX0 ( a,
b )
Value:
(((a) > (b)) ? (a) : (b))

Example of use of the mmgs library (basic use of mesh adaptation)

Author
Charles Dapogny (LJLL, UPMC)
Cécile Dobrzynski (Inria / IMB, Université de Bordeaux)
Pascal Frey (LJLL, UPMC)
Algiane Froehly (Inria / IMB, Université de Bordeaux)
Version
5

Definition at line 50 of file main.c.

◆ MAX3

#define MAX3 ( a,
b,
c )
Value:
(((MAX0(a,b)) > c) ? (MAX0(a,b)) : c)
#define MAX0(a, b)
Definition main.c:24

Definition at line 51 of file main.c.

Function Documentation

◆ main()

int main ( int argc,
char * argv[] )

---------------------------— STEP I -----------------------—

1) Initialisation of mesh and sol structures

2) Build mesh in MMG5 format

Two solutions: just use the MMGS_loadMesh function that will read a .mesh(b) file formatted or manually set your mesh using the MMGS_Set* functions

Manually set of the mesh

a) give the size of the mesh: 12 vertices, 20 triangles, 0 edges

b) give the vertices: for each vertex, give the coordinates, the reference and the position in mesh of the vertex

d) give the triangles (not mandatory): for each triangle, give the vertices index, the reference and the position of the triangle

3) Build sol in MMG5 format

Two solutions: just use the MMGS_loadSol function that will read a .sol(b) file formatted or manually set your sol using the MMGS_Set* functions

Manually set of the sol

a) give info for the sol structure: sol applied on vertex entities, number of vertices=12, the sol is scalar

b) give solutions values and positions

4) (not mandatory): check if the number of given entities match with mesh size

---------------------------— STEP II -----------------------—

remesh function

---------------------------— STEP III -----------------------—

get results

Two solutions: just use the MMGS_saveMesh/MMGS_saveSol functions that will write .mesh(b)/.sol formatted files or manually get your mesh/sol using the MMGS_getMesh/MMGS_getSol functions

1) Manually get the mesh

a) get the size of the mesh: vertices, tetra, triangles, edges

b) Vertex recovering

d) Triangles recovering

e) Edges recovering

2) Manually get the solution

a) get the size of the sol: type of entity (SolAtVertices,...), number of sol, type of solution (scalar, tensor...)

b) Vertex recovering

3) Free the MMGS structures

Definition at line 53 of file main.c.

Here is the call graph for this function: