www.mooseframework.org
Classes | Public Member Functions | Static Public Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
MaterialData Class Reference

Proxy for accessing MaterialPropertyStorage. More...

#include <MaterialData.h>

Classes

class  XFEMKey
 Key that provides access to only the XFEM class. More...
 

Public Member Functions

 MaterialData (MaterialPropertyStorage &storage, const THREAD_ID tid)
 
void resize (unsigned int n_qpoints)
 Resize the data to hold properties for n_qpoints quadrature points. More...
 
unsigned int nQPoints () const
 Returns the number of quadrature points the material properties support/hold. More...
 
void copy (const Elem &elem_to, const Elem &elem_from, unsigned int side)
 copy material properties from one element to another More...
 
void swap (const Elem &elem, unsigned int side=0)
 material properties for given element (and possible side) More...
 
template<typename MatContainer >
void reinit (const MatContainer &mats)
 Reinit material properties for given element (and possible side) More...
 
void reset (const std::vector< std::shared_ptr< MaterialBase >> &mats)
 Calls the reset method of Materials to ensure that they are in a proper state. More...
 
void swapBack (const Elem &elem, unsigned int side=0)
 material properties for given element (and possible side) More...
 
const MaterialPropertiesprops (const unsigned int state=0) const
 
MaterialPropertiesprops (const unsigned int state=0)
 
template<typename T , bool is_ad>
bool haveGenericProperty (const std::string &prop_name) const
 
template<typename T >
bool haveProperty (const std::string &prop_name) const
 Returns true if the regular material property exists - defined by any material. More...
 
template<typename T >
bool haveADProperty (const std::string &prop_name) const
 Returns true if the AD material property exists - defined by any material. More...
 
template<typename T , bool is_ad = false>
GenericMaterialProperty< T, is_ad > & getProperty (const std::string &prop_name, const unsigned int state, const MooseObject &requestor)
 Retrieves a material property. More...
 
template<typename T , bool is_ad>
GenericMaterialProperty< T, is_ad > & declareProperty (const std::string &prop_name, const MooseObject &requestor)
 Declares a material property. More...
 
bool isSwapped () const
 Returns true if the stateful material is in a swapped state. More...
 
const MaterialPropertyStoragegetMaterialPropertyStorage () const
 Provide read-only access to the underlying MaterialPropertyStorage object. More...
 
MaterialPropertyStoragegetMaterialPropertyStorageForXFEM (const XFEMKey)
 Provide write-only access to the underlying MaterialPropertyStorage object JUST FOR XFEM. More...
 
bool hasProperty (const std::string &prop_name) const
 
unsigned int getPropertyId (const std::string &prop_name) const
 Wrapper for MaterialStorage::getPropertyId. More...
 
void onlyResizeIfSmaller (bool flag)
 Set _resize_only_if_smaller to perform a non-destructive resize. More...
 
bool isOnlyResizeIfSmaller () const
 Check value of _resize_only_if_smaller. More...
 
void eraseProperty (const Elem *elem)
 Remove the property storage and element pointer from MaterialPropertyStorage data structures Use this when elements are deleted so we don't end up with invalid elem pointers (for e.g. More...
 

Static Public Attributes

static constexpr unsigned int max_state = 2
 The max time state supported (2 = older) More...
 

Private Member Functions

unsigned int addPropertyHelper (const std::string &prop_name, const std::type_info &type, const unsigned int state, const MaterialBase *const declarer)
 
template<typename T , bool is_ad, bool declare>
GenericMaterialProperty< T, is_ad > & getPropertyHelper (const std::string &prop_name, const unsigned int state, const MooseObject &requestor)
 
const MaterialBasecastRequestorToDeclarer (const MooseObject &requestor) const
 Helper for casting requestor to a MaterialBase in addPropertyHelper() (templated) More...
 
unsigned int getMaxStateRequested (const unsigned int prop_id) const
 maximum state id requested for a property More...
 

Static Private Member Functions

static void mooseErrorHelper (const MooseObject &object, const std::string_view &error)
 

Private Attributes

MaterialPropertyStorage_storage
 Reference to the MaterialStorage class. More...
 
const THREAD_ID _tid
 The thread id. More...
 
unsigned int _n_qpoints
 Number of quadrature points. More...
 
std::array< MaterialProperties, max_state+1 > _props
 The underlying property data. More...
 
bool _swapped
 Status of storage swapping (calling swap sets this to true; swapBack sets it to false) More...
 
bool _resize_only_if_smaller
 Use non-destructive resize of material data (calling resize() will not reduce size). More...
 

Detailed Description

Proxy for accessing MaterialPropertyStorage.

MaterialData stores the values associated with a particular material object

Definition at line 33 of file MaterialData.h.

Constructor & Destructor Documentation

◆ MaterialData()

MaterialData::MaterialData ( MaterialPropertyStorage storage,
const THREAD_ID  tid 
)

Definition at line 15 of file MaterialData.C.

16  : _storage(storage), _tid(tid), _n_qpoints(0), _swapped(false), _resize_only_if_smaller(false)
17 {
18 }
MaterialPropertyStorage & _storage
Reference to the MaterialStorage class.
Definition: MaterialData.h:198
bool _resize_only_if_smaller
Use non-destructive resize of material data (calling resize() will not reduce size).
Definition: MaterialData.h:231
unsigned int _n_qpoints
Number of quadrature points.
Definition: MaterialData.h:204
bool _swapped
Status of storage swapping (calling swap sets this to true; swapBack sets it to false) ...
Definition: MaterialData.h:227
const THREAD_ID _tid
The thread id.
Definition: MaterialData.h:201

Member Function Documentation

◆ addPropertyHelper()

unsigned int MaterialData::addPropertyHelper ( const std::string &  prop_name,
const std::type_info &  type,
const unsigned int  state,
const MaterialBase *const  declarer 
)
private

Definition at line 92 of file MaterialData.C.

Referenced by getPropertyHelper().

96 {
97  return _storage.addProperty(prop_name, type, state, declarer);
98 }
MaterialPropertyStorage & _storage
Reference to the MaterialStorage class.
Definition: MaterialData.h:198
unsigned int addProperty(const std::string &prop_name, const std::type_info &type, const unsigned int state, const MaterialBase *const declarer)
Adds a property with the name prop_name, type type, and state state (0 = current, 1 = old...

◆ castRequestorToDeclarer()

const MaterialBase & MaterialData::castRequestorToDeclarer ( const MooseObject requestor) const
private

Helper for casting requestor to a MaterialBase in addPropertyHelper() (templated)

Definition at line 101 of file MaterialData.C.

Referenced by getPropertyHelper().

102 {
103  const auto declarer = dynamic_cast<const MaterialBase *>(&requestor);
104  mooseAssert(declarer, "Not a MaterialBase");
105  return *declarer;
106 }
MaterialBases compute MaterialProperties.
Definition: MaterialBase.h:60

◆ copy()

void MaterialData::copy ( const Elem &  elem_to,
const Elem &  elem_from,
unsigned int  side 
)

copy material properties from one element to another

Definition at line 35 of file MaterialData.C.

36 {
37  _storage.copy(_tid, &elem_to, &elem_from, side, nQPoints());
38 }
MaterialPropertyStorage & _storage
Reference to the MaterialStorage class.
Definition: MaterialData.h:198
unsigned int nQPoints() const
Returns the number of quadrature points the material properties support/hold.
Definition: MaterialData.h:50
void copy(const THREAD_ID tid, const Elem &elem_to, const Elem &elem_from, unsigned int side, unsigned int n_qpoints)
Copy material properties from elem_from to elem_to.
const THREAD_ID _tid
The thread id.
Definition: MaterialData.h:201

◆ declareProperty()

template<typename T , bool is_ad>
GenericMaterialProperty<T, is_ad>& MaterialData::declareProperty ( const std::string &  prop_name,
const MooseObject requestor 
)
inline

Declares a material property.

Template Parameters
TThe type of the property
is_adWhether or not the property is AD
Parameters
prop_nameThe name of the property
requestorThe MooseObject declaring the property
Returns
The property for the supplied type and name

Definition at line 126 of file MaterialData.h.

Referenced by MaterialBase::declareGenericPropertyByName().

128  {
129  return getPropertyHelper<T, is_ad, true>(prop_name, 0, requestor);
130  }

◆ eraseProperty()

void MaterialData::eraseProperty ( const Elem *  elem)

Remove the property storage and element pointer from MaterialPropertyStorage data structures Use this when elements are deleted so we don't end up with invalid elem pointers (for e.g.

stateful properties) hanging around in our data structures

Definition at line 86 of file MaterialData.C.

87 {
88  _storage.eraseProperty(elem);
89 }
void eraseProperty(const Elem *elem)
Remove the property storage and element pointer from internal data structures Use this when elements ...
MaterialPropertyStorage & _storage
Reference to the MaterialStorage class.
Definition: MaterialData.h:198

◆ getMaterialPropertyStorage()

const MaterialPropertyStorage& MaterialData::getMaterialPropertyStorage ( ) const
inline

Provide read-only access to the underlying MaterialPropertyStorage object.

Definition at line 140 of file MaterialData.h.

140 { return _storage; }
MaterialPropertyStorage & _storage
Reference to the MaterialStorage class.
Definition: MaterialData.h:198

◆ getMaterialPropertyStorageForXFEM()

MaterialPropertyStorage& MaterialData::getMaterialPropertyStorageForXFEM ( const XFEMKey  )
inline

Provide write-only access to the underlying MaterialPropertyStorage object JUST FOR XFEM.

This should be removed. To be clear - you should not ever expect to have write access to this data. It just turned out that XFEM got away with it when we were storing things as pointers instead of smart pointers...

These dirty reasons are why this method is named so egregiously.

Definition at line 161 of file MaterialData.h.

161 { return _storage; }
MaterialPropertyStorage & _storage
Reference to the MaterialStorage class.
Definition: MaterialData.h:198

◆ getMaxStateRequested()

unsigned int MaterialData::getMaxStateRequested ( const unsigned int  prop_id) const
private

maximum state id requested for a property

Definition at line 109 of file MaterialData.C.

Referenced by getPropertyHelper().

110 {
111  return _storage.getPropRecord(prop_id).state;
112 }
MaterialPropertyStorage & _storage
Reference to the MaterialStorage class.
Definition: MaterialData.h:198
unsigned int state
The max state requrested for this property (0 = current, 1 = old, ...)
const PropRecord & getPropRecord(const unsigned int id) const
Get the property record associated with the material with id id.

◆ getProperty()

template<typename T , bool is_ad = false>
GenericMaterialProperty<T, is_ad>& MaterialData::getProperty ( const std::string &  prop_name,
const unsigned int  state,
const MooseObject requestor 
)
inline

Retrieves a material property.

Template Parameters
TThe type of the property
is_adWhether or not the property is AD
Parameters
prop_nameThe name of the property
stateThe time state (0 = current, 1 = old, etc; defaults to 0)
requestorThe MooseObject requesting the property
Returns
The property for the supplied type and name

Definition at line 111 of file MaterialData.h.

Referenced by MaterialPropertyInterface::getBlockMaterialProperty(), MaterialPropertyInterface::getGenericMaterialPropertyByName(), and MaterialBase::getGenericZeroMaterialPropertyByName().

114  {
115  return getPropertyHelper<T, is_ad, false>(prop_name, state, requestor);
116  }

◆ getPropertyHelper()

template<typename T , bool is_ad, bool declare>
GenericMaterialProperty< T, is_ad > & MaterialData::getPropertyHelper ( const std::string &  prop_name,
const unsigned int  state,
const MooseObject requestor 
)
private

Definition at line 269 of file MaterialData.h.

272 {
273  if constexpr (is_ad)
274  mooseAssert(state == 0, "Cannot request/declare AD properties for states other than zero");
275  if constexpr (declare)
276  mooseAssert(state == 0, "Cannot declare properties for states other than zero");
277 
278  // Register/get the ID of the property
279  const auto prop_id = addPropertyHelper(
280  prop_name, typeid(T), state, declare ? &castRequestorToDeclarer(requestor) : nullptr);
281  const auto size = prop_id + 1;
282 
283  // Initialize the states that we need
284  for (const auto state_i : make_range(getMaxStateRequested(prop_id) + 1))
285  {
286  auto & entry = props(state_i);
287  if (entry.size() < size)
288  entry.resize(size, {});
289  // if we are not declaring the property we initialize only what we need (the requested state)
290  if (!entry.hasValue(prop_id) && (declare || state_i == state))
291  {
292  if (state_i == 0)
293  entry.setPointer(
294  prop_id, std::move(std::make_unique<GenericMaterialProperty<T, is_ad>>(prop_id)), {});
295  else
296  entry.setPointer(prop_id, std::move(std::make_unique<MaterialProperty<T>>(prop_id)), {});
297  }
298  }
299 
300  // Should be available now
301  auto & base_prop = props(state)[prop_id];
302 
303  // In the event that this property was already declared/requested, make sure
304  // that the types are consistent
305  auto prop = dynamic_cast<GenericMaterialProperty<T, is_ad> *>(&base_prop);
306  if (!prop)
307  {
308  constexpr std::string_view action = declare ? "declared" : "requested";
309  constexpr auto is_ad_to_str = [](const bool is_ad_bool)
310  { return std::string_view(is_ad_bool ? "AD" : "non-AD"); };
311  constexpr std::string_view ad_type = is_ad_to_str(is_ad);
312 
313  std::stringstream error;
314  error << "The " << action << " " << ad_type << " "
315  << "material property '" + prop_name + "' of type '" << MooseUtils::prettyCppType<T>()
316  << "'\nis already retrieved or declared as a " << is_ad_to_str(base_prop.isAD())
317  << " property of type '" << base_prop.type() << "'.";
318  mooseErrorHelper(requestor, error.str());
319  }
320 
321  return *prop;
322 }
const MaterialBase & castRequestorToDeclarer(const MooseObject &requestor) const
Helper for casting requestor to a MaterialBase in addPropertyHelper() (templated) ...
Definition: MaterialData.C:101
unsigned int addPropertyHelper(const std::string &prop_name, const std::type_info &type, const unsigned int state, const MaterialBase *const declarer)
Definition: MaterialData.C:92
typename GenericMaterialPropertyStruct< T, is_ad >::type GenericMaterialProperty
const MaterialProperties & props(const unsigned int state=0) const
Definition: MaterialData.h:238
unsigned int getMaxStateRequested(const unsigned int prop_id) const
maximum state id requested for a property
Definition: MaterialData.C:109
IntRange< T > make_range(T beg, T end)
static void mooseErrorHelper(const MooseObject &object, const std::string_view &error)
Definition: MaterialData.C:68

◆ getPropertyId()

unsigned int MaterialData::getPropertyId ( const std::string &  prop_name) const

Wrapper for MaterialStorage::getPropertyId.

Allows classes with a MaterialData object (i.e. MaterialPropertyInterface) to access material property IDs.

Parameters
prop_nameThe name of the material property
Returns
An unsigned int corresponding to the property ID of the passed in prop_name

Definition at line 80 of file MaterialData.C.

Referenced by MaterialPropertyInterface::getBlockMaterialProperty(), MaterialPropertyInterface::getGenericMaterialPropertyByName(), haveGenericProperty(), and MaterialBase::registerPropName().

81 {
82  return _storage.getMaterialPropertyRegistry().getID(prop_name);
83 }
MaterialPropertyStorage & _storage
Reference to the MaterialStorage class.
Definition: MaterialData.h:198
const MaterialPropertyRegistry & getMaterialPropertyRegistry() const
unsigned int getID(const std::string &name) const

◆ hasProperty()

bool MaterialData::hasProperty ( const std::string &  prop_name) const
Returns
Whether or not a property exists with the name name

Definition at line 74 of file MaterialData.C.

Referenced by haveGenericProperty().

75 {
76  return _storage.hasProperty(prop_name);
77 }
MaterialPropertyStorage & _storage
Reference to the MaterialStorage class.
Definition: MaterialData.h:198
bool hasProperty(const std::string &prop_name) const

◆ haveADProperty()

template<typename T >
bool MaterialData::haveADProperty ( const std::string &  prop_name) const
inline

Returns true if the AD material property exists - defined by any material.

Definition at line 96 of file MaterialData.h.

Referenced by MaterialPropertyInterface::hasADMaterialPropertyByName(), and MaterialOutputAction::hasADProperty().

97  {
98  return haveGenericProperty<T, true>(prop_name);
99  }

◆ haveGenericProperty()

template<typename T , bool is_ad>
bool MaterialData::haveGenericProperty ( const std::string &  prop_name) const
inline

Definition at line 253 of file MaterialData.h.

Referenced by BlockRestrictable::hasBlockMaterialProperty(), and BoundaryRestrictable::hasBoundaryMaterialProperty().

254 {
255  if (!hasProperty(prop_name))
256  return false;
257 
258  const auto prop_id = getPropertyId(prop_name);
259  // the property id exists, but the property was not created in this instance of the material type
260  if (prop_id >= props(0).size())
261  return false;
262 
263  const PropertyValue * const base_prop = props(0).queryValue(prop_id);
264  return dynamic_cast<const GenericMaterialProperty<T, is_ad> *>(base_prop) != nullptr;
265 }
bool hasProperty(const std::string &prop_name) const
Definition: MaterialData.C:74
unsigned int getPropertyId(const std::string &prop_name) const
Wrapper for MaterialStorage::getPropertyId.
Definition: MaterialData.C:80
const T * queryValue(const std::size_t i) const
typename GenericMaterialPropertyStruct< T, is_ad >::type GenericMaterialProperty
Abstract definition of a property value.
const MaterialProperties & props(const unsigned int state=0) const
Definition: MaterialData.h:238

◆ haveProperty()

template<typename T >
bool MaterialData::haveProperty ( const std::string &  prop_name) const
inline

Returns true if the regular material property exists - defined by any material.

Definition at line 89 of file MaterialData.h.

Referenced by MaterialPropertyInterface::hasMaterialPropertyByName(), and MaterialOutputAction::hasProperty().

90  {
91  return haveGenericProperty<T, false>(prop_name);
92  }

◆ isOnlyResizeIfSmaller()

bool MaterialData::isOnlyResizeIfSmaller ( ) const
inline

Check value of _resize_only_if_smaller.

Definition at line 187 of file MaterialData.h.

187 { return _resize_only_if_smaller; };
bool _resize_only_if_smaller
Use non-destructive resize of material data (calling resize() will not reduce size).
Definition: MaterialData.h:231

◆ isSwapped()

bool MaterialData::isSwapped ( ) const
inline

Returns true if the stateful material is in a swapped state.

Definition at line 135 of file MaterialData.h.

Referenced by swap(), and swapBack().

135 { return _swapped; }
bool _swapped
Status of storage swapping (calling swap sets this to true; swapBack sets it to false) ...
Definition: MaterialData.h:227

◆ mooseErrorHelper()

void MaterialData::mooseErrorHelper ( const MooseObject object,
const std::string_view &  error 
)
staticprivate

Definition at line 68 of file MaterialData.C.

Referenced by getPropertyHelper().

69 {
70  object.mooseError(error);
71 }

◆ nQPoints()

unsigned int MaterialData::nQPoints ( ) const
inline

Returns the number of quadrature points the material properties support/hold.

Definition at line 50 of file MaterialData.h.

Referenced by copy(), and resize().

50 { return _n_qpoints; }
unsigned int _n_qpoints
Number of quadrature points.
Definition: MaterialData.h:204

◆ onlyResizeIfSmaller()

void MaterialData::onlyResizeIfSmaller ( bool  flag)
inline

Set _resize_only_if_smaller to perform a non-destructive resize.

Setting this flag to true means that resize(n) will not decrease the size of _props if n is smaller than the size of the material data object.

Definition at line 182 of file MaterialData.h.

182 { _resize_only_if_smaller = flag; };
bool _resize_only_if_smaller
Use non-destructive resize of material data (calling resize() will not reduce size).
Definition: MaterialData.h:231

◆ props() [1/2]

const MaterialProperties & MaterialData::props ( const unsigned int  state = 0) const
inline
Returns
The properties for the state state (defaults to zero).

This should NEVER be used to modify the size of these objects.{

Definition at line 238 of file MaterialData.h.

Referenced by Material::computeProperties(), getPropertyHelper(), haveGenericProperty(), resize(), and Material::subdomainSetup().

239 {
240  mooseAssert(_props.size() > state, "Invalid state");
241  return _props[state];
242 }
std::array< MaterialProperties, max_state+1 > _props
The underlying property data.
Definition: MaterialData.h:207

◆ props() [2/2]

MaterialProperties & MaterialData::props ( const unsigned int  state = 0)
inline

Definition at line 245 of file MaterialData.h.

246 {
247  mooseAssert(_props.size() > state, "Invalid state");
248  return _props[state];
249 }
std::array< MaterialProperties, max_state+1 > _props
The underlying property data.
Definition: MaterialData.h:207

◆ reinit()

template<typename MatContainer >
void MaterialData::reinit ( const MatContainer &  mats)

Reinit material properties for given element (and possible side)

Parameters
matsThe material objects for which to compute properties
execute_statefulWhether to execute material objects that have stateful properties. This should be false when for example executing material objects for mortar contexts in which stateful properties don't make sense

Definition at line 326 of file MaterialData.h.

327 {
328  for (const auto & mat : mats)
329  mat->computeProperties();
330 }

◆ reset()

void MaterialData::reset ( const std::vector< std::shared_ptr< MaterialBase >> &  mats)

Calls the reset method of Materials to ensure that they are in a proper state.

Definition at line 51 of file MaterialData.C.

52 {
53  for (const auto & mat : mats)
54  mat->resetProperties();
55 }

◆ resize()

void MaterialData::resize ( unsigned int  n_qpoints)

Resize the data to hold properties for n_qpoints quadrature points.

Definition at line 21 of file MaterialData.C.

Referenced by ComputeMaterialsObjectThread::onBoundary(), ComputeMaterialsObjectThread::onInterface(), ComputeMaterialsObjectThread::onInternalSide(), MaterialPropertyStorage::prolongStatefulProps(), FEProblemBase::reinitMaterials(), FEProblemBase::reinitMaterialsBoundary(), FEProblemBase::reinitMaterialsFace(), FEProblemBase::reinitMaterialsInterface(), FEProblemBase::reinitMaterialsNeighbor(), FEProblemBase::resizeMaterialData(), and MaterialPropertyStorage::updateStatefulPropsForPRefinement().

22 {
23  if (n_qpoints == nQPoints())
24  return;
25 
26  if (_resize_only_if_smaller && n_qpoints < nQPoints())
27  return;
28 
29  for (const auto state : _storage.stateIndexRange())
30  props(state).resizeItems(n_qpoints, {});
31  _n_qpoints = n_qpoints;
32 }
MaterialPropertyStorage & _storage
Reference to the MaterialStorage class.
Definition: MaterialData.h:198
bool _resize_only_if_smaller
Use non-destructive resize of material data (calling resize() will not reduce size).
Definition: MaterialData.h:231
IntRange< unsigned int > stateIndexRange() const
unsigned int _n_qpoints
Number of quadrature points.
Definition: MaterialData.h:204
void resizeItems(const std::size_t n_qpoints, const WriteKey)
Resize items in this array, i.e.
const MaterialProperties & props(const unsigned int state=0) const
Definition: MaterialData.h:238
unsigned int nQPoints() const
Returns the number of quadrature points the material properties support/hold.
Definition: MaterialData.h:50

◆ swap()

void MaterialData::swap ( const Elem &  elem,
unsigned int  side = 0 
)

material properties for given element (and possible side)

Definition at line 41 of file MaterialData.C.

42 {
44  return;
45 
46  _storage.swap(_tid, elem, side);
47  _swapped = true;
48 }
bool isSwapped() const
Returns true if the stateful material is in a swapped state.
Definition: MaterialData.h:135
MaterialPropertyStorage & _storage
Reference to the MaterialStorage class.
Definition: MaterialData.h:198
bool _swapped
Status of storage swapping (calling swap sets this to true; swapBack sets it to false) ...
Definition: MaterialData.h:227
void swap(const THREAD_ID tid, const Elem &elem, unsigned int side)
Swap (shallow copy) material properties in MaterialData and MaterialPropertyStorage Thread safe...
const THREAD_ID _tid
The thread id.
Definition: MaterialData.h:201

◆ swapBack()

void MaterialData::swapBack ( const Elem &  elem,
unsigned int  side = 0 
)

material properties for given element (and possible side)

Definition at line 58 of file MaterialData.C.

Referenced by FEProblemBase::swapBackMaterials(), FEProblemBase::swapBackMaterialsFace(), and FEProblemBase::swapBackMaterialsNeighbor().

59 {
61  {
62  _storage.swapBack(_tid, elem, side);
63  _swapped = false;
64  }
65 }
bool isSwapped() const
Returns true if the stateful material is in a swapped state.
Definition: MaterialData.h:135
MaterialPropertyStorage & _storage
Reference to the MaterialStorage class.
Definition: MaterialData.h:198
void swapBack(const THREAD_ID tid, const Elem &elem, unsigned int side)
Swap (shallow copy) material properties in MaterialPropertyStorage and MaterialDat Thread safe...
bool _swapped
Status of storage swapping (calling swap sets this to true; swapBack sets it to false) ...
Definition: MaterialData.h:227
const THREAD_ID _tid
The thread id.
Definition: MaterialData.h:201

Member Data Documentation

◆ _n_qpoints

unsigned int MaterialData::_n_qpoints
private

Number of quadrature points.

Definition at line 204 of file MaterialData.h.

Referenced by nQPoints(), and resize().

◆ _props

std::array<MaterialProperties, max_state + 1> MaterialData::_props
private

The underlying property data.

Definition at line 207 of file MaterialData.h.

Referenced by props().

◆ _resize_only_if_smaller

bool MaterialData::_resize_only_if_smaller
private

Use non-destructive resize of material data (calling resize() will not reduce size).

Default is false (normal resize behaviour)

Definition at line 231 of file MaterialData.h.

Referenced by isOnlyResizeIfSmaller(), onlyResizeIfSmaller(), and resize().

◆ _storage

MaterialPropertyStorage& MaterialData::_storage
private

◆ _swapped

bool MaterialData::_swapped
private

Status of storage swapping (calling swap sets this to true; swapBack sets it to false)

Definition at line 227 of file MaterialData.h.

Referenced by isSwapped(), swap(), and swapBack().

◆ _tid

const THREAD_ID MaterialData::_tid
private

The thread id.

Definition at line 201 of file MaterialData.h.

Referenced by copy(), swap(), and swapBack().

◆ max_state

constexpr unsigned int MaterialData::max_state = 2
static

The max time state supported (2 = older)

Definition at line 39 of file MaterialData.h.

Referenced by MaterialPropertyStorage::addProperty().


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