https://mooseframework.inl.gov
Public Member Functions | Protected Attributes | Private Attributes | List of all members
OptionalMaterialPropertyProxy< M, T, is_ad > Class Template Reference

#include <MaterialProperty.h>

Inheritance diagram for OptionalMaterialPropertyProxy< M, T, is_ad >:
[legend]

Public Member Functions

 OptionalMaterialPropertyProxy (const std::string &name, const unsigned int state)
 
const GenericOptionalMaterialProperty< T, is_ad > & value () const
 
void resolve (M &mpi) override
 

Protected Attributes

const std::string _name
 
const unsigned int _state
 

Private Attributes

GenericOptionalMaterialProperty< T, is_ad > _value
 

Detailed Description

template<class M, typename T, bool is_ad>
class OptionalMaterialPropertyProxy< M, T, is_ad >

Definition at line 453 of file MaterialProperty.h.

Constructor & Destructor Documentation

◆ OptionalMaterialPropertyProxy()

template<class M , typename T , bool is_ad>
OptionalMaterialPropertyProxy< M, T, is_ad >::OptionalMaterialPropertyProxy ( const std::string &  name,
const unsigned int  state 
)
inline

Definition at line 695 of file MaterialPropertyInterface.h.

697  {
698  }
std::string name(const ElemQuality q)
Helper class for deferred getting of material properties after the construction phase for materials...

Member Function Documentation

◆ resolve()

template<class M , typename T , bool is_ad>
void OptionalMaterialPropertyProxy< M, T, is_ad >::resolve ( M &  mpi)
inlineoverridevirtual

Implements OptionalMaterialPropertyProxyBase< M >.

Definition at line 700 of file MaterialPropertyInterface.h.

701  {
702  if (mpi.template hasGenericMaterialProperty<T, is_ad>(this->_name))
703  {
704  if constexpr (is_ad)
705  if (this->_state > 0)
706  mooseError("Non-current (state > 0) material properties are not available as AD");
707 
708  _value.set(&mpi.template getGenericMaterialProperty<T, is_ad>(this->_name, this->_state));
709  }
710  }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
GenericOptionalMaterialProperty< T, is_ad > _value

◆ value()

template<class M , typename T , bool is_ad>
const GenericOptionalMaterialProperty<T, is_ad>& OptionalMaterialPropertyProxy< M, T, is_ad >::value ( ) const
inline

Definition at line 699 of file MaterialPropertyInterface.h.

699 { return _value; }
GenericOptionalMaterialProperty< T, is_ad > _value

Member Data Documentation

◆ _name

template<class M>
const std::string OptionalMaterialPropertyProxyBase< M >::_name
protectedinherited

Definition at line 55 of file MaterialPropertyInterface.h.

◆ _state

template<class M>
const unsigned int OptionalMaterialPropertyProxyBase< M >::_state
protectedinherited

◆ _value

template<class M , typename T , bool is_ad>
GenericOptionalMaterialProperty<T, is_ad> OptionalMaterialPropertyProxy< M, T, is_ad >::_value
private

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