AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
axom::quest::Shaper Class Referenceabstract

#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/main/src/axom/quest/Shaper.hpp>

Inheritance diagram for axom::quest::Shaper:

Public Types

using RuntimePolicy = axom::runtime_policy::Policy
 
using RefinementType = DiscreteShape::RefinementType
 Refinement type. More...
 

Public Member Functions

 Shaper (RuntimePolicy execPolicy, int allocatorId, const klee::ShapeSet &shapeSet, sidre::Group *bpMesh, const std::string &topo="")
 Construct Shaper to operate on a blueprint-formatted mesh stored in a sidre Group. More...
 
 Shaper (RuntimePolicy execPolicy, int allocatorId, const klee::ShapeSet &shapeSet, conduit::Node &bpNode, const std::string &topo="")
 Construct Shaper to operate on a blueprint-formatted mesh stored in a conduit Node. More...
 
virtual ~Shaper ()
 
bool verifyInputMesh (std::string &whyBad) const
 Verify the input mesh is okay for this class to work with. More...
 
void setFilePath (const std::string &filePath)
 Set path of shape input file. More...
 
mint::MeshgetSurfaceMesh () const
 
bool isVerbose () const
 
virtual bool isValidFormat (const std::string &format) const
 Predicate to determine if the specified format is valid. More...
 
std::string shapeFormat (const klee::Shape &shape) const
 Returns the format type of the supplied shape. More...
 
RuntimePolicy getExecutionPolicy () const
 Returns the execution policy used by the Shaper. More...
 
double allReduceSum (double val) const
 Helper to apply a parallel sum reduction to a quantity. More...
 
double allReduceMin (double val) const
 Helper to apply a parallel min reduction to a quantity. More...
 
double allReduceMax (double val) const
 Helper to apply a parallel max reduction to a quantity. More...
 
Functions to get and set shaping parameters
void setSamplesPerKnotSpan (int nSamples)
 
void setVertexWeldThreshold (double threshold)
 
void setVerbosity (bool isVerbose)
 
void setPercentError (double percent)
 
void setRefinementType (RefinementType t)
 
Functions related to the stages for a given shape
virtual void loadShape (const klee::Shape &shape)
 Loads the shape from file into m_surfaceMesh. More...
 
virtual void prepareShapeQuery (klee::Dimensions shapeDimension, const klee::Shape &shape)=0
 
virtual void runShapeQuery (const klee::Shape &shape)=0
 
virtual void applyReplacementRules (const klee::Shape &shape)=0
 
virtual void finalizeShapeQuery ()=0
 
Functions to generate/adjust volume fractions after all shapes have been applied
virtual void adjustVolumeFractions ()=0
 

Static Public Attributes

static constexpr int DEFAULT_SAMPLES_PER_KNOT_SPAN {25}
 
static constexpr double MINIMUM_PERCENT_ERROR {0.}
 
static constexpr double MAXIMUM_PERCENT_ERROR {100.}
 
static constexpr double DEFAULT_VERTEX_WELD_THRESHOLD {1e-9}
 

Protected Member Functions

void loadShapeInternal (const klee::Shape &shape, double percentError, double &revolvedVolume)
 Loads the shape into m_surfaceMesh. More...
 
void applyTransforms (const klee::Shape &shape)
 Computes transforms for the shape and applies them to the surface mesh. More...
 
void applyTransforms (const numerics::Matrix< double > &transform)
 Computes transforms for the shape and applies them to the surface mesh. More...
 
numerics::Matrix< double > getTransforms (const klee::Shape &shape) const
 Get a matrix that contains the shape's concatenated transforms. More...
 
int getRank () const
 Helper function to get the rank associated with the current process. More...
 

Protected Attributes

RuntimePolicy m_execPolicy
 
int m_allocatorId
 
sidre::DataStore m_dataStore
 
const klee::ShapeSetm_shapeSet
 
std::string m_prefixPath
 Prefix path for shape file names with relative path. More...
 
axom::IndexType m_cellCount
 Number of cells in computational mesh (m_dc or m_bpGrp). More...
 
std::shared_ptr< mint::Meshm_surfaceMesh
 
int m_samplesPerKnotSpan {DEFAULT_SAMPLES_PER_KNOT_SPAN}
 
double m_percentError {MINIMUM_PERCENT_ERROR}
 
RefinementType m_refinementType {DiscreteShape::RefinementUniformSegments}
 
double m_vertexWeldThreshold {DEFAULT_VERTEX_WELD_THRESHOLD}
 
bool m_verboseOutput {false}
 
MPI_Comm m_comm {MPI_COMM_SELF}
 

Detailed Description

Abstract base class for shaping material volume fractions

Shaper requires Axom to be configured with Conduit or MFEM or both.

Member Typedef Documentation

◆ RuntimePolicy

◆ RefinementType

Constructor & Destructor Documentation

◆ Shaper() [1/2]

axom::quest::Shaper::Shaper ( RuntimePolicy  execPolicy,
int  allocatorId,
const klee::ShapeSet shapeSet,
sidre::Group bpMesh,
const std::string &  topo = "" 
)

Construct Shaper to operate on a blueprint-formatted mesh stored in a sidre Group.

◆ Shaper() [2/2]

axom::quest::Shaper::Shaper ( RuntimePolicy  execPolicy,
int  allocatorId,
const klee::ShapeSet shapeSet,
conduit::Node &  bpNode,
const std::string &  topo = "" 
)

Construct Shaper to operate on a blueprint-formatted mesh stored in a conduit Node.

Because conduit::Node doesn't support application-specified allocator id for (only) arrays, the incoming bpNode must have all arrays pre-allocated in a space accessible by the runtime policy. Any needed-but-missing space would lead to an exception.

◆ ~Shaper()

virtual axom::quest::Shaper::~Shaper ( )
virtual

Member Function Documentation

◆ verifyInputMesh()

bool axom::quest::Shaper::verifyInputMesh ( std::string &  whyBad) const

Verify the input mesh is okay for this class to work with.

◆ setSamplesPerKnotSpan()

void axom::quest::Shaper::setSamplesPerKnotSpan ( int  nSamples)

◆ setVertexWeldThreshold()

void axom::quest::Shaper::setVertexWeldThreshold ( double  threshold)

◆ setVerbosity()

void axom::quest::Shaper::setVerbosity ( bool  isVerbose)
inline

References isVerbose(), and m_verboseOutput.

◆ setPercentError()

void axom::quest::Shaper::setPercentError ( double  percent)

◆ setRefinementType()

void axom::quest::Shaper::setRefinementType ( RefinementType  t)

◆ setFilePath()

void axom::quest::Shaper::setFilePath ( const std::string &  filePath)

Set path of shape input file.

The path is used to resolve relative paths that may have been specified in the file.

◆ getSurfaceMesh()

mint::Mesh* axom::quest::Shaper::getSurfaceMesh ( ) const
inline

References m_surfaceMesh.

◆ isVerbose()

bool axom::quest::Shaper::isVerbose ( ) const
inline

References m_verboseOutput.

◆ isValidFormat()

virtual bool axom::quest::Shaper::isValidFormat ( const std::string &  format) const
virtual

Predicate to determine if the specified format is valid.

Parameters
formatA string listing the format to check

◆ shapeFormat()

std::string axom::quest::Shaper::shapeFormat ( const klee::Shape shape) const
inline

Returns the format type of the supplied shape.

References axom::klee::Geometry::getFormat(), and axom::klee::Shape::getGeometry().

◆ getExecutionPolicy()

RuntimePolicy axom::quest::Shaper::getExecutionPolicy ( ) const
inline

Returns the execution policy used by the Shaper.

References m_execPolicy.

◆ loadShape()

virtual void axom::quest::Shaper::loadShape ( const klee::Shape shape)
virtual

Loads the shape from file into m_surfaceMesh.

Reimplemented in axom::quest::SamplingShaper, and axom::quest::IntersectionShaper.

◆ prepareShapeQuery()

virtual void axom::quest::Shaper::prepareShapeQuery ( klee::Dimensions  shapeDimension,
const klee::Shape shape 
)
pure virtual

◆ runShapeQuery()

virtual void axom::quest::Shaper::runShapeQuery ( const klee::Shape shape)
pure virtual

◆ applyReplacementRules()

virtual void axom::quest::Shaper::applyReplacementRules ( const klee::Shape shape)
pure virtual

◆ finalizeShapeQuery()

virtual void axom::quest::Shaper::finalizeShapeQuery ( )
pure virtual

◆ adjustVolumeFractions()

virtual void axom::quest::Shaper::adjustVolumeFractions ( )
pure virtual

◆ allReduceSum()

double axom::quest::Shaper::allReduceSum ( double  val) const

Helper to apply a parallel sum reduction to a quantity.

Note
This is the identity function when running without MPI

◆ allReduceMin()

double axom::quest::Shaper::allReduceMin ( double  val) const

Helper to apply a parallel min reduction to a quantity.

Note
This is the identity function when running without MPI

◆ allReduceMax()

double axom::quest::Shaper::allReduceMax ( double  val) const

Helper to apply a parallel max reduction to a quantity.

Note
This is the identity function when running without MPI

◆ loadShapeInternal()

void axom::quest::Shaper::loadShapeInternal ( const klee::Shape shape,
double  percentError,
double &  revolvedVolume 
)
protected

Loads the shape into m_surfaceMesh.

Parameters
shapeThe shape.
percentErrorA percent error to use when refining the shape. If it positive then Axom will try to refine dynamically according to this error. Otherwise, it will use the segmentsPerKnotSpan value.
[out]revolvedvolumeA revolved volume for the shape, if the shape is from a C2C contour.

◆ applyTransforms() [1/2]

void axom::quest::Shaper::applyTransforms ( const klee::Shape shape)
protected

Computes transforms for the shape and applies them to the surface mesh.

Parameters
shapeThe shape.

◆ applyTransforms() [2/2]

void axom::quest::Shaper::applyTransforms ( const numerics::Matrix< double > &  transform)
protected

Computes transforms for the shape and applies them to the surface mesh.

Parameters
shapeThe shape.
transformA 4x4 matrix containing the transformation to apply.

◆ getTransforms()

numerics::Matrix<double> axom::quest::Shaper::getTransforms ( const klee::Shape shape) const
protected

Get a matrix that contains the shape's concatenated transforms.

Parameters
shapeThe shape whose transforms are being concatenated.
Returns
A 4x4 matrix that represents the transforms.

◆ getRank()

int axom::quest::Shaper::getRank ( ) const
protected

Helper function to get the rank associated with the current process.

Note
This function can be called even in non-mpi configurations

Member Data Documentation

◆ DEFAULT_SAMPLES_PER_KNOT_SPAN

constexpr int axom::quest::Shaper::DEFAULT_SAMPLES_PER_KNOT_SPAN {25}
staticconstexpr

◆ MINIMUM_PERCENT_ERROR

constexpr double axom::quest::Shaper::MINIMUM_PERCENT_ERROR {0.}
staticconstexpr

◆ MAXIMUM_PERCENT_ERROR

constexpr double axom::quest::Shaper::MAXIMUM_PERCENT_ERROR {100.}
staticconstexpr

◆ DEFAULT_VERTEX_WELD_THRESHOLD

constexpr double axom::quest::Shaper::DEFAULT_VERTEX_WELD_THRESHOLD {1e-9}
staticconstexpr

◆ m_execPolicy

RuntimePolicy axom::quest::Shaper::m_execPolicy
protected

◆ m_allocatorId

int axom::quest::Shaper::m_allocatorId
protected

◆ m_dataStore

sidre::DataStore axom::quest::Shaper::m_dataStore
protected

◆ m_shapeSet

const klee::ShapeSet& axom::quest::Shaper::m_shapeSet
protected

◆ m_prefixPath

std::string axom::quest::Shaper::m_prefixPath
protected

Prefix path for shape file names with relative path.

◆ m_cellCount

axom::IndexType axom::quest::Shaper::m_cellCount
protected

Number of cells in computational mesh (m_dc or m_bpGrp).

◆ m_surfaceMesh

std::shared_ptr<mint::Mesh> axom::quest::Shaper::m_surfaceMesh
protected

◆ m_samplesPerKnotSpan

int axom::quest::Shaper::m_samplesPerKnotSpan {DEFAULT_SAMPLES_PER_KNOT_SPAN}
protected

◆ m_percentError

double axom::quest::Shaper::m_percentError {MINIMUM_PERCENT_ERROR}
protected

◆ m_refinementType

RefinementType axom::quest::Shaper::m_refinementType {DiscreteShape::RefinementUniformSegments}
protected

◆ m_vertexWeldThreshold

double axom::quest::Shaper::m_vertexWeldThreshold {DEFAULT_VERTEX_WELD_THRESHOLD}
protected

◆ m_verboseOutput

bool axom::quest::Shaper::m_verboseOutput {false}
protected

◆ m_comm

MPI_Comm axom::quest::Shaper::m_comm {MPI_COMM_SELF}
protected

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