21#define usingMaterialMembers \
22 usingMaterialBaseMembers; \
23 usingCoupleableMembers; \
24 usingMaterialPropertyInterfaceMembers; \
25 using Material::_q_point; \
26 using Material::_qrule; \
27 using Material::_JxW; \
28 using Material::_current_elem; \
29 using Material::_current_subdomain_id; \
30 using Material::_current_side
48 virtual const dof_id_type &
getElementID(
const std::string & id_parameter_name,
49 unsigned int comp = 0)
const override
59 unsigned int comp = 0)
const override
61 mooseError(
"Directly calling 'getElementIDNeighbor' is not allowed for materials. Please call "
62 "'getElementID' instead");
71 virtual const dof_id_type &
81 virtual const dof_id_type &
84 mooseError(
"Directly calling 'getElementIDNeighborByName' is not allowed for materials. Please "
85 "call 'getElementIDByName' instead");
96 template <
typename T,
bool is_ad>
101 const unsigned int state = 0)
103 return getGenericMaterialProperty<T, false>(
name, state);
105 template <
typename T>
108 return getGenericMaterialProperty<T, true>(
name, 0);
110 template <
typename T>
113 return getGenericMaterialProperty<T, false>(
name, 1);
115 template <
typename T>
118 return getGenericMaterialProperty<T, false>(
name, 2);
126 template <
typename T,
bool is_ad>
129 template <
typename T>
131 const unsigned int state = 0)
133 return getGenericMaterialPropertyByName<T, false>(prop_name, state);
135 template <
typename T>
138 return getGenericMaterialPropertyByName<T, true>(prop_name, 0);
140 template <
typename T>
143 return getGenericMaterialPropertyByName<T, false>(prop_name, 1);
145 template <
typename T>
148 return getGenericMaterialPropertyByName<T, false>(prop_name, 2);
172 template <
typename T,
bool is_ad>
175 template <
typename T>
177 const unsigned int state = 0)
179 return getGenericOptionalMaterialProperty<T, false>(
name, state);
181 template <
typename T>
184 return getGenericOptionalMaterialProperty<T, true>(
name, 0);
186 template <
typename T>
189 return getGenericOptionalMaterialProperty<T, false>(
name, 1);
191 template <
typename T>
194 return getGenericOptionalMaterialProperty<T, false>(
name, 2);
256 std::vector<std::unique_ptr<OptionalMaterialPropertyProxyBase<Material>>>
260template <
typename T,
bool is_ad>
268 if (
const auto * default_property = defaultGenericMaterialProperty<T, is_ad>(prop_name))
269 return *default_property;
271 return getGenericMaterialPropertyByName<T, is_ad>(prop_name, state);
274template <
typename T,
bool is_ad>
277 const unsigned int state)
282 return getGenericMaterialPropertyByName<T, is_ad>(prop_name_in +
_interpolated_old, 0);
291 const auto prop_name =
294 : MooseUtils::join(std::vector<std::string>({prop_name_in,
_get_suffix}),
"_");
301 MaterialPropertyInterface::getGenericMaterialPropertyByName<T, is_ad>(prop_name_in, state);
308template <
typename T,
bool is_ad>
312 auto proxy = std::make_unique<OptionalMaterialPropertyProxy<Material, T, is_ad>>(
name, state);
313 auto & optional_property = proxy->value();
315 return optional_property;
subdomain_id_type SubdomainID
typename GenericMaterialPropertyStruct< T, is_ad >::type GenericMaterialProperty
Interface for objects that needs coupling capabilities.
virtual const dof_id_type & getElementIDByName(const std::string &id_name) const
Gets an element integer with the element integer name.
virtual const dof_id_type & getElementIDNeighbor(const std::string &id_parameter_name, unsigned int comp=0) const
Gets a neighbor element integer with a parameter of the object derived from this interface.
virtual const dof_id_type & getElementID(const std::string &id_parameter_name, unsigned int comp=0) const
Gets an element integer with a parameter of the object derived from this interface.
virtual const dof_id_type & getElementIDNeighborByName(const std::string &id_name) const
Gets a neighbor element integer with the element integer name.
Wrapper around a material property pointer.
MaterialBases compute MaterialProperties.
const MaterialProperty< T > & getZeroMaterialProperty(Ts... args)
for backwards compatibility
void checkExecutionStage()
Check and throw an error if the execution has progressed past the construction stage.
const GenericMaterialProperty< T, is_ad > & getGenericZeroMaterialProperty()
Return a constant zero anonymous material property.
std::set< std::string > _requested_props
Set of properties accessed via get method.
void registerPropName(const std::string &prop_name, bool is_get, const unsigned int state)
Small helper function to call store{Subdomain,Boundary}MatPropName.
const GenericMaterialProperty< T, is_ad > & getGenericZeroMaterialPropertyByName(const std::string &prop_name)
Proxy for accessing MaterialPropertyStorage.
An interface for accessing Materials.
MaterialPropertyName getMaterialPropertyName(const std::string &name) const
static const std::string _interpolated_old
name suffixes for interpolated old and older properties
const Moose::MaterialDataType _material_data_type
The type of data.
static const std::string _interpolated_older
virtual const std::unordered_set< unsigned int > & getMatPropDependencies() const
Retrieve the set of material properties that this object depends on.
MaterialData & _material_data
The material data class that stores properties.
const bool _use_interpolated_state
Use the interpolated state set up through the ProjectedStatefulMaterialStorageAction.
const MaterialPropertyName _get_suffix
Materials compute MaterialProperties.
const OptionalMaterialProperty< T > & getOptionalMaterialProperty(const std::string &name, const unsigned int state=0)
MaterialBase & getMaterialByName(const std::string &name, bool no_warn=false, bool no_dep=false)
Retrieve the discrete material named "name".
virtual void computeProperties() override
Performs the quadrature point loop, calling computeQpProperties.
static InputParameters validParams()
bool usesFaceCoupledValues() const override
Whether this object evaluates coupled variables on element faces, so that it must request coupled AD ...
const unsigned int & _current_side
current side of the current element
const ADMaterialProperty< T > & getADMaterialPropertyByName(const std::string &prop_name)
virtual const dof_id_type & getElementIDNeighbor(const std::string &id_parameter_name, unsigned int comp=0) const override
Directly calling this function is not needed for materials because the same material has three copies...
virtual Moose::MaterialDataType materialDataType() override
const Elem *const & _current_elem
CreateMooseEnumClass(ConstantTypeEnum, NONE, ELEMENT, SUBDOMAIN)
const MaterialProperty< T > & getMaterialPropertyOlder(const std::string &name)
virtual void resolveOptionalProperties() override
resolve all optional properties
const OptionalMaterialProperty< T > & getOptionalMaterialPropertyOlder(const std::string &name)
virtual const dof_id_type & getElementID(const std::string &id_parameter_name, unsigned int comp=0) const override
Gets an element integer for the proper current element with a parameter of the object derived from th...
MaterialBase & getMaterial(const std::string &name)
Retrieve the discrete material with a given parameter key named "name".
const ConstantTypeEnum _constant_option
Options of the constantness level of the material.
const SubdomainID & _current_subdomain_id
const GenericOptionalMaterialProperty< T, is_ad > & getGenericOptionalMaterialProperty(const std::string &name, const unsigned int state=0)
Optional material property getters.
ConstantTypeEnum computeConstantOption()
virtual const MaterialData & materialData() const override
const GenericMaterialProperty< T, is_ad > & getGenericMaterialProperty(const std::string &name, const unsigned int state=0)
Retrieve the property through a given input parameter key with a fallback to getting it by name.
std::vector< std::unique_ptr< OptionalMaterialPropertyProxyBase< Material > > > _optional_property_proxies
optional material properties
const MaterialProperty< T > & getMaterialProperty(const std::string &name, const unsigned int state=0)
const MaterialProperty< T > & getMaterialPropertyByName(const std::string &prop_name, const unsigned int state=0)
const QBase *const & _qrule
virtual MaterialData & materialData() override
bool ghostable() const override final
Whether this material supports ghosted computations.
const MaterialProperty< T > & getMaterialPropertyOld(const std::string &name)
const ADMaterialProperty< T > & getADMaterialProperty(const std::string &name)
const OptionalMaterialProperty< T > & getOptionalMaterialPropertyOld(const std::string &name)
const OptionalADMaterialProperty< T > & getOptionalADMaterialProperty(const std::string &name)
const MaterialProperty< T > & getMaterialPropertyOldByName(const std::string &prop_name)
virtual const dof_id_type & getElementIDByName(const std::string &id_parameter_name) const override
Gets an element integer for the proper current element with the element integer name Note: This overr...
virtual void subdomainSetup() override
Subdomain setup evaluating material properties when required.
const GenericMaterialProperty< T, is_ad > & getGenericMaterialPropertyByName(const std::string &name, const unsigned int state=0)
Retrieve the property named "name".
const MooseArray< Real > & _JxW
virtual bool isBoundaryMaterial() const override
Returns true of the MaterialData type is not associated with volume data.
virtual void checkMaterialProperty(const std::string &name, const unsigned int state) override
A helper method for checking material properties This method was required to avoid a compiler problem...
virtual const dof_id_type & getElementIDNeighborByName(const std::string &id_parameter_name) const override
Directly calling this function is not needed for materials because the same material has three copies...
virtual const QBase & qRule() const override
virtual const std::unordered_set< unsigned int > & getMatPropDependencies() const override
Retrieve the set of material properties that this object depends on.
const MooseArray< Point > & _q_point
bool _ghostable
Whether this material can be computed in a ghosted context.
const MaterialProperty< T > & getMaterialPropertyOlderByName(const std::string &prop_name)
const InputParameters & parameters() const
Get the parameters of the object.
const std::string & name() const
Get the name of the class.
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
MaterialDataType
MaterialData types.