xmsmesh  1.0
MeMeshUtils.h File Reference

Utilities related to a VTK unstructured grid (from shared1\UGridUtils.cpp) More...

#include <string>
#include <vector>
#include <xmscore/stl/set.h>
#include <xmscore/stl/vector.h>
#include <xmscore/misc/boost_defines.h>
#include <xmscore/misc/DynBitset.h>

Go to the source code of this file.

Functions

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 related to a VTK unstructured grid (from shared1\UGridUtils.cpp)

Definition in file MeMeshUtils.h.

Function Documentation

◆ 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().