mmgs
|
Go to the source code of this file.
Macros | |
#define | _MMGS_ALPHAD 3.464101615137755 /* 6.0 / sqrt(3.0) */ |
#define | _MMGS_LOPTL 1.4 |
#define | _MMGS_LOPTS 0.71 |
#define | _MMGS_LLONG 2.0 |
#define | _MMGS_LSHRT 0.3 |
#define | _MMGS_LMAX 1024 |
#define | _MMGS_BADKAL 2.e-2 |
#define | _MMGS_NULKAL 1.e-4 |
#define | _MMGS_NPMAX 500000 |
#define | _MMGS_NTMAX 1000000 |
#define | _MMGS_XPMAX 500000 |
#define | MS_SIN(tag) ((tag & MG_CRN) || (tag & MG_REQ) || (tag & MG_NOM)) |
#define | _MMGS_RETURN_AND_FREE(mesh, met, val) |
#define | _MMGS_POINT_REALLOC(mesh, sol, ip, wantedGap, law, o, tag, retval) |
#define | _MMGS_TRIA_REALLOC(mesh, jel, wantedGap, law, retval) |
Variables | |
double(* | _MMG5_calelt )(MMG5_pMesh mesh, MMG5_pSol met, MMG5_pTria ptt) |
int(* | _MMG5_defsiz )(MMG5_pMesh mesh, MMG5_pSol met) |
int(* | gradsiz )(MMG5_pMesh mesh, MMG5_pSol met) |
int(* | intmet )(MMG5_pMesh mesh, MMG5_pSol met, int k, char i, int ip, double s) |
int(* | movridpt )(MMG5_pMesh mesh, MMG5_pSol met, int *list, int ilist) |
int(* | movintpt )(MMG5_pMesh mesh, MMG5_pSol met, int *list, int ilist) |
#define _MMGS_ALPHAD 3.464101615137755 /* 6.0 / sqrt(3.0) */ |
#define _MMGS_BADKAL 2.e-2 |
#define _MMGS_LLONG 2.0 |
#define _MMGS_LMAX 1024 |
#define _MMGS_LOPTL 1.4 |
#define _MMGS_LOPTS 0.71 |
#define _MMGS_LSHRT 0.3 |
#define _MMGS_NPMAX 500000 |
#define _MMGS_NTMAX 1000000 |
#define _MMGS_NULKAL 1.e-4 |
Reallocation of point table and sol table and creation of point ip with coordinates o and tag tag
#define _MMGS_RETURN_AND_FREE | ( | mesh, | |
met, | |||
val | |||
) |
Free allocated pointers of mesh and sol structure and return value val
Reallocation of tria table and creation of tria jel
#define _MMGS_XPMAX 500000 |
void _MMG5_defaultValues | ( | MMG5_pMesh | ) |
void _MMG5_Init_parameters | ( | MMG5_pMesh | mesh | ) |
mesh | pointer toward the mesh structure. |
Initialization of the input parameters (stored in the Info structure).
MMG5_IPARAM_verbose = 1
MMG*_IPARAM_iso = 0
MMG5_IPARAM_mem = -1
MMG5_IPARAM_debug = 0
MMG5_IPARAM_npar = 0
MMG5_IPARAM_noinsert = 0
MMG5_IPARAM_noswap = 0
MMG5_IPARAM_nomove = 0
MMG5_IPARAM nmat = 0
MMG5_DPARAM_angleDetection = _MMG5_ANGEDG
MMG5_DPARAM_hmin = 0.001 bounding box size;
MMG5_DPARAM_hmax = double of the bounding box size
MMG5_DPARAM_hsiz= -1.
MMG5_DPARAM_hausd = 0.01
MMG5_DPARAM_hgrad = 1.3
MMG5_PPARAM = NULL
MMG3D_IPARAM_lag = -1 used by mmg3d only but need to be negative in the scaleMesh function
int _MMG5_intridmet | ( | MMG5_pMesh | , |
MMG5_pSol | , | ||
int | , | ||
int | , | ||
double | , | ||
double * | , | ||
double * | |||
) |
long long _MMG5_memSize | ( | void | ) |
Compute the available memory size of the computer.
int _MMG5_mmgs1 | ( | MMG5_pMesh | , |
MMG5_pSol | |||
) |
int _MMG5_mmgsBezierCP | ( | MMG5_pMesh | mesh, |
MMG5_Tria * | pt, | ||
_MMG5_pBezier | pb, | ||
char | ori | ||
) |
mesh | pointer toward the mesh structure. |
pt | pointer toward the triangle structure. |
pb | pointer toward the computed Bezier structure. |
ori | triangle orientation (unused but here for compatibility with the _MMG5_bezierCP interface). |
Compute Bezier control points on triangle pt (cf. Vlachos)
int _MMG5_mmgsChkmsh | ( | MMG5_pMesh | mesh, |
int | severe, | ||
int | base | ||
) |
mesh | pointer toward the mesh structure. |
severe | level of performed check |
base | unused argument. |
Check the mesh validity
int _MMG5_split2_sim | ( | MMG5_pMesh | mesh, |
MMG5_pSol | met, | ||
int | k, | ||
int * | vx | ||
) |
mesh | pointer toward the mesh structure. |
met | pointer toward the metric structure. |
k | index of element to split. |
vx | ![]() |
Simulate the splitting of element k along the 2 edges i1 and i2. Check that the new triangles are not empty (otherwise we can create a 0 surface triangle).
int _MMGS_analys | ( | MMG5_pMesh | mesh | ) |
int _MMGS_bezierInt | ( | _MMG5_pBezier | , |
double * | , | ||
double * | , | ||
double * | , | ||
double * | |||
) |
int _MMGS_defsiz_ani | ( | MMG5_pMesh | mesh, |
MMG5_pSol | met | ||
) |
mesh | pointer toward the mesh structure. |
met | pointer toward the metric stucture. |
Define size at points by intersecting the surfacic metric and the physical metric.
int _MMGS_defsiz_iso | ( | MMG5_pMesh | mesh, |
MMG5_pSol | met | ||
) |
mesh | pointer toward the mesh |
met | pointer toward the metric |
Define isotropic size map at all vertices of the mesh, associated with geometric approx ; by convention, p0->h stores desired length at point p0
int _MMGS_delElt | ( | MMG5_pMesh | mesh, |
int | iel | ||
) |
mesh | pointer toward the mesh |
iel | index of the element to delete |
Delete the element iel
void _MMGS_delPt | ( | MMG5_pMesh | mesh, |
int | ip | ||
) |
int _MMGS_Free_all_var | ( | va_list | argptr | ) |
argptr | list of the mmg structures that must be deallocated. Each structure must follow one of the MMG5_ARG preprocessor variable that allow to identify it. |
argptr contains at least a pointer toward a MMG5_pMesh structure (that will contain the mesh and identified by the MMG5_ARG_ppMesh keyword).
To call the MMGS_mmgslib function, you must also provide a pointer toward a MMG5_pSol structure (that will contain the ouput metric (and the input one, if provided) and identified by the MMG5_ARG_ppMet keyword).
To call the MMGS_mmgsls function, you must also provide a pointer toward a MMG5_pSol structure (that will contain the level-set function and identified by the MMG5_ARG_ppLs keyword).
Internal function for deallocations before return (taking a va_list as argument).
int _MMGS_Free_names_var | ( | va_list | argptr | ) |
argptr | list of the mmg structures for whose we want to deallocate the name. Each structure must follow one of the MMG5_ARG preprocessor variable that allow to identify it. |
argptr contains at least a pointer toward a MMG5_pMesh structure (that will contain the mesh and identified by the MMG5_ARG_ppMesh keyword).
To call the MMGS_mmgslib function, you must also provide a pointer toward a MMG5_pSol structure (that will contain the ouput metric (and the input one, if provided) and identified by the MMG5_ARG_ppMet keyword).
To call the MMGS_mmgsls function, you must also provide a pointer toward a MMG5_pSol structure (that will contain the level-set function and identified by the MMG5_ARG_ppLs keyword).
Internal function for name deallocations before return (taking a va_list as argument).
int _MMGS_Free_structures_var | ( | va_list | argptr | ) |
argptr | list of the mmg structures that must be deallocated. Each structure must follow one of the MMG5_ARG* preprocessor variable that allow to identify it. |
argptr contains at least a pointer toward a MMG5_pMesh structure (that will contain the mesh and identified by the MMG5_ARG_ppMesh keyword).
To call the MMGS_mmgslib function, you must also provide a pointer toward a MMG5_pSol structure (that will contain the ouput metric (and the input one, if provided) and identified by the MMG5_ARG_ppMet keyword).
To call the MMGS_mmgsls function, you must also provide a pointer toward a MMG5_pSol structure (that will contain the level-set function and identified by the MMG5_ARG_ppLs keyword).
Internal function for structures deallocations before return (taking a va_list as argument).
int _MMGS_hashTria | ( | MMG5_pMesh | mesh | ) |
mesh | pointer toward the mesh structure. |
Create adjacency table.
int _MMGS_indElt | ( | MMG5_pMesh | mesh, |
int | kel | ||
) |
find the element number in packed numerotation
int _MMGS_indPt | ( | MMG5_pMesh | mesh, |
int | kp | ||
) |
find the point number in packed numerotation
int _MMGS_Init_mesh_var | ( | va_list | argptr | ) |
argptr | list of the mmg structures that must be initialized. Each structure must follow one of the MMG5_ARG* preprocessor variable that allow to identify it. |
argptr contains at least a pointer toward a MMG5_pMesh structure (that will contain the mesh and identified by the MMG5_ARG_ppMesh keyword).
To call the MMGS_mmgslib function, you must also provide a pointer toward a MMG5_pSol structure (that will contain the ouput metric (and the input one, if provided) and identified by the MMG5_ARG_ppMet keyword).
To call the MMGS_mmgsls function, you must also provide a pointer toward a MMG5_pSol structure (that will contain the level-set function and identified by the MMG5_ARG_ppLs keyword).
Internal function for structure allocations (taking a va_list argument).
int _MMGS_inqua | ( | MMG5_pMesh | mesh, |
MMG5_pSol | met | ||
) |
mesh | pointer toward the mesh structure. |
met | pointer toward the metric structure. |
Print histogram of mesh qualities for classical storage of ridges metrics (so before the the _MMG5_defsiz function call).
int _MMGS_intmet33_ani | ( | MMG5_pMesh | mesh, |
MMG5_pSol | met, | ||
int | k, | ||
char | i, | ||
int | ip, | ||
double | s | ||
) |
mesh | pointer toward the mesh structure. |
met | pointer toward the metric structure. |
k | element index. |
i | local index of edge in k. |
ip | global index of the new point in which we want to compute the metric. |
s | interpolation parameter (between 0 and 1). |
Interpolation of anisotropic sizemap at parameter s along edge i of elt k for classic storage of ridges metrics (before defsiz call).
int _MMGS_memOption | ( | MMG5_pMesh | mesh | ) |
memory repartition for the -m option
int _MMGS_mmgs2 | ( | MMG5_pMesh | mesh, |
MMG5_pSol | sol | ||
) |
mesh | pointer toward the mesh structure. |
sol | pointer toward the solution structure |
Create implicit surface in mesh.
int _MMGS_newElt | ( | MMG5_pMesh | mesh | ) |
int _MMGS_newPt | ( | MMG5_pMesh | mesh, |
double | c[3], | ||
double | n[3] | ||
) |
int _MMGS_outqua | ( | MMG5_pMesh | mesh, |
MMG5_pSol | met | ||
) |
mesh | pointer toward the mesh structure. |
met | pointer toward the metric structure. |
Print histogram of mesh qualities for special storage of ridges metrics (after the _MMG5_defsiz function call).
int _MMGS_prilen | ( | MMG5_pMesh | mesh, |
MMG5_pSol | met, | ||
int | metRidTyp | ||
) |
mesh | pointer toward the mesh structure. |
met | pointer toward the metric structure. |
metRidTyp | Type of storage of ridges metrics: 0 for classic storage, 1 for special storage. |
Compute sizes of edges of the mesh, and displays histo.
|
inlinestatic |
Set common pointer functions between mmgs and mmg3d to the matching mmgs functions.
int _MMGS_simbulgept | ( | MMG5_pMesh | mesh, |
MMG5_pSol | met, | ||
int | k, | ||
int | i, | ||
int | ip | ||
) |
mesh | pointer toward the mesh structure. |
met | pointer toward the metric structure. |
k | index of the starting triangle. |
i | local index of the edge to split in k. |
ip | index of the point that we try to create. |
Simulate the creation of the point ip, to be inserted at an edge. Check that the new triangles are not empty (otherwise we can create a 0 surface triangle).
int _MMGS_split1 | ( | MMG5_pMesh | mesh, |
MMG5_pSol | met, | ||
int | k, | ||
int | i, | ||
int * | vx | ||
) |
mesh | pointer toward the mesh structure. |
met | pointer toward the metric structure. |
k | index of element to split. |
i | index of edge to split. |
vx | ![]() |
Split element k along edge i.
int _MMGS_split1_sim | ( | MMG5_pMesh | mesh, |
MMG5_pSol | met, | ||
int | k, | ||
int | i, | ||
int * | vx | ||
) |
mesh | pointer toward the mesh structure. |
met | pointer toward the metric structure. |
k | index of element to split. |
i | index of edge to split. |
vx | ![]() |
k | index of element to split. |
Simulate the splitting of element k along edge i. Check that the new triangles are not empty (otherwise we can create a 0 surface triangle).
int _MMGS_split2 | ( | MMG5_pMesh | mesh, |
MMG5_pSol | met, | ||
int | k, | ||
int * | vx | ||
) |
mesh | pointer toward the mesh structure. |
met | pointer toward the metric structure. |
k | index of element to split. |
vx | ![]() |
Split element k along the 2 edges i1 and i2.
int _MMGS_split3 | ( | MMG5_pMesh | mesh, |
MMG5_pSol | met, | ||
int | k, | ||
int * | vx | ||
) |
mesh | pointer toward the mesh structure. |
met | pointer toward the metric structure. |
k | index of element to split. |
vx | ![]() |
Split element k along the 3 edges
int _MMGS_split3_sim | ( | MMG5_pMesh | mesh, |
MMG5_pSol | met, | ||
int | k, | ||
int * | vx | ||
) |
mesh | pointer toward the mesh structure. |
met | pointer toward the metric structure. |
k | index of element to split. |
vx | ![]() |
Simulate the splitting of element k along the 3 edges. Check that the new triangles are not empty (otherwise we can create a 0 surface triangle).
int _MMGS_zaldy | ( | MMG5_pMesh | mesh | ) |
mesh | pointer toward the mesh |
allocate main structure
int assignEdge | ( | MMG5_pMesh | mesh | ) |
mesh | pointer toward the mesh structure. |
Copy the properties (ref and tag) of the declared edges to the triangles, where they are assigned to the individual corners of the triangle. First a hash is created for rapid lookup of the edges. Then in a loop over all edges of all triangles, the hash is probed for each edge, and if it exists its properties are copied. Thus, declared edges that do not occur in any triangle will be silently ignored.
int boulechknm | ( | MMG5_pMesh | mesh, |
int | start, | ||
int | ip, | ||
int * | list | ||
) |
mesh | pointer toward the mesh structure. |
start | index of tetra to start to compute the ball. |
ip | index of point in tetra start for which we want to compute the ball. |
list | pointer toward the computed ball of point. |
Find all triangles sharing ip, . Do not stop when crossing ridge. Check whether resulting configuration is manifold.
int boulep | ( | MMG5_pMesh | mesh, |
int | start, | ||
int | ip, | ||
int * | list | ||
) |
int boulet | ( | MMG5_pMesh | mesh, |
int | start, | ||
int | ip, | ||
int * | list | ||
) |
mesh | pointer toward the mesh structure. |
start | index of triangle to start. |
ip | index of point for wich we compute the ball. |
list | pointer toward the computed ball of ip. |
Find all triangles sharing ip, start do not stop when crossing ridge.
int bouletrid | ( | MMG5_pMesh | mesh, |
int | start, | ||
int | ip, | ||
int * | il1, | ||
int * | l1, | ||
int * | il2, | ||
int * | l2, | ||
int * | ip0, | ||
int * | ip1 | ||
) |
mesh | pointer toward the mesh structure. |
start | index of the starting triangle. |
ip | index of the looked ridge point. |
il1 | pointer toward the first ball size. |
l1 | pointer toward the first computed ball (associated to n1's side). |
il2 | pointer toward the second ball size. |
l2 | pointer toward the second computed ball (associated to n2's side). |
ip0 | index of the first extremity of the ridge. |
ip1 | index of the second extremity of the ridge. |
Computation of the two balls of a ridge point: the list l1 is associated to normal n1's side. ip0 and ip1 are the indices of the 2 ending point of the ridge. Both lists are returned enumerated in direct order.
|
inline |
mesh | pointer toward the mesh structure. |
met | pointer toward the metric structure. |
iel | element index |
Quality function identic to caltri_ani but puts a sign according to deviation to normal to vertices.
|
inline |
int chkcol | ( | MMG5_pMesh | mesh, |
MMG5_pSol | met, | ||
int | k, | ||
char | i, | ||
int * | list, | ||
char | typchk | ||
) |
mesh | pointer toward the mesh |
met | pointer toward the metric |
k | index of the element in wich we collapse |
i | index of the edge to collapse |
list | pointer toward the ball of point |
typchk | type of check to perform |
check if geometry preserved by collapsing edge i
int chkedg | ( | MMG5_pMesh | , |
int | |||
) |
int chkmet | ( | MMG5_pMesh | mesh, |
MMG5_pSol | met | ||
) |
Check metric consistency.
int chknor | ( | MMG5_pMesh | mesh | ) |
mesh | pointer toward the mesh |
Check normal vectors consistency
int chkswp | ( | MMG5_pMesh | mesh, |
MMG5_pSol | met, | ||
int | k, | ||
int | i, | ||
char | typchk | ||
) |
int colver | ( | MMG5_pMesh | mesh, |
int * | list, | ||
int | ilist | ||
) |
int colver2 | ( | MMG5_pMesh | mesh, |
int * | ilist | ||
) |
int colver3 | ( | MMG5_pMesh | mesh, |
int * | list | ||
) |
mesh | pointer toward the mesh structure. |
list | pointer toward the ball of the point to collapse. |
Collapse edge in tet
(
) for a ball of the collapsed point of size 3: the collapsed point is removed.
int curvpo | ( | MMG5_pMesh | , |
MMG5_pSol | |||
) |
int delref | ( | MMG5_pMesh | ) |
int gradsiz_ani | ( | MMG5_pMesh | mesh, |
MMG5_pSol | met | ||
) |
mesh | pointer toward the mesh structure. |
met | pointer toward the metric structure. |
Enforces mesh gradation by truncating metric field.
int gradsiz_iso | ( | MMG5_pMesh | mesh, |
MMG5_pSol | met | ||
) |
Enforces mesh gradations by truncating size map
int intmet_ani | ( | MMG5_pMesh | mesh, |
MMG5_pSol | met, | ||
int | k, | ||
char | i, | ||
int | ip, | ||
double | s | ||
) |
mesh | pointer toward the mesh structure. |
met | pointer toward the metric structure. |
k | element index. |
i | local index of edge in k. |
ip | global index of the new point in which we want to compute the metric. |
s | interpolation parameter (between 0 and 1). |
Interpolation of anisotropic sizemap at parameter s along edge i of elt k for special storage of ridges metrics (after defsiz call).
int intmet_iso | ( | MMG5_pMesh | mesh, |
MMG5_pSol | met, | ||
int | k, | ||
char | i, | ||
int | ip, | ||
double | s | ||
) |
mesh | pointer toward the mesh structure. |
met | pointer toward the metric structure. |
k | triangle in which we interpole the metrics. |
i | edge along which we interpole the metrics. |
ip | index of point in which we compute the interpolated metric. |
s | parameter at which we compute the interpolation. |
Linear interpolation of sizemap along edge i of tria k.
int intregmet | ( | MMG5_pMesh | mesh, |
MMG5_pSol | met, | ||
int | k, | ||
char | i, | ||
double | s, | ||
double | mr[6] | ||
) |
mesh | pointer toward the mesh structure. |
met | pointer toward the metric structure. |
k | element index. |
i | local index of edge in k. |
s | interpolation parameter. |
mr | computed metric. |
Metric interpolation on edge i in elt it at parameter from p1 result is stored in mr. edge
must not be a ridge.
int litcol | ( | MMG5_pMesh | mesh, |
int | k, | ||
char | i, | ||
double | kal | ||
) |
int litswp | ( | MMG5_pMesh | mesh, |
int | k, | ||
char | i, | ||
double | kal | ||
) |
int movintpt_ani | ( | MMG5_pMesh | mesh, |
MMG5_pSol | met, | ||
int * | list, | ||
int | ilist | ||
) |
mesh | pointer toward the mesh structure. |
met | pointer toward the metric structure. |
list | ball of point. |
ilist | size of the point ball. |
Compute movement of an internal point whose ball is passed.
Step 1 : Rotation matrix that sends normal at p0 to e_z
Step 2 : Compute gradient towards optimal position = centre of mass of the ball, projected to tangent plane
int movintpt_iso | ( | MMG5_pMesh | mesh, |
MMG5_pSol | met, | ||
int * | list, | ||
int | ilist | ||
) |
int movridpt_ani | ( | MMG5_pMesh | mesh, |
MMG5_pSol | met, | ||
int * | list, | ||
int | ilist | ||
) |
int movridpt_iso | ( | MMG5_pMesh | mesh, |
MMG5_pSol | met, | ||
int * | list, | ||
int | ilist | ||
) |
int paratmet | ( | double | c0[3], |
double | n0[3], | ||
double | m[6], | ||
double | c1[3], | ||
double | n1[3], | ||
double | mt[6] | ||
) |
int setref | ( | MMG5_pMesh | mesh, |
int | start, | ||
int | ref, | ||
int | putreq | ||
) |
mesh | pointer toward the mesh |
start | index of the tetra from which we start |
ref | reference to set |
putreq | 1 if boundary edges must be set to required |
Start from triangle start, and pile up triangles by adjacency, till a GEO or REF curve is met ; pass all references of travelled faces to ref ; putreq = 1 if boundary edges met must be set to MG_REQ, 0 otherwise.
int split1b | ( | MMG5_pMesh | mesh, |
int | k, | ||
char | i, | ||
int | ip | ||
) |
mesh | pointer toward the mesh structure. |
k | index of element to split. |
i | index of edge to split. |
ip | index of the new point. |
Split element k along edge i, inserting point ip and updating the adjacency relations.
int swapar | ( | MMG5_pMesh | mesh, |
int | k, | ||
int | i | ||
) |
mesh | poiner toward the mesh structure. |
k | elt index. |
i | index of the elt edge to swap. |
int swpedg | ( | MMG5_pMesh | mesh, |
MMG5_pSol | met, | ||
int * | list, | ||
int | ilist, | ||
char | typchk | ||
) |
attempt to swap any edge below quality value list goes from 0 to ilist-1.
char typelt | ( | MMG5_pPoint | p[3], |
char * | ia | ||
) |
double(* _MMG5_calelt) (MMG5_pMesh mesh, MMG5_pSol met, MMG5_pTria ptt) |
int(* _MMG5_defsiz) (MMG5_pMesh mesh, MMG5_pSol met) |
int(* gradsiz) (MMG5_pMesh mesh, MMG5_pSol met) |
int(* intmet) (MMG5_pMesh mesh, MMG5_pSol met, int k, char i, int ip, double s) |
int(* movintpt) (MMG5_pMesh mesh, MMG5_pSol met, int *list, int ilist) |
int(* movridpt) (MMG5_pMesh mesh, MMG5_pSol met, int *list, int ilist) |