AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
axom::bump::ExtractZones< ExecSpace, TopologyView, CoordsetView > 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::ExtractZones< ExecSpace, TopologyView, CoordsetView >:

Classes

struct  Sizes
 This struct contains extra amounts of storage that we might want to overallocate. More...
 

Public Types

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

Public Member Functions

 ExtractZones (const TopologyView &topoView, const CoordsetView &coordsetView)
 Constructor. More...
 
virtual ~ExtractZones ()=default
 Destructor. 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...
 
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...
 

Protected Member Functions

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

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

Detailed Description

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

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.

Member Typedef Documentation

◆ SelectedZonesView

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

◆ ZoneType

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

Constructor & Destructor Documentation

◆ ExtractZones()

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

Constructor.

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

◆ ~ExtractZones()

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

Destructor.

Member Function Documentation

◆ setAllocatorID()

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

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
inline

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.

◆ execute()

template<typename ExecSpace , typename TopologyView , typename CoordsetView >
void axom::bump::ExtractZones< ExecSpace, TopologyView, CoordsetView >::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.

The n_options node controls how the algorithm works.

topology: mesh
compact: 1
extra:
nodes: 0
zones: 0
connectivity: 0

The "topology" node contains a string that selects the name of the topology to extract. The "compact" node causes the algorithm to restrict the output coordset and vertex fields to only the nodes used by the selected zones. If "compact" is set to 0 then the original coordset and vertex fields will retain their size in the output mesh. The "extra" node is optional and it contains 3 integer values for extra allocation to be made for nodes, zones, and connectivity. This extra space can be filled in later by the application.

References AXOM_ANNOTATE_SCOPE, axom::sidre::ConduitMemory::axomAllocIdToConduit(), axom::bump::ExtractZones< ExecSpace, TopologyView, CoordsetView >::compact(), axom::bump::ExtractZones< ExecSpace, TopologyView, CoordsetView >::compactNodeMap(), axom::bump::Options::coordsetName(), axom::copy(), axom::ArrayView< T, DIM, SPACE >::data(), axom::bump::ExtractZones< ExecSpace, TopologyView, CoordsetView >::getAllocatorID(), axom::bump::ExtractZones< ExecSpace, TopologyView, CoordsetView >::getExtra(), axom::bump::SliceData::m_indicesView, axom::bump::ExtractZones< ExecSpace, TopologyView, CoordsetView >::makeCoordset(), axom::bump::ExtractZones< ExecSpace, TopologyView, CoordsetView >::makeFields(), axom::bump::ExtractZones< ExecSpace, TopologyView, CoordsetView >::makeTopology(), axom::bump::ExtractZones< ExecSpace, TopologyView, CoordsetView >::nodeMap(), axom::bump::Options::originalElementsField(), axom::ArrayView< T, DIM, SPACE >::size(), axom::bump::ExtractZones< ExecSpace, TopologyView, CoordsetView >::topologyName(), axom::bump::Options::topologyName(), axom::Array< T, DIM, SPACE, StoragePolicy >::view(), and axom::bump::ExtractZones< ExecSpace, TopologyView, CoordsetView >::zoneSliceView().

◆ 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 
)
inlineprotected

◆ getExtra()

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

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
inlineprotected

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
inlineprotected

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
inlineprotectedvirtual

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
inlineprotected

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
inlineprotected

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
inlineprotected

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
inlineprotected

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
inlineprotected

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_topologyView

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

◆ m_coordsetView

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

◆ m_zoneSlice

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

◆ m_allocator_id

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

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