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 595 of file MaterialPropertyInterface.h.

597  {
598  }
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 600 of file MaterialPropertyInterface.h.

601  {
602  if (mpi.template hasGenericMaterialProperty<T, is_ad>(this->_name))
603  {
604  if constexpr (is_ad)
605  if (this->_state > 0)
606  mooseError("Non-current (state > 0) material properties are not available as AD");
607 
608  _value.set(&mpi.template getGenericMaterialProperty<T, is_ad>(this->_name, this->_state));
609  }
610  }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
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 599 of file MaterialPropertyInterface.h.

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

Member Data Documentation

◆ _name

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

Definition at line 51 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: