PPL Logo

Bulk_Adapt Class Reference

Provides high level adaptivity operations. More...

#include <bulk_adapt.h>

Collaboration diagram for Bulk_Adapt:

Collaboration graph
[legend]

Public Member Functions

 Bulk_Adapt ()
 default constructor
 Bulk_Adapt (FEM_Mesh *m, int d)
 Initialize Bulk_Adapt_Algs with a partition of the mesh.
void Bulk_Adapt_SetMesh (FEM_Mesh *m)
 Initialize FEM_Adapt with the FEM_Mesh object.
void Bulk_Adapt_SetDim (int dimension)
 Initialize the coord_attr and boundary attr and number of dimensions for this mesh.
void Bulk_Adapt_SetElemType (int et)
 ~Bulk_Adapt ()
 default destructor
void pup (PUP::er &p)
 pup for this object
void Bulk_Adapt_Init (int mid, FEM_Mesh *mp, int d)
void ParFUM_Refine (int qm, int method, double factor, double *sizes)
 Perform refinements on a mesh.
void ParFUM_Coarsen (int qm, int method, double factor, double *sizes)
 Perform coarsening on a mesh.
void ParFUM_AdaptMesh (int qm, int method, double factor, double *sizes)
 Perform refinement/coarsening on a mesh.
void ParFUM_Smooth (int qm, int method)
 Smooth the mesh using method according to some quality measure qm.
void ParFUM_Repair (int qm)
 Repair the bad quality elements of a mesh.
void ParFUM_Remesh (int qm, int method, double factor, double *sizes)
 Remesh entire mesh.
void ParFUM_SetReferenceMesh ()
 Set sizes on mesh elements based on their average edge length.
void ParFUM_GradateMesh (double smoothness)
 Adjust sizes on mesh elements to avoid sharp discontinuities.
void findEdgeLengths (int elemID, double *avgEdgeLength, double *maxEdgeLength, int *maxEdge, double *minEdgeLength, int *minEdge)

Protected Attributes

FEM_MeshtheMesh
 cross-pointer to theMesh object on this chunk
int theMeshID
int dim
 The number of dimensions of this mesh (adaptivity works only for 2D).
int elemType

Private Member Functions

int Refine_h (int qm, int method, double factor, double *sizes)
 Performs refinement; returns number of modifications.
int Coarsen_h (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.
double length (int n1, int n2)
 Returns the length of the edge formed by nodes n1, n2.
double length3D (int n1, int n2)
double length (double *n1_coord, double *n2_coord)
 Returns the length between these two points.
double length3D (double *n1_coord, double *n2_coord)
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)
 Returns 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)
 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.

Friends

class FEM_Interpolate

Detailed Description

Provides high level adaptivity operations.

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

Definition at line 245 of file bulk_adapt.h.


Constructor & Destructor Documentation

Bulk_Adapt::Bulk_Adapt (  )  [inline]

default constructor

Definition at line 255 of file bulk_adapt.h.

References theMesh.

Bulk_Adapt::Bulk_Adapt ( FEM_Mesh m,
int  d 
) [inline]

Initialize Bulk_Adapt_Algs with a partition of the mesh.

Definition at line 257 of file bulk_adapt.h.

References dim, and theMesh.

Bulk_Adapt::~Bulk_Adapt (  )  [inline]

default destructor

Definition at line 264 of file bulk_adapt.h.


Member Function Documentation

void Bulk_Adapt::Bulk_Adapt_SetMesh ( FEM_Mesh m  )  [inline]

Initialize FEM_Adapt with the FEM_Mesh object.

Definition at line 259 of file bulk_adapt.h.

References theMesh.

void Bulk_Adapt::Bulk_Adapt_SetDim ( int  dimension  )  [inline]

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

Definition at line 261 of file bulk_adapt.h.

References dim.

void Bulk_Adapt::Bulk_Adapt_SetElemType ( int  et  )  [inline]

Definition at line 262 of file bulk_adapt.h.

References elemType.

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

pup for this object

Definition at line 266 of file bulk_adapt.h.

References dim.

void Bulk_Adapt::Bulk_Adapt_Init ( int  mid,
FEM_Mesh mp,
int  d 
) [inline]

Definition at line 270 of file bulk_adapt.h.

References CreateAdaptAdjacencies(), dim, FEM_Mesh_allocate_valid_attr(), MPI_Barrier, MPI_Comm_rank, ParFUM_SA_Init(), rank, theMesh, and theMeshID.

Here is the call graph for this function:

void Bulk_Adapt::ParFUM_Refine ( int  qm,
int  method,
double  factor,
double *  sizes 
)

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.

Definition at line 27 of file bulk_adapt.C.

References ParFUM_GradateMesh(), Refine_h(), and SetMeshSize().

Here is the call graph for this function:

void Bulk_Adapt::ParFUM_Coarsen ( int  qm,
int  method,
double  factor,
double *  sizes 
)

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.

Definition at line 190 of file bulk_adapt.C.

References ParFUM_GradateMesh(), and SetMeshSize().

Here is the call graph for this function:

void Bulk_Adapt::ParFUM_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.

Definition at line 338 of file bulk_adapt.C.

void Bulk_Adapt::ParFUM_Smooth ( int  qm,
int  method 
)

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

Definition at line 376 of file bulk_adapt.C.

void Bulk_Adapt::ParFUM_Repair ( int  qm  ) 

Repair the bad quality elements of a mesh.

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. Elements with a bad quality metric are either flipped or coarsened to newer elements which are of better quality

Definition at line 447 of file bulk_adapt.C.

void Bulk_Adapt::ParFUM_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.

Definition at line 607 of file bulk_adapt.C.

void Bulk_Adapt::ParFUM_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 615 of file bulk_adapt.C.

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

Here is the call graph for this function:

void Bulk_Adapt::ParFUM_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 641 of file bulk_adapt.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(), and theMesh.

Referenced by ParFUM_Coarsen(), and ParFUM_Refine().

Here is the call graph for this function:

Here is the caller graph for this function:

void Bulk_Adapt::findEdgeLengths ( int  elemID,
double *  avgEdgeLength,
double *  maxEdgeLength,
int maxEdge,
double *  minEdgeLength,
int minEdge 
)

Definition at line 864 of file bulk_adapt.C.

References conn, FEM_Mesh::elem, elem, elemType, FEM_Entity::getCoord(), length3D(), FEM_Mesh::node, and theMesh.

Referenced by Refine_h().

Here is the call graph for this function:

Here is the caller graph for this function:

int Bulk_Adapt::Refine_h ( int  qm,
int  method,
double  factor,
double *  sizes 
) [private]

int Bulk_Adapt::Coarsen_h ( 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 200 of file bulk_adapt.C.

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

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

Definition at line 759 of file bulk_adapt.C.

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

Referenced by ParFUM_Coarsen(), and ParFUM_Refine().

Here is the call graph for this function:

Here is the caller graph for this function:

double Bulk_Adapt::length ( int  n1,
int  n2 
) [private]

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

Definition at line 823 of file bulk_adapt.C.

References getCoord().

Referenced by controlQualityC(), controlQualityR(), ensureQuality(), flipOrBisect(), getAreaQuality(), getShortestEdge(), ParFUM_GradateMesh(), ParFUM_SetReferenceMesh(), and SetMeshSize().

Here is the call graph for this function:

Here is the caller graph for this function:

double Bulk_Adapt::length3D ( int  n1,
int  n2 
) [private]

Definition at line 833 of file bulk_adapt.C.

References getCoord().

Referenced by findEdgeLengths().

Here is the call graph for this function:

Here is the caller graph for this function:

double Bulk_Adapt::length ( double *  n1_coord,
double *  n2_coord 
) [private]

Returns the length between these two points.

Definition at line 842 of file bulk_adapt.C.

References PUP::d, and dim.

double Bulk_Adapt::length3D ( double *  n1_coord,
double *  n2_coord 
) [private]

Definition at line 853 of file bulk_adapt.C.

References PUP::d.

double Bulk_Adapt::getArea ( int  n1,
int  n2,
int  n3 
) [private]

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

Definition at line 908 of file bulk_adapt.C.

References getCoord().

Referenced by controlQualityR(), and getAreaQuality().

Here is the call graph for this function:

Here is the caller graph for this function:

double Bulk_Adapt::getArea ( double *  n1_coord,
double *  n2_coord,
double *  n3_coord 
) [private]

Returns the area between these three points.

Definition at line 919 of file bulk_adapt.C.

References PUP::d.

double Bulk_Adapt::getSignedArea ( int  n1,
int  n2,
int  n3 
) [private]

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

Definition at line 948 of file bulk_adapt.C.

References getCoord().

Referenced by controlQualityC(), and ensureQuality().

Here is the call graph for this function:

Here is the caller graph for this function:

double Bulk_Adapt::getSignedArea ( double *  n1_coord,
double *  n2_coord,
double *  n3_coord 
) [private]

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

Definition at line 958 of file bulk_adapt.C.

int Bulk_Adapt::getCoord ( int  n1,
double *  crds 
) [private]

Populates crds with the coordinates of the node n1.

Definition at line 971 of file bulk_adapt.C.

References dim, FEM_Entity::getCoord(), FEM_Mesh::node, and theMesh.

Referenced by controlQualityC(), controlQualityF(), ensureQuality(), getArea(), getAreaQuality(), getShortestEdge(), getSignedArea(), length(), and length3D().

Here is the call graph for this function:

Here is the caller graph for this function:

int Bulk_Adapt::getShortestEdge ( int  n1,
int  n2,
int  n3,
int shortestEdge 
) [private]

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

Definition at line 981 of file bulk_adapt.C.

References getCoord(), and length().

Here is the call graph for this function:

double Bulk_Adapt::getAreaQuality ( int  elem  )  [private]

Returns the quality metric for this element.

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 1019 of file bulk_adapt.C.

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

Here is the call graph for this function:

void Bulk_Adapt::ensureQuality ( int  n1,
int  n2,
int  n3 
) [private]

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 1045 of file bulk_adapt.C.

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

Here is the call graph for this function:

bool Bulk_Adapt::controlQualityF ( int  n1,
int  n2,
int  n3,
int  n4 
) [private]

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 1068 of file bulk_adapt.C.

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

Here is the call graph for this function:

bool Bulk_Adapt::controlQualityR ( int  n1,
int  n2,
int  n3,
int  n4 
) [private]

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

bool Bulk_Adapt::controlQualityR ( double *  n1_coord,
double *  n2_coord,
double *  n3_coord 
) [private]

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

Definition at line 1082 of file bulk_adapt.C.

References getArea(), length(), and max().

Here is the call graph for this function:

bool Bulk_Adapt::controlQualityC ( int  n1,
int  n2,
int  n3,
double *  n4_coord 
) [private]

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 1102 of file bulk_adapt.C.

References getCoord().

Referenced by controlQualityF().

Here is the call graph for this function:

Here is the caller graph for this function:

bool Bulk_Adapt::controlQualityC ( double *  n1_coord,
double *  n2_coord,
double *  n3_coord,
double *  n4_coord 
) [private]

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

Definition at line 1111 of file bulk_adapt.C.

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

Here is the call graph for this function:

bool Bulk_Adapt::flipOrBisect ( int  elId,
int  n1,
int  n2,
int  maxEdgeIdx,
double  maxlen 
) [private]

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 1144 of file bulk_adapt.C.

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

Here is the call graph for this function:


Friends And Related Function Documentation

friend class FEM_Interpolate [friend]

Definition at line 246 of file bulk_adapt.h.


Field Documentation

Definition at line 250 of file bulk_adapt.h.

Referenced by Bulk_Adapt_Init().

int Bulk_Adapt::dim [protected]

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

Definition at line 252 of file bulk_adapt.h.

Referenced by Bulk_Adapt(), Bulk_Adapt_Init(), Bulk_Adapt_SetDim(), getCoord(), length(), pup(), Refine_h(), and SetMeshSize().

Definition at line 252 of file bulk_adapt.h.

Referenced by Bulk_Adapt_SetElemType(), and findEdgeLengths().


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

Generated on Mon Sep 21 08:18:02 2020 for Charm++ by  doxygen 1.5.5