#include <MaterialProperty.h>
|
| static constexpr id_type | invalid_property_id = std::numeric_limits<id_type>::max() - 1 |
| | The material property ID for an invalid property We only have this because there are a few cases where folks want to instantiate their own fake materials, and we should at least force them to be consistent.
|
| |
template<typename T>
class ADMaterialProperty< T >
Definition at line 363 of file MaterialProperty.h.
◆ id_type
◆ value_type
◆ ADMaterialProperty() [1/2]
Definition at line 366 of file MaterialProperty.h.
368 {
369 }
Concrete definition of a parameter value for a specified type.
◆ ADMaterialProperty() [2/2]
private copy constructor to avoid shallow copying of material properties
Definition at line 375 of file MaterialProperty.h.
376 {
377 mooseError(
"Material properties must be assigned to references (missing '&')");
378 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
◆ clone()
|
|
finaloverridevirtualinherited |
- Returns
- A clone of this property.
Note that this will only ever return a non-AD clone, even if this property is an AD property. This is on purpose; whenever we need clones, it's for older states in which we don't store derivatives beacuse it's too expensive.
Implements PropertyValue.
Definition at line 182 of file MaterialProperty.h.
332{
333 auto prop = std::make_unique<MaterialProperty<T>>(this->
id());
336 return prop;
337}
virtual unsigned int size() const override final
◆ get()
- Returns
- a read-only reference to the parameter value.
Definition at line 121 of file MaterialProperty.h.
MooseArray< Moose::GenericType< T, is_ad > > _value
Stored parameter value.
◆ id()
| id_type PropertyValue::id |
( |
| ) |
const |
|
inlineinherited |
◆ isAD()
|
|
inlinefinaloverridevirtualinherited |
◆ load()
|
|
inlinefinaloverridevirtualinherited |
Load the property from a binary stream.
Implements PropertyValue.
Definition at line 169 of file MaterialProperty.h.
282{
285}
void loadHelper(std::istream &stream, P &data, void *context)
Scalar helper routine.
auto index_range(const T &sizable)
◆ operator=()
private assignment operator to avoid shallow copying of material properties
Definition at line 381 of file MaterialProperty.h.
382 {
383 mooseError(
"Material properties must be assigned to references (missing '&')");
384 }
◆ operator[]() [1/2]
Get element i out of the array as a writeable reference.
Definition at line 143 of file MaterialProperty.h.
◆ operator[]() [2/2]
Get element i out of the array as a ready-only reference.
Definition at line 148 of file MaterialProperty.h.
◆ qpCopy()
|
|
inlinefinaloverridevirtualinherited |
Copy the value of a Property from one specific to a specific qp in this Property.
- Parameters
-
| to_qp | The quadrature point in this Property that you want to copy to. |
| rhs | The Property you want to copy from. |
| from_qp | The quadrature point in rhs you want to copy from. |
Implements PropertyValue.
Definition at line 157 of file MaterialProperty.h.
260{
261
262 if (rhs.
isAD() == is_ad)
264 libMesh::cast_ptr<const MaterialPropertyBase<T, is_ad> *>(&rhs)->
_value[from_qp];
265 else
269}
virtual bool isAD() const =0
Tnew cast_ptr(Told *oldvar)
void rawValueEqualityHelper(T1 &out, const T2 &in)
◆ resize()
|
|
inlinefinaloverridevirtualinherited |
Resizes the property to the size n.
Implements PropertyValue.
Definition at line 136 of file MaterialProperty.h.
251{
253}
virtual void resize(const std::size_t size) override final
Resizes the property to the size n.
◆ set()
◆ size()
|
|
inlinefinaloverridevirtualinherited |
◆ store()
|
|
inlinefinaloverridevirtualinherited |
Store the property into a binary stream.
Implements PropertyValue.
Definition at line 164 of file MaterialProperty.h.
274{
277}
void storeHelper(std::ostream &stream, P &data, void *context)
Scalar helper routine.
◆ swap()
|
|
inlinefinaloverridevirtualinherited |
Implements PropertyValue.
Definition at line 171 of file MaterialProperty.h.
290{
291 mooseAssert(this->
id() == rhs.
id(),
"Inconsistent properties");
292 mooseAssert(this->
typeID() == rhs.
typeID(),
"Inconsistent types");
293
294
295 if (rhs.
isAD() == is_ad)
296 {
297 mooseAssert(dynamic_cast<decltype(this)>(&rhs), "Expected same type is not the same");
299 return;
300 }
301
302
303
304
305
306
307
308
309
310
311
312
313
314 auto * different_type_prop = libMesh::cast_ptr<MaterialPropertyBase<T, !is_ad> *>(&rhs);
315
316 this->
resize(different_type_prop->size());
319}
const std::type_info & typeID() const override final
void swap(MooseArray &rhs)
Swap memory in this object with the 'rhs' object.
virtual const std::type_info & typeID() const =0
IntRange< T > make_range(T beg, T end)
◆ type()
|
|
inlinefinaloverridevirtualinherited |
String identifying the type of parameter stored.
Implements PropertyValue.
Definition at line 131 of file MaterialProperty.h.
243{
244 static const std::string type_name = MooseUtils::prettyCppType<T>();
245 return type_name;
246}
◆ typeID()
|
|
inlinefinaloverridevirtualinherited |
◆ _id
◆ _value
◆ invalid_property_id
| constexpr id_type PropertyValue::invalid_property_id = std::numeric_limits<id_type>::max() - 1 |
|
staticconstexprinherited |
The material property ID for an invalid property We only have this because there are a few cases where folks want to instantiate their own fake materials, and we should at least force them to be consistent.
Definition at line 50 of file MaterialProperty.h.
The documentation for this class was generated from the following file: