|
AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
|
#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/develop/src/axom/quest/IntersectionShaper.hpp>

Public Types | |
| using | BoundingBox2D = primal::BoundingBox< double, 2 > |
| using | BoundingBox3D = primal::BoundingBox< double, 3 > |
| using | HexahedronType = primal::Hexahedron< double, 3 > |
| using | OctahedronType = primal::Octahedron< double, 3 > |
| using | PolyhedronType = primal::Polyhedron< double, 3 > |
| using | Point2D = primal::Point< double, 2 > |
| using | Point3D = primal::Point< double, 3 > |
| using | TetrahedronType = primal::Tetrahedron< double, 3 > |
| using | SegmentMesh = mint::UnstructuredMesh< mint::SINGLE_SHAPE > |
| using | TetMesh = mint::UnstructuredMesh< mint::SINGLE_SHAPE > |
| using | PolygonStaticType = primal::Polygon< double, 2, axom::primal::PolygonArray::Static > |
| using | RuntimePolicy = axom::runtime_policy::Policy |
| using | RefinementType = DiscreteShape::RefinementType |
| Refinement type. More... | |
Public Member Functions | |
| template<typename ShapeType > | |
| void | setMeshDependentData () |
| Set data that depends on mesh (but not on shapes). More... | |
| template<typename ExecSpace > | |
| void | setMeshDependentDataImpl2D () |
| Set 2D mesh-dependent data, using the given ExecSpace for execution. More... | |
| template<typename ExecSpace > | |
| void | setMeshDependentDataImpl3D () |
| Set 3D mesh-dependent data, using the given ExecSpace for execution. More... | |
| double | getRevolvedVolume () const |
| Return the revolved volume that was computed during dynamic refinement. More... | |
| double | getApproximateRevolvedVolume () const |
| Return the revolved volume for the m_surfaceMesh at m_level circle refinement. More... | |
| virtual void | loadShape (const klee::Shape &shape) override |
| Loads the shape from file into m_surfaceMesh. More... | |
| void | prepareShapeQuery (klee::Dimensions shapeDimension, const klee::Shape &shape) override |
| Prepares the shaping query, based on the policy member set (default is sequential) More... | |
| void | runShapeQuery (const klee::Shape &shape) override |
| axom::ArrayView< const double > | getOverlapVolumes () const |
| axom::ArrayView< const double > | getCellVolumes () const |
| double | sumOverlapVolumes (bool global=true) const |
| template<typename ExecSpace , typename Summable > | |
| Summable | sumArray (const Summable *a, axom::IndexType count) const |
| void | adjustVolumeFractions () override |
| std::vector< std::string > | getMaterialNames () const |
| std::pair< axom::ArrayView< double >, int > | getMaterial (const std::string &materialName) |
| Gets the grid function and material number for a material name. More... | |
| 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::Mesh * | getSurfaceMesh () 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 related to intersection; supplements parameters in base class | |
| void | setLevel (int level) |
| void | setFreeMaterialName (const std::string &name) |
| Set the name of the material used to account for free volume fractions. 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) |
Static Public Attributes | |
| static constexpr int | DEFAULT_CIRCLE_REFINEMENT_LEVEL {7} |
| static constexpr double | DEFAULT_REVOLVED_VOLUME {0.} |
| 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::ShapeSet & | m_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::Mesh > | m_surfaceMesh |
| int | m_samplesPerKnotSpan {DEFAULT_SAMPLES_PER_KNOT_SPAN} |
| double | m_percentError {MINIMUM_PERCENT_ERROR} |
| RefinementType | m_refinementType {DiscreteShape::RefinementUniformSegments} |
| bool | m_verboseOutput {false} |
| MPI_Comm | m_comm {MPI_COMM_SELF} |
Private functions related to the stages for a given shape | |
| template<typename ExecSpace > | |
| axom::ArrayView< double > | getCompletelyFree () |
| Make a new grid function that contains all of the free space not occupied by existing materials. More... | |
| template<typename ExecSpace > | |
| void | applyReplacementRulesImpl (const klee::Shape &shape) |
| Set the volume fractions for the current shape into the grid function for the material and adjust any other material volume fraction grid functions. More... | |
| void | applyReplacementRules (const klee::Shape &shape) override |
| Apply material replacement rules for the current shape, using the appropriate execution policy. More... | |
| void | finalizeShapeQuery () override |
| using axom::quest::IntersectionShaper::BoundingBox2D = primal::BoundingBox<double, 2> |
| using axom::quest::IntersectionShaper::BoundingBox3D = primal::BoundingBox<double, 3> |
| using axom::quest::IntersectionShaper::HexahedronType = primal::Hexahedron<double, 3> |
| using axom::quest::IntersectionShaper::OctahedronType = primal::Octahedron<double, 3> |
| using axom::quest::IntersectionShaper::PolyhedronType = primal::Polyhedron<double, 3> |
| using axom::quest::IntersectionShaper::Point2D = primal::Point<double, 2> |
| using axom::quest::IntersectionShaper::Point3D = primal::Point<double, 3> |
| using axom::quest::IntersectionShaper::TetrahedronType = primal::Tetrahedron<double, 3> |
| using axom::quest::IntersectionShaper::PolygonStaticType = primal::Polygon<double, 2, axom::primal::PolygonArray::Static> |
|
inherited |
Refinement type.
|
inline |
Set data that depends on mesh (but not on shapes).
References AXOM_ANNOTATE_SCOPE, axom::quest::Shaper::m_execPolicy, and SLIC_ERROR.
|
inline |
Set 2D mesh-dependent data, using the given ExecSpace for execution.
This method has proven to be a potential bottleneck on devices. The performance annotations will be removed once it is robustly fixed.
References axom::primal::BoundingBox< T, NDIMS >::addPoint(), AXOM_ANNOTATE_BEGIN, AXOM_ANNOTATE_END, AXOM_LAMBDA, axom::Array< T, DIM, SPACE, StoragePolicy >::fill(), axom::quest::Shaper::m_allocatorId, axom::quest::Shaper::m_cellCount, SLIC_INFO, and axom::Array< T, DIM, SPACE, StoragePolicy >::view().
|
inline |
Set 3D mesh-dependent data, using the given ExecSpace for execution.
This method has proven to be a potential bottleneck on devices. The performance annotations will be removed once it is robustly fixed.
References AXOM_ANNOTATE_BEGIN, AXOM_ANNOTATE_END, AXOM_LAMBDA, axom::Array< T, DIM, SPACE, StoragePolicy >::fill(), axom::quest::Shaper::m_allocatorId, axom::quest::Shaper::m_cellCount, SLIC_INFO, and axom::Array< T, DIM, SPACE, StoragePolicy >::view().
|
inline |
|
inline |
Set the name of the material used to account for free volume fractions.
| name | The new name of the material. This name cannot contain underscores and it cannot be set once shaping has started. |
References axom::quest::Shaper::m_cellCount, and SLIC_ERROR.
|
inline |
Return the revolved volume that was computed during dynamic refinement.
|
inline |
Return the revolved volume for the m_surfaceMesh at m_level circle refinement.
References axom::quest::Shaper::m_surfaceMesh.
|
inlineoverridevirtual |
Loads the shape from file into m_surfaceMesh.
Reimplemented from axom::quest::Shaper.
References axom::quest::Shaper::loadShapeInternal(), axom::quest::Shaper::m_percentError, axom::quest::Shaper::m_surfaceMesh, and axom::quest::Shaper::shapeFormat().
|
inline |
Make a new grid function that contains all of the free space not occupied by existing materials.
| ExecSpace | The execution space where the data are computed. |
References AXOM_ANNOTATE_SCOPE, AXOM_LAMBDA, axom::ArrayView< T, DIM, SPACE >::empty(), axom::ArrayView< T, DIM, SPACE >::size(), and SLIC_ASSERT.
|
inline |
Set the volume fractions for the current shape into the grid function for the material and adjust any other material volume fraction grid functions.
| ExecSpace | The execution space where the data are computed. |
| shape | The shape whose volume fractions are being stored. |
The replacement rules operate on the current shape's material as well as the rest of the materials since they need to be updated to sum to 1. When adding a volume fraction to a zone, the code adds the allowed amount to the zone. In most cases, this is just the computed material volume, though it can be restricted by amounts of other materials if replacing materials. Once a volume fraction has been added, a list of update materials is iterated and a corresponding amount is subtracted from them. This update list consists of "completely free", all non-shape materials, and finally the shape material itself. The shape material is added at the end in case the initial volume fraction addition exceeded 1.
The "completely free" material (CF) represents any volume fraction in the zones that has not been assigned to any material. We subtract from CF first as part of the update process so we do not have to subtract from real materials in the event that a zone is not full.
The list of update materials depends on the shape's material replacement rule.
Example: update mats |-—>
mat1 CF mat0 subtract
| 0.8 | 0.2 | 0.4 | | 0.4 | (added 0.4 to mat1)
mat1 CF mat0 subtract
| 0.8 | 0.0 | 0.4 | | 0.2 | (subtracted 0.2 from CF)
mat1 CF mat0 subtract
| 0.8 | 0.0 | 0.2 | | 0.0 | (subtracted 0.2 from mat0)
References AXOM_ANNOTATE_SCOPE, AXOM_LAMBDA, axom::klee::Shape::getMaterial(), getMaterial(), getMaterialNames(), axom::klee::Shape::getMaterialsNotReplaced(), axom::klee::Shape::getMaterialsReplaced(), axom::klee::Shape::getName(), axom::quest::Shaper::m_allocatorId, SLIC_ERROR_IF, axom::sort(), and axom::Array< T, DIM, SPACE, StoragePolicy >::view().
|
inlineoverridevirtual |
Apply material replacement rules for the current shape, using the appropriate execution policy.
Implements axom::quest::Shaper.
References AXOM_ANNOTATE_SCOPE, AXOM_UNUSED_VAR, and axom::quest::Shaper::m_execPolicy.
|
inlineoverridevirtual |
Implements axom::quest::Shaper.
References AXOM_ANNOTATE_SCOPE, and axom::quest::Shaper::m_surfaceMesh.
|
inlineoverridevirtual |
Prepares the shaping query, based on the policy member set (default is sequential)
Implements axom::quest::Shaper.
References AXOM_ANNOTATE_SCOPE, AXOM_UNUSED_VAR, axom::klee::Geometry::getFormat(), axom::klee::Shape::getGeometry(), axom::quest::Shaper::m_execPolicy, axom::quest::Shaper::m_percentError, axom::bump::views::shapeDimension(), and axom::quest::Shaper::shapeFormat().
|
inlineoverridevirtual |
|
inline |
|
inline |
|
inline |
|
inline |
References AXOM_LAMBDA.
|
inlineoverridevirtual |
Implements axom::quest::Shaper.
|
inline |
|
inline |
Gets the grid function and material number for a material name.
| materialName | The name of the material. |
References AXOM_LAMBDA, axom::detail::getAllocatorSpace(), axom::quest::Shaper::m_execPolicy, and SLIC_ASSERT.
|
inherited |
Verify the input mesh is okay for this class to work with.
|
inherited |
|
inherited |
|
inlineinherited |
References axom::quest::Shaper::isVerbose(), and axom::quest::Shaper::m_verboseOutput.
|
inherited |
|
inherited |
|
inherited |
Set path of shape input file.
The path is used to resolve relative paths that may have been specified in the file.
|
inlineinherited |
References axom::quest::Shaper::m_surfaceMesh.
|
inlineinherited |
References axom::quest::Shaper::m_verboseOutput.
|
virtualinherited |
Predicate to determine if the specified format is valid.
| format | A string listing the format to check |
|
inlineinherited |
Returns the format type of the supplied shape.
References axom::klee::Geometry::getFormat(), and axom::klee::Shape::getGeometry().
|
inlineinherited |
Returns the execution policy used by the Shaper.
References axom::quest::Shaper::m_execPolicy.
|
inherited |
Helper to apply a parallel sum reduction to a quantity.
|
inherited |
Helper to apply a parallel min reduction to a quantity.
|
inherited |
Helper to apply a parallel max reduction to a quantity.
|
protectedinherited |
Loads the shape into m_surfaceMesh.
| shape | The shape. | |
| percentError | A 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] | revolvedvolume | A revolved volume for the shape, if the shape is from a C2C contour. |
|
protectedinherited |
Computes transforms for the shape and applies them to the surface mesh.
| shape | The shape. |
|
protectedinherited |
Computes transforms for the shape and applies them to the surface mesh.
| shape | The shape. |
| transform | A 4x4 matrix containing the transformation to apply. |
|
protectedinherited |
Get a matrix that contains the shape's concatenated transforms.
| shape | The shape whose transforms are being concatenated. |
|
protectedinherited |
Helper function to get the rank associated with the current process.
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexprinherited |
|
staticconstexprinherited |
|
staticconstexprinherited |
|
staticconstexprinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
Prefix path for shape file names with relative path.
|
protectedinherited |
Number of cells in computational mesh (m_dc or m_bpGrp).
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |