Mmg
Simplicial remeshers (mesh adaptation, isovalue discretization, lagrangian movement)
Functions
anisosiz_s.c File Reference

Fonctions for anisotropic size map computation. More...

#include "libmmgs_private.h"
#include "libmmgs.h"
#include "inlined_functions_private.h"
#include "mmgsexterns_private.h"
#include "mmgexterns_private.h"
Include dependency graph for anisosiz_s.c:

Go to the source code of this file.

Functions

static int MMG5_defmetsin (MMG5_pMesh mesh, MMG5_pSol met, MMG5_int it, int ip)
 
static int MMG5_defmetrid (MMG5_pMesh mesh, MMG5_pSol met, MMG5_int it, int ip)
 
static int MMG5_defmetref (MMG5_pMesh mesh, MMG5_pSol met, MMG5_int it, int ip)
 
int MMGS_surfballRotation (MMG5_pMesh mesh, MMG5_pPoint p0, MMG5_int *list, int ilist, double r[3][3], double *lispoi, double n[3])
 
static int MMG5_defmetreg (MMG5_pMesh mesh, MMG5_pSol met, MMG5_int it, int ip)
 
static int MMGS_intextmet (MMG5_pMesh mesh, MMG5_pSol met, MMG5_int np, double me[6])
 
int MMGS_defsiz_ani (MMG5_pMesh mesh, MMG5_pSol met)
 
int MMGS_gradsiz_ani (MMG5_pMesh mesh, MMG5_pSol met)
 

Detailed Description

Fonctions for anisotropic size map computation.

Author
Charles Dapogny (UPMC)
Cécile Dobrzynski (Bx INP/Inria/UBordeaux)
Pascal Frey (UPMC)
Algiane Froehly (Inria/UBordeaux)
Version
5
Todo:
doxygen documentation.

Definition in file anisosiz_s.c.

Function Documentation

◆ MMG5_defmetref()

static int MMG5_defmetref ( MMG5_pMesh  mesh,
MMG5_pSol  met,
MMG5_int  it,
int  ip 
)
static
Parameters
meshpointer toward the mesh structure.
metpointer toward the metric structure.
itindex of the triangle in which we work.
ipindex of the point on which we want to compute the metric in it.
Returns
1 if success, 0 otherwise.

Define metric map at a REF vertex of the mesh, associated to the geometric approx of the surface.

Definition at line 352 of file anisosiz_s.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MMG5_defmetreg()

static int MMG5_defmetreg ( MMG5_pMesh  mesh,
MMG5_pSol  met,
MMG5_int  it,
int  ip 
)
static
Parameters
meshpointer toward the mesh structure.
metpointer toward the metric structure.
itindex of the triangle in which we work.
ipindex of the point on which we want to compute the metric in it.
Returns
1 if success, 0 otherwise.

Define metric map at a REGULAR vertex of the mesh, associated to the geometric approx of the surface.

Definition at line 593 of file anisosiz_s.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MMG5_defmetrid()

static int MMG5_defmetrid ( MMG5_pMesh  mesh,
MMG5_pSol  met,
MMG5_int  it,
int  ip 
)
static
Parameters
meshpointer toward the mesh structure.
metpointer toward the metric structure.
itindex of the triangle in which we work.
ipindex of the point on which we want to compute the metric in it.
Returns
1 if success, 0 otherwise.

Compute metric tensor associated to a ridge point : convention is a bit weird here :

  • p->m[0] is the specific size in direction t,
  • p->m[1] is the specific size in direction $ u_1 = n_1 \wedge t $ ,
  • p->m[2] is the specific size in direction $ u_2 = n_2 \wedge t $ ,
  • p->m[3] is the specific size in direction $ n_1 $ (computed by the MMG5_intextmet function),
  • p->m[4] is the specific size in direction $n_2$ , (computed by the MMG5_intextmet function), and at each time, metric tensor has to be recomputed, depending on the side.
Warning
As it is implemented, the interpolation at ridge point from 2 singular points leads to an isotropic metric of size m[0] (even if the metric at singular points is not enforced to be isotropic).

Definition at line 173 of file anisosiz_s.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MMG5_defmetsin()

static int MMG5_defmetsin ( MMG5_pMesh  mesh,
MMG5_pSol  met,
MMG5_int  it,
int  ip 
)
static
Parameters
meshpointer toward the mesh structure.
metpointer toward the metric structure.
itindex of the triangle in which we work.
ipindex of the point on which we want to compute the metric in it.
Returns
1 if success, 0 otherwise.

Define metric map at a SINGULARITY of the geometry, associated to the geometric approx of the surface. metric $=\alpha*Id$, $\alpha =$ size.

Definition at line 54 of file anisosiz_s.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MMGS_defsiz_ani()

int MMGS_defsiz_ani ( MMG5_pMesh  mesh,
MMG5_pSol  met 
)
Parameters
meshpointer toward the mesh structure.
metpointer toward the metric stucture.
Returns
0 if fail, 1 otherwise.

Define size at points by intersecting the surfacic metric and the physical metric.

The output metric is:

  • at singular points: isotropic
  • at ridge points: anisotropic in the orthonormal basis defined by the tangent at the ridge and the normal at each portion of surface.
  • at surface boundary points: anisotropic in an orthonormal basis difined in the tangent plane and the direction normal to this plane.
Warning
What we are doing on non-manifold points has to be improved: as such points are marked as MG_CRN and MG_REQ, we first try to call MMG5_defmetsin that likely fails (because MMG5_boulet don't work for non-manifod points due to the missing of consistent adjacencies relationships), then we call MMG5_defUninitSize and we set hmax on non-manifold points. Note that the building of adjacency table depends on the initial mesh numbering, thus, in certain cases, MMG5_boulet will succeed...

Step 1: Set metric at points belonging to a required edge: compute the metric as the mean of the length of the required eges passing through the point

Step 2: Travel all the points (via triangles) in the mesh and set metric tensor

search for unintialized metric

Remark: as non manifold points are marked as CRN and REQ, we first try to call defmetsin that fails (because MMG5_boulet don't work for non-manifod points), then we pass here and we set hmax on non-manifold points

Definition at line 735 of file anisosiz_s.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MMGS_gradsiz_ani()

int MMGS_gradsiz_ani ( MMG5_pMesh  mesh,
MMG5_pSol  met 
)
Parameters
meshpointer toward the mesh structure.
metpointer toward the metric structure.
Returns
1

Enforces mesh gradation by truncating metric field.

Definition at line 835 of file anisosiz_s.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MMGS_intextmet()

static int MMGS_intextmet ( MMG5_pMesh  mesh,
MMG5_pSol  met,
MMG5_int  np,
double  me[6] 
)
inlinestatic
Parameters
meshpointer toward the mesh structure.
metpointer toward the metric structure.
npglobal index of vertex in which we intersect the metrics.
mephysical metric at point np.
Returns
0 if fail, 1 otherwise.

Intersect the surface metric held in np (supported in tangent plane of np) with 3*3 physical metric in me. For ridge points, this function fill the $ p_0->m[3]$ and $ p_0->m[4]$ fields that contains respectively the specific sizes in the $n_1$ and $n_2$ directions.

Definition at line 692 of file anisosiz_s.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MMGS_surfballRotation()

int MMGS_surfballRotation ( MMG5_pMesh  mesh,
MMG5_pPoint  p0,
MMG5_int *  list,
int  ilist,
double  r[3][3],
double *  lispoi,
double  n[3] 
)
Parameters
meshpointer toward the mesh structure.
p0starting point
listball of p0
ilistnumber of tria in the ball of p0
rrotation that send the normal at p0 onto the z vector
lipointrotated ball of point p0
nnormal at point p0
Returns
1 if success, 0 otherwise.

Compute the rotation matrix that sends the tangent plane at p0 onto z=0 and apply this rotation to the ball of p0.

Definition at line 529 of file anisosiz_s.c.

Here is the call graph for this function:
Here is the caller graph for this function: