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

#include <MaterialPropertyInterface.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 724 of file MaterialPropertyInterface.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 727 of file MaterialPropertyInterface.h.

729 {
730 }
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 732 of file MaterialPropertyInterface.h.

733 {
734 if (mpi.template hasGenericMaterialProperty<T, is_ad>(this->_name))
735 {
736 if constexpr (is_ad)
737 if (this->_state > 0)
738 mooseError("Non-current (state > 0) material properties are not available as AD");
739
740 _value.set(&mpi.template getGenericMaterialProperty<T, is_ad>(this->_name, this->_state));
741 }
742 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
Definition MooseError.h:311
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 731 of file MaterialPropertyInterface.h.

731{ return _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: