www.mooseframework.org
Public Member Functions | Protected Attributes | List of all members
ADMaterialPropertyObject< T > Class Template Reference

#include <MaterialProperty.h>

Inheritance diagram for ADMaterialPropertyObject< T >:
[legend]

Public Member Functions

 ADMaterialPropertyObject ()
 
MooseADWrapper< T >::DNType & operator[] (const unsigned int i)
 Get element i out of the array as a writeable reference. More...
 
const MooseADWrapper< T >::DNType & operator[] (const unsigned int i) const
 Get element i out of the array as a read-only reference. More...
 
const MooseArray< MooseADWrapper< T > > & get () const
 
MooseArray< MooseADWrapper< T > > & set ()
 
virtual std::string type () override
 String identifying the type of parameter stored. More...
 
virtual PropertyValueinit (int size) override
 Clone this value. More...
 
virtual void resize (int n) override
 Resizes the property to the size n. More...
 
virtual unsigned int size () const override
 
virtual void swap (PropertyValue *rhs) override
 
virtual void qpCopy (const unsigned int to_qp, PropertyValue *rhs, const unsigned int from_qp) override
 Copy the value of a Property from one specific to a specific qp in this Property. More...
 
virtual void store (std::ostream &stream) override
 Store the property into a binary stream. More...
 
virtual void load (std::istream &stream) override
 Load the property from a binary stream. More...
 
void copyValueToDualNumber (const unsigned int i) override
 copy the Real version to the DualNumber<Real> version of the material property for the specified quadrature point More...
 
void copyDualNumberToValue (const unsigned int i) override
 copy the value portion (not the derivatives) of the DualNumber<Real> version of the material property to the Real version for the specified quadrature point More...
 

Protected Attributes

MooseArray< MooseADWrapper< T > > _value
 Stored parameter value. More...
 

Detailed Description

template<typename T>
class ADMaterialPropertyObject< T >

Definition at line 275 of file MaterialProperty.h.

Constructor & Destructor Documentation

◆ ADMaterialPropertyObject()

template<typename T>
ADMaterialPropertyObject< T >::ADMaterialPropertyObject ( )
inline

Definition at line 278 of file MaterialProperty.h.

278 : MaterialProperty<T>() {}
Concrete definition of a parameter value for a specified type.

Member Function Documentation

◆ copyDualNumberToValue()

template<typename T>
void MaterialProperty< T >::copyDualNumberToValue ( const unsigned int  i)
inlineoverridevirtualinherited

copy the value portion (not the derivatives) of the DualNumber<Real> version of the material property to the Real version for the specified quadrature point

Implements PropertyValue.

Definition at line 197 of file MaterialProperty.h.

197 { _value[i].copyDualNumberToValue(); }
MooseArray< MooseADWrapper< T > > _value
Stored parameter value.

◆ copyValueToDualNumber()

template<typename T>
void MaterialProperty< T >::copyValueToDualNumber ( const unsigned int  i)
inlineoverridevirtualinherited

copy the Real version to the DualNumber<Real> version of the material property for the specified quadrature point

Implements PropertyValue.

Definition at line 191 of file MaterialProperty.h.

191 { _value[i].copyValueToDualNumber(); }
MooseArray< MooseADWrapper< T > > _value
Stored parameter value.

◆ get()

template<typename T>
const MooseArray<MooseADWrapper<T> >& MaterialProperty< T >::get ( ) const
inlineinherited
Returns
a read-only reference to the parameter value.

Definition at line 118 of file MaterialProperty.h.

118 { return _value; }
MooseArray< MooseADWrapper< T > > _value
Stored parameter value.

◆ init()

template<typename T >
PropertyValue * MaterialProperty< T >::init ( int  size)
inlineoverridevirtualinherited

Clone this value.

Useful in copy-construction.

Implements PropertyValue.

Definition at line 228 of file MaterialProperty.h.

229 {
230  return _init_helper(size, this, static_cast<T *>(0));
231 }
friend PropertyValue * _init_helper(int size, PropertyValue *prop, const P *the_type)
Friend helper function to handle scalar material property initializations.
virtual unsigned int size() const override

◆ load()

template<typename T >
void MaterialProperty< T >::load ( std::istream &  stream)
inlineoverridevirtualinherited

Load the property from a binary stream.

Implements PropertyValue.

Definition at line 268 of file MaterialProperty.h.

269 {
270  for (unsigned int i = 0; i < size(); i++)
271  loadHelper(stream, _value[i], NULL);
272 }
MooseArray< MooseADWrapper< T > > _value
Stored parameter value.
virtual unsigned int size() const override
void loadHelper(std::istream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:731

◆ operator[]() [1/2]

template<typename T>
MooseADWrapper<T>::DNType& ADMaterialPropertyObject< T >::operator[] ( const unsigned int  i)
inline

Get element i out of the array as a writeable reference.

Definition at line 283 of file MaterialProperty.h.

284  {
285  return this->_value[i].dn();
286  }
MooseArray< MooseADWrapper< T > > _value
Stored parameter value.

◆ operator[]() [2/2]

template<typename T>
const MooseADWrapper<T>::DNType& ADMaterialPropertyObject< T >::operator[] ( const unsigned int  i) const
inline

Get element i out of the array as a read-only reference.

Definition at line 290 of file MaterialProperty.h.

291  {
292  return this->_value[i].dn();
293  }
MooseArray< MooseADWrapper< T > > _value
Stored parameter value.

◆ qpCopy()

template<typename T >
void MaterialProperty< T >::qpCopy ( const unsigned int  to_qp,
PropertyValue rhs,
const unsigned int  from_qp 
)
inlineoverridevirtualinherited

Copy the value of a Property from one specific to a specific qp in this Property.

Parameters
to_qpThe quadrature point in this Property that you want to copy to.
rhsThe Property you want to copy from.
from_qpThe quadrature point in rhs you want to copy from.

Implements PropertyValue.

Definition at line 250 of file MaterialProperty.h.

253 {
254  mooseAssert(rhs != NULL, "Assigning NULL?");
255  _value[to_qp] = cast_ptr<const MaterialProperty<T> *>(rhs)->_value[from_qp];
256 }
MooseArray< MooseADWrapper< T > > _value
Stored parameter value.

◆ resize()

template<typename T >
void MaterialProperty< T >::resize ( int  n)
inlineoverridevirtualinherited

Resizes the property to the size n.

Implements PropertyValue.

Definition at line 235 of file MaterialProperty.h.

Referenced by MaterialPropertyInterface::getZeroMaterialProperty(), and Material::getZeroMaterialProperty().

236 {
237  _value.resize(n);
238 }
void resize(const unsigned int size)
Change the number of elements the array can store.
Definition: MooseArray.h:200
MooseArray< MooseADWrapper< T > > _value
Stored parameter value.
PetscInt n

◆ set()

template<typename T>
MooseArray<MooseADWrapper<T> >& MaterialProperty< T >::set ( )
inlineinherited
Returns
a writable reference to the parameter value.

Definition at line 123 of file MaterialProperty.h.

123 { return _value; }
MooseArray< MooseADWrapper< T > > _value
Stored parameter value.

◆ size()

template<typename T>
virtual unsigned int MaterialProperty< T >::size ( ) const
inlineoverridevirtualinherited

Implements PropertyValue.

Definition at line 140 of file MaterialProperty.h.

Referenced by MaterialPropertyInterface::getZeroMaterialProperty(), Material::getZeroMaterialProperty(), and MooseUtils::MaterialPropertyStorageDump().

140 { return _value.size(); }
MooseArray< MooseADWrapper< T > > _value
Stored parameter value.
unsigned int size() const
The number of elements that can currently be stored in the array.
Definition: MooseArray.h:245

◆ store()

template<typename T >
void MaterialProperty< T >::store ( std::ostream &  stream)
inlineoverridevirtualinherited

Store the property into a binary stream.

Implements PropertyValue.

Definition at line 260 of file MaterialProperty.h.

261 {
262  for (unsigned int i = 0; i < size(); i++)
263  storeHelper(stream, _value[i], NULL);
264 }
void storeHelper(std::ostream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:667
MooseArray< MooseADWrapper< T > > _value
Stored parameter value.
virtual unsigned int size() const override

◆ swap()

template<typename T >
void MaterialProperty< T >::swap ( PropertyValue rhs)
inlineoverridevirtualinherited

Implements PropertyValue.

Definition at line 242 of file MaterialProperty.h.

243 {
244  mooseAssert(rhs != NULL, "Assigning NULL?");
245  _value.swap(cast_ptr<MaterialProperty<T> *>(rhs)->_value);
246 }
void swap(MooseArray &rhs)
Swap memory in this object with the &#39;rhs&#39; object.
Definition: MooseArray.h:270
MooseArray< MooseADWrapper< T > > _value
Stored parameter value.
Concrete definition of a parameter value for a specified type.

◆ type()

template<typename T >
std::string MaterialProperty< T >::type ( )
inlineoverridevirtualinherited

String identifying the type of parameter stored.

Implements PropertyValue.

Definition at line 221 of file MaterialProperty.h.

222 {
223  return typeid(T).name();
224 }

Member Data Documentation

◆ _value

template<typename T>
MooseArray<MooseADWrapper<T> > MaterialProperty< T >::_value
protectedinherited

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