20 #define usingMaterialMembers \ 21 usingMaterialBaseMembers; \ 22 usingCoupleableMembers; \ 23 usingMaterialPropertyInterfaceMembers; \ 24 using Material::_q_point; \ 25 using Material::_qrule; \ 26 using Material::_JxW; \ 27 using Material::_current_elem; \ 28 using Material::_current_subdomain_id; \ 29 using Material::_current_side 48 unsigned int comp = 0)
const override 58 unsigned int comp = 0)
const override 60 mooseError(
"Directly calling 'getElementIDNeighbor' is not allowed for materials. Please call " 61 "'getElementID' instead");
83 mooseError(
"Directly calling 'getElementIDNeighborByName' is not allowed for materials. Please " 84 "call 'getElementIDByName' instead");
95 template <
typename T,
bool is_ad>
100 const unsigned int state = 0)
102 return getGenericMaterialProperty<T, false>(
name, state);
104 template <
typename T>
107 return getGenericMaterialProperty<T, true>(
name, 0);
109 template <
typename T>
112 return getGenericMaterialProperty<T, false>(
name, 1);
114 template <
typename T>
117 return getGenericMaterialProperty<T, false>(
name, 2);
125 template <
typename T,
bool is_ad>
128 template <
typename T>
130 const unsigned int state = 0)
132 return getGenericMaterialPropertyByName<T, false>(prop_name, state);
134 template <
typename T>
137 return getGenericMaterialPropertyByName<T, true>(prop_name, 0);
139 template <
typename T>
142 return getGenericMaterialPropertyByName<T, false>(prop_name, 1);
144 template <
typename T>
147 return getGenericMaterialPropertyByName<T, false>(prop_name, 2);
171 template <
typename T,
bool is_ad>
174 template <
typename T>
176 const unsigned int state = 0)
178 return getGenericOptionalMaterialProperty<T, false>(
name, state);
180 template <
typename T>
183 return getGenericOptionalMaterialProperty<T, true>(
name, 0);
185 template <
typename T>
188 return getGenericOptionalMaterialProperty<T, false>(
name, 1);
190 template <
typename T>
193 return getGenericOptionalMaterialProperty<T, false>(
name, 2);
257 std::vector<std::unique_ptr<OptionalMaterialPropertyProxyBase<Material>>>
261 template <
typename T,
bool is_ad>
269 if (
const auto * default_property = defaultGenericMaterialProperty<T, is_ad>(prop_name))
270 return *default_property;
272 return getGenericMaterialPropertyByName<T, is_ad>(prop_name, state);
275 template <
typename T,
bool is_ad>
278 const unsigned int state)
283 return getGenericMaterialPropertyByName<T, is_ad>(prop_name_in +
_interpolated_old, 0);
292 const auto prop_name =
302 MaterialPropertyInterface::getGenericMaterialPropertyByName<T, is_ad>(prop_name_in, state);
309 template <
typename T,
bool is_ad>
313 auto proxy = std::make_unique<OptionalMaterialPropertyProxy<Material, T, is_ad>>(
name, state);
314 auto & optional_property = proxy->value();
316 return optional_property;
const MooseArray< Point > & _q_point
const OptionalADMaterialProperty< T > & getOptionalADMaterialProperty(const std::string &name)
const OptionalMaterialProperty< T > & getOptionalMaterialPropertyOlder(const std::string &name)
const MaterialProperty< T > & getMaterialPropertyOld(const std::string &name)
static const std::string _interpolated_old
name suffixes for interpolated old and older properties
const QBase *const & _qrule
ConstantTypeEnum computeConstantOption()
const OptionalMaterialProperty< T > & getOptionalMaterialPropertyOld(const std::string &name)
const MaterialProperty< T > & getMaterialProperty(const std::string &name, const unsigned int state=0)
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 MaterialData & materialData() const override
const GenericOptionalMaterialProperty< T, is_ad > & getGenericOptionalMaterialProperty(const std::string &name, const unsigned int state=0)
Optional material property getters.
const GenericMaterialProperty< T, is_ad > & getGenericMaterialPropertyByName(const std::string &name, const unsigned int state=0)
Retrieve the property named "name".
static const std::string _interpolated_older
const ConstantTypeEnum _constant_option
Options of the constantness level of the material.
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 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 computeProperties() override
Performs the quadrature point loop, calling computeQpProperties.
bool _ghostable
Whether this material can be computed in a ghosted context.
const MooseArray< Real > & _JxW
const MaterialProperty< T > & getMaterialPropertyByName(const std::string &prop_name, const unsigned int state=0)
bool ghostable() const override final
Whether this material supports ghosted computations.
const ADMaterialProperty< T > & getADMaterialProperty(const std::string &name)
virtual const dof_id_type & getElementIDNeighborByName(const std::string &id_name) const
Gets a neighbor element integer with the element integer name.
virtual void subdomainSetup() override
Subdomain setup evaluating material properties when required.
MaterialPropertyName getMaterialPropertyName(const std::string &name) const
virtual bool isBoundaryMaterial() const override
Returns true of the MaterialData type is not associated with volume data.
virtual const std::string & name() const
Get the name of the class.
MaterialData & _material_data
The material data class that stores properties.
Wrapper around a material property pointer.
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...
std::set< std::string > _requested_props
Set of properties accessed via get method.
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...
static InputParameters validParams()
MaterialBase & getMaterial(const std::string &name)
Retrieve the discrete material with a given parameter key named "name".
void checkExecutionStage()
Check and throw an error if the execution has progressed past the construction stage.
typename GenericMaterialPropertyStruct< T, is_ad >::type GenericMaterialProperty
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...
const MaterialProperty< T > & getMaterialPropertyOlderByName(const std::string &prop_name)
virtual const dof_id_type & getElementIDByName(const std::string &id_name) const
Gets an element integer with the element integer name.
const MaterialPropertyName _get_suffix
const MaterialProperty< T > & getMaterialPropertyOldByName(const std::string &prop_name)
MaterialBase & getMaterialByName(const std::string &name, bool no_warn=false, bool no_dep=false)
Retrieve the discrete material named "name".
Materials compute MaterialProperties.
const ADMaterialProperty< T > & getADMaterialPropertyByName(const std::string &prop_name)
Interface for objects that needs coupling capabilities.
An interface for accessing Materials.
const GenericMaterialProperty< T, is_ad > & getGenericZeroMaterialPropertyByName(const std::string &prop_name)
const unsigned int & _current_side
current side of the current element
const GenericMaterialProperty< T, is_ad > & getGenericZeroMaterialProperty()
Return a constant zero anonymous material property.
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
const bool _use_interpolated_state
Use the interpolated state set up through the ProjectedStatefulMaterialStorageAction.
const MaterialProperty< T > & getMaterialPropertyOlder(const std::string &name)
const InputParameters & parameters() const
Get the parameters of the object.
Proxy for accessing MaterialPropertyStorage.
const OptionalMaterialProperty< T > & getOptionalMaterialProperty(const std::string &name, const unsigned int state=0)
void registerPropName(const std::string &prop_name, bool is_get, const unsigned int state)
Small helper function to call store{Subdomain,Boundary}MatPropName.
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.
std::vector< std::unique_ptr< OptionalMaterialPropertyProxyBase< Material > > > _optional_property_proxies
optional material properties
const MaterialProperty< T > & getZeroMaterialProperty(Ts... args)
for backwards compatibility
const SubdomainID & _current_subdomain_id
virtual void resolveOptionalProperties() override
resolve all optional properties
virtual const QBase & qRule() const override
const std::unordered_set< unsigned int > & getMatPropDependencies() const
Retrieve the set of material properties that this object depends on.
MaterialBases compute MaterialProperties.
std::string join(const T &strings, const std::string &delimiter)
Python like join function for strings.
const Elem *const & _current_elem
virtual MaterialData & materialData() override
Material(const InputParameters ¶meters)
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...
virtual const std::unordered_set< unsigned int > & getMatPropDependencies() const override
Retrieve the set of material properties that this object depends on.