#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 361 of file MaterialProperty.h.
◆ id_type
◆ value_type
◆ ADMaterialProperty() [1/2]
Definition at line 364 of file MaterialProperty.h.
366 {
367 }
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 373 of file MaterialProperty.h.
374 {
375 mooseError(
"Material properties must be assigned to references (missing '&')");
376 }
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.
330{
331 auto prop = std::make_unique<MaterialProperty<T>>(this->
id());
334 return prop;
335}
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.
280{
283}
void dataLoad(std::istream &stream, LineSegment &l, void *context)
auto index_range(const T &sizable)
◆ operator=()
private assignment operator to avoid shallow copying of material properties
Definition at line 379 of file MaterialProperty.h.
380 {
381 mooseError(
"Material properties must be assigned to references (missing '&')");
382 }
◆ 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)
263 _value[to_qp] = cast_ptr<const MaterialPropertyBase<T, is_ad> *>(&rhs)->
_value[from_qp];
264 else
267}
virtual bool isAD() const =0
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.
272{
275}
void dataStore(std::ostream &stream, LineSegment &l, void *context)
◆ swap()
|
|
inlinefinaloverridevirtualinherited |
Implements PropertyValue.
Definition at line 171 of file MaterialProperty.h.
288{
289 mooseAssert(this->
id() == rhs.
id(),
"Inconsistent properties");
290 mooseAssert(this->
typeID() == rhs.
typeID(),
"Inconsistent types");
291
292
293 if (rhs.
isAD() == is_ad)
294 {
295 mooseAssert(dynamic_cast<decltype(this)>(&rhs), "Expected same type is not the same");
297 return;
298 }
299
300
301
302
303
304
305
306
307
308
309
310
311
312 auto * different_type_prop = cast_ptr<MaterialPropertyBase<T, !is_ad> *>(&rhs);
313
314 this->
resize(different_type_prop->size());
317}
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: