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

A multimaterial data management class that provides storage in various layouts (dense/sparse, and material-dominant/cell-dominant). More...

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

Public Types

using BivariateSetType = slam::BivariateSet< RangeSetType, RangeSetType >
 
using ProductSetType = slam::ProductSet< RangeSetType, RangeSetType >
 
using SparseRelationType = StaticVariableRelationType
 
using RelationSetType = slam::RelationSet< StaticVariableRelationType >
 
using RelationSetDynType = slam::RelationSet< DynamicVariableRelationType >
 
template<typename T >
using Field1D = MapType< T >
 
template<typename T , typename BSet = BivariateSetType>
using Field2D = MMField2D< T, BSet >
 
template<typename T >
using SparseField2D = MMField2D< T, typename RelationSetType::ConcreteSet >
 
template<typename T >
using DenseField2D = MMField2D< T, typename ProductSetType::ConcreteSet >
 
template<typename T , DataLayout D, typename B >
using Field2DTemplated = MMField2DTemplated< T, D, B >
 
template<typename Field2DType >
using SubField = MMSubField2D< Field2DType >
 
using IndexSet = RangeSetType
 
using IdSet = typename BivariateSetType::SubsetType
 

Public Member Functions

 MultiMat (DataLayout data_layout=DataLayout::CELL_DOM, SparsityLayout sparsity_layout=SparsityLayout::SPARSE)
 Constructor to create a new MultiMat object. More...
 
 MultiMat (const MultiMat &other)
 Copy constructor for a MultiMat object. More...
 
MultiMatoperator= (const MultiMat &other)
 Copy assignment operator for a MultiMat object. More...
 
 MultiMat (MultiMat &&)=default
 Move constructor for MultiMat, defaulted. More...
 
MultiMatoperator= (MultiMat &&)=default
 Move assignment operator for MultiMat, defaulted. More...
 
 ~MultiMat ()=default
 Destructor for MultiMat, defaulted. More...
 
void setNumberOfMaterials (int num_mats)
 Set the number of materials. More...
 
void setNumberOfCells (int num_cells)
 Set the number of cells. More...
 
void setAllocatorID (int alloc_id)
 Sets the allocator ID to use for allocations. Has the same effect as calling setSlamAllocatorID() and setFieldAllocatorID() with the same allocator ID. More...
 
void setSlamAllocatorID (int alloc_id)
 Sets the allocator ID to use for Slam object allocations. This should point to either a host Umpire pool if only being used on the host, or a unified memory pool if also being used on the GPU. More...
 
void setFieldAllocatorID (int alloc_id)
 Sets the allocator ID to use for field allocations. More...
 
const ProductSetTypegetDense2dFieldSet (DataLayout layout) const
 Returns a pointer to the dense 2d field set. More...
 
const RelationSetTypegetSparse2dFieldSet (DataLayout layout) const
 Returns a pointer to the sparse 2d field set. More...
 
void setCellMatRel (const std::vector< bool > &relation_info, DataLayout layout)
 Set the cell-material relation. More...
 
void setCellMatRel (axom::ArrayView< const SetPosType > cardinality, axom::ArrayView< const SetPosType > indices, DataLayout layout)
 Set the cell-material relation. More...
 
int getNumberOfFields () const
 
template<typename T >
int addField (const std::string &field_name, FieldMapping field_mapping, DataLayout data_layout, SparsityLayout sparsity_layout, axom::ArrayView< T > data_array, int ncomp=1)
 Add a field to the MultiMat object. More...
 
template<typename T >
int addExternalField (const std::string &field_name, FieldMapping field_mapping, DataLayout data_layout, SparsityLayout sparsity_layout, axom::ArrayView< T > data_array, int ncomp=1)
 Add an externally-managed field to the MultiMat object. More...
 
void removeField (const std::string &name)
 Delete a field from the MultiMat object. More...
 
template<typename T >
int setVolfracField (axom::ArrayView< T > data_array, DataLayout layout, SparsityLayout sparsity)
 Set the volume fraction field \detail volume fraction field is assumed to be a double. Its field index is always 0, and the name of the field is "Volfrac". More...
 
int setVolfracField (axom::ArrayView< const double > data_array, DataLayout layout, SparsityLayout sparsity)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
int getFieldIdx (const std::string &field_name) const
 Search for and return the field index of the field given its name. More...
 
std::string getFieldName (int field_idx) const
 Return the name of the field given its index. More...
 
template<typename T >
Field1D< T > get1dField (const std::string &field_name)
 Search for and return the field given the field name. \detail the field is of type Field1D, containing an entry for each cell or material. To retrieve a field of type Field2D, use get2dField(). More...
 
template<typename T >
Field1D< const T > get1dField (const std::string &field_name) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
template<typename T >
Field2D< T > get2dField (const std::string &field_name)
 Search for and return the field given the field name. \detail the field is of type Field2D, containing an entry for each cell and each material. To retrieve a field of type Field1D, use get1dField(). More...
 
template<typename T >
Field2D< const T > get2dField (const std::string &field_name) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
template<typename T , typename BSetType >
Field2D< T, BSetType > get2dField (const std::string &field_name)
 
template<typename T >
DenseField2D< T > getDense2dField (const std::string &field_name)
 
template<typename T >
SparseField2D< T > getSparse2dField (const std::string &field_name)
 
template<typename T , DataLayout D, typename B >
Field2DTemplated< T, D, B > getTemplated2DField (const std::string &field_name)
 
template<typename T , typename BSetType >
slam::BivariateMap< T, BSetType, IndViewPolicy< T > > get2dFieldAsSlamBivarMap (const std::string &field_name)
 
Field2D< double > getVolfracField ()
 Get the volume fraction field. More...
 
Field2D< const double > getVolfracField () const
 
IdSet getSubfieldIndex (int idx)
 Get a set of index for a Subfield. \detail for a cell-dominant layout, this is equivalent to getting the set of materials presented in a cell. Vice versa, for a material-dominant layout, this returns a set of cells containing a material.
getMatInCell() and getCellContainingMat() are layout specific calls for this function. More...
 
IdSet getMatInCell (int cell_id)
 
IdSet getCellContainingMat (int mat_id)
 
IndexSet getSubfieldIndexingSet (int idx, DataLayout layout, SparsityLayout sparsity) const
 Get a set to index a Subfield in a Field2D. \detail This returns a set of indices that can be used to directly access a subfield in a Field2D without having to retrieve a Subfield first.
Accessing the Field2D using this indexing set should be done with the bracket operator. More...
 
IndexSet getIndexingSetOfCell (int cell_id, SparsityLayout sparsity) const
 
IndexSet getIndexingSetOfMat (int mat_id, SparsityLayout sparsity) const
 
int getNumberOfMaterials () const
 
int getNumberOfCells () const
 
void convertFieldLayout (int field_idx, SparsityLayout, DataLayout)
 
void convertFieldToSparse (int field_idx)
 Converts a field with a given index to a sparse layout. No-op if the field is already in sparse layout, or if the field is not a 2D cell-material field. More...
 
void convertFieldToDense (int field_idx)
 Converts a field with a given index to a dense layout. No-op if the field is already in dense layout, or if the field is not a 2D cell-material field. More...
 
SparsityLayout getFieldSparsityLayout (int field_idx) const
 
void transposeField (int field_idx)
 
void convertFieldToMatDom (int field_idx)
 
void convertFieldToCellDom (int field_idx)
 
DataLayout getFieldDataLayout (int field_idx) const
 
std::string getFieldDataLayoutAsString (int field_idx) const
 
std::string getFieldSparsityLayoutAsString (int field_idx) const
 
void convertLayout (DataLayout, SparsityLayout)
 
void convertLayoutToSparse ()
 
void convertLayoutToDense ()
 
void convertLayoutToCellDominant ()
 
void convertLayoutToMaterialDominant ()
 
FieldMapping getFieldMapping (int field_idx) const
 Get the FieldMapping for a field. More...
 
void convertToDynamic ()
 
void convertToStatic ()
 
bool addEntry (int firstIdx, int secondIdx)
 Add a material to a cell. More...
 
bool removeEntry (int firstIdx, int secondIdx)
 Remove a material from a cell. More...
 
void print () const
 
bool isValid (bool verboseOutput=false) const
 Return true if the object is valid, false otherwise. More...
 

Protected Types

using SetPosType = slam::DefaultPositionType
 
using SetElemType = slam::DefaultPositionType
 
using SetType = slam::Set< SetPosType, SetElemType >
 
using RangeSetType = slam::RangeSet< SetPosType, SetElemType >::ConcreteSet
 

Protected Member Functions

const RangeSetTypegetMappedRangeSet (FieldMapping mapping) const
 
const BivariateSetTypeget_mapped_biSet (DataLayout, SparsityLayout) const
 
const BivariateSetTypeget_mapped_biSet (int field_idx) const
 
StaticVariableRelationTypegetRel (int field_idx)
 

Friends

template<typename T , typename S >
class MMField2D
 
template<typename Field2D >
class MMSubField2D
 
template<typename T , DataLayout D, typename S >
class MMField2DTemplated
 

Detailed Description

A multimaterial data management class that provides storage in various layouts (dense/sparse, and material-dominant/cell-dominant).

Member Typedef Documentation

◆ SetPosType

◆ SetElemType

◆ SetType

◆ RangeSetType

◆ BivariateSetType

◆ ProductSetType

◆ SparseRelationType

◆ RelationSetType

◆ RelationSetDynType

◆ Field1D

template<typename T >
using axom::multimat::MultiMat::Field1D = MapType<T>

◆ Field2D

template<typename T , typename BSet = BivariateSetType>
using axom::multimat::MultiMat::Field2D = MMField2D<T, BSet>

◆ SparseField2D

◆ DenseField2D

◆ Field2DTemplated

template<typename T , DataLayout D, typename B >
using axom::multimat::MultiMat::Field2DTemplated = MMField2DTemplated<T, D, B>

◆ SubField

template<typename Field2DType >
using axom::multimat::MultiMat::SubField = MMSubField2D<Field2DType>

◆ IndexSet

◆ IdSet

Constructor & Destructor Documentation

◆ MultiMat() [1/3]

axom::multimat::MultiMat::MultiMat ( DataLayout  data_layout = DataLayout::CELL_DOM,
SparsityLayout  sparsity_layout = SparsityLayout::SPARSE 
)

Constructor to create a new MultiMat object.

Parameters
data_layoutSelect material-dominant or cell-dominant layout to store the data in. Default is cell-dominant.
sparsity_layoutSelect dense or sparse layout to store the data in. Default is sparse.

◆ MultiMat() [2/3]

axom::multimat::MultiMat::MultiMat ( const MultiMat other)

Copy constructor for a MultiMat object.

Parameters
otherThe MultiMat object to copy from.

◆ MultiMat() [3/3]

axom::multimat::MultiMat::MultiMat ( MultiMat &&  )
default

Move constructor for MultiMat, defaulted.

◆ ~MultiMat()

axom::multimat::MultiMat::~MultiMat ( )
default

Destructor for MultiMat, defaulted.

Member Function Documentation

◆ operator=() [1/2]

MultiMat& axom::multimat::MultiMat::operator= ( const MultiMat other)
inline

Copy assignment operator for a MultiMat object.

Parameters
otherThe MultiMat object to copy from.

◆ operator=() [2/2]

MultiMat& axom::multimat::MultiMat::operator= ( MultiMat &&  )
default

Move assignment operator for MultiMat, defaulted.

◆ setNumberOfMaterials()

void axom::multimat::MultiMat::setNumberOfMaterials ( int  num_mats)

Set the number of materials.

Precondition
num_mats > 0

◆ setNumberOfCells()

void axom::multimat::MultiMat::setNumberOfCells ( int  num_cells)

Set the number of cells.

Precondition
num_cells > 0

◆ setAllocatorID()

void axom::multimat::MultiMat::setAllocatorID ( int  alloc_id)

Sets the allocator ID to use for allocations. Has the same effect as calling setSlamAllocatorID() and setFieldAllocatorID() with the same allocator ID.

Parameters
Theallocator ID to use

◆ setSlamAllocatorID()

void axom::multimat::MultiMat::setSlamAllocatorID ( int  alloc_id)

Sets the allocator ID to use for Slam object allocations. This should point to either a host Umpire pool if only being used on the host, or a unified memory pool if also being used on the GPU.

Parameters
alloc_idthe Umpire allocator ID to use

◆ setFieldAllocatorID()

void axom::multimat::MultiMat::setFieldAllocatorID ( int  alloc_id)

Sets the allocator ID to use for field allocations.

Parameters
alloc_idthe Umpire allocator ID to use

◆ getDense2dFieldSet()

const ProductSetType* axom::multimat::MultiMat::getDense2dFieldSet ( DataLayout  layout) const
inline

Returns a pointer to the dense 2d field set.

◆ getSparse2dFieldSet()

const RelationSetType* axom::multimat::MultiMat::getSparse2dFieldSet ( DataLayout  layout) const
inline

Returns a pointer to the sparse 2d field set.

◆ setCellMatRel() [1/2]

void axom::multimat::MultiMat::setCellMatRel ( const std::vector< bool > &  relation_info,
DataLayout  layout 
)

Set the cell-material relation.

\detail This function takes the input of boolean vectors and set-up internal data structure. The relation_info vector is indexed by the cell and material index:
idx = mat * num_cell + cell
or idx = cell * num_mats + mat
for material-centric and cell-centric layout, respectively.
Entry at idx should containing 'true' where materials are presented in the cell.
The number of materials and cell must be set prior to calling this function with setNumberOfMaterials(int) and setNumberOfCells(int)

Parameters
Aboolean vector of size num_mats * num_cells containing information on if a materials is present in a cell.

◆ setCellMatRel() [2/2]

void axom::multimat::MultiMat::setCellMatRel ( axom::ArrayView< const SetPosType cardinality,
axom::ArrayView< const SetPosType indices,
DataLayout  layout 
)

Set the cell-material relation.

\detail This function accepts a compressed sparse row representation of a relation.

Parameters
cardinalityThe number of secondary elements associated with each dominant element, i.e.:
  • cell-dominant: the number of materials associated with each cell
  • material-dominant: the number of cells containing each material
indicesA compressed sparse row array of indices representing the associated secondary-set elements, i.e.:
  • cell-dominant: the index of each material in a cell
  • material-dominant: the index of each cell containing the material
layoutThe layout of the relation (cell- or material-dominant)
Precondition
The number of materials and cell must be set prior to calling this function with setNumberOfMaterials(int) and setNumberOfCells(int)
If m_slamAllocatorID points to device-accessible memory, cardinality and indices must be device accessible.

◆ getNumberOfFields()

int axom::multimat::MultiMat::getNumberOfFields ( ) const
inline

◆ addField()

template<class T >
int axom::multimat::MultiMat::addField ( const std::string &  field_name,
FieldMapping  field_mapping,
DataLayout  data_layout,
SparsityLayout  sparsity_layout,
axom::ArrayView< T >  data_array,
int  ncomp = 1 
)

Add a field to the MultiMat object.

If a field has the special name 'VolFrac', calling addField will have the same behavior as calling setVolfracField. If a field already exists, the call to addExternalField is a no-op, and the index of the already-existing field will be returned.

Template Parameters
TThe data type (double, float...) of the field
Parameters
field_nameThe name of the field, used to retrieve the field later
field_mapping
data_layout
sparsity_layout
data_arrayThe array containing data to the field. The length of the array should be num_mats * num_cells * ncomp if the current format is Dense, or num_nonzero * ncomp if the current format is Sprase.
(optional)ncomp The number of component of the field. Default is 1
Returns
int the index of the field, can be used to retrieve the field later

References getFieldIdx(), axom::multimat::PER_CELL_MAT, setVolfracField(), SLIC_ASSERT, and SLIC_WARNING.

◆ addExternalField()

template<class T >
int axom::multimat::MultiMat::addExternalField ( const std::string &  field_name,
FieldMapping  field_mapping,
DataLayout  data_layout,
SparsityLayout  sparsity_layout,
axom::ArrayView< T >  data_array,
int  ncomp = 1 
)

Add an externally-managed field to the MultiMat object.

If a field has the special name 'VolFrac', calling addField will have the same behavior as calling setVolfracField. A volume fraction field will always be internally-managed. If a field already exists, the call to addExternalField is a no-op, and the index of the already-existing field will be returned.

Template Parameters
TThe data type (double, float...) of the field
Parameters
field_nameThe name of the field, used to retrieve the field later
field_mapping
data_layout
sparsity_layout
data_arrayThe array containing data to the field. The length of the array should be num_mats * num_cells * ncomp if the current format is Dense, or num_nonzero * ncomp if the current format is Sprase.
(optional)ncomp The number of component of the field. Default is 1
Returns
int the index of the field, can be used to retrieve the field later

References getFieldIdx(), axom::multimat::PER_CELL_MAT, setVolfracField(), SLIC_ASSERT, and SLIC_WARNING.

◆ removeField()

void axom::multimat::MultiMat::removeField ( const std::string &  name)

Delete a field from the MultiMat object.

Parameters
nameThe name of the field to remove.

◆ setVolfracField() [1/2]

template<typename T >
int axom::multimat::MultiMat::setVolfracField ( axom::ArrayView< T >  data_array,
DataLayout  layout,
SparsityLayout  sparsity 
)

Set the volume fraction field \detail volume fraction field is assumed to be a double. Its field index is always 0, and the name of the field is "Volfrac".

Parameters
data_arraythe array containing the volume fraction information
Returns
int the volume fraction field index, which is always zero.

References axom::ArrayView< T, DIM, SPACE >::size().

◆ setVolfracField() [2/2]

int axom::multimat::MultiMat::setVolfracField ( axom::ArrayView< const double >  data_array,
DataLayout  layout,
SparsityLayout  sparsity 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ getFieldIdx()

int axom::multimat::MultiMat::getFieldIdx ( const std::string &  field_name) const

Search for and return the field index of the field given its name.

Parameters
field_namethe name of the field
Returns
if found, the index of the field; otherwise, -1

◆ getFieldName()

std::string axom::multimat::MultiMat::getFieldName ( int  field_idx) const

Return the name of the field given its index.

Parameters
field_idxthe index of the field
Returns
if found, the name of the field; otherwise, the empty string

◆ get1dField() [1/2]

template<typename T >
MultiMat::Field1D< T > axom::multimat::MultiMat::get1dField ( const std::string &  field_name)

Search for and return the field given the field name. \detail the field is of type Field1D, containing an entry for each cell or material. To retrieve a field of type Field2D, use get2dField().

Template Parameters
TThe data type of the field
Parameters
field_namethe name of the field
Returns
Field1D<T>& the field reference

References getFieldIdx(), and SLIC_ERROR.

◆ get1dField() [2/2]

template<typename T >
MultiMat::Field1D< const T > axom::multimat::MultiMat::get1dField ( const std::string &  field_name) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

References getFieldIdx(), and SLIC_ERROR.

◆ get2dField() [1/3]

template<typename T >
MultiMat::Field2D< T > axom::multimat::MultiMat::get2dField ( const std::string &  field_name)

Search for and return the field given the field name. \detail the field is of type Field2D, containing an entry for each cell and each material. To retrieve a field of type Field1D, use get1dField().

Template Parameters
TThe data type of the field
Parameters
field_namethe name of the field
Returns
Field1D<T>& the field reference

References getFieldIdx(), and SLIC_ERROR.

◆ get2dField() [2/3]

template<typename T >
MultiMat::Field2D< const T > axom::multimat::MultiMat::get2dField ( const std::string &  field_name) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

References getFieldIdx().

◆ get2dField() [3/3]

template<typename T , typename BSetType >
MultiMat::Field2D< T, BSetType > axom::multimat::MultiMat::get2dField ( const std::string &  field_name)

References getFieldIdx().

◆ getDense2dField()

template<typename T >
MultiMat::DenseField2D< T > axom::multimat::MultiMat::getDense2dField ( const std::string &  field_name)

References getFieldIdx(), and SLIC_CHECK_MSG.

◆ getSparse2dField()

template<typename T >
MultiMat::SparseField2D< T > axom::multimat::MultiMat::getSparse2dField ( const std::string &  field_name)

References getFieldIdx(), and SLIC_CHECK_MSG.

◆ getTemplated2DField()

template<typename T , DataLayout D, typename B >
MultiMat::Field2DTemplated< T, D, B > axom::multimat::MultiMat::getTemplated2DField ( const std::string &  field_name)

References getFieldIdx().

◆ get2dFieldAsSlamBivarMap()

template<typename T , typename BSetType >
slam::BivariateMap< T, BSetType, MultiMat::IndViewPolicy< T > > axom::multimat::MultiMat::get2dFieldAsSlamBivarMap ( const std::string &  field_name)

References getFieldIdx().

◆ getVolfracField() [1/2]

Field2D<double> axom::multimat::MultiMat::getVolfracField ( )

Get the volume fraction field.

◆ getVolfracField() [2/2]

Field2D<const double> axom::multimat::MultiMat::getVolfracField ( ) const

◆ getSubfieldIndex()

IdSet axom::multimat::MultiMat::getSubfieldIndex ( int  idx)

Get a set of index for a Subfield. \detail for a cell-dominant layout, this is equivalent to getting the set of materials presented in a cell. Vice versa, for a material-dominant layout, this returns a set of cells containing a material.
getMatInCell() and getCellContainingMat() are layout specific calls for this function.

Parameters
idxthe index of the subfield
Returns
IdSet A set of index in the subfield

◆ getMatInCell()

IdSet axom::multimat::MultiMat::getMatInCell ( int  cell_id)

Cell-dominant version of getSubfieldIndex()

◆ getCellContainingMat()

IdSet axom::multimat::MultiMat::getCellContainingMat ( int  mat_id)

Material-dominant version of getSubfieldIndex()

◆ getSubfieldIndexingSet()

IndexSet axom::multimat::MultiMat::getSubfieldIndexingSet ( int  idx,
DataLayout  layout,
SparsityLayout  sparsity 
) const

Get a set to index a Subfield in a Field2D. \detail This returns a set of indices that can be used to directly access a subfield in a Field2D without having to retrieve a Subfield first.
Accessing the Field2D using this indexing set should be done with the bracket operator.

For example:

IndexSet indexing_set = getSubfieldIndexingSet( idx );
for( int i : indexing_set );
value = field2d[ i ];
IndexSet getSubfieldIndexingSet(int idx, DataLayout layout, SparsityLayout sparsity) const
Get a set to index a Subfield in a Field2D. \detail This returns a set of indices that can be used to...
RangeSetType IndexSet
Definition: multimat.hpp:145

Or to account for multiple components:

IndexSet indexing_set = getSubfieldIndexingSet( idx );
for( int i : indexing_set );
for( int c = 0; c < numComp; c++)
value = field2d[ i * numComp + c ];

getIndexingSetOfCell() and getIndexingSetOfMat() are layout specific calls for this function.

Parameters
idxThe index of the subfield
Returns
IndexSet A Set of index for the subfield

◆ getIndexingSetOfCell()

IndexSet axom::multimat::MultiMat::getIndexingSetOfCell ( int  cell_id,
SparsityLayout  sparsity 
) const

Cell-dominant version of getSubfieldIndexingSet()

◆ getIndexingSetOfMat()

IndexSet axom::multimat::MultiMat::getIndexingSetOfMat ( int  mat_id,
SparsityLayout  sparsity 
) const

Material-dominant version of getSubfieldIndexingSet()

◆ getNumberOfMaterials()

int axom::multimat::MultiMat::getNumberOfMaterials ( ) const
inline

Return the number of material this object holds

◆ getNumberOfCells()

int axom::multimat::MultiMat::getNumberOfCells ( ) const
inline

Return the number of cells this object holds

◆ convertFieldLayout()

void axom::multimat::MultiMat::convertFieldLayout ( int  field_idx,
SparsityLayout  ,
DataLayout   
)

◆ convertFieldToSparse()

void axom::multimat::MultiMat::convertFieldToSparse ( int  field_idx)

Converts a field with a given index to a sparse layout. No-op if the field is already in sparse layout, or if the field is not a 2D cell-material field.

Parameters
field_idxthe index of the field to convert
Postcondition
getFieldSparsityLayout(field_idx) == SparsityLayout::SPARSE

◆ convertFieldToDense()

void axom::multimat::MultiMat::convertFieldToDense ( int  field_idx)

Converts a field with a given index to a dense layout. No-op if the field is already in dense layout, or if the field is not a 2D cell-material field.

Parameters
field_idxthe index of the field to convert
Postcondition
getFieldSparsityLayout(field_idx) == SparsityLayout::DENSE

◆ getFieldSparsityLayout()

SparsityLayout axom::multimat::MultiMat::getFieldSparsityLayout ( int  field_idx) const

◆ transposeField()

void axom::multimat::MultiMat::transposeField ( int  field_idx)

◆ convertFieldToMatDom()

void axom::multimat::MultiMat::convertFieldToMatDom ( int  field_idx)

◆ convertFieldToCellDom()

void axom::multimat::MultiMat::convertFieldToCellDom ( int  field_idx)

◆ getFieldDataLayout()

DataLayout axom::multimat::MultiMat::getFieldDataLayout ( int  field_idx) const

◆ getFieldDataLayoutAsString()

std::string axom::multimat::MultiMat::getFieldDataLayoutAsString ( int  field_idx) const

◆ getFieldSparsityLayoutAsString()

std::string axom::multimat::MultiMat::getFieldSparsityLayoutAsString ( int  field_idx) const

◆ convertLayout()

void axom::multimat::MultiMat::convertLayout ( DataLayout  ,
SparsityLayout   
)

Convert the data to be stored in the specified layout.

◆ convertLayoutToSparse()

void axom::multimat::MultiMat::convertLayoutToSparse ( )

Convert the data to be stored in sparse/compact layout

◆ convertLayoutToDense()

void axom::multimat::MultiMat::convertLayoutToDense ( )

Convert the data to be stored in dense layout

◆ convertLayoutToCellDominant()

void axom::multimat::MultiMat::convertLayoutToCellDominant ( )

Convert the data to be stored in cell-dominant layout.

◆ convertLayoutToMaterialDominant()

void axom::multimat::MultiMat::convertLayoutToMaterialDominant ( )

Convert the data to be stored in material-dominant layout.

◆ getFieldMapping()

FieldMapping axom::multimat::MultiMat::getFieldMapping ( int  field_idx) const
inline

Get the FieldMapping for a field.

A FieldMapping of a field describes if there is an entry for each cell, for each material, or for each cell x material.

Parameters
field_idxthe index of the field

◆ convertToDynamic()

void axom::multimat::MultiMat::convertToDynamic ( )

Convert the layout to use dynamic layout. In dynamic layout, users can call addEntry() or removeEntry() to change the materials in a cell.

◆ convertToStatic()

void axom::multimat::MultiMat::convertToStatic ( )

Convert the layout to use static layout.

◆ addEntry()

bool axom::multimat::MultiMat::addEntry ( int  firstIdx,
int  secondIdx 
)

Add a material to a cell.

In a cell-dominant layout, firstIdx is the cell index, secondIdx is the material index. Conversely, for a material-dominant layout, firstIdx is the material index and secondIdx is the cell index.

Returns
true if the material is added to the cell, false if it already exists.

◆ removeEntry()

bool axom::multimat::MultiMat::removeEntry ( int  firstIdx,
int  secondIdx 
)

Remove a material from a cell.

In a cell-dominant layout, firstIdx is the cell index, secondIdx is the material index. Conversely, for a material-dominant layout, firstIdx is the material index and secondIdx is the cell index.

Returns
true if a material is removed. False if it was not in the cell.

◆ print()

void axom::multimat::MultiMat::print ( ) const

Print the detail of this object

◆ isValid()

bool axom::multimat::MultiMat::isValid ( bool  verboseOutput = false) const

Return true if the object is valid, false otherwise.

Parameters
verboseOutput(Optional) if true, this function will print out its valid/invalid detail.

◆ getMappedRangeSet()

const RangeSetType* axom::multimat::MultiMat::getMappedRangeSet ( FieldMapping  mapping) const
inlineprotected

◆ get_mapped_biSet() [1/2]

const BivariateSetType* axom::multimat::MultiMat::get_mapped_biSet ( DataLayout  ,
SparsityLayout   
) const
protected

◆ get_mapped_biSet() [2/2]

const BivariateSetType* axom::multimat::MultiMat::get_mapped_biSet ( int  field_idx) const
protected

◆ getRel()

StaticVariableRelationType* axom::multimat::MultiMat::getRel ( int  field_idx)
protected

Friends And Related Function Documentation

◆ MMField2D

template<typename T , typename S >
friend class MMField2D
friend

◆ MMSubField2D

template<typename Field2D >
friend class MMSubField2D
friend

◆ MMField2DTemplated

template<typename T , DataLayout D, typename S >
friend class MMField2DTemplated
friend

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