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

Fonctions for anisotropic size map computation. More...

#include "libmmg3d.h"
#include "inlined_functions_3d_private.h"
#include "mmg3dexterns_private.h"
#include "mmgexterns_private.h"
Include dependency graph for anisosiz_3d.c:

Go to the source code of this file.

Functions

int MMG3D_printEigenv (double dm[3], double vp[3][3])
 
int MMG3D_printMat (int8_t symmat, double *m)
 
int MMG3D_printErrorMat (int8_t symmat, double *m, double *mr)
 
int MMG3D_chk4ridVertices (MMG5_pMesh mesh, MMG5_pTetra pt)
 
int MMG5_moymet (MMG5_pMesh mesh, MMG5_pSol met, MMG5_pTetra pt, double *m1)
 
static int MMG5_defmetsin (MMG5_pMesh mesh, MMG5_pSol met, MMG5_int kel, int iface, int ip)
 
static int MMG5_defmetrid (MMG5_pMesh mesh, MMG5_pSol met, MMG5_int kel, int iface, MMG5_int ip)
 
static int MMG5_defmetref (MMG5_pMesh mesh, MMG5_pSol met, MMG5_int kel, int iface, int ip)
 
static int MMG5_defmetreg (MMG5_pMesh mesh, MMG5_pSol met, MMG5_int kel, int iface, int ip)
 
static int MMG5_defmetvol (MMG5_pMesh mesh, MMG5_pSol met, int8_t ismet)
 
static int MMG3D_intextmet (MMG5_pMesh mesh, MMG5_pSol met, int np, double me[6])
 
int MMG3D_defsiz_ani (MMG5_pMesh mesh, MMG5_pSol met)
 
static int MMG5_grad2metVol_getmet (MMG5_pMesh mesh, MMG5_pSol met, MMG5_int ip, double ux, double uy, double uz, double *m, int8_t *ridgedir)
 
static void MMG5_grad2metVol_extmet (MMG5_pMesh mesh, MMG5_pPoint ppt, double l, double *m, double *mext)
 
static void MMG3D_gradSimred (MMG5_pMesh mesh, MMG5_pPoint ppt, double m[6], double mext[6], int8_t ridgedir, int8_t iloc, int *ier)
 
static void MMG5_grad2metVol_setmet (MMG5_pMesh mesh, MMG5_pSol met, int ip, double *m, int8_t ridgedir)
 
static int MMG5_grad2metVol (MMG5_pMesh mesh, MMG5_pSol met, int np1, int np2)
 
int MMG3D_updatemetreq_ani (double *n, double dn[3], double vp[3][3])
 
static int MMG5_grad2metVolreq (MMG5_pMesh mesh, MMG5_pSol met, MMG5_pTetra pt, MMG5_int npmaster, MMG5_int npslave)
 
int MMG3D_gradsiz_ani (MMG5_pMesh mesh, MMG5_pSol met)
 
int MMG3D_gradsizreq_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_3d.c.

Function Documentation

◆ MMG3D_chk4ridVertices()

int MMG3D_chk4ridVertices ( MMG5_pMesh  mesh,
MMG5_pTetra  pt 
)

Definition at line 113 of file anisosiz_3d.c.

Here is the caller graph for this function:

◆ MMG3D_defsiz_ani()

int MMG3D_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.

  1. On singular (CRN, REQ, NOM) points, the metric on P is made isotropic.
  2. On non-singular ridge points, the metric is forced to be aligned with the ridge directions and surface normals.
  3. On regular boundary points, the metric can be anisotropic on the tangent plane, but it is forced to be aligned to the normal direction.

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

Definition at line 1310 of file anisosiz_3d.c.

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

◆ MMG3D_gradSimred()

static void MMG3D_gradSimred ( MMG5_pMesh  mesh,
MMG5_pPoint  ppt,
double  m[6],
double  mext[6],
int8_t  ridgedir,
int8_t  iloc,
int *  ier 
)
inlinestatic
Parameters
meshpointer toward the mesh.
pptpointer toward the P point structure.
mmetric tensor on point P.
mextextended metric tensor from Q to P.
ridgedirnormal direction for metric reconstruction on P (on ridge only).
iloclocal index of point P on the edge.
ierpointer to the local indices (on the edge) of updated points, with bitwise encoding.

Use metric intersection to gradate the anisotropic metric on point P, given the metric extended from point Q on the edge PQ.

  1. On singular (CRN, REQ, NOM) points, the metric on P is isotropic (as in MMG5_defmetsin) and should remain isotropic.
  2. On non-singular ridge points, the metric on P should remain aligned with the ridge directions (thus it is not possible to apply metric intersection, sizes are truncated instead).
  3. On regular boundary points, the metric can be anisotropic on the tangent plane, but it should remain aligned to the normal direction (thus, intersection is used only in the tangent plane and sizes are truncated in the normal direction).
  4. On interior volume points, 3D metric intersection can be used.

Definition at line 1534 of file anisosiz_3d.c.

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

◆ MMG3D_gradsiz_ani()

int MMG3D_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.

  1. On singular (CRN, REQ, NOM) points, the metric on P is isotropic (as in MMG5_defmetsin) and should remain isotropic.
  2. On non-singular ridge points, the metric on P should remain aligned with the ridge directions (thus it is not possible to apply metric intersection, sizes are truncated instead).
  3. On regular boundary points, the metric can be anisotropic on the tangent plane, but it should remain aligned to the normal direction (thus, intersection is used only in the tangent plane and sizes are truncated in the normal direction).
  4. On interior volume points, 3D metric intersection can be used.

Mark the edges belonging to a required entity

Definition at line 2073 of file anisosiz_3d.c.

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

◆ MMG3D_gradsizreq_ani()

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

Enforce mesh gradation by truncating size map.

Mark the edges belonging to a required entity (already done if the classic gradation is enabled)

Definition at line 2210 of file anisosiz_3d.c.

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

◆ MMG3D_intextmet()

static int MMG3D_intextmet ( MMG5_pMesh  mesh,
MMG5_pSol  met,
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 1267 of file anisosiz_3d.c.

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

◆ MMG3D_printEigenv()

int MMG3D_printEigenv ( double  dm[3],
double  vp[3][3] 
)
Parameters
dmmatrix eigenvalues (1x3 array).
vpeigenvectors matrix (3x3 array, eigenvectors stored by lines).
Returns
1 if success, 0 if fail.

Print eigendecomposition.

Definition at line 48 of file anisosiz_3d.c.

◆ MMG3D_printErrorMat()

int MMG3D_printErrorMat ( int8_t  symmat,
double *  m,
double *  mr 
)
Parameters
symmatflag for symmetric(1) or non-symmetric(0) matrix..
mfirst matrix (1x6 or 1x9 array).
mrsecond matrix (1x6 or 1x9 array).
Returns
1 if success, 0 if fail.

Print relative error between two matrices, for each matrix entry.

Definition at line 90 of file anisosiz_3d.c.

Here is the call graph for this function:

◆ MMG3D_printMat()

int MMG3D_printMat ( int8_t  symmat,
double *  m 
)
Parameters
symmatflag for symmetric(1) or non-symmetric(0) matrix..
mmatrix (1x6 or 1x9 array).
Returns
1 if success, 0 if fail.

Print matrix entries.

Definition at line 67 of file anisosiz_3d.c.

Here is the caller graph for this function:

◆ MMG3D_updatemetreq_ani()

int MMG3D_updatemetreq_ani ( double *  n,
double  dn[3],
double  vp[3][3] 
)
Parameters
nmatrix to update
dneigenvalues of n in the coreduction basis
vpcoreduction basis
Returns
0 if fail, 1 otherwise

Update of the metric n = tP^-1 diag(dn0,dn1,dn2)P^-1, P = (vp[0],vp[1],vp[2]) stored in columns

Definition at line 1867 of file anisosiz_3d.c.

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

◆ MMG5_defmetref()

static int MMG5_defmetref ( MMG5_pMesh  mesh,
MMG5_pSol  met,
MMG5_int  kel,
int  iface,
int  ip 
)
static
Parameters
meshpointer toward the mesh structure.
metpointer toward the metric structure.
kelindex of the triangle in which we work.
ifaceface of the tetra on which we work.
ipindex of the point on which we want to compute the metric (in tetra kel).
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 606 of file anisosiz_3d.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  kel,
int  iface,
int  ip 
)
static
Parameters
meshpointer toward the mesh structure.
metpointer toward the metric structure.
kelindex of the triangle in which we work.
ifaceworking face.
ipindex of the point on which we want to compute the metric in (tetra kel).
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 875 of file anisosiz_3d.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  kel,
int  iface,
MMG5_int  ip 
)
static
Parameters
meshpointer toward the mesh structure.
metpointer toward the metric structure.
kelindex of the tetra in which we work.
ifaceface of the tetra on which we work.
ipindex of the point on which we want to compute the metric (in tetra kel).
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^t$ p->m[2] is the specific size in direction $ u_2 = n_2^t$, and at each time, metric tensor has to be recomputed, depending on the side.

Definition at line 390 of file anisosiz_3d.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  kel,
int  iface,
int  ip 
)
static
Parameters
meshpointer toward the mesh structure.
metpointer toward the metric structure.
kelindex of the tetra in which we work.
ifaceface of the tetra on which we work.
ipindex of the point on which we want to compute the metric (in tetra kel).
Returns
1 if success, 0 otherwise.

Define metric map at a SINGULARITY (corner, required or non-manifold points) of the geometry, associated to the geometric approx of the surface. metric $=\alpha*Id$, $\alpha =$ size.

Definition at line 191 of file anisosiz_3d.c.

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

◆ MMG5_defmetvol()

static int MMG5_defmetvol ( MMG5_pMesh  mesh,
MMG5_pSol  met,
int8_t  ismet 
)
inlinestatic
Parameters
meshpointer toward the mesh structure.
metpointer toward the metric structure.
ismet1 if user provided metric
Returns
1 if success, 0 otherwise.

Define metric map at a non-boundary vertex of the mesh. Allocate the metric if needed. Truncate the metric at the hmin/hmax values.

  1. no metric is provided: Set isotropic hmax size at the vertex

First step: search for local parameters

Second step: set metric

  1. A metric is provided: truncate it by hmax/hmin

First step: search for local parameters

Second step: set metric

Definition at line 1101 of file anisosiz_3d.c.

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

◆ MMG5_grad2metVol()

static int MMG5_grad2metVol ( MMG5_pMesh  mesh,
MMG5_pSol  met,
int  np1,
int  np2 
)
inlinestatic
Parameters
meshpointer toward the mesh.
metpointer toward the metric structure.
np1global index of the first edge extremity.
np2global index of the second edge extremity.
Returns
-1 on failure, else local indices of graded point on the edge (bitwise encoded, so 0 for no update, 1 if the first point iis updated, 2 if the second one is updated, 3 if both). Use the third bit to switch on warning information at output.

Enforces gradation of metric in both extremities of an edge with respect to one other.

Recover normal and metric associated to p1 and p2 (metric can be in ridge storage)

Extend p2 metric and gradate p1

Extend p1 metric and gradate p2 (p1 has already been updated)

Definition at line 1779 of file anisosiz_3d.c.

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

◆ MMG5_grad2metVol_extmet()

static void MMG5_grad2metVol_extmet ( MMG5_pMesh  mesh,
MMG5_pPoint  ppt,
double  l,
double *  m,
double *  mext 
)
inlinestatic
Parameters
meshpointer toward the mesh.
pptpointer toward the P point structure.
lEuclidean length of the edge PQ.
mmetric tensor on point P.
mextmetric tensor extended on Q.

Extend metric tensor from point P to point Q according to an h-variation law applied on each eigenvalue.

Definition at line 1498 of file anisosiz_3d.c.

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

◆ MMG5_grad2metVol_getmet()

static int MMG5_grad2metVol_getmet ( MMG5_pMesh  mesh,
MMG5_pSol  met,
MMG5_int  ip,
double  ux,
double  uy,
double  uz,
double *  m,
int8_t *  ridgedir 
)
inlinestatic
Parameters
meshpointer toward the mesh.
metpointer toward the metric structure.
ipglobal point index.
uxedge vector x-component.
uyedge vector y-component.
uzedge vector z-component.
mpoint metric (copy, to be filled).
ridgedirpointer to the index of the normal direction used for ridge metric (on ridge points only).
Returns
0 on failure, 1 if success.

Get metric tensor from metric structure (pass from ridge storage to classical storage on non-singular ridge points, copy metric on all other points). See: [1]. The Hv-correction is used (gradation with respect to H-variation measure).

Definition at line 1439 of file anisosiz_3d.c.

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

◆ MMG5_grad2metVol_setmet()

static void MMG5_grad2metVol_setmet ( MMG5_pMesh  mesh,
MMG5_pSol  met,
int  ip,
double *  m,
int8_t  ridgedir 
)
inlinestatic
Parameters
meshpointer toward the mesh.
metpointer toward the metric structure.
ipglobal index of the point.
mmetric tensor on the point (copy).
ridgedirnormal direction for metric reconstruction (on ridge only).

Set new metric tensor to the metric structure (pass from classical storage to ridge storage on non-singular ridge points, copy metric on all other points).

Definition at line 1722 of file anisosiz_3d.c.

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

◆ MMG5_grad2metVolreq()

static int MMG5_grad2metVolreq ( MMG5_pMesh  mesh,
MMG5_pSol  met,
MMG5_pTetra  pt,
MMG5_int  npmaster,
MMG5_int  npslave 
)
inlinestatic
Parameters
meshpointer toward the mesh.
metpointer toward the metric structure.
ptpointer toward a tetra.
npmasteredge extremity that cannot be modified
npslaveedge extremity to modify to respect the gradation.
Returns
1 if the graddation succeed, 0 otherwise

Enforces gradation of metric from required entity toward other using the simultaneous reduction technique (note that as the gradation is propagated, we can be on an edge without a required extremity).

Definition at line 1903 of file anisosiz_3d.c.

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

◆ MMG5_moymet()

int MMG5_moymet ( MMG5_pMesh  mesh,
MMG5_pSol  met,
MMG5_pTetra  pt,
double *  m1 
)
inline
Parameters
meshpointer toward the mesh structure.
metpointer toward the sol structure.
ptpointer toward a tetra.
m1computed metric.
Returns
the number of vertices used for the mean computation, 0 if fail.

Compute mean metric over the internal tetra pt. Do not take into account the metric values at ridges points (because we don't know how to build it).

Definition at line 144 of file anisosiz_3d.c.

Here is the caller graph for this function: