AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
axom::bump::ExtractZonesAndMatset< ExecSpace, TopologyView, CoordsetView, MatsetView > Class Template Reference

Make a new topology and coordset by extracting certain zones from the input mesh. More...

#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/develop/src/axom/bump/ExtractZones.hpp>

Inheritance diagram for axom::bump::ExtractZonesAndMatset< ExecSpace, TopologyView, CoordsetView, MatsetView >:

Public Types

using SelectedZonesView = axom::ArrayView< axom::IndexType >
 
using ZoneType = typename TopologyView::ShapeType
 

Public Member Functions

 ExtractZonesAndMatset (const TopologyView &topoView, const CoordsetView &coordsetView, const MatsetView &matsetView)
 Constructor. More...
 
virtual ~ExtractZonesAndMatset ()=default
 Destructor. More...
 
void execute (const SelectedZonesView &selectedZonesView, const conduit::Node &n_input, const conduit::Node &n_options, conduit::Node &n_output)
 Select zones from the input mesh by id and output them in the output mesh. More...
 
void setAllocatorID (int allocator_id)
 Set the allocator id to use when allocating memory. More...
 
int getAllocatorID () const
 Get the allocator id to use when allocating memory. More...
 

Protected Member Functions

std::string matsetName (const conduit::Node &n_input, const std::string &topoName) const
 Return the matset for the named topology. More...
 
void makeMatset (const SelectedZonesView selectedZonesView, const conduit::Node &n_matset, conduit::Node &n_newMatset) const
 Make a new matset that covers the selected zones. More...
 
axom::ArrayView< axom::IndexTypezoneSliceView (const SelectedZonesView &selectedZonesView, const Sizes &extra)
 Create a zone slice view, building m_zoneSlice if needed. More...
 
Sizes getExtra (const conduit::Node &n_options) const
 Return a Sizes object initialized from the options. More...
 
Sizes nodeMap (const SelectedZonesView &selectedZonesView, const Sizes &extra, axom::Array< ConnectivityType > &AXOM_UNUSED_PARAM(old2new), axom::Array< axom::IndexType > &nodeSlice) const
 Make node map and node slice information for the selected zones but do not limit the selection to only the used nodes. More...
 
Sizes compactNodeMap (const SelectedZonesView selectedZonesView, const Sizes &extra, axom::Array< ConnectivityType > &old2new, axom::Array< axom::IndexType > &nodeSlice) const
 Make node map and node slice information for the selected zones selecting only the used nodes. More...
 
virtual void makeTopology (const SelectedZonesView selectedZonesView, const Sizes &dataSizes, const Sizes &extra, const axom::ArrayView< ConnectivityType > &old2newView, const conduit::Node &n_topo, const conduit::Node &n_options, conduit::Node &n_newTopo) const
 Make the output topology for just the selected zones. More...
 
void makeCoordset (const SliceData &nodeSlice, const conduit::Node &n_coordset, conduit::Node &n_newCoordset) const
 Make the new coordset using the blend data and the input coordset/coordsetview. More...
 
void makeFields (const SliceData &nodeSlice, const SliceData &zoneSlice, const std::string &newTopoName, const conduit::Node &n_fields, conduit::Node &n_newFields) const
 Make fields for the output mesh, as needed. More...
 
std::string topologyName (const conduit::Node &n_input, const conduit::Node &n_options) const
 Get the topology name. More...
 
bool compact (const conduit::Node &n_options) const
 Return whether coordset/vertex compaction is desired. More...
 
std::string outputShape (const conduit::Node &n_topo) const
 Return the name of the output shape type. More...
 

Protected Attributes

MatsetView m_matsetView
 
TopologyView m_topologyView
 
CoordsetView m_coordsetView
 
axom::Array< axom::IndexTypem_zoneSlice
 
int m_allocator_id
 

Detailed Description

template<typename ExecSpace, typename TopologyView, typename CoordsetView, typename MatsetView>
class axom::bump::ExtractZonesAndMatset< ExecSpace, TopologyView, CoordsetView, MatsetView >

Make a new topology and coordset by extracting certain zones from the input mesh.

Template Parameters
ExecSpaceThe execution space where the algorithm will run.
TopologyViewThe topology view type on which the algorithm will run.
MatsetViewThe matset view type on which the algorithm will run.

Member Typedef Documentation

◆ SelectedZonesView

template<typename ExecSpace , typename TopologyView , typename CoordsetView , typename MatsetView >
using axom::bump::ExtractZonesAndMatset< ExecSpace, TopologyView, CoordsetView, MatsetView >::SelectedZonesView = axom::ArrayView<axom::IndexType>

◆ ZoneType

template<typename ExecSpace , typename TopologyView , typename CoordsetView >
using axom::bump::ExtractZones< ExecSpace, TopologyView, CoordsetView >::ZoneType = typename TopologyView::ShapeType
inherited

Constructor & Destructor Documentation

◆ ExtractZonesAndMatset()

template<typename ExecSpace , typename TopologyView , typename CoordsetView , typename MatsetView >
axom::bump::ExtractZonesAndMatset< ExecSpace, TopologyView, CoordsetView, MatsetView >::ExtractZonesAndMatset ( const TopologyView &  topoView,
const CoordsetView &  coordsetView,
const MatsetView &  matsetView 
)
inline

Constructor.

Parameters
topoViewThe input topology view.
coordsetViewThe input coordset view.
matsetViewThe input matset view.

◆ ~ExtractZonesAndMatset()

template<typename ExecSpace , typename TopologyView , typename CoordsetView , typename MatsetView >
virtual axom::bump::ExtractZonesAndMatset< ExecSpace, TopologyView, CoordsetView, MatsetView >::~ExtractZonesAndMatset ( )
virtualdefault

Destructor.

Member Function Documentation

◆ execute()

template<typename ExecSpace , typename TopologyView , typename CoordsetView , typename MatsetView >
void axom::bump::ExtractZonesAndMatset< ExecSpace, TopologyView, CoordsetView, MatsetView >::execute ( const SelectedZonesView selectedZonesView,
const conduit::Node &  n_input,
const conduit::Node &  n_options,
conduit::Node &  n_output 
)
inline

Select zones from the input mesh by id and output them in the output mesh.

Parameters
selectedZonesViewA view that contains the selected zone ids.
n_inputThe input mesh.
n_optionsThe input options.
[out]n_outputThe output mesh.
Note
The n_options node contains a "topology" string that is selects the name of the topology to extract.

References AXOM_ANNOTATE_SCOPE, axom::bump::ExtractZones< ExecSpace, TopologyView, CoordsetView >::execute(), axom::bump::ExtractZonesAndMatset< ExecSpace, TopologyView, CoordsetView, MatsetView >::makeMatset(), axom::bump::ExtractZonesAndMatset< ExecSpace, TopologyView, CoordsetView, MatsetView >::matsetName(), axom::bump::Options::matsetName(), axom::bump::ExtractZones< ExecSpace, TopologyView, CoordsetView >::topologyName(), and axom::bump::Options::topologyName().

◆ matsetName()

template<typename ExecSpace , typename TopologyView , typename CoordsetView , typename MatsetView >
std::string axom::bump::ExtractZonesAndMatset< ExecSpace, TopologyView, CoordsetView, MatsetView >::matsetName ( const conduit::Node &  n_input,
const std::string &  topoName 
) const
inlineprotected

Return the matset for the named topology.

Parameters
n_inputThe input mesh.
topoNameThe name of the topology.
Returns
The name of the matset for the topology or an empty string if no matset was found.

◆ makeMatset()

template<typename ExecSpace , typename TopologyView , typename CoordsetView , typename MatsetView >
void axom::bump::ExtractZonesAndMatset< ExecSpace, TopologyView, CoordsetView, MatsetView >::makeMatset ( const SelectedZonesView  selectedZonesView,
const conduit::Node &  n_matset,
conduit::Node &  n_newMatset 
) const
inlineprotected

◆ setAllocatorID()

template<typename ExecSpace , typename TopologyView , typename CoordsetView >
void axom::bump::ExtractZones< ExecSpace, TopologyView, CoordsetView >::setAllocatorID ( int  allocator_id)
inlineinherited

Set the allocator id to use when allocating memory.

Parameters
allocator_idThe allocator id to use when allocating memory.

References axom::isValidAllocatorID(), axom::bump::ExtractZones< ExecSpace, TopologyView, CoordsetView >::m_allocator_id, and SLIC_ERROR_IF.

◆ getAllocatorID()

template<typename ExecSpace , typename TopologyView , typename CoordsetView >
int axom::bump::ExtractZones< ExecSpace, TopologyView, CoordsetView >::getAllocatorID ( ) const
inlineinherited

Get the allocator id to use when allocating memory.

Returns
The allocator id to use when allocating memory.

References axom::bump::ExtractZones< ExecSpace, TopologyView, CoordsetView >::m_allocator_id.

◆ zoneSliceView()

template<typename ExecSpace , typename TopologyView , typename CoordsetView >
axom::ArrayView<axom::IndexType> axom::bump::ExtractZones< ExecSpace, TopologyView, CoordsetView >::zoneSliceView ( const SelectedZonesView selectedZonesView,
const Sizes extra 
)
inlineprotectedinherited

◆ getExtra()

template<typename ExecSpace , typename TopologyView , typename CoordsetView >
Sizes axom::bump::ExtractZones< ExecSpace, TopologyView, CoordsetView >::getExtra ( const conduit::Node &  n_options) const
inlineprotectedinherited

Return a Sizes object initialized from the options.

Parameters
n_optionsThe options node that contains extra sizes.
Returns
A Sizes object that contains extra sizes. Values not present in the options will be 0.

References axom::utilities::max(), and axom::bump::ExtractZones< ExecSpace, TopologyView, CoordsetView >::Sizes::nodes.

◆ nodeMap()

template<typename ExecSpace , typename TopologyView , typename CoordsetView >
Sizes axom::bump::ExtractZones< ExecSpace, TopologyView, CoordsetView >::nodeMap ( const SelectedZonesView selectedZonesView,
const Sizes extra,
axom::Array< ConnectivityType > &  AXOM_UNUSED_PARAMold2new,
axom::Array< axom::IndexType > &  nodeSlice 
) const
inlineprotectedinherited

Make node map and node slice information for the selected zones but do not limit the selection to only the used nodes.

Parameters
selectedZonesViewThe selected zones.
extraA Sizes object containing any extra sizes to use for allocation.
[out]old2newAn array that contains the new node id for each node in the mesh.
[out]nodeSliceAn array that contains the node ids that will be selected from the input mesh when making coordsets and vertex fields.
Returns
A Sizes object that contains the size of the nodes,zones,connectivity (excluding extra) for the output mesh.
Note
old2new is not used in this method.

References AXOM_ANNOTATE_SCOPE, AXOM_LAMBDA, axom::ArrayView< T, DIM, SPACE >::empty(), axom::serial::reductions::ReduceSum< ExecSpace, T >::get(), axom::bump::ExtractZones< ExecSpace, TopologyView, CoordsetView >::getAllocatorID(), axom::bump::ExtractZones< ExecSpace, TopologyView, CoordsetView >::m_coordsetView, axom::bump::ExtractZones< ExecSpace, TopologyView, CoordsetView >::m_topologyView, axom::bump::ExtractZones< ExecSpace, TopologyView, CoordsetView >::Sizes::nodes, axom::ArrayView< T, DIM, SPACE >::size(), SLIC_ERROR_IF, and axom::Array< T, DIM, SPACE, StoragePolicy >::view().

◆ compactNodeMap()

template<typename ExecSpace , typename TopologyView , typename CoordsetView >
Sizes axom::bump::ExtractZones< ExecSpace, TopologyView, CoordsetView >::compactNodeMap ( const SelectedZonesView  selectedZonesView,
const Sizes extra,
axom::Array< ConnectivityType > &  old2new,
axom::Array< axom::IndexType > &  nodeSlice 
) const
inlineprotectedinherited

Make node map and node slice information for the selected zones selecting only the used nodes.

Parameters
selectedZonesViewThe selected zones.
extraA Sizes object containing any extra sizes to use for allocation.
[out]old2newAn array that contains the new node id for each node in the mesh.
[out]nodeSliceAn array that contains the node ids that will be selected from the input mesh when making coordsets and vertex fields.
Returns
A Sizes object that contains the size of the nodes,zones,connectivity (excluding extra) for the output mesh.

References AXOM_ANNOTATE_SCOPE, AXOM_LAMBDA, axom::ArrayView< T, DIM, SPACE >::empty(), axom::Array< T, DIM, SPACE, StoragePolicy >::fill(), axom::serial::reductions::ReduceSum< ExecSpace, T >::get(), axom::bump::ExtractZones< ExecSpace, TopologyView, CoordsetView >::getAllocatorID(), axom::bump::ExtractZones< ExecSpace, TopologyView, CoordsetView >::m_coordsetView, axom::bump::ExtractZones< ExecSpace, TopologyView, CoordsetView >::m_topologyView, axom::bump::ExtractZones< ExecSpace, TopologyView, CoordsetView >::Sizes::nodes, axom::ArrayView< T, DIM, SPACE >::size(), SLIC_ERROR_IF, SLIC_INFO, and axom::Array< T, DIM, SPACE, StoragePolicy >::view().

◆ makeTopology()

template<typename ExecSpace , typename TopologyView , typename CoordsetView >
virtual void axom::bump::ExtractZones< ExecSpace, TopologyView, CoordsetView >::makeTopology ( const SelectedZonesView  selectedZonesView,
const Sizes dataSizes,
const Sizes extra,
const axom::ArrayView< ConnectivityType > &  old2newView,
const conduit::Node &  n_topo,
const conduit::Node &  n_options,
conduit::Node &  n_newTopo 
) const
inlineprotectedvirtualinherited

Make the output topology for just the selected zones.

Parameters
selectedZonesViewA view that contains the ids of the zones to extract.
dataSizesArray sizes for connectivity, sizes, etc.
extraExtra sizes for connectivity, sizes, etc.
old2newViewA view that lets us map old node numbers to new node numbers.
n_topoThe input topology.
n_optionsA node containing the options.
n_newTopoA node to contain the new topology.

References AXOM_ANNOTATE_SCOPE, AXOM_LAMBDA, axom::sidre::ConduitMemory::axomAllocIdToConduit(), axom::bump::ExtractZones< ExecSpace, TopologyView, CoordsetView >::compact(), axom::bump::ExtractZones< ExecSpace, TopologyView, CoordsetView >::Sizes::connectivity, axom::bump::ExtractZones< ExecSpace, TopologyView, CoordsetView >::getAllocatorID(), axom::bump::ExtractZones< ExecSpace, TopologyView, CoordsetView >::m_topologyView, axom::bump::ExtractZones< ExecSpace, TopologyView, CoordsetView >::outputShape(), axom::ArrayView< T, DIM, SPACE >::size(), SLIC_ERROR, and axom::bump::ExtractZones< ExecSpace, TopologyView, CoordsetView >::Sizes::zones.

◆ makeCoordset()

template<typename ExecSpace , typename TopologyView , typename CoordsetView >
void axom::bump::ExtractZones< ExecSpace, TopologyView, CoordsetView >::makeCoordset ( const SliceData nodeSlice,
const conduit::Node &  n_coordset,
conduit::Node &  n_newCoordset 
) const
inlineprotectedinherited

Make the new coordset using the blend data and the input coordset/coordsetview.

Parameters
nodeSliceNode slice information.
n_coordsetThe input coordset, which is passed for metadata.
[out]n_newCoordsetThe new coordset.

References AXOM_ANNOTATE_SCOPE, axom::bump::CoordsetSlicer< ExecSpace, CoordsetView >::execute(), axom::bump::ExtractZones< ExecSpace, TopologyView, CoordsetView >::getAllocatorID(), axom::bump::ExtractZones< ExecSpace, TopologyView, CoordsetView >::m_coordsetView, and axom::bump::CoordsetSlicer< ExecSpace, CoordsetView >::setAllocatorID().

◆ makeFields()

template<typename ExecSpace , typename TopologyView , typename CoordsetView >
void axom::bump::ExtractZones< ExecSpace, TopologyView, CoordsetView >::makeFields ( const SliceData nodeSlice,
const SliceData zoneSlice,
const std::string &  newTopoName,
const conduit::Node &  n_fields,
conduit::Node &  n_newFields 
) const
inlineprotectedinherited

Make fields for the output mesh, as needed.

Parameters
nodeSliceNode slice information.
zoneSliceZone slice information.
newTopoNameThe name of the new topology for the field.
n_fieldsThe input fields.
n_newFieldsThe output fields.

References AXOM_ANNOTATE_SCOPE, axom::bump::FieldSlicer< ExecSpace, IndexingPolicy >::execute(), axom::bump::ExtractZones< ExecSpace, TopologyView, CoordsetView >::getAllocatorID(), and axom::bump::FieldSlicer< ExecSpace, IndexingPolicy >::setAllocatorID().

◆ topologyName()

template<typename ExecSpace , typename TopologyView , typename CoordsetView >
std::string axom::bump::ExtractZones< ExecSpace, TopologyView, CoordsetView >::topologyName ( const conduit::Node &  n_input,
const conduit::Node &  n_options 
) const
inlineprotectedinherited

Get the topology name.

Parameters
n_inputThe input mesh.
n_optionsThe options node that may contain a "topology" string.
Returns
Returns the options topology name, if present. Otherwise, it returns the first topology name.

◆ compact()

template<typename ExecSpace , typename TopologyView , typename CoordsetView >
bool axom::bump::ExtractZones< ExecSpace, TopologyView, CoordsetView >::compact ( const conduit::Node &  n_options) const
inlineprotectedinherited

Return whether coordset/vertex compaction is desired.

Parameters
n_optionsThe options node that may contain a "topology" string.
Returns
True if compaction is on (the default), false otherwise.

◆ outputShape()

template<typename ExecSpace , typename TopologyView , typename CoordsetView >
std::string axom::bump::ExtractZones< ExecSpace, TopologyView, CoordsetView >::outputShape ( const conduit::Node &  n_topo) const
inlineprotectedinherited

Return the name of the output shape type.

Parameters
n_topoThe input topology node.
Returns
The name of the output shape.

Member Data Documentation

◆ m_matsetView

template<typename ExecSpace , typename TopologyView , typename CoordsetView , typename MatsetView >
MatsetView axom::bump::ExtractZonesAndMatset< ExecSpace, TopologyView, CoordsetView, MatsetView >::m_matsetView
protected

◆ m_topologyView

template<typename ExecSpace , typename TopologyView , typename CoordsetView >
TopologyView axom::bump::ExtractZones< ExecSpace, TopologyView, CoordsetView >::m_topologyView
protectedinherited

◆ m_coordsetView

template<typename ExecSpace , typename TopologyView , typename CoordsetView >
CoordsetView axom::bump::ExtractZones< ExecSpace, TopologyView, CoordsetView >::m_coordsetView
protectedinherited

◆ m_zoneSlice

template<typename ExecSpace , typename TopologyView , typename CoordsetView >
axom::Array<axom::IndexType> axom::bump::ExtractZones< ExecSpace, TopologyView, CoordsetView >::m_zoneSlice
protectedinherited

◆ m_allocator_id

template<typename ExecSpace , typename TopologyView , typename CoordsetView >
int axom::bump::ExtractZones< ExecSpace, TopologyView, CoordsetView >::m_allocator_id
protectedinherited

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