Fade2D Documentation pages v2.16.7
Delaunay Features
GEOM_FADE2D::MeshGenParams Class Reference

Parameters for the mesh generator. More...

#include <MeshGenParams.h>

Public Member Functions

 MeshGenParams (Zone2 *pZone_)
 Constructor for mesh generator parameters. More...
 
void addLockedConstraint (ConstraintSegment2 *pConstraintSegment)
 Locked constraint segments that should not be split. More...
 
virtual double getMaxEdgeLength (Triangle2 *pT)
 Get the maximum allowed edge length for a Triangle2. More...
 
virtual double getMaxTriangleArea (Triangle2 *pT)
 Get the maximum allowed triangle area for mesh refinement. More...
 

Public Attributes

bool bAllowConstraintSplitting
 Allow constraint segment splitting. More...
 
bool bGridMeshingLQ
 Low-quality grid meshing for high performance. More...
 
bool bKeepExistingSteinerPoints
 Steiner points from previous refinements. More...
 
bool bReproducibleResults
 Flag for reproducible results. More...
 
double capAspectLimit
 Aspect ratio limit for triangle refinement. More...
 
double gridLength
 Grid length for meshing. More...
 
Point2 gridPoint
 Grid point through which the grid mesh must pass. More...
 
Vector2 gridVector
 gridVector More...
 
double growFactor
 Grow factor for adjacent triangles. More...
 
double growFactorMinArea
 growFactorMinArea More...
 
double maxEdgeLength
 Maximum edge length. More...
 
double maxTriangleArea
 maxTriangleArea More...
 
double minAngleDegree
 Minimum interior angle for triangles. More...
 
double minEdgeLength
 Minimum edge length for triangle refinement. More...
 
Zone2pZone
 The Zone2 to be meshed. More...
 

Detailed Description

This class serves as a container for the parameters used by the mesh generator, i.e., for the Fade_2D::refineAdvanced() method. Client code can derive a custom class from MeshGenParams and provide specific implementations for methods such as getMaxTriangleArea(Triangle* pT) or getMaxEdgeLength(Triangle* pT) to control the local density of the generated mesh. The meshing algorithm calls these functions during refinement to check whether a triangle meets the conditions for further subdivision.

Quality meshing with different parameter configurations leading to varying results
See also
C++ Examples on advanced mesh generation.

Constructor & Destructor Documentation

◆ MeshGenParams()

GEOM_FADE2D::MeshGenParams::MeshGenParams ( Zone2 pZone_)
inlineexplicit

Initializes the mesh generator parameters with default values. These can be overridden as needed.

Parameters
pZone_A pointer to the Zone2 to be remeshed.

Member Function Documentation

◆ addLockedConstraint()

void GEOM_FADE2D::MeshGenParams::addLockedConstraint ( ConstraintSegment2 pConstraintSegment)

This method allows the user to specify which ConstraintSegment2 objects should remain intact and not be split during mesh refinement. To use, set bAllowConstraintSplitting to true and then add locked segments using this method.

◆ getMaxEdgeLength()

virtual double GEOM_FADE2D::MeshGenParams::getMaxEdgeLength ( Triangle2 pT)
inlinevirtual

This method is called by the mesh generation algorithm. It returns for a Triangle2 pT the maximum allowed edge length. If any of the edges of pT are larger, then pT will be subdivided. The default implementation returns the value maxEdgeLength for all triangles, which is DBL_MAX by default (indicating no limit). You may change this value or derive a class from MeshGenParams and override the method.

Parameters
pTA pointer to the Triangle2 being evaluated.
Returns
The maximum edge length allowed for the Triangle2.
User Controlled Mesh Density, the edge length is limited in the lower left corner

◆ getMaxTriangleArea()

virtual double GEOM_FADE2D::MeshGenParams::getMaxTriangleArea ( Triangle2 pT)
inlinevirtual

This method is called by the mesh generation algorithm. It returns for a Triangle2 pT the maximum allowed area. If the area of pT exceeds this value, then pT will be subdivided. The default implementation returns the value maxTriangleArea for all triangles, which is DBL_MAX by default (indicating no limit). You may change this value or derive a class from MeshGenParams and override the method.

Parameters
pTA pointer to the Triangle2 being evaluated.
Returns
The maximum area allowed for the Triangle2.
User Controlled Mesh Density, the area is limited in the lower left corner

Member Data Documentation

◆ bAllowConstraintSplitting

bool GEOM_FADE2D::MeshGenParams::bAllowConstraintSplitting

The bAllowConstraintSplitting flag determines whether constraint segments can be split during mesh refinement. If set to true, constraint segments are allowed to be divided, otherwise not. Default: true.

◆ bGridMeshingLQ

bool GEOM_FADE2D::MeshGenParams::bGridMeshingLQ

This flag allows for faster grid-based meshing at the cost of producing triangles with potentially bad shapes. Set this flag to true to improve performance when grid meshing is enabled. Default: false.

◆ bKeepExistingSteinerPoints

bool GEOM_FADE2D::MeshGenParams::bKeepExistingSteinerPoints

A previous call to refine() or refineAdvanced() may have created Steiner points. These points may be partially or entirely removed during a later refinement call, even if the later refinement occurs in a different zone. Whether this behavior is desired depends on your application. Typically, you want to preserve the points, so the default value of bKeepExistingSteinerPoints is true.

◆ bReproducibleResults

bool GEOM_FADE2D::MeshGenParams::bReproducibleResults

If true, the algorithm will generate reproducible triangulations. This is useful for debugging and consistency across runs. Set to false for better performance if reproducibility is not required. Default: true.

Note
Reproducible results are created inside pZone. For reproducibility across different zones use Zone2::unifyGrid(0) on the global Zone2.

◆ capAspectLimit

double GEOM_FADE2D::MeshGenParams::capAspectLimit

The capAspectLimit parameter limits the ratio of edge length to height for triangles. Triangles with a higher aspect ratio than this value will be subdivided. Default: 10.0.

◆ gridLength

double GEOM_FADE2D::MeshGenParams::gridLength

The gridLength parameter determines the length of the grid cells for grid-based meshing. A value greater than 0 enables grid meshing. By default, gridLength=0 (disabled).

Grid Meshing axis aligned
Note
The algorithm may automatically adapt the gridLength a bit such that the grid fits better into the shape.

◆ gridPoint

Point2 GEOM_FADE2D::MeshGenParams::gridPoint

This optional point can be used to force the grid mesh to pass through a specific point. By default, the coordinates of gridPoint are initialized to DBL_MAX, which disables this feature. When set, the grid will be aligned such that it passes through the specified point.

◆ gridVector

Vector2 GEOM_FADE2D::MeshGenParams::gridVector

This vector determines the alignment of the grid when grid-based meshing is used. By default, the vector is aligned with the x-axis (1.0, 0.0).

Grid meshing with custom alignment, not axis-aligned.

◆ growFactor

double GEOM_FADE2D::MeshGenParams::growFactor

The growFactor parameter controls how much adjacent triangles can grow in area. For two adjacent triangles (t0, t1), the ratio of their areas must be less than the growFactor. Recommendation: growFactor>5.0, Default: DBL_MAX (no limit).

◆ growFactorMinArea

double GEOM_FADE2D::MeshGenParams::growFactorMinArea

The growFactor value is ignored for triangles with a smaller area than growFactorMinArea. This value prevents generation of hundreds of tiny triangles around one that is unusually small. Default: 0.001

◆ maxEdgeLength

double GEOM_FADE2D::MeshGenParams::maxEdgeLength

The maxEdgeLength value is returned by the default implementation of MeshGenParams::getMaxEdgeLength(). Larger edges are automatically subdivided. Default value: DBL_MAX (no limit)

◆ maxTriangleArea

double GEOM_FADE2D::MeshGenParams::maxTriangleArea

The maxTriangleArea value is returned by the default implementation of MeshGenParams::getMaxTriangleArea(). Larger triangles are automatically subdivided. Default value: DBL_MAX (no limit)

◆ minAngleDegree

double GEOM_FADE2D::MeshGenParams::minAngleDegree

This parameter sets the minimum allowable interior angle for triangles in the mesh. Triangles with angles smaller than this value will be refined. The default value is 20.0 degrees, the maximum is 30.0.

◆ minEdgeLength

double GEOM_FADE2D::MeshGenParams::minEdgeLength

This parameter sets the minimum edge length for triangles in the mesh. Triangles with edges shorter than this value will not be subdivided. The default value is 1e-3.

◆ pZone

Zone2* GEOM_FADE2D::MeshGenParams::pZone

This parameter specifies the Zone2 that the meshing algorithm will operate on.


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