xmsmesh  1.0
MeMeshUtils.cpp File Reference

Utilities meshing algorithms. More...

Go to the source code of this file.

Classes

class  xms::SmoothIo
 Helper class for size function smoothing. More...
 

Functions

static void xms::meiDoSmooth (SmoothIo &a_)
 Smooths a size function. Ensures that the size function transitions over a sufficient distance so that the area change of adjacent elements does not exceed the size maximum passed in. More...
 
void xms::meSizeFunctionFromDepth (const VecDbl &a_depths, VecDbl &a_size, double a_minSize, double a_maxSize)
 Creates a size at each point based on the depth at the point and the min and max sizes the equation is min_depth + ( (depth - min_depth) / (max_depth - min_depth) ) * (max_size - min_size) More...
 
void xms::meSmoothSizeFunction (BSHP< TrTin > a_tin, const VecFlt &a_sizes, double a_sizeRatio, double a_minSize, int a_anchorType, const DynBitset &a_ptsFlag, VecFlt &a_smoothSize)
 Smooths a size function. Ensures that the size function transitions over a sufficient distance so that the area change of adjacent elements meets the size ratio passed in. More...
 
void xms::meSmoothElevBySlope (BSHP< TrTin > a_tin, const VecFlt &a_elevs, double a_maxSlope, int a_anchorType, const DynBitset &a_ptsFlag, VecFlt &a_smoothElevs)
 Smooths a elevations based on max specified slope (a_maxSlope) preserving either the min or max based on a_anchorType. More...
 
void xms::meModifyMessageWithPolygonId (int a_polyId, std::string &a_msg)
 Prepends the polygon id as part of an error messge. More...
 

Detailed Description

Utilities meshing algorithms.

Definition in file MeMeshUtils.cpp.

Function Documentation

◆ meiDoSmooth()

static void xms::meiDoSmooth ( SmoothIo a_)
static

Smooths a size function. Ensures that the size function transitions over a sufficient distance so that the area change of adjacent elements does not exceed the size maximum passed in.

Parameters
[in]a_SmoothIo class with variables for the operation

Definition at line 133 of file MeMeshUtils.cpp.

References xms::SmoothIo::CalcMaxSize(), xms::SmoothIo::CalcMinSize(), xms::SmoothIo::m_anchorType, xms::SmoothIo::m_checkMinSize, xms::SmoothIo::m_minSize, xms::SmoothIo::m_ptsFlag, xms::SmoothIo::m_sizes, xms::SmoothIo::m_smoothSize, xms::SmoothIo::m_tin, Mdist(), xms::meiDoSmooth(), xms::Pt3< T >::x, XM_ASSERT, XM_ENSURE_TRUE, and xms::Pt3< T >::y.

Referenced by xms::meiDoSmooth(), xms::meSmoothElevBySlope(), and xms::meSmoothSizeFunction().

◆ meModifyMessageWithPolygonId()

void xms::meModifyMessageWithPolygonId ( int  a_polyId,
std::string &  a_msg 
)

◆ meSizeFunctionFromDepth()

void xms::meSizeFunctionFromDepth ( const VecDbl a_depths,
VecDbl a_size,
double  a_minSize,
double  a_maxSize 
)

Creates a size at each point based on the depth at the point and the min and max sizes the equation is min_depth + ( (depth - min_depth) / (max_depth - min_depth) ) * (max_size - min_size)

Parameters
[in]a_depthsThe measured depths at point locations
[out]a_sizeA target size value based on the depth and the min/max specified size.
[in]a_minSizeThe minimum element edge size
[in]a_maxSizeThe maximum element edge size

Definition at line 264 of file MeMeshUtils.cpp.

References xms::meSizeFunctionFromDepth(), and XM_ENSURE_TRUE.

Referenced by xms::meSizeFunctionFromDepth().

◆ meSmoothElevBySlope()

void xms::meSmoothElevBySlope ( BSHP< TrTin a_tin,
const VecFlt a_elevs,
double  a_maxSlope,
int  a_anchorType,
const DynBitset a_ptsFlag,
VecFlt a_smoothElevs 
)

Smooths a elevations based on max specified slope (a_maxSlope) preserving either the min or max based on a_anchorType.

Parameters
[in]a_tinPoints and triangles defining the connectivity of the size function.
[in]a_elevsArray of the current elevations
[in]a_maxSlopeMaximum allowable slope
[in]a_anchorTypeIndicates if you are anchoring to the top or bottom of the slope
[in]a_ptsFlagFlag to indicate if the value at the point should be adjusted (a value of true will skip the point). Leave the bitset empty to process all points.
[out]a_smoothElevsArray of smoothed elevations

Definition at line 349 of file MeMeshUtils.cpp.

References xms::SmoothIo::m_anchorType, xms::SmoothIo::m_maxSize, xms::SmoothIo::m_ptsFlag, xms::SmoothIo::m_sizes, xms::SmoothIo::m_smoothSize, xms::SmoothIo::m_tin, xms::meiDoSmooth(), xms::meSmoothElevBySlope(), and XM_ENSURE_TRUE.

Referenced by xms::meSmoothElevBySlope().

◆ meSmoothSizeFunction()

void xms::meSmoothSizeFunction ( BSHP< TrTin a_tin,
const VecFlt a_sizes,
double  a_sizeRatio,
double  a_minSize,
int  a_anchorType,
const DynBitset a_ptsFlag,
VecFlt a_smoothSize 
)

Smooths a size function. Ensures that the size function transitions over a sufficient distance so that the area change of adjacent elements meets the size ratio passed in.

Parameters
[in]a_tinPoints and triangles defining the connectivity of the size function.
[in]a_sizesArray of the current sizes
[in]a_sizeRatioAllowable size difference between adjacent elements
[in]a_minSizeMinimum specified element size
[in]a_anchorTypeThe minimum element edge size
[in]a_ptsFlagFlag to indicate if the value at the point should be adjusted (a value of true will skip the point). Leave the bitset empty to process all points.
[out]a_smoothSizeArray of smoothed sizes

Definition at line 300 of file MeMeshUtils.cpp.

References xms::SmoothIo::m_anchorType, xms::SmoothIo::m_checkMinSize, xms::SmoothIo::m_logPercentGrowth, xms::SmoothIo::m_minSize, xms::SmoothIo::m_percentGrowth, xms::SmoothIo::m_ptsFlag, xms::SmoothIo::m_scaleFactor, xms::SmoothIo::m_sizeRatio, xms::SmoothIo::m_sizes, xms::SmoothIo::m_smoothSize, xms::SmoothIo::m_tin, xms::meiDoSmooth(), xms::meSmoothSizeFunction(), and XM_ENSURE_TRUE.

Referenced by xms::meSmoothSizeFunction().