16 : _storage(storage), _tid(tid), _n_qpoints(0), _swapped(false), _resize_only_if_smaller(false)
53 for (
const auto & mat : mats)
54 mat->resetProperties();
70 object.mooseError(error);
93 const std::type_info & type,
94 const unsigned int state,
103 const auto declarer =
dynamic_cast<const MaterialBase *
>(&requestor);
104 mooseAssert(declarer,
"Not a MaterialBase");
bool isSwapped() const
Returns true if the stateful material is in a swapped state.
bool hasProperty(const std::string &prop_name) const
const MaterialBase & castRequestorToDeclarer(const MooseObject &requestor) const
Helper for casting requestor to a MaterialBase in addPropertyHelper() (templated) ...
void swapBack(const Elem &elem, unsigned int side=0)
material properties for given element (and possible side)
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.
bool _resize_only_if_smaller
Use non-destructive resize of material data (calling resize() will not reduce size).
Stores the stateful material properties computed by materials.
unsigned int getPropertyId(const std::string &prop_name) const
Wrapper for MaterialStorage::getPropertyId.
const MaterialPropertyRegistry & getMaterialPropertyRegistry() const
void eraseProperty(const Elem *elem)
Remove the property storage and element pointer from MaterialPropertyStorage data structures Use this...
MaterialData(MaterialPropertyStorage &storage, const THREAD_ID tid)
unsigned int _n_qpoints
Number of quadrature points.
unsigned int addPropertyHelper(const std::string &prop_name, const std::type_info &type, const unsigned int state, const MaterialBase *const declarer)
void resizeItems(const std::size_t n_qpoints, const WriteKey)
Resize items in this array, i.e.
libMesh::IntRange< unsigned int > stateIndexRange() const
Every object that can be built by the factory should be derived from this class.
void swapBack(const THREAD_ID tid, const Elem &elem, unsigned int side)
Swap (shallow copy) material properties in MaterialPropertyStorage and MaterialDat Thread safe...
void copy(const Elem &elem_to, const Elem &elem_from, unsigned int side)
copy material properties from one element to another
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...
const MaterialProperties & props(const unsigned int state=0) const
unsigned int state
The max state requrested for this property (0 = current, 1 = old, ...)
bool hasStatefulProperties() const
unsigned int getMaxStateRequested(const unsigned int prop_id) const
maximum state id requested for a property
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.
void swap(const Elem &elem, unsigned int side=0)
material properties for given element (and possible side)
bool _swapped
Status of storage swapping (calling swap sets this to true; swapBack sets it to false) ...
bool hasProperty(const std::string &prop_name) const
unsigned int getID(const std::string &name) const
static void mooseErrorHelper(const MooseObject &object, const std::string_view &error)
unsigned int nQPoints() const
Returns the number of quadrature points the material properties support/hold.
void swap(const THREAD_ID tid, const Elem &elem, unsigned int side)
Swap (shallow copy) material properties in MaterialData and MaterialPropertyStorage Thread safe...
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 PropRecord & getPropRecord(const unsigned int id) const
Get the property record associated with the material with id id.
MaterialBases compute MaterialProperties.
void resize(unsigned int n_qpoints)
Resize the data to hold properties for n_qpoints quadrature points.
const THREAD_ID _tid
The thread id.