PPL Logo

FEM_Adapt_Algs Class Reference

Provides high level adaptivity operations (by calling the primitive operations repetitively). More...

#include <fem_adapt_algs.h>

Collaboration diagram for FEM_Adapt_Algs:

Collaboration graph
[legend]

Public Member Functions

 FEM_Adapt_Algs ()
 FEM_Adapt_Algs (FEM_Mesh *m, femMeshModify *fm, int dimension)
 Initialize FEM_Adapt_Algs with a chunk of the mesh.
void FEM_Adapt_Algs_Init (int coord_at, int bc_at)
void FEM_Refine (int qm, int method, double factor, double *sizes)
 Perform refinements on a mesh.
void FEM_Coarsen (int qm, int method, double factor, double *sizes)
 Perform coarsening on a mesh.
void FEM_AdaptMesh (int qm, int method, double factor, double *sizes)
 Perform refinement/coarsening on a mesh.
void FEM_Smooth (int qm, int method)
 Smooth the mesh using method according to some quality measure qm.
void FEM_mesh_smooth (FEM_Mesh *meshP, int *nodes, int nNodes, int attrNo)
 Repair the mesh according to some quality measure qm.
void FEM_Repair (int qm)
 Elements with a bad quality metric are either flipped or coarsened to newer elements which are of better quality.
void FEM_Remesh (int qm, int method, double factor, double *sizes)
 Remesh entire mesh.
void SetReferenceMesh ()
 Set sizes on mesh elements based on their average edge length.
void GradateMesh (double smoothness)
 Adjust sizes on mesh elements to avoid sharp discontinuities.
virtual int refine_element_leb (int e)
 Initiate instance of Longest Edge Bisection on an element.
virtual void refine_flip_element_leb (int e, int p, int n1, int n2, double le)
 Continue longest edge bisection on element 'e', then flip edge (n1,n2); If the length of the new edge (p, newnode) is greater than 'le' (longest edge), recursively call this function on (newElem, p, n1, newNode, le).
int simple_refine (double targetA, double xmin=0.0, double ymin=0.0, double xmax=1.0, double ymax=1.0)
 The region is defined by (xmax, xmin, ymax, ymin) and the target area is given by targetA.
int simple_coarsen (double targetA, double xmin=0.0, double ymin=0.0, double xmax=1.0, double ymax=1.0)
 The region is defined by (xmax, xmin, ymax, ymin) and the target area is given by targetA.
double length (int n1, int n2)
double getArea (int n1, int n2, int n3)
double length (double *n1_coord, double *n2_coord)
double getArea (double *n1_coord, double *n2_coord, double *n3_coord)
int getCoord (int n1, double *crds)
int getShortestEdge (int n1, int n2, int n3, int *shortestEdge)
double getAreaQuality (int elem)
 The quality metric is proportional to the area of the triangle upon the sum of squares of the lengths of each of the 3 sides.
bool didItFlip (int n1, int n2, int n3, double *n4_coord)
bool didItFlip (double *n1_coord, double *n2_coord, double *n3_coord, double *n4_coord)
double getSignedArea (double *n1_coord, double *n2_coord, double *n3_coord)
void tests (void)
 FEM_Adapt_Algs ()
 default constructor
 FEM_Adapt_Algs (FEM_Mesh *m, femMeshModify *fm)
 Initialize FEM_Adapt_Algs with a chunk of the mesh.
 FEM_Adapt_Algs (femMeshModify *fm)
 Initialize FEM_Adapt with the femMeshModify object.
void FEM_AdaptAlgsSetMesh (FEM_Mesh *m)
 Initialize FEM_Adapt with the FEM_Mesh object.
void FEM_Adapt_Algs_Init (int coord_at, int bc_at, int dimension)
 Initialize the coord_attr and boundary attr and number of dimensions for this mesh.
 ~FEM_Adapt_Algs ()
 default destructor
void pup (PUP::er &p)
 pup for this object
void FEM_Refine (int qm, int method, double factor, double *sizes)
 Perform refinements on a mesh.
void FEM_Coarsen (int qm, int method, double factor, double *sizes)
 Perform coarsening on a mesh.
void FEM_AdaptMesh (int qm, int method, double factor, double *sizes)
 Perform refinement/coarsening on a mesh.
void FEM_Smooth (int qm, int method)
 Smooth the mesh using method according to some quality measure qm.
void FEM_mesh_smooth (FEM_Mesh *meshP, int *nodes, int nNodes, int attrNo)
 Repair the mesh according to some quality measure qm.
void FEM_Repair (int qm)
 Repair the bad quality elements of a mesh.
void FEM_Remesh (int qm, int method, double factor, double *sizes)
 Remesh entire mesh.
void SetReferenceMesh ()
 Set sizes on mesh elements based on their average edge length.
void GradateMesh (double smoothness)
 Adjust sizes on mesh elements to avoid sharp discontinuities.
int refine_element_leb (int e)
 Initiate instance of Longest Edge Bisection on an element.
void refine_flip_element_leb (int e, int p, int n1, int n2, double le)
 The propagating function for Longest Edge Bisection.
int simple_refine (double targetA, double xmin=0.0, double ymin=0.0, double xmax=1.0, double ymax=1.0)
 A simple refine algorithm that refines all elements in a region to areas larger than targetA.
int simple_coarsen (double targetA, double xmin=0.0, double ymin=0.0, double xmax=1.0, double ymax=1.0)
 A simple coarsen algorithm that coarsen all elements in a region to areas smaller than targetA.
double length (int n1, int n2)
 Returns the length of the edge formed by nodes n1, n2.
double length (double *n1_coord, double *n2_coord)
 Returns the length between these two points.
double getArea (int n1, int n2, int n3)
 Returns the area of the triangle formed by n1, n2 aand n3.
double getArea (double *n1_coord, double *n2_coord, double *n3_coord)
 Returns the area between these three points.
double getSignedArea (int n1, int n2, int n3)
 Returns the signed area of the triangle formed by the nodes in that order.
double getSignedArea (double *n1_coord, double *n2_coord, double *n3_coord)
 Returns the signed area of the triangle formed by the point coordinates in that order.
int getCoord (int n1, double *crds)
 Populates crds with the coordinates of the node n1.
int getShortestEdge (int n1, int n2, int n3, int *shortestEdge)
 Retuns the shortest edge for the triangle formed by n1, n2, n3.
double getAreaQuality (int elem)
 Retuens the quality metric for this element.
void ensureQuality (int n1, int n2, int n3)
 Ensure the quality of the triangle formed by these three nodes.
bool controlQualityF (int n1, int n2, int n3, int n4)
 Verify if flip(n1,n2) will create bad quality elements.
bool controlQualityR (int n1, int n2, int n3, int n4)
 Verify if bisect(n1,n2) will create bad quality elements.
bool controlQualityR (double *n1_coord, double *n2_coord, double *n3_coord)
 Same as above; instead of node indices, it takes point coordinates as input.
bool controlQualityC (int n1, int n2, int n3, double *n4_coord)
 Returns true if the quality will become bad if element (n1,n2,n3) changes to (n1,n2,n4).
bool controlQualityC (double *n1_coord, double *n2_coord, double *n3_coord, double *n4_coord)
 same as above only takes in point coordinates instead of node indices
bool flipOrBisect (int elId, int n1, int n2, int maxEdgeIdx, double maxlen)
 Decide based on quality metrics if a flip or bisect is good for this element.
void tests (bool b)
 A series of tests to maintain validity of mesh structure, area, IDXL lists, etc.

Data Fields

int coord_attr
 attribute index for coordinates
int bc_attr
 attribute index for boundaries

Protected Attributes

FEM_MeshtheMesh
femMeshModifytheMod
FEM_AdaptLtheAdaptor
int numNodes
 Number of nodes on this chunk.
int numElements
 Number of elements on this chunk.
int dim
 The number of dimensions of this mesh (adaptivity works only for 2D).
elemHeapcoarsenElements
elemHeaprefineElements
elemHeaprefineStack
int refineTop
 The number of entries in refinestack.
int refineHeapSize
 The number of entries in the refine heap.
int coarsenHeapSize
 The number of entries in the coarsen heap.
FEM_MeshtheMesh
 cross-pointer to theMesh object on this chunk
femMeshModifytheMod
 cross-pointer to the femMeshModify object on this chunk
FEM_AdaptLtheAdaptor
 cross-pointer to the FEM_AdaptL object for this chunk
elemHeapcoarsenElements
 A heap pointer created while coarsening (to order from smallest to largest length).
elemHeaprefineElements
 A heap pointer created while refining (to order from largest to smallest length).
elemHeaprefineStack
 A stack of elements used for refine.
intelemConn
 Used for populating the e2n adjacency connectivity for an element (avoids multiple memory allocations).
double * coordsn1
 Coordinates of the three nodes which form the e2n of an element (avoids multiple memory allocations).
double * coordsn2
double * coordsn3

Private Member Functions

int Refine (int qm, int method, double factor, double *sizes)
 Performs refinement; returns number of modifications.
int Coarsen (int qm, int method, double factor, double *sizes)
 Performs coarsening; returns number of modifications.
void SetMeshSize (int method, double factor, double *sizes)
 Set sizes on elements throughout the mesh; note: size is edge length.
void Insert (int elID, double len, int cFlag)
 Insert element to be refined/coarsened.
int Delete_Min (int cFlag)
 Get next element to be refined/coarsened.
int Refine (int qm, int method, double factor, double *sizes)
 Performs refinement; returns number of modifications.
int Coarsen (int qm, int method, double factor, double *sizes)
 Performs coarsening; returns number of modifications.
void SetMeshSize (int method, double factor, double *sizes)
 Set sizes on elements throughout the mesh; note: size is edge length.
void Insert (int elID, double len, int cFlag)
 Insert element to be refined/coarsened.
int Delete_Min (int cFlag)
 Get next element to be refined/coarsenen.

Friends

class FEM_AdaptL
class FEM_Adapt
class femMeshModify
class FEM_Interpolate
class FEM_MUtil

Data Structures

struct  elemHeap
 This is a heap data structure used to sort elements. More...

Detailed Description

Provides high level adaptivity operations (by calling the primitive operations repetitively).

This module implements high level mesh adaptivity algorithms that make use of the primitive mesh adaptivity operations provided by ParFUM_Adapt.

Definition at line 34 of file fem_adapt_algs.h.


Constructor & Destructor Documentation

FEM_Adapt_Algs::FEM_Adapt_Algs (  )  [inline]

Definition at line 62 of file fem_adapt_algs.h.

References theAdaptor, theMesh, and theMod.

FEM_Adapt_Algs::FEM_Adapt_Algs ( FEM_Mesh m,
femMeshModify fm,
int  dimension 
)

Initialize FEM_Adapt_Algs with a chunk of the mesh.

Definition at line 21 of file fem_adapt_algs.C.

References dim, femMeshModify::fmAdaptL, theAdaptor, theMesh, and theMod.

FEM_Adapt_Algs::FEM_Adapt_Algs (  )  [inline]

default constructor

Definition at line 79 of file ParFUM_Adapt_Algs.h.

References theAdaptor, theMesh, and theMod.

FEM_Adapt_Algs::FEM_Adapt_Algs ( FEM_Mesh m,
femMeshModify fm 
)

Initialize FEM_Adapt_Algs with a chunk of the mesh.

Definition at line 23 of file adapt_algs.C.

References femMeshModify::fmAdaptL, theAdaptor, theMesh, and theMod.

FEM_Adapt_Algs::FEM_Adapt_Algs ( femMeshModify fm  ) 

Initialize FEM_Adapt with the femMeshModify object.

Definition at line 30 of file adapt_algs.C.

References femMeshModify::fmAdaptL, theAdaptor, theMesh, and theMod.

FEM_Adapt_Algs::~FEM_Adapt_Algs (  ) 

default destructor

Definition at line 36 of file adapt_algs.C.


Member Function Documentation

void FEM_Adapt_Algs::FEM_Adapt_Algs_Init ( int  coord_at,
int  bc_at 
) [inline]

Definition at line 67 of file fem_adapt_algs.h.

References bc_attr, and coord_attr.

Referenced by FEM_ADAPT_Init().

Here is the caller graph for this function:

void FEM_Adapt_Algs::FEM_Refine ( int  qm,
int  method,
double  factor,
double *  sizes 
)

Perform refinements on a mesh.

Perform refinements on a mesh. Tries to maintain/improve element quality as specified by a quality measure qm; if method = 0, refine areas with size larger than factor down to factor if method = 1, refine elements down to sizes specified in sizes array Negative entries in size array indicate no refinement.

Tries to maintain/improve element quality as specified by a quality measure qm; if method = 0, refine areas with size larger than factor down to factor if method = 1, refine elements down to sizes specified in sizes array Negative entries in size array indicate no refinement.

Definition at line 45 of file fem_adapt_algs.C.

References GradateMesh(), Refine(), and SetMeshSize().

Referenced by FEM_ADAPT_Refine().

Here is the call graph for this function:

Here is the caller graph for this function:

void FEM_Adapt_Algs::FEM_Coarsen ( int  qm,
int  method,
double  factor,
double *  sizes 
)

Perform coarsening on a mesh.

Perform coarsening on a mesh. Tries to maintain/improve element quality as specified by a quality measure qm; if method = 0, coarsen areas with size smaller than factor up to factor if method = 1, coarsen elements up to sizes specified in sizes array Negative entries in size array indicate no coarsening.

Tries to maintain/improve element quality as specified by a quality measure qm; if method = 0, coarsen areas with size smaller than factor up to factor if method = 1, coarsen elements up to sizes specified in sizes array Negative entries in size array indicate no coarsening.

Definition at line 137 of file fem_adapt_algs.C.

References Coarsen(), GradateMesh(), and SetMeshSize().

Referenced by FEM_ADAPT_Coarsen().

Here is the call graph for this function:

Here is the caller graph for this function:

void FEM_Adapt_Algs::FEM_AdaptMesh ( int  qm,
int  method,
double  factor,
double *  sizes 
)

Perform refinement/coarsening on a mesh.

Performs a sequence of refinements or coarsening as is needed to achieve the target areas for elements.

Same as above

Definition at line 30 of file fem_adapt_algs.C.

References Coarsen(), GradateMesh(), Refine(), and SetMeshSize().

Referenced by FEM_ADAPT_AdaptMesh().

Here is the call graph for this function:

Here is the caller graph for this function:

void FEM_Adapt_Algs::FEM_Smooth ( int  qm,
int  method 
)

Smooth the mesh using method according to some quality measure qm.

Definition at line 255 of file fem_adapt_algs.C.

void FEM_Adapt_Algs::FEM_mesh_smooth ( FEM_Mesh meshP,
int nodes,
int  nNodes,
int  attrNo 
)

Repair the mesh according to some quality measure qm.

FEM_Mesh_smooth Inputs : meshP - a pointer to the FEM_Mesh object to smooth : nodes - an array of local node numbers to be smoothed.

Send NULL pointer to smooth all nodes. : nNodes - the size of the nodes array : attrNo - the attribute number where the coords are registered Shifts nodes around to improve mesh quality. FEM_BOUNDARY attribute and interpolator function must be registered by user to maintain boundary information.

Definition at line 1015 of file fem_adapt_algs.C.

References coords, FEM_is_valid(), FEM_Mesh_data(), FEM_Mesh_default_read(), FEM_Mesh_get_length(), FEM_set_entity_coord2(), FEM_Update_ghost_field(), idx, mesh, FEM_Mesh::n2n_getAll(), vector2d::x, and vector2d::y.

Here is the call graph for this function:

void FEM_Adapt_Algs::FEM_Repair ( int  qm  ) 

Elements with a bad quality metric are either flipped or coarsened to newer elements which are of better quality.

Definition at line 261 of file fem_adapt_algs.C.

void FEM_Adapt_Algs::FEM_Remesh ( int  qm,
int  method,
double  factor,
double *  sizes 
)

Remesh entire mesh.

Remesh entire mesh according to quality measure qm if method = 0, set entire mesh size to factor if method = 1, keep regional mesh sizes, and scale by factor if method = 2, uses sizes to size mesh by regions.

Remesh entire mesh according to quality measure qm if method = 0, set entire mesh size to factor if method = 1, keep regional mesh sizes, and scale by factor if method = 2, uses sizes to size mesh by regions

Definition at line 269 of file fem_adapt_algs.C.

void FEM_Adapt_Algs::SetReferenceMesh (  ) 

Set sizes on mesh elements based on their average edge length.

For each element, set its size to its average edge length.

Definition at line 337 of file fem_adapt_algs.C.

References FEM_Mesh::e2n_getAll(), FEM_Mesh::elem, free(), length(), malloc(), numElements, FEM_Entity_Types< T >::size(), theMesh, and width().

Referenced by FEM_ADAPT_SetReferenceMesh().

Here is the call graph for this function:

Here is the caller graph for this function:

void FEM_Adapt_Algs::GradateMesh ( double  smoothness  ) 

Adjust sizes on mesh elements to avoid sharp discontinuities.

Resize mesh elements to avoid jumps in element size Algorithm based on h-shock correction, described in Mesh Gradation Control, Borouchaki et al IJNME43 1998 www.ann.jussieu.fr/~frey/publications/ijnme4398.pdf.

Definition at line 359 of file fem_adapt_algs.C.

References beta, e1, FEM_Mesh::elem, FEM_is_valid(), FEM_Mesh_data(), FEM_Mesh_default_read(), FEM_Mesh::get2ElementsOnEdge(), length(), FEM_Mesh::n2n_getAll(), nnodes, FEM_Mesh::node, FEM_Entity::size(), tests(), and theMesh.

Referenced by FEM_ADAPT_GradateMesh(), FEM_AdaptMesh(), FEM_Coarsen(), and FEM_Refine().

Here is the call graph for this function:

Here is the caller graph for this function:

int FEM_Adapt_Algs::Refine ( int  qm,
int  method,
double  factor,
double *  sizes 
) [private]

Performs refinement; returns number of modifications.

The actual refine in the previous operation.

Definition at line 54 of file fem_adapt_algs.C.

References CthYield(), Delete_Min(), FEM_Mesh::e2n_getAll(), FEM_AdaptL::edge_bisect(), FEM_Mesh::elem, FEM_Adapt_Algs::elemHeap::elID, getAreaQuality(), Insert(), length(), malloc(), n1, n2, FEM_Mesh::node, numElements, numNodes, refineElements, refineHeapSize, refineStack, refineTop, FEM_Entity_Types< T >::size(), FEM_Entity::size(), theAdaptor, and theMesh.

Referenced by FEM_AdaptMesh(), and FEM_Refine().

Here is the call graph for this function:

Here is the caller graph for this function:

int FEM_Adapt_Algs::Coarsen ( int  qm,
int  method,
double  factor,
double *  sizes 
) [private]

Performs coarsening; returns number of modifications.

The actual coarsen in the previous operation.

Definition at line 147 of file fem_adapt_algs.C.

References coarsenElements, coarsenHeapSize, CthYield(), Delete_Min(), FEM_Mesh::e2e_getNbr(), FEM_Mesh::e2n_getAll(), FEM_Mesh::e2n_getIndex(), FEM_AdaptL::edge_contraction(), FEM_Mesh::elem, FEM_Adapt_Algs::elemHeap::elID, getAreaQuality(), Insert(), FEM_Adapt_Algs::elemHeap::len, length(), malloc(), n1, n2, FEM_Mesh::node, numElements, numNodes, FEM_Entity_Types< T >::size(), FEM_Entity::size(), theAdaptor, and theMesh.

Referenced by FEM_AdaptMesh(), and FEM_Coarsen().

Here is the call graph for this function:

Here is the caller graph for this function:

void FEM_Adapt_Algs::SetMeshSize ( int  method,
double  factor,
double *  sizes 
) [private]

Set sizes on elements throughout the mesh; note: size is edge length.

Definition at line 276 of file fem_adapt_algs.C.

References dim, FEM_Mesh::e2n_getAll(), FEM_Mesh::elem, length(), malloc(), FEM_Mesh::node, numElements, numNodes, FEM_Entity_Types< T >::size(), FEM_Entity::size(), theMesh, and width().

Referenced by FEM_AdaptMesh(), FEM_Coarsen(), and FEM_Refine().

Here is the call graph for this function:

Here is the caller graph for this function:

void FEM_Adapt_Algs::Insert ( int  elID,
double  len,
int  cFlag 
) [private]

Insert element to be refined/coarsened.

Insert this element to the refine or coarsen heap.

Definition at line 912 of file fem_adapt_algs.C.

References coarsenElements, coarsenHeapSize, FEM_Adapt_Algs::elemHeap::elID, FEM_Adapt_Algs::elemHeap::len, refineElements, and refineHeapSize.

Referenced by Coarsen(), and Refine().

Here is the caller graph for this function:

int FEM_Adapt_Algs::Delete_Min ( int  cFlag  )  [private]

Get next element to be refined/coarsened.

Removes and returns the minimum element from the refine/coarsen heap.

Definition at line 938 of file fem_adapt_algs.C.

References coarsenElements, coarsenHeapSize, FEM_Adapt_Algs::elemHeap::elID, FEM_Adapt_Algs::elemHeap::len, len, refineElements, and refineHeapSize.

Referenced by Coarsen(), and Refine().

Here is the caller graph for this function:

int FEM_Adapt_Algs::refine_element_leb ( int  e  )  [virtual]

Initiate instance of Longest Edge Bisection on an element.

Initiate instance of Longest Edge Bisection on element e.

Initiate instance of Longest Edge Bisection on element e. Propagates throughout the mesh to maintain the requirement that only longest edges are bisected; returns 1 if successful, 0 if not

Propagates throughout the mesh to maintain the requirement that only longest edges are bisected; returns the new node index that it created Given an element e, if e's longest edge f is also the longest edge of e's neighbor across f, g, split f by adding a new node in the center of f, and splitting both e and g into two elements. If g does not have f as it's longest edge, recursively call refine_element_leb on g, and start over.

Definition at line 649 of file fem_adapt_algs.C.

References FEM_Mesh::e2e_getNbr(), FEM_Mesh::e2n_getAll(), FEM_Adapt::e2n_getNot(), FEM_AdaptL::edge_bisect(), FEM_Adapt::findElementWithNodes(), free(), femMeshModify::getfmUtil(), FEM_Adapt::getGhostElementIdxl(), FEM_Adapt::getGhostNodeIdxl(), FEM_MUtil::getIdx(), FEM_MUtil::getRemoteIdx(), FEM_Adapt::getSharedNodeIdxl(), length(), malloc(), meshMod, refine_flip_element_leb(), theAdaptor, theMesh, and theMod.

Referenced by refine_flip_element_leb(), and simple_refine().

Here is the call graph for this function:

Here is the caller graph for this function:

void FEM_Adapt_Algs::refine_flip_element_leb ( int  e,
int  p,
int  n1,
int  n2,
double  le 
) [virtual]

Continue longest edge bisection on element 'e', then flip edge (n1,n2); If the length of the new edge (p, newnode) is greater than 'le' (longest edge), recursively call this function on (newElem, p, n1, newNode, le).

Definition at line 713 of file fem_adapt_algs.C.

References FEM_AdaptL::edge_flip(), FEM_Adapt::findElementWithNodes(), femMeshModify::getfmUtil(), FEM_MUtil::getIdx(), length(), refine_element_leb(), theAdaptor, and theMod.

Referenced by refine_element_leb(), and femMeshModify::refine_flip_element_leb().

Here is the call graph for this function:

Here is the caller graph for this function:

int FEM_Adapt_Algs::simple_refine ( double  targetA,
double  xmin = 0.0,
double  ymin = 0.0,
double  xmax = 1.0,
double  ymax = 1.0 
)

The region is defined by (xmax, xmin, ymax, ymin) and the target area is given by targetA.

Definition at line 489 of file fem_adapt_algs.C.

References FEM_Mesh::e2n_getAll(), FEM_Mesh::elem, free(), getArea(), getCoord(), malloc(), refine_element_leb(), FEM_Entity_Types< T >::size(), PUP::t, and theMesh.

Referenced by FEM_ADAPT_SimpleRefineMesh().

Here is the call graph for this function:

Here is the caller graph for this function:

int FEM_Adapt_Algs::simple_coarsen ( double  targetA,
double  xmin = 0.0,
double  ymin = 0.0,
double  xmax = 1.0,
double  ymax = 1.0 
)

The region is defined by (xmax, xmin, ymax, ymin) and the target area is given by targetA.

Definition at line 556 of file fem_adapt_algs.C.

References FEM_Mesh::e2n_getAll(), FEM_AdaptL::edge_contraction(), FEM_Mesh::elem, free(), getArea(), getCoord(), getShortestEdge(), malloc(), FEM_Entity_Types< T >::size(), PUP::t, theAdaptor, and theMesh.

Referenced by FEM_ADAPT_SimpleCoarsenMesh().

Here is the call graph for this function:

Here is the caller graph for this function:

double FEM_Adapt_Algs::length ( int  n1,
int  n2 
)

Definition at line 729 of file fem_adapt_algs.C.

References dim, free(), getCoord(), and malloc().

Referenced by Coarsen(), controlQualityC(), controlQualityR(), ensureQuality(), flipOrBisect(), getAreaQuality(), getShortestEdge(), GradateMesh(), Refine(), refine_element_leb(), refine_flip_element_leb(), SetMeshSize(), and SetReferenceMesh().

Here is the call graph for this function:

Here is the caller graph for this function:

double FEM_Adapt_Algs::getArea ( int  n1,
int  n2,
int  n3 
)

Definition at line 755 of file fem_adapt_algs.C.

References dim, free(), getCoord(), and malloc().

Referenced by FEM_MUtil::AreaTest(), controlQualityR(), getAreaQuality(), simple_coarsen(), and simple_refine().

Here is the call graph for this function:

Here is the caller graph for this function:

double FEM_Adapt_Algs::length ( double *  n1_coord,
double *  n2_coord 
)

Definition at line 744 of file fem_adapt_algs.C.

References PUP::d, and dim.

double FEM_Adapt_Algs::getArea ( double *  n1_coord,
double *  n2_coord,
double *  n3_coord 
)

Definition at line 773 of file fem_adapt_algs.C.

References PUP::d.

int FEM_Adapt_Algs::getCoord ( int  n1,
double *  crds 
)

int FEM_Adapt_Algs::getShortestEdge ( int  n1,
int  n2,
int  n3,
int shortestEdge 
)

Definition at line 875 of file fem_adapt_algs.C.

References dim, free(), getCoord(), length(), and malloc().

Referenced by simple_coarsen().

Here is the call graph for this function:

Here is the caller graph for this function:

double FEM_Adapt_Algs::getAreaQuality ( int  elem  ) 

The quality metric is proportional to the area of the triangle upon the sum of squares of the lengths of each of the 3 sides.

Definition at line 981 of file fem_adapt_algs.C.

References dim, FEM_Mesh::e2n_getAll(), getArea(), getCoord(), len, length(), malloc(), n, and theMesh.

Referenced by Coarsen(), and Refine().

Here is the call graph for this function:

Here is the caller graph for this function:

bool FEM_Adapt_Algs::didItFlip ( int  n1,
int  n2,
int  n3,
double *  n4_coord 
)

Definition at line 802 of file fem_adapt_algs.C.

References dim, free(), getCoord(), getSignedArea(), and malloc().

Referenced by FEM_AdaptL::edge_contraction_help().

Here is the call graph for this function:

Here is the caller graph for this function:

bool FEM_Adapt_Algs::didItFlip ( double *  n1_coord,
double *  n2_coord,
double *  n3_coord,
double *  n4_coord 
)

Definition at line 827 of file fem_adapt_algs.C.

References getSignedArea().

Here is the call graph for this function:

double FEM_Adapt_Algs::getSignedArea ( double *  n1_coord,
double *  n2_coord,
double *  n3_coord 
)

Definition at line 836 of file fem_adapt_algs.C.

Referenced by controlQualityC(), didItFlip(), ensureQuality(), and getSignedArea().

Here is the caller graph for this function:

void FEM_Adapt_Algs::tests ( void   ) 

Definition at line 628 of file fem_adapt_algs.C.

References femMeshModify::fmUtil, FEM_MUtil::IdxlListTest(), FEM_MUtil::residualLockTest(), FEM_MUtil::StructureTest(), theMesh, and theMod.

Referenced by FEM_ADAPT_TestMesh(), and GradateMesh().

Here is the call graph for this function:

Here is the caller graph for this function:

void FEM_Adapt_Algs::FEM_AdaptAlgsSetMesh ( FEM_Mesh m  )  [inline]

Initialize FEM_Adapt with the FEM_Mesh object.

Definition at line 87 of file ParFUM_Adapt_Algs.h.

References theMesh.

Referenced by femMeshModify::setPointersAfterMigrate().

Here is the caller graph for this function:

void FEM_Adapt_Algs::FEM_Adapt_Algs_Init ( int  coord_at,
int  bc_at,
int  dimension 
) [inline]

Initialize the coord_attr and boundary attr and number of dimensions for this mesh.

Definition at line 89 of file ParFUM_Adapt_Algs.h.

References bc_attr, coord_attr, and dim.

void FEM_Adapt_Algs::pup ( PUP::er p  )  [inline]

pup for this object

Definition at line 97 of file ParFUM_Adapt_Algs.h.

References bc_attr, coord_attr, and dim.

Referenced by femMeshModify::pup().

Here is the caller graph for this function:

void FEM_Adapt_Algs::FEM_Refine ( int  qm,
int  method,
double  factor,
double *  sizes 
)

Perform refinements on a mesh.

void FEM_Adapt_Algs::FEM_Coarsen ( int  qm,
int  method,
double  factor,
double *  sizes 
)

Perform coarsening on a mesh.

void FEM_Adapt_Algs::FEM_AdaptMesh ( int  qm,
int  method,
double  factor,
double *  sizes 
)

Perform refinement/coarsening on a mesh.

void FEM_Adapt_Algs::FEM_Smooth ( int  qm,
int  method 
)

Smooth the mesh using method according to some quality measure qm.

void FEM_Adapt_Algs::FEM_mesh_smooth ( FEM_Mesh meshP,
int nodes,
int  nNodes,
int  attrNo 
)

Repair the mesh according to some quality measure qm.

void FEM_Adapt_Algs::FEM_Repair ( int  qm  ) 

Repair the bad quality elements of a mesh.

void FEM_Adapt_Algs::FEM_Remesh ( int  qm,
int  method,
double  factor,
double *  sizes 
)

Remesh entire mesh.

void FEM_Adapt_Algs::SetReferenceMesh (  ) 

Set sizes on mesh elements based on their average edge length.

void FEM_Adapt_Algs::GradateMesh ( double  smoothness  ) 

Adjust sizes on mesh elements to avoid sharp discontinuities.

int FEM_Adapt_Algs::Refine ( int  qm,
int  method,
double  factor,
double *  sizes 
) [private]

Performs refinement; returns number of modifications.

int FEM_Adapt_Algs::Coarsen ( int  qm,
int  method,
double  factor,
double *  sizes 
) [private]

Performs coarsening; returns number of modifications.

void FEM_Adapt_Algs::SetMeshSize ( int  method,
double  factor,
double *  sizes 
) [private]

Set sizes on elements throughout the mesh; note: size is edge length.

void FEM_Adapt_Algs::Insert ( int  elID,
double  len,
int  cFlag 
) [private]

Insert element to be refined/coarsened.

int FEM_Adapt_Algs::Delete_Min ( int  cFlag  )  [private]

Get next element to be refined/coarsenen.

int FEM_Adapt_Algs::refine_element_leb ( int  e  ) 

Initiate instance of Longest Edge Bisection on an element.

void FEM_Adapt_Algs::refine_flip_element_leb ( int  e,
int  p,
int  n1,
int  n2,
double  le 
)

The propagating function for Longest Edge Bisection.

int FEM_Adapt_Algs::simple_refine ( double  targetA,
double  xmin = 0.0,
double  ymin = 0.0,
double  xmax = 1.0,
double  ymax = 1.0 
)

A simple refine algorithm that refines all elements in a region to areas larger than targetA.

int FEM_Adapt_Algs::simple_coarsen ( double  targetA,
double  xmin = 0.0,
double  ymin = 0.0,
double  xmax = 1.0,
double  ymax = 1.0 
)

A simple coarsen algorithm that coarsen all elements in a region to areas smaller than targetA.

double FEM_Adapt_Algs::length ( int  n1,
int  n2 
)

Returns the length of the edge formed by nodes n1, n2.

double FEM_Adapt_Algs::length ( double *  n1_coord,
double *  n2_coord 
)

Returns the length between these two points.

double FEM_Adapt_Algs::getArea ( int  n1,
int  n2,
int  n3 
)

Returns the area of the triangle formed by n1, n2 aand n3.

double FEM_Adapt_Algs::getArea ( double *  n1_coord,
double *  n2_coord,
double *  n3_coord 
)

Returns the area between these three points.

double FEM_Adapt_Algs::getSignedArea ( int  n1,
int  n2,
int  n3 
)

Returns the signed area of the triangle formed by the nodes in that order.

Definition at line 1259 of file adapt_algs.C.

References getCoord(), and getSignedArea().

Here is the call graph for this function:

double FEM_Adapt_Algs::getSignedArea ( double *  n1_coord,
double *  n2_coord,
double *  n3_coord 
)

Returns the signed area of the triangle formed by the point coordinates in that order.

int FEM_Adapt_Algs::getCoord ( int  n1,
double *  crds 
)

Populates crds with the coordinates of the node n1.

int FEM_Adapt_Algs::getShortestEdge ( int  n1,
int  n2,
int  n3,
int shortestEdge 
)

Retuns the shortest edge for the triangle formed by n1, n2, n3.

double FEM_Adapt_Algs::getAreaQuality ( int  elem  ) 

Retuens the quality metric for this element.

void FEM_Adapt_Algs::ensureQuality ( int  n1,
int  n2,
int  n3 
)

Ensure the quality of the triangle formed by these three nodes.

The quality metric used is the maxEdgeLength / shortestAltitude of the triangle If this metric is less than 100 and the area is greater than sliverArea, the quality is supposed to be good.

Definition at line 1373 of file adapt_algs.C.

References getCoord(), getSignedArea(), length(), and min().

Referenced by FEM_add_element_local().

Here is the call graph for this function:

Here is the caller graph for this function:

bool FEM_Adapt_Algs::controlQualityF ( int  n1,
int  n2,
int  n3,
int  n4 
)

Verify if flip(n1,n2) will create bad quality elements.

Verify the quality of the two new elements that will be created by flip.

Definition at line 1396 of file adapt_algs.C.

References controlQualityC(), flag, and getCoord().

Here is the call graph for this function:

bool FEM_Adapt_Algs::controlQualityR ( int  n1,
int  n2,
int  n3,
int  n4 
)

Verify if bisect(n1,n2) will create bad quality elements.

Verify the quality of the four new elements that will be created by flip.

Definition at line 1412 of file adapt_algs.C.

References controlQualityR(), flag, femMeshModify::fmAdaptAlgs, getCoord(), and theMod.

Referenced by controlQualityR().

Here is the call graph for this function:

Here is the caller graph for this function:

bool FEM_Adapt_Algs::controlQualityR ( double *  n1_coord,
double *  n2_coord,
double *  n3_coord 
)

Same as above; instead of node indices, it takes point coordinates as input.

Definition at line 1430 of file adapt_algs.C.

References getArea(), and length().

Here is the call graph for this function:

bool FEM_Adapt_Algs::controlQualityC ( int  n1,
int  n2,
int  n3,
double *  n4_coord 
)

Returns true if the quality will become bad if element (n1,n2,n3) changes to (n1,n2,n4).

Computes the longestLength, shotestLength, shortestAltitude, and other quality metrics for the new element (n1,n2,n4) If the new element forms a sliver or bad quality, return true.

Definition at line 1450 of file adapt_algs.C.

References getCoord().

Referenced by controlQualityF().

Here is the call graph for this function:

Here is the caller graph for this function:

bool FEM_Adapt_Algs::controlQualityC ( double *  n1_coord,
double *  n2_coord,
double *  n3_coord,
double *  n4_coord 
)

same as above only takes in point coordinates instead of node indices

Definition at line 1459 of file adapt_algs.C.

References getSignedArea(), length(), and min().

Here is the call graph for this function:

bool FEM_Adapt_Algs::flipOrBisect ( int  elId,
int  n1,
int  n2,
int  maxEdgeIdx,
double  maxlen 
)

Decide based on quality metrics if a flip or bisect is good for this element.

Used from FEM_Repair, when poor quality elements are encountered, depending on their maxEdgeLength, it could be better to flip it or bisect it to get better quality elements.

Returns true if it should flip.

Definition at line 1492 of file adapt_algs.C.

References FEM_Mesh::e2e_getNbr(), FEM_Mesh::e2n_getAll(), length(), and theMesh.

Here is the call graph for this function:

void FEM_Adapt_Algs::tests ( bool  b = true  ) 

A series of tests to maintain validity of mesh structure, area, IDXL lists, etc.

Definition at line 1515 of file adapt_algs.C.

References FEM_MUtil::AreaTest(), PUP::b, femMeshModify::fmUtil, FEM_MUtil::IdxlListTest(), FEM_MUtil::residualLockTest(), FEM_MUtil::StructureTest(), theMesh, and theMod.

Here is the call graph for this function:


Friends And Related Function Documentation

FEM_AdaptL [friend]

Definition at line 35 of file fem_adapt_algs.h.

FEM_Adapt [friend]

Definition at line 36 of file fem_adapt_algs.h.

femMeshModify [friend]

Definition at line 37 of file fem_adapt_algs.h.

FEM_Interpolate [friend]

Definition at line 38 of file fem_adapt_algs.h.

FEM_MUtil [friend]

Definition at line 39 of file fem_adapt_algs.h.


Field Documentation

attribute index for boundaries

Definition at line 43 of file fem_adapt_algs.h.

Referenced by FEM_Adapt_Algs_Init(), and pup().

Number of nodes on this chunk.

Definition at line 50 of file fem_adapt_algs.h.

Referenced by Coarsen(), ParFUMShadowArray::collectLocalNodes(), Refine(), and SetMeshSize().

Number of elements on this chunk.

Definition at line 50 of file fem_adapt_algs.h.

Referenced by Coarsen(), Refine(), SetMeshSize(), and SetReferenceMesh().

int FEM_Adapt_Algs::dim [protected]

The number of dimensions of this mesh (adaptivity works only for 2D).

Definition at line 50 of file fem_adapt_algs.h.

Referenced by didItFlip(), FEM_Adapt_Algs(), FEM_Adapt_Algs_Init(), getArea(), getAreaQuality(), getCoord(), getShortestEdge(), length(), pup(), and SetMeshSize().

Definition at line 56 of file fem_adapt_algs.h.

Referenced by Coarsen(), Delete_Min(), and Insert().

Definition at line 57 of file fem_adapt_algs.h.

Referenced by Delete_Min(), Insert(), and Refine().

Definition at line 58 of file fem_adapt_algs.h.

Referenced by Refine().

The number of entries in refinestack.

Definition at line 59 of file fem_adapt_algs.h.

Referenced by Refine().

The number of entries in the refine heap.

Definition at line 59 of file fem_adapt_algs.h.

Referenced by Delete_Min(), Insert(), and Refine().

The number of entries in the coarsen heap.

Definition at line 59 of file fem_adapt_algs.h.

Referenced by Coarsen(), Delete_Min(), and Insert().

cross-pointer to theMesh object on this chunk

Definition at line 44 of file ParFUM_Adapt_Algs.h.

cross-pointer to the femMeshModify object on this chunk

Definition at line 46 of file ParFUM_Adapt_Algs.h.

cross-pointer to the FEM_AdaptL object for this chunk

Definition at line 48 of file ParFUM_Adapt_Algs.h.

A heap pointer created while coarsening (to order from smallest to largest length).

Definition at line 61 of file ParFUM_Adapt_Algs.h.

A heap pointer created while refining (to order from largest to smallest length).

Definition at line 63 of file ParFUM_Adapt_Algs.h.

A stack of elements used for refine.

Definition at line 65 of file ParFUM_Adapt_Algs.h.

Used for populating the e2n adjacency connectivity for an element (avoids multiple memory allocations).

Definition at line 73 of file ParFUM_Adapt_Algs.h.

double* FEM_Adapt_Algs::coordsn1 [protected]

Coordinates of the three nodes which form the e2n of an element (avoids multiple memory allocations).

Definition at line 75 of file ParFUM_Adapt_Algs.h.

double * FEM_Adapt_Algs::coordsn2 [protected]

Definition at line 75 of file ParFUM_Adapt_Algs.h.

double * FEM_Adapt_Algs::coordsn3 [protected]

Definition at line 75 of file ParFUM_Adapt_Algs.h.


The documentation for this class was generated from the following files:

Generated on Mon Sep 21 08:23:53 2020 for Charm++ by  doxygen 1.5.5