https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
AdvectionHDGAssemblyHelper Class Referenceabstract

Shared assembly for element-and-trace scalar hybridized DG discretizations of the advection equation. More...

#include <AdvectionHDGAssemblyHelper.h>

Inheritance diagram for AdvectionHDGAssemblyHelper:
[legend]

Public Member Functions

 AdvectionHDGAssemblyHelper (const MooseObject *moose_obj, MooseVariableDependencyInterface *mvdi, const TransientInterface *ti, SystemBase &sys, const Assembly &assembly, THREAD_ID tid, const std::set< SubdomainID > &block_ids, const std::set< BoundaryID > &boundary_ids)
 
virtual void scalarVolume () override
 Assembles the element-interior equation's volume contribution.
 
virtual void scalarFace () override
 Assembles the element-interior equation's face contribution.
 
virtual void lmFace () override
 Assembles the facet equation's interior-face contribution.
 
virtual void scalarDirichlet (const Moose::Functor< Real > &dirichlet_value) override
 Assembles the element-interior equation on a Dirichlet boundary.
 
void lmOutflow ()
 Prescribes an outflow condition for the facet scalar.
 
void resizeResiduals ()
 Resizes the element-interior and facet residual vectors for the current element.
 
void lmDirichlet (const Moose::Functor< Real > &dirichlet_value)
 Enforces a Dirichlet value in the facet equation.
 
void lmPrescribedFlux (const Moose::Functor< Real > &flux_value)
 Applies a prescribed flux in the facet equation.
 
std::array< ADResidualsPacket, 2 > taggingData () const
 
std::set< std::string > additionalROVariables ()
 
template<typename T >
const MaterialProperty< T > & getFaceMaterialProperty (const std::string &name)
 Retrieve the property deduced from the name name.
 
template<typename T >
const MaterialProperty< T > & getFaceMaterialPropertyByName (const std::string &name)
 Retrieve the property named "name" without any deduction.
 
template<typename T >
const ADMaterialProperty< T > & getFaceADMaterialProperty (const std::string &name)
 Retrieve the ADMaterialProperty named "name".
 
template<typename T >
const MaterialProperty< T > & getFaceMaterialPropertyOld (const std::string &name)
 
template<typename T >
const MaterialProperty< T > & getFaceMaterialPropertyOlder (const std::string &name)
 
template<typename T , bool is_ad>
const auto & getGenericFaceMaterialProperty (const std::string &name)
 Retrieve the face material property whether AD or not.
 
template<typename T , bool is_ad>
const GenericMaterialProperty< T, is_ad > & getGenericMaterialProperty (const std::string &name, MaterialData &material_data, const unsigned int state=0)
 Retrieve the generic property named "name" for the specified material_data at state state.
 
template<typename T >
const MaterialProperty< T > & getMaterialProperty (const std::string &name, MaterialData &material_data, const unsigned int state=0)
 Retrieve the property named "name" for the specified material_data.
 
template<typename T >
const ADMaterialProperty< T > & getADMaterialProperty (const std::string &name, MaterialData &material_data)
 Retrieve the AD property named "name" for the specified material_data.
 
template<typename T >
const MaterialProperty< T > & getMaterialPropertyOld (const std::string &name, MaterialData &material_data)
 Retrieve the old property deduced from the name name for the specified material_data.
 
template<typename T >
const MaterialProperty< T > & getMaterialPropertyOlder (const std::string &name, MaterialData &material_data)
 Retrieve the older property deduced from the name name for the specified material_data.
 
template<typename T , bool is_ad>
const GenericMaterialProperty< T, is_ad > & getGenericMaterialPropertyByName (const MaterialPropertyName &name, MaterialData &material_data, const unsigned int state)
 Retrieve the generic property named "name" without any deduction for the specified material_data for state state.
 
template<typename T >
const MaterialProperty< T > & getMaterialPropertyByName (const MaterialPropertyName &name, MaterialData &material_data, const unsigned int state=0)
 Retrieve the property named "name" without any deduction for the specified material_data.
 
template<typename T >
const ADMaterialProperty< T > & getADMaterialPropertyByName (const MaterialPropertyName &name, MaterialData &material_data)
 Retrieve the AD property named "name" without any deduction for the specified \q material_data.
 
template<typename T >
const MaterialProperty< T > & getMaterialPropertyOldByName (const MaterialPropertyName &name, MaterialData &material_data)
 Retrieve the old property named name without any deduction for the specified material_data.
 
template<typename T >
const MaterialProperty< T > & getMaterialPropertyOlderByName (const MaterialPropertyName &name, MaterialData &material_data)
 Retrieve the older property named name without any deduction for the specified material_data.
 
template<typename T , unsigned int dimension = 0, unsigned int state = 0>
Moose::Kokkos::MaterialProperty< T, dimension > getKokkosMaterialPropertyByName (const std::string &prop_name_in)
 Get a Kokkos material property by property name for any state.
 
template<typename T , unsigned int dimension = 0>
Moose::Kokkos::MaterialProperty< T, dimension > getKokkosMaterialPropertyOldByName (const std::string &prop_name)
 Get an old Kokkos material property by property name.
 
template<typename T , unsigned int dimension = 0>
Moose::Kokkos::MaterialProperty< T, dimension > getKokkosMaterialPropertyOlderByName (const std::string &prop_name)
 Get an older Kokkos material property by property name.
 
template<typename T , unsigned int dimension = 0, unsigned int state = 0>
Moose::Kokkos::MaterialProperty< T, dimension > getKokkosMaterialProperty (const std::string &name)
 Get a Kokkos material property for any state.
 
template<typename T , unsigned int dimension = 0>
Moose::Kokkos::MaterialProperty< T, dimension > getKokkosMaterialPropertyOld (const std::string &name)
 Get an old Kokkos material property.
 
template<typename T , unsigned int dimension = 0>
Moose::Kokkos::MaterialProperty< T, dimension > getKokkosMaterialPropertyOlder (const std::string &name)
 Get an older Kokkos material property.
 
template<typename T >
std::pair< const MaterialProperty< T > *, std::set< SubdomainID > > getBlockMaterialProperty (const MaterialPropertyName &name)
 Retrieve pointer to a material property with the mesh blocks where it is defined The name required by this method is the name defined in the input file.
 
template<typename T , unsigned int dimension = 0, unsigned int state = 0>
std::pair< Moose::Kokkos::MaterialProperty< T, dimension >, std::set< SubdomainID > > getKokkosBlockMaterialProperty (const MaterialPropertyName &name)
 Retrieve a Kokkos material property with the mesh blocks where it is defined NOTE: This is not a drop-in replacement of getBlockMaterialProperty().
 
template<typename T , bool is_ad>
const GenericMaterialProperty< T, is_ad > & getGenericZeroMaterialProperty (const std::string &name)
 Return a material property that is initialized to zero by default and does not need to (but can) be declared by another material.
 
template<typename T , bool is_ad>
const GenericMaterialProperty< T, is_ad > & getGenericZeroMaterialProperty ()
 Return a constant zero anonymous material property.
 
template<typename T , bool is_ad>
const GenericMaterialProperty< T, is_ad > & getGenericZeroMaterialPropertyByName (const std::string &prop_name)
 
template<typename T , typename... Ts>
const MaterialProperty< T > & getZeroMaterialProperty (Ts... args)
 for backwards compatibility
 
std::set< SubdomainIDgetMaterialPropertyBlocks (const std::string &name)
 Retrieve the block ids that the material property is defined.
 
std::vector< SubdomainName > getMaterialPropertyBlockNames (const std::string &name)
 Retrieve the block names that the material property is defined.
 
std::set< BoundaryIDgetMaterialPropertyBoundaryIDs (const std::string &name)
 Retrieve the boundary ids that the material property is defined.
 
std::vector< BoundaryName > getMaterialPropertyBoundaryNames (const std::string &name)
 Retrieve the boundary namess that the material property is defined.
 
void checkBlockAndBoundaryCompatibility (std::shared_ptr< MaterialBase > discrete)
 Check if block and boundary restrictions of a given material are compatible with the current material.
 
std::unordered_map< SubdomainID, std::vector< MaterialBase * > > buildRequiredMaterials (bool allow_stateful=true)
 get a map of MaterialBase pointers for all material objects that this object depends on for each block
 
void statefulPropertiesAllowed (bool)
 Derived classes can declare whether or not they work with stateful material properties.
 
virtual bool getMaterialPropertyCalled () const
 Returns true if getMaterialProperty() has been called, false otherwise.
 
virtual const std::unordered_set< unsigned int > & getMatPropDependencies () const
 Retrieve the set of material properties that this object depends on.
 
virtual void resolveOptionalProperties ()
 resolve all optional properties
 
template<typename T , bool is_ad>
const GenericMaterialProperty< T, is_ad > & getPossiblyConstantGenericMaterialPropertyByName (const MaterialPropertyName &prop_name, MaterialData &material_data, const unsigned int state)
 Retrieve the generic property named "prop_name" without any deduction for the specified material_data for state state.
 
template<typename T , bool is_ad>
const GenericMaterialProperty< T, is_ad > & getGenericNeighborMaterialProperty (const std::string &name, const unsigned int state=0)
 Retrieve the neighbor property deduced from the name name.
 
template<typename T >
const MaterialProperty< T > & getNeighborMaterialProperty (const std::string &name, const unsigned int state=0)
 
template<typename T >
const ADMaterialProperty< T > & getNeighborADMaterialProperty (const std::string &name)
 
template<typename T >
const MaterialProperty< T > & getNeighborMaterialPropertyOld (const std::string &name)
 
template<typename T >
const MaterialProperty< T > & getNeighborMaterialPropertyOlder (const std::string &name)
 
template<typename T , bool is_ad>
const GenericMaterialProperty< T, is_ad > & getGenericNeighborMaterialPropertyByName (const std::string &name, const unsigned int state=0)
 Retrieve the neighbor property named "name" without any deduction.
 
template<typename T >
const MaterialProperty< T > & getNeighborMaterialPropertyByName (const std::string &name, const unsigned int state=0)
 
template<typename T >
const ADMaterialProperty< T > & getNeighborADMaterialPropertyByName (const std::string &name)
 
template<typename T , bool is_ad>
const GenericMaterialProperty< T, is_ad > & getGenericMaterialProperty (const std::string &name, const unsigned int state=0)
 Retrieve reference to material property or one of it's old or older values.
 
template<typename T >
const MaterialProperty< T > & getMaterialProperty (const std::string &name, const unsigned int state=0)
 
template<typename T >
const ADMaterialProperty< T > & getADMaterialProperty (const std::string &name)
 
template<typename T >
const MaterialProperty< T > & getMaterialPropertyOld (const std::string &name)
 
template<typename T >
const MaterialProperty< T > & getMaterialPropertyOlder (const std::string &name)
 
template<typename T , bool is_ad>
const GenericMaterialProperty< T, is_ad > & getGenericMaterialPropertyByName (const MaterialPropertyName &name, const unsigned int state=0)
 Retrieve reference to material property or its old or older value The name required by this method is the name defined in the input file.
 
template<typename T >
const MaterialProperty< T > & getMaterialPropertyByName (const MaterialPropertyName &name, const unsigned int state=0)
 
template<typename T >
const ADMaterialProperty< T > & getADMaterialPropertyByName (const MaterialPropertyName &name)
 
template<typename T >
const MaterialProperty< T > & getMaterialPropertyOldByName (const MaterialPropertyName &name)
 
template<typename T >
const MaterialProperty< T > & getMaterialPropertyOlderByName (const MaterialPropertyName &name)
 
template<typename T , bool is_ad>
const GenericOptionalMaterialProperty< T, is_ad > & getGenericOptionalMaterialProperty (const std::string &name, const unsigned int state=0)
 
template<typename T >
const OptionalMaterialProperty< T > & getOptionalMaterialProperty (const std::string &name, const unsigned int state=0)
 
template<typename T >
const OptionalADMaterialProperty< T > & getOptionalADMaterialProperty (const std::string &name)
 
template<typename T >
const OptionalMaterialProperty< T > & getOptionalMaterialPropertyOld (const std::string &name)
 
template<typename T >
const OptionalMaterialProperty< T > & getOptionalMaterialPropertyOlder (const std::string &name)
 
MaterialBasegetMaterial (const std::string &name)
 Return a MaterialBase reference - usable for computing directly.
 
MaterialBasegetMaterialByName (const std::string &name, bool no_warn=false)
 
template<typename T >
bool hasMaterialProperty (const std::string &name)
 Check if the material property exists.
 
template<typename T >
bool hasMaterialPropertyByName (const std::string &name)
 
template<typename T >
bool hasADMaterialProperty (const std::string &name)
 
template<typename T >
bool hasADMaterialPropertyByName (const std::string &name)
 
template<typename T , unsigned int dimension = 0>
bool hasKokkosMaterialProperty (const std::string &name)
 
template<typename T , unsigned int dimension = 0>
bool hasKokkosMaterialPropertyByName (const std::string &name)
 
template<typename T , bool is_ad>
bool hasGenericMaterialProperty (const std::string &name)
 generic hasMaterialProperty helper
 
template<typename T , bool is_ad>
bool hasGenericMaterialPropertyByName (const std::string &name)
 

Static Public Member Functions

static InputParameters validParams ()
 

Static Public Attributes

static constexpr PropertyValue::id_type default_property_id
 The material property ID for a default (parsed from input) property.
 
static constexpr PropertyValue::id_type zero_property_id = PropertyValue::invalid_property_id - 2
 The material property ID for a zero property.
 

Protected Member Functions

virtual ADRealVectorValue faceVelocity (unsigned int qp) const =0
 
ADReal computeFlux (unsigned int qp, const ADReal &face_value) const
 Computes the upwind face flux.
 
virtual void checkMaterialProperty (const std::string &name, const unsigned int state)
 A helper method for checking material properties This method was required to avoid a compiler problem with the template getMaterialProperty method.
 
virtual void getKokkosMaterialPropertyHook (const std::string &, const unsigned int)
 A virtual method that can be overriden by Kokkos objects to insert additional operations in getKokkosMaterialProperty.
 
void markMatPropRequested (const std::string &)
 A proxy method for _mi_feproblem.markMatPropRequested(name)
 
MaterialPropertyName getMaterialPropertyName (const std::string &name) const
 
void checkExecutionStage ()
 Check and throw an error if the execution has progressed past the construction stage.
 
template<typename T , bool is_ad>
const GenericMaterialProperty< T, is_ad > * defaultGenericMaterialProperty (const std::string &name)
 
template<typename T >
const MaterialProperty< T > * defaultMaterialProperty (const std::string &name)
 
template<typename T >
const ADMaterialProperty< T > * defaultADMaterialProperty (const std::string &name)
 

Protected Attributes

const ADMaterialProperty< RealVectorValue > & _velocity
 Cell-interior velocity used in the volume advection term.
 
const Real _coeff
 Constant coefficient multiplying the advected scalar, such as density.
 
const TransientInterface_ti
 Transient state used to evaluate boundary functors.
 
const MooseVariableFE< Real > & _u_var
 Element-interior scalar variable.
 
const MooseVariableFE< Real > & _u_face_var
 Facet trace variable.
 
const std::vector< dof_id_type > & _u_dof_indices
 Degree-of-freedom indices for the element-interior scalar.
 
const std::vector< dof_id_type > & _lm_u_dof_indices
 Degree-of-freedom indices for the facet trace.
 
const MooseArray< ADReal > & _u_sol
 Element-interior scalar values at quadrature points.
 
const MooseArray< ADReal > & _lm_u_sol
 Facet trace values at face quadrature points.
 
const MooseArray< std::vector< Real > > & _scalar_phi
 Element-interior scalar test functions.
 
const MooseArray< std::vector< RealVectorValue > > & _grad_scalar_phi
 Gradients of the element-interior scalar test functions.
 
const MooseArray< std::vector< Real > > & _scalar_phi_face
 Element-interior scalar test functions evaluated on a face.
 
const MooseArray< std::vector< Real > > & _lm_phi_face
 Facet trace test functions evaluated on a face.
 
const Real & _elem_volume
 Current element volume.
 
const Real & _side_area
 Current side area.
 
const Elem *const & _current_elem
 Current element.
 
const unsigned int_current_side
 Current element-side index.
 
const Elem *const & _current_side_elem
 Current side element.
 
const MooseArray< Real > & _JxW
 Element quadrature weights including the transformed Jacobian.
 
const libMesh::QBase *const & _qrule
 Element quadrature rule.
 
const MooseArray< Point > & _q_point
 Physical element quadrature points.
 
const MooseArray< Real > & _JxW_face
 Face quadrature weights including the transformed Jacobian.
 
const libMesh::QBase *const & _qrule_face
 Face quadrature rule.
 
const MooseArray< Point > & _q_point_face
 Physical face quadrature points.
 
const MooseArray< Point > & _normals
 Outward unit normals on the current face.
 
DenseVector< ADReal_scalar_re
 Residual for the element-interior scalar equation.
 
DenseVector< ADReal_lm_re
 Residual for the facet trace equation.
 
MaterialData_face_material_data
 
MaterialData_neighbor_material_data
 
const InputParameters_mi_params
 Parameters of the object with this interface.
 
const std::string _mi_name
 The name of the object that this interface belongs to.
 
const MooseObjectName _mi_moose_object_name
 The "complete" name of the object that this interface belongs for material property output.
 
FEProblemBase_mi_feproblem
 Reference to the FEProblemBase class.
 
SubProblem_mi_subproblem
 Reference to the subproblem.
 
const THREAD_ID _mi_tid
 Current threaded it.
 
const bool _is_kokkos_object
 Whether the MOOSE object is a Kokkos object.
 
const Moose::MaterialDataType _material_data_type
 The type of data.
 
MaterialData_material_data
 The material data class that stores properties.
 
bool _stateful_allowed
 True by default.
 
bool _get_material_property_called
 Initialized to false.
 
std::vector< std::unique_ptr< PropertyValue > > _default_properties
 Storage vector for default properties.
 
std::unordered_set< unsigned int_material_property_dependencies
 The set of material properties (as given by their IDs) that this object depends on.
 
const MaterialPropertyName _get_suffix
 
const bool _use_interpolated_state
 Use the interpolated state set up through the ProjectedStatefulMaterialStorageAction.
 

Static Protected Attributes

static const std::string _interpolated_old = "_interpolated_old"
 name suffixes for interpolated old and older properties
 
static const std::string _interpolated_older = "_interpolated_older"
 

Private Member Functions

Moose::MaterialDataType getMaterialDataType (const std::set< BoundaryID > &boundary_ids) const
 
unsigned int getMaxQps () const
 
void addConsumedPropertyName (const MooseObjectName &obj_name, const std::string &prop_name)
 

Private Attributes

const MooseObject_mi_moose_object
 The MooseObject creating the MaterialPropertyInterface.
 
const bool _mi_boundary_restricted
 BoundaryRestricted flag.
 
const std::set< SubdomainID > & _mi_block_ids
 Storage for the block ids created by BlockRestrictable.
 
const std::set< BoundaryID > & _mi_boundary_ids
 Storage for the boundary ids created by BoundaryRestrictable.
 
std::vector< std::unique_ptr< OptionalMaterialPropertyProxyBase< MaterialPropertyInterface > > > _optional_property_proxies
 optional material properties
 

Detailed Description

Shared assembly for element-and-trace scalar hybridized DG discretizations of the advection equation.

Derived helpers provide the face velocity appropriate to their flow discretization.

Definition at line 20 of file AdvectionHDGAssemblyHelper.h.

Constructor & Destructor Documentation

◆ AdvectionHDGAssemblyHelper()

AdvectionHDGAssemblyHelper::AdvectionHDGAssemblyHelper ( const MooseObject moose_obj,
MooseVariableDependencyInterface mvdi,
const TransientInterface ti,
SystemBase sys,
const Assembly assembly,
THREAD_ID  tid,
const std::set< SubdomainID > &  block_ids,
const std::set< BoundaryID > &  boundary_ids 
)

Definition at line 28 of file AdvectionHDGAssemblyHelper.C.

38 moose_obj, mvdi, ti, sys, assembly, tid, block_ids, boundary_ids),
39 _velocity(getADMaterialProperty<RealVectorValue>("velocity")),
40 _coeff(moose_obj->getParam<Real>("coeff"))
41{
42}
const Real _coeff
Constant coefficient multiplying the advected scalar, such as density.
const ADMaterialProperty< RealVectorValue > & _velocity
Cell-interior velocity used in the volume advection term.
Method-neutral assembly data and operations for an element-and-trace scalar hybridized DG discretizat...
const T & getParam(const std::string &name) const
Retrieve a parameter for the object.
Definition MooseBase.h:406
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

Member Function Documentation

◆ addConsumedPropertyName()

void MaterialPropertyInterface::addConsumedPropertyName ( const MooseObjectName obj_name,
const std::string &  prop_name 
)
privateinherited

Definition at line 148 of file MaterialPropertyInterface.C.

150{
151 return _mi_feproblem.addConsumedPropertyName(obj_name, prop_name);
152}
FEProblemBase & _mi_feproblem
Reference to the FEProblemBase class.
void addConsumedPropertyName(const MooseObjectName &obj_name, const std::string &prop_name)
Helper for tracking the object that is consuming a property for MaterialPropertyDebugOutput.
Definition SubProblem.C:737

Referenced by MaterialPropertyInterface::getBlockMaterialProperty(), MaterialPropertyInterface::getGenericMaterialPropertyByName(), MaterialPropertyInterface::getKokkosBlockMaterialProperty(), and MaterialPropertyInterface::getKokkosMaterialPropertyByName().

◆ additionalROVariables()

std::set< std::string > ElementAndTraceScalarHDGAssemblyHelper::additionalROVariables ( )
inherited
Returns
The facet variable as a set

Definition at line 77 of file ElementAndTraceScalarHDGAssemblyHelper.C.

78{
79 return {_u_face_var.name()};
80}
const MooseVariableFE< Real > & _u_face_var
Facet trace variable.
const std::string & name() const
Get the name of the class.
Definition MooseBase.h:103

Referenced by ElementAndTraceScalarHDGKernel::additionalROVariables().

◆ buildRequiredMaterials()

std::unordered_map< SubdomainID, std::vector< MaterialBase * > > MaterialPropertyInterface::buildRequiredMaterials ( bool  allow_stateful = true)
inherited

get a map of MaterialBase pointers for all material objects that this object depends on for each block

Definition at line 243 of file MaterialPropertyInterface.C.

244{
245 std::unordered_map<SubdomainID, std::vector<MaterialBase *>> required_mats;
246 const auto & mwh = _mi_feproblem.getMaterialWarehouse();
247 for (const auto id : _mi_block_ids)
248 {
249 const auto & mats = mwh[_material_data_type].getActiveBlockObjects(id, _mi_tid);
250 std::array<const MaterialPropertyInterface *, 1> consumers = {{this}};
251 const auto block_required =
252 MaterialBase::buildRequiredMaterials(consumers, mats, allow_stateful);
253 required_mats[id].insert(
254 required_mats[id].begin(), block_required.begin(), block_required.end());
255 }
256 return required_mats;
257}
const MaterialWarehouse & getMaterialWarehouse() const
static std::deque< MaterialBase * > buildRequiredMaterials(const Consumers &mat_consumers, const std::vector< std::shared_ptr< MaterialBase > > &mats, const bool allow_stateful)
Build the materials required by a set of consumer objects.
const THREAD_ID _mi_tid
Current threaded it.
const Moose::MaterialDataType _material_data_type
The type of data.
const std::set< SubdomainID > & _mi_block_ids
Storage for the block ids created by BlockRestrictable.
const std::map< SubdomainID, std::vector< std::shared_ptr< T > > > & getActiveBlockObjects(THREAD_ID tid=0) const

◆ checkBlockAndBoundaryCompatibility()

void MaterialPropertyInterface::checkBlockAndBoundaryCompatibility ( std::shared_ptr< MaterialBase discrete)
inherited

Check if block and boundary restrictions of a given material are compatible with the current material.

Error out otherwise.

Definition at line 184 of file MaterialPropertyInterface.C.

186{
187 // Check block compatibility
188 if (!discrete->hasBlocks(_mi_block_ids))
189 {
190 std::ostringstream oss;
191 oss << "Incompatible material and object blocks:";
192
193 oss << "\n " << discrete->parameters().paramLocationPrefix("block")
194 << " material defined on blocks ";
195 for (const auto & sbd_id : discrete->blockIDs())
196 oss << sbd_id << ", ";
197
198 oss << "\n " << _mi_params.paramLocationPrefix("block")
199 << " object needs material on blocks ";
200 for (const auto & block_id : _mi_block_ids)
201 oss << block_id << ", ";
202
203 mooseError(oss.str());
204 }
205
206 // Check boundary compatibility
207 if (!discrete->hasBoundary(_mi_boundary_ids))
208 {
209 std::ostringstream oss;
210 oss << "Incompatible material and object boundaries:";
211
212 oss << "\n " << discrete->parameters().paramLocationPrefix("boundary")
213 << " material defined on boundaries ";
214 for (const auto & bnd_id : discrete->boundaryIDs())
215 oss << bnd_id << ", ";
216
217 oss << "\n " << _mi_params.paramLocationPrefix("boundary")
218 << " object needs material on boundaries ";
219 for (const auto & bnd_id : _mi_boundary_ids)
220 oss << bnd_id << ", ";
221
222 mooseError(oss.str());
223 }
224}
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
Definition MooseError.h:311
std::string paramLocationPrefix(const std::string &param) const
Returns a prefix containing the parameter name and location (if available)
const std::set< BoundaryID > & _mi_boundary_ids
Storage for the boundary ids created by BoundaryRestrictable.
const InputParameters & _mi_params
Parameters of the object with this interface.

Referenced by MaterialPropertyInterface::getMaterialByName().

◆ checkExecutionStage()

void MaterialPropertyInterface::checkExecutionStage ( )
protectedinherited

Check and throw an error if the execution has progressed past the construction stage.

Definition at line 260 of file MaterialPropertyInterface.C.

261{
263 mooseError("Material properties must be retrieved during object construction. This is a code "
264 "problem.");
265}
virtual bool startedInitialSetup()
Returns true if we are in or beyond the initialSetup stage.

Referenced by MaterialPropertyInterface::getGenericMaterialPropertyByName(), MaterialPropertyInterface::getKokkosBlockMaterialProperty(), and MaterialPropertyInterface::getKokkosMaterialPropertyByName().

◆ checkMaterialProperty()

void MaterialPropertyInterface::checkMaterialProperty ( const std::string &  name,
const unsigned int  state 
)
protectedvirtualinherited

A helper method for checking material properties This method was required to avoid a compiler problem with the template getMaterialProperty method.

Reimplemented in Moose::Kokkos::Material, and Material.

Definition at line 155 of file MaterialPropertyInterface.C.

156{
157 if (state == 0)
158 {
159 // If the material property is boundary restrictable, add to the list of materials to check
161 for (const auto & bnd_id : _mi_boundary_ids)
162 _mi_feproblem.storeBoundaryDelayedCheckMatProp(_mi_name, bnd_id, name);
163
164 // The default is to assume block restrictions
165 else
166 for (const auto & blk_ids : _mi_block_ids)
167 _mi_feproblem.storeSubdomainDelayedCheckMatProp(_mi_name, blk_ids, name);
168 }
169}
const bool _mi_boundary_restricted
BoundaryRestricted flag.
const std::string _mi_name
The name of the object that this interface belongs to.
std::string name(const ElemQuality q)

Referenced by Moose::Kokkos::Material::checkMaterialProperty(), Material::checkMaterialProperty(), MaterialPropertyInterface::getGenericMaterialPropertyByName(), and MaterialPropertyInterface::getKokkosMaterialPropertyByName().

◆ computeFlux()

ADReal AdvectionHDGAssemblyHelper::computeFlux ( unsigned int  qp,
const ADReal face_value 
) const
protected

Computes the upwind face flux.

Parameters
qpThe quadrature point index
face_valueThe advected quantity evaluated on the face

Definition at line 57 of file AdvectionHDGAssemblyHelper.C.

58{
59 const auto vdotn = faceVelocity(qp) * _normals[qp];
60 const auto face_phi = _coeff * face_value;
61 const auto internal_phi = _coeff * _u_sol[qp];
62 // If velocity points out of the element, use the interior value; otherwise use the face value.
63 return 0.5 * vdotn * (internal_phi + face_phi) + 0.5 * abs(vdotn) * (internal_phi - face_phi);
64}
virtual ADRealVectorValue faceVelocity(unsigned int qp) const =0
const MooseArray< Point > & _normals
Outward unit normals on the current face.
const MooseArray< ADReal > & _u_sol
Element-interior scalar values at quadrature points.
MetaPhysicL::DualNumber< V, D, asd > abs(const MetaPhysicL::DualNumber< V, D, asd > &a)
Definition EigenADReal.h:50

Referenced by lmFace(), scalarDirichlet(), and scalarFace().

◆ defaultADMaterialProperty()

template<typename T >
const ADMaterialProperty< T > * MaterialPropertyInterface::defaultADMaterialProperty ( const std::string &  name)
inlineprotectedinherited

Definition at line 653 of file MaterialPropertyInterface.h.

654 {
655 return defaultGenericMaterialProperty<T, true>(name);
656 }

◆ defaultGenericMaterialProperty()

template<typename T , bool is_ad>
const GenericMaterialProperty< T, is_ad > * MaterialPropertyInterface::defaultGenericMaterialProperty ( const std::string &  name)
protectedinherited
Returns
The default material property with the name name, if any.

"Default" properties are properties whose default values are set from within the name. That is, if we can cast name to a Real, and the prop type is a Real or RealVectorValue, we'll return said value.

Definition at line 750 of file MaterialPropertyInterface.h.

751{
752 if constexpr (std::is_same_v<T, Real> || std::is_same_v<T, RealVectorValue>)
753 {
754 std::istringstream ss(name);
755 Real real_value;
756
757 // check if the string parsed cleanly into a Real number
758 if (ss >> real_value && ss.eof())
759 {
760 using prop_type = GenericMaterialProperty<T, is_ad>;
761
762 const auto nqp = Moose::constMaxQpsPerElem;
763 auto & property =
764 _default_properties.emplace_back(std::make_unique<prop_type>(default_property_id));
765 auto & T_property = static_cast<prop_type &>(*property);
766
767 T_property.resize(nqp);
768 for (const auto qp : make_range(nqp))
769 T_property[qp] = real_value;
770
771 return &T_property;
772 }
773 }
774
775 return nullptr;
776}
typename GenericMaterialPropertyStruct< T, is_ad >::type GenericMaterialProperty
std::vector< std::unique_ptr< PropertyValue > > _default_properties
Storage vector for default properties.
static constexpr PropertyValue::id_type default_property_id
The material property ID for a default (parsed from input) property.
constexpr std::size_t constMaxQpsPerElem
This is used for places where we initialize some qp-sized data structures that would end up being siz...
Definition MooseTypes.h:258
IntRange< T > make_range(T beg, T end)

◆ defaultMaterialProperty()

template<typename T >
const MaterialProperty< T > * MaterialPropertyInterface::defaultMaterialProperty ( const std::string &  name)
inlineprotectedinherited

Definition at line 648 of file MaterialPropertyInterface.h.

649 {
650 return defaultGenericMaterialProperty<T, false>(name);
651 }

◆ faceVelocity()

virtual ADRealVectorValue AdvectionHDGAssemblyHelper::faceVelocity ( unsigned int  qp) const
protectedpure virtual
Returns
The velocity on the current face quadrature point

Implemented in AdvectionIPHDGAssemblyHelper.

Referenced by computeFlux(), and lmOutflow().

◆ getADMaterialProperty() [1/2]

template<typename T >
const ADMaterialProperty< T > & MaterialPropertyInterface::getADMaterialProperty ( const std::string &  name)
inlineinherited

Definition at line 115 of file MaterialPropertyInterface.h.

116 {
117 return getGenericMaterialProperty<T, true>(name, 0);
118 }

◆ getADMaterialProperty() [2/2]

template<typename T >
const ADMaterialProperty< T > & MaterialPropertyInterface::getADMaterialProperty ( const std::string &  name,
MaterialData material_data 
)
inlineinherited

Retrieve the AD property named "name" for the specified material_data.

state is the property state; 0 = current, 1 = old, 2 = older, etc.

Definition at line 476 of file MaterialPropertyInterface.h.

478 {
479 return getGenericMaterialProperty<T, true>(name, material_data, 0);
480 }

◆ getADMaterialPropertyByName() [1/2]

template<typename T >
const ADMaterialProperty< T > & MaterialPropertyInterface::getADMaterialPropertyByName ( const MaterialPropertyName &  name)
inlineinherited

Definition at line 152 of file MaterialPropertyInterface.h.

153 {
154 return getGenericMaterialPropertyByName<T, true>(name, 0);
155 }

◆ getADMaterialPropertyByName() [2/2]

template<typename T >
const ADMaterialProperty< T > & MaterialPropertyInterface::getADMaterialPropertyByName ( const MaterialPropertyName &  name,
MaterialData material_data 
)
inlineinherited

Retrieve the AD property named "name" without any deduction for the specified \q material_data.

Definition at line 519 of file MaterialPropertyInterface.h.

521 {
522 return getGenericMaterialPropertyByName<T, true>(name, material_data, 0);
523 }

◆ getBlockMaterialProperty()

template<typename T >
std::pair< const MaterialProperty< T > *, std::set< SubdomainID > > MaterialPropertyInterface::getBlockMaterialProperty ( const MaterialPropertyName &  name)
inherited

Retrieve pointer to a material property with the mesh blocks where it is defined The name required by this method is the name defined in the input file.

This function can be thought as the combination of getMaterialPropertyByName and getMaterialPropertyBlocks. It can be called after the action of all actions.

Parameters
nameThe name of the material property to retrieve
Returns
Pointer to the material property with the name 'name' and the set of blocks where the property is valid

Definition at line 780 of file MaterialPropertyInterface.h.

781{
782 if (_mi_block_ids.empty())
783 mooseError("getBlockMaterialProperty must be called by a block restrictable object");
784
785 const auto name = _get_suffix.empty()
786 ? static_cast<const std::string &>(name_in)
787 : MooseUtils::join(std::vector<std::string>({name_in, _get_suffix}), "_");
788
789 using pair_type = std::pair<const MaterialProperty<T> *, std::set<SubdomainID>>;
790
791 if (!hasMaterialPropertyByName<T>(name))
792 return pair_type(nullptr, {});
793
794 // Call first so that the ID gets registered
795 const auto & prop = _material_data.getProperty<T, false>(name, 0, _mi_moose_object);
797 auto prop_blocks_pair = pair_type(&prop, std::move(blocks));
798
800
801 // Update consumed properties in MaterialPropertyDebugOutput
803
804 return prop_blocks_pair;
805}
char ** blocks
unsigned int getPropertyId(const std::string &prop_name) const
Wrapper for MaterialStorage::getPropertyId.
GenericMaterialProperty< T, is_ad > & getProperty(const std::string &prop_name, const unsigned int state, const MooseObject &requestor)
Retrieves a material property.
std::set< SubdomainID > getMaterialPropertyBlocks(const std::string &name)
Retrieve the block ids that the material property is defined.
std::unordered_set< unsigned int > _material_property_dependencies
The set of material properties (as given by their IDs) that this object depends on.
const MooseObjectName _mi_moose_object_name
The "complete" name of the object that this interface belongs for material property output.
MaterialData & _material_data
The material data class that stores properties.
const MooseObject & _mi_moose_object
The MooseObject creating the MaterialPropertyInterface.
void addConsumedPropertyName(const MooseObjectName &obj_name, const std::string &prop_name)
const MaterialPropertyName _get_suffix

◆ getFaceADMaterialProperty()

template<typename T >
const ADMaterialProperty< T > & ThreeMaterialPropertyInterface::getFaceADMaterialProperty ( const std::string &  name)
inherited

Retrieve the ADMaterialProperty named "name".

Definition at line 89 of file ThreeMaterialPropertyInterface.h.

90{
91 return getADMaterialProperty<T>(name, _face_material_data);
92}

◆ getFaceMaterialProperty()

template<typename T >
const MaterialProperty< T > & ThreeMaterialPropertyInterface::getFaceMaterialProperty ( const std::string &  name)
inherited

Retrieve the property deduced from the name name.

Definition at line 75 of file ThreeMaterialPropertyInterface.h.

76{
77 return getMaterialProperty<T>(name, _face_material_data);
78}

◆ getFaceMaterialPropertyByName()

template<typename T >
const MaterialProperty< T > & ThreeMaterialPropertyInterface::getFaceMaterialPropertyByName ( const std::string &  name)
inherited

Retrieve the property named "name" without any deduction.

Definition at line 82 of file ThreeMaterialPropertyInterface.h.

83{
84 return getMaterialPropertyByName<T>(name, _face_material_data);
85}

◆ getFaceMaterialPropertyOld()

template<typename T >
const MaterialProperty< T > & ThreeMaterialPropertyInterface::getFaceMaterialPropertyOld ( const std::string &  name)
inherited

Definition at line 96 of file ThreeMaterialPropertyInterface.h.

97{
98 return getMaterialPropertyOld<T>(name, _face_material_data);
99}

◆ getFaceMaterialPropertyOlder()

template<typename T >
const MaterialProperty< T > & ThreeMaterialPropertyInterface::getFaceMaterialPropertyOlder ( const std::string &  name)
inherited

Definition at line 103 of file ThreeMaterialPropertyInterface.h.

104{
105 return getMaterialPropertyOlder<T>(name, _face_material_data);
106}

◆ getGenericFaceMaterialProperty()

template<typename T , bool is_ad>
const auto & ThreeMaterialPropertyInterface::getGenericFaceMaterialProperty ( const std::string &  name)
inlineinherited

Retrieve the face material property whether AD or not.

Definition at line 61 of file ThreeMaterialPropertyInterface.h.

62 {
63 if constexpr (is_ad)
64 return getFaceADMaterialProperty<T>(name);
65 else
66 return getFaceMaterialProperty<T>(name);
67 }

◆ getGenericMaterialProperty() [1/2]

template<typename T , bool is_ad>
const GenericMaterialProperty< T, is_ad > & MaterialPropertyInterface::getGenericMaterialProperty ( const std::string &  name,
const unsigned int  state = 0 
)
inlineinherited

Retrieve reference to material property or one of it's old or older values.

The name required by this method is the name that is hard-coded into your source code as the input parameter key. If no input parameter is found this behaves like the getMaterialPropertyByName family as a fall back.

Parameters
nameThe name of the parameter key of the material property to retrieve
stateThe state (current = 0, old = 1, older = 2)
Returns
Reference to the desired material property

Definition at line 103 of file MaterialPropertyInterface.h.

105 {
106 return getGenericMaterialProperty<T, is_ad>(name, _material_data, state);
107 }

◆ getGenericMaterialProperty() [2/2]

template<typename T , bool is_ad>
const GenericMaterialProperty< T, is_ad > & MaterialPropertyInterface::getGenericMaterialProperty ( const std::string &  name,
MaterialData material_data,
const unsigned int  state = 0 
)
inherited

Retrieve the generic property named "name" for the specified material_data at state state.

Definition at line 921 of file MaterialPropertyInterface.h.

924{
925 // Check if the supplied parameter is a valid input parameter key
926 const auto prop_name = getMaterialPropertyName(name);
927
928 return getPossiblyConstantGenericMaterialPropertyByName<T, is_ad>(
929 prop_name, material_data, state);
930}
MaterialPropertyName getMaterialPropertyName(const std::string &name) const

◆ getGenericMaterialPropertyByName() [1/2]

template<typename T , bool is_ad>
const GenericMaterialProperty< T, is_ad > & MaterialPropertyInterface::getGenericMaterialPropertyByName ( const MaterialPropertyName &  name,
const unsigned int  state = 0 
)
inlineinherited

Retrieve reference to material property or its old or older value The name required by this method is the name defined in the input file.

Parameters
nameThe name of the material property to retrieve
stateThe state (current = 0, old = 1, older = 2)
Returns
Reference to the material property with the name 'name'

Definition at line 141 of file MaterialPropertyInterface.h.

142 {
143 return getGenericMaterialPropertyByName<T, is_ad>(name, _material_data, state);
144 }

◆ getGenericMaterialPropertyByName() [2/2]

template<typename T , bool is_ad>
const GenericMaterialProperty< T, is_ad > & MaterialPropertyInterface::getGenericMaterialPropertyByName ( const MaterialPropertyName &  name,
MaterialData material_data,
const unsigned int  state 
)
inherited

Retrieve the generic property named "name" without any deduction for the specified material_data for state state.

Definition at line 934 of file MaterialPropertyInterface.h.

937{
938#ifdef MOOSE_KOKKOS_ENABLED
941 "Attempted to retrieve a standard MOOSE material property from a Kokkos object.");
942#endif
943
945 {
946 if (state == 1)
947 return getGenericMaterialPropertyByName<T, is_ad>(
948 name_in + _interpolated_old, material_data, 0);
949 if (state == 2)
950 return getGenericMaterialPropertyByName<T, is_ad>(
951 name_in + _interpolated_older, material_data, 0);
952 }
953
954 const auto name = _get_suffix.empty()
955 ? static_cast<const std::string &>(name_in)
956 : MooseUtils::join(std::vector<std::string>({name_in, _get_suffix}), "_");
957
959 checkMaterialProperty(name, state);
960
961 // mark property as requested
963
964 // Update the boolean flag.
966
967 // Call first so that the ID gets registered
968 auto & prop = material_data.getProperty<T, is_ad>(name, state, _mi_moose_object);
969
970 // Does the material data used here matter?
971 _material_property_dependencies.insert(material_data.getPropertyId(name));
972
973 if (state == 0)
975
976 return prop;
977}
bool _get_material_property_called
Initialized to false.
static const std::string _interpolated_old
name suffixes for interpolated old and older properties
virtual void checkMaterialProperty(const std::string &name, const unsigned int state)
A helper method for checking material properties This method was required to avoid a compiler problem...
static const std::string _interpolated_older
const bool _is_kokkos_object
Whether the MOOSE object is a Kokkos object.
void markMatPropRequested(const std::string &)
A proxy method for _mi_feproblem.markMatPropRequested(name)
const bool _use_interpolated_state
Use the interpolated state set up through the ProjectedStatefulMaterialStorageAction.
void checkExecutionStage()
Check and throw an error if the execution has progressed past the construction stage.
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...
Definition MooseBase.h:271

◆ getGenericNeighborMaterialProperty()

template<typename T , bool is_ad>
const GenericMaterialProperty< T, is_ad > & TwoMaterialPropertyInterface::getGenericNeighborMaterialProperty ( const std::string &  name,
const unsigned int  state = 0 
)
inlineinherited

Retrieve the neighbor property deduced from the name name.

state is the property state; 0 = current, 1 = old, 2 = older, etc.

Definition at line 39 of file TwoMaterialPropertyInterface.h.

40 {
41 return getGenericMaterialProperty<T, is_ad>(name, _neighbor_material_data, state);
42 }

◆ getGenericNeighborMaterialPropertyByName()

template<typename T , bool is_ad>
const GenericMaterialProperty< T, is_ad > & TwoMaterialPropertyInterface::getGenericNeighborMaterialPropertyByName ( const std::string &  name,
const unsigned int  state = 0 
)
inlineinherited

Retrieve the neighbor property named "name" without any deduction.

state is the property state; 0 = current, 1 = old, 2 = older, etc.

Definition at line 74 of file TwoMaterialPropertyInterface.h.

75 {
76 return getGenericMaterialPropertyByName<T, is_ad>(name, _neighbor_material_data, state);
77 }

◆ getGenericOptionalMaterialProperty()

template<typename T , bool is_ad>
const GenericOptionalMaterialProperty< T, is_ad > & MaterialPropertyInterface::getGenericOptionalMaterialProperty ( const std::string &  name,
const unsigned int  state = 0 
)
inherited

Optional material property getters state is the property state; 0 = current, 1 = old, 2 = older, etc.

Definition at line 886 of file MaterialPropertyInterface.h.

888{
889 auto proxy = std::make_unique<OptionalMaterialPropertyProxy<MaterialPropertyInterface, T, is_ad>>(
890 name, state);
891 auto & optional_property = proxy->value();
892 _optional_property_proxies.push_back(std::move(proxy));
893 return optional_property;
894}
std::vector< std::unique_ptr< OptionalMaterialPropertyProxyBase< MaterialPropertyInterface > > > _optional_property_proxies
optional material properties

◆ getGenericZeroMaterialProperty() [1/2]

template<typename T , bool is_ad>
const GenericMaterialProperty< T, is_ad > & MaterialPropertyInterface::getGenericZeroMaterialProperty ( )
inherited

Return a constant zero anonymous material property.

Definition at line 847 of file MaterialPropertyInterface.h.

848{
849 // static zero property storage
851
852 // resize to accomodate maximum number of qpoints
853 // (in multiapp scenarios getMaxQps can return different values in each app; we need the max)
854 unsigned int nqp = getMaxQps();
855 if (nqp > zero.size())
856 zero.resize(nqp);
857
858 // set values for all qpoints to zero
859 for (unsigned int qp = 0; qp < nqp; ++qp)
861
862 return zero;
863}
static constexpr PropertyValue::id_type zero_property_id
The material property ID for a zero property.
void mooseSetToZero(T &v)
Helper function templates to set a variable to zero.
Definition MathUtils.h:373
const Number zero

◆ getGenericZeroMaterialProperty() [2/2]

template<typename T , bool is_ad>
const GenericMaterialProperty< T, is_ad > & MaterialPropertyInterface::getGenericZeroMaterialProperty ( const std::string &  name)
inherited

Return a material property that is initialized to zero by default and does not need to (but can) be declared by another material.

Definition at line 828 of file MaterialPropertyInterface.h.

829{
830 const auto prop_name = getMaterialPropertyName(name);
831 return getGenericZeroMaterialPropertyByName<T, is_ad>(prop_name);
832}

◆ getGenericZeroMaterialPropertyByName()

template<typename T , bool is_ad>
const GenericMaterialProperty< T, is_ad > & MaterialPropertyInterface::getGenericZeroMaterialPropertyByName ( const std::string &  prop_name)
inherited

Definition at line 836 of file MaterialPropertyInterface.h.

837{
838 // if found return the requested property
839 if (hasGenericMaterialPropertyByName<T, is_ad>(prop_name))
840 return getGenericMaterialPropertyByName<T, is_ad>(prop_name);
841
842 return getGenericZeroMaterialProperty<T, is_ad>();
843}

◆ getKokkosBlockMaterialProperty()

template<typename T , unsigned int dimension, unsigned int state>
std::pair< Moose::Kokkos::MaterialProperty< T, dimension >, std::set< SubdomainID > > MaterialPropertyInterface::getKokkosBlockMaterialProperty ( const MaterialPropertyName &  name)
inherited

Retrieve a Kokkos material property with the mesh blocks where it is defined NOTE: This is not a drop-in replacement of getBlockMaterialProperty().

Unlike the original API, this function cannot be called after object construction

Template Parameters
TThe property data type
dimensionThe property dimension
stateThe property state
Parameters
nameThe name of the material property to retrieve
Returns
The Kokkos material property with the name 'name' and the set of blocks where the property is valid

Definition at line 1047 of file MaterialPropertyInterface.h.

1048{
1049 if (!_is_kokkos_object)
1051 "Attempted to retrieve a Kokkos material property from a standard MOOSE object.");
1052
1053 if (_mi_block_ids.empty())
1054 mooseError("getKokkosBlockMaterialProperty must be called by a block restrictable object");
1055
1056 const auto name = _get_suffix.empty()
1057 ? static_cast<const std::string &>(name_in)
1058 : MooseUtils::join(std::vector<std::string>({name_in, _get_suffix}), "_");
1059
1060 using pair_type = std::pair<Moose::Kokkos::MaterialProperty<T, dimension>, std::set<SubdomainID>>;
1061
1062 if (!hasKokkosMaterialPropertyByName<T, dimension>(name))
1063 return pair_type(Moose::Kokkos::MaterialProperty<T, dimension>(), {});
1064
1066
1067 // Mark property as requested
1069
1070 // Call first so that the ID gets registered
1071 auto prop = _material_data.getKokkosProperty<T, dimension, state>(name);
1072 auto blocks = getMaterialPropertyBlocks(name);
1073 auto prop_blocks_pair = pair_type(prop, std::move(blocks));
1074
1076
1077 // Update consumed properties in MaterialPropertyDebugOutput
1078 if constexpr (state == 0)
1080
1081 getKokkosMaterialPropertyHook(name_in, state);
1082
1083 return prop_blocks_pair;
1084}
Moose::Kokkos::MaterialProperty< T, dimension > getKokkosProperty(const std::string &prop_name)
Get a Kokkos material property.
virtual void getKokkosMaterialPropertyHook(const std::string &, const unsigned int)
A virtual method that can be overriden by Kokkos objects to insert additional operations in getKokkos...
The Kokkos material property class.

◆ getKokkosMaterialProperty()

template<typename T , unsigned int dimension = 0, unsigned int state = 0>
Moose::Kokkos::MaterialProperty< T, dimension > MaterialPropertyInterface::getKokkosMaterialProperty ( const std::string &  name)
inlineinherited

Get a Kokkos material property for any state.

Template Parameters
TThe property data type
dimensionThe property dimension
stateThe property state
Parameters
nameThe property name or the parameter name containing the property name
Returns
The Kokkos material property

Definition at line 215 of file MaterialPropertyInterface.h.

216 {
217 return getKokkosMaterialPropertyByName<T, dimension, state>(getMaterialPropertyName(name));
218 }

◆ getKokkosMaterialPropertyByName()

template<typename T , unsigned int dimension, unsigned int state>
Moose::Kokkos::MaterialProperty< T, dimension > MaterialPropertyInterface::getKokkosMaterialPropertyByName ( const std::string &  prop_name_in)
inherited

Get a Kokkos material property by property name for any state.

Template Parameters
TThe property data type
dimensionThe property dimension
stateThe property state
Parameters
prop_name_inThe property name
Returns
The Kokkos material property

Definition at line 1001 of file MaterialPropertyInterface.h.

1002{
1003 if (!_is_kokkos_object)
1005 "Attempted to retrieve a Kokkos material property from a standard MOOSE object.");
1006
1007 if constexpr (std::is_same_v<T, Real>)
1008 {
1009 std::istringstream ss(prop_name_in);
1010 Real value;
1011
1012 // Check if the string parsed cleanly into a Real number
1013 if (ss >> value && ss.eof())
1015 }
1016
1017 const auto prop_name =
1018 _get_suffix.empty()
1019 ? static_cast<const std::string &>(prop_name_in)
1020 : MooseUtils::join(std::vector<std::string>({prop_name_in, _get_suffix}), "_");
1021
1023 checkMaterialProperty(prop_name, state);
1024
1025 // Mark property as requested
1026 markMatPropRequested(prop_name);
1027
1028 // Update the boolean flag
1030
1031 // Call first so that the ID gets registered
1032 auto prop = _material_data.getKokkosProperty<T, dimension, state>(prop_name);
1033
1034 // Does the material data used here matter?
1036
1037 if constexpr (state == 0)
1039
1040 getKokkosMaterialPropertyHook(prop_name_in, state);
1041
1042 return prop;
1043}
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)

◆ getKokkosMaterialPropertyHook()

virtual void MaterialPropertyInterface::getKokkosMaterialPropertyHook ( const std::string &  ,
const unsigned int   
)
inlineprotectedvirtualinherited

A virtual method that can be overriden by Kokkos objects to insert additional operations in getKokkosMaterialProperty.

Parameters
prop_name_inThe property name
stateThe property state

Reimplemented in Moose::Kokkos::AuxKernel, and Moose::Kokkos::Material.

Definition at line 616 of file MaterialPropertyInterface.h.

618 {
619 }

Referenced by MaterialPropertyInterface::getKokkosBlockMaterialProperty(), and MaterialPropertyInterface::getKokkosMaterialPropertyByName().

◆ getKokkosMaterialPropertyOld()

template<typename T , unsigned int dimension = 0>
Moose::Kokkos::MaterialProperty< T, dimension > MaterialPropertyInterface::getKokkosMaterialPropertyOld ( const std::string &  name)
inlineinherited

Get an old Kokkos material property.

Template Parameters
TThe property data type
dimensionThe property dimension
Parameters
nameThe property name or the parameter name containing the property name
Returns
The Kokkos material property

Definition at line 228 of file MaterialPropertyInterface.h.

229 {
230 return getKokkosMaterialPropertyByName<T, dimension, 1>(getMaterialPropertyName(name));
231 }

◆ getKokkosMaterialPropertyOldByName()

template<typename T , unsigned int dimension = 0>
Moose::Kokkos::MaterialProperty< T, dimension > MaterialPropertyInterface::getKokkosMaterialPropertyOldByName ( const std::string &  prop_name)
inlineinherited

Get an old Kokkos material property by property name.

Template Parameters
TThe property data type
dimensionThe property dimension
Parameters
prop_nameThe property name
Returns
The Kokkos material property

Definition at line 189 of file MaterialPropertyInterface.h.

190 {
191 return getKokkosMaterialPropertyByName<T, dimension, 1>(prop_name);
192 }

◆ getKokkosMaterialPropertyOlder()

template<typename T , unsigned int dimension = 0>
Moose::Kokkos::MaterialProperty< T, dimension > MaterialPropertyInterface::getKokkosMaterialPropertyOlder ( const std::string &  name)
inlineinherited

Get an older Kokkos material property.

Template Parameters
TThe property data type
dimensionThe property dimension
Parameters
nameThe property name or the parameter name containing the property name
Returns
The Kokkos material property

Definition at line 241 of file MaterialPropertyInterface.h.

242 {
243 return getKokkosMaterialPropertyByName<T, dimension, 2>(getMaterialPropertyName(name));
244 }

◆ getKokkosMaterialPropertyOlderByName()

template<typename T , unsigned int dimension = 0>
Moose::Kokkos::MaterialProperty< T, dimension > MaterialPropertyInterface::getKokkosMaterialPropertyOlderByName ( const std::string &  prop_name)
inlineinherited

Get an older Kokkos material property by property name.

Template Parameters
TThe property data type
dimensionThe property dimension
Parameters
prop_nameThe property name
Returns
The Kokkos material property

Definition at line 202 of file MaterialPropertyInterface.h.

203 {
204 return getKokkosMaterialPropertyByName<T, dimension, 2>(prop_name);
205 }

◆ getMaterial()

MaterialBase & MaterialPropertyInterface::getMaterial ( const std::string &  name)
inherited

Return a MaterialBase reference - usable for computing directly.

Parameters
nameThe name of the input parameter or explicit material name.
no_warnIf true, suppress warning about retrieving the material potentially during its calculation. If you don't know what this is/means, then you don't need it.

Definition at line 227 of file MaterialPropertyInterface.C.

228{
229 return getMaterialByName(_mi_params.get<MaterialName>(name));
230}
std::vector< std::pair< R1, R2 > > get(const std::string &param1, const std::string &param2) const
Combine two vector parameters into a single vector of pairs.
MaterialBase & getMaterialByName(const std::string &name, bool no_warn=false)

◆ getMaterialByName()

MaterialBase & MaterialPropertyInterface::getMaterialByName ( const std::string &  name,
bool  no_warn = false 
)
inherited

Definition at line 233 of file MaterialPropertyInterface.C.

234{
235 std::shared_ptr<MaterialBase> discrete =
237
239 return *discrete;
240}
std::shared_ptr< MaterialBase > getMaterial(std::string name, Moose::MaterialDataType type, const THREAD_ID tid=0, bool no_warn=false)
Return a pointer to a MaterialBase object.
void checkBlockAndBoundaryCompatibility(std::shared_ptr< MaterialBase > discrete)
Check if block and boundary restrictions of a given material are compatible with the current material...

Referenced by ElementMaterialSampler::ElementMaterialSampler(), MaterialPropertyInterface::getMaterial(), and Material::getMaterialByName().

◆ getMaterialDataType()

Moose::MaterialDataType MaterialPropertyInterface::getMaterialDataType ( const std::set< BoundaryID > &  boundary_ids) const
privateinherited
Returns
The MaterialDataType given the interface's parameters

Definition at line 275 of file MaterialPropertyInterface.C.

276{
277 if (_mi_params.isParamValid("_material_data_type"))
278 return _mi_params.get<Moose::MaterialDataType>("_material_data_type");
279 if (moose::internal::boundaryRestricted(boundary_ids))
282}
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another,...
MaterialDataType
MaterialData types.
Definition MooseTypes.h:746
@ BOUNDARY_MATERIAL_DATA
Definition MooseTypes.h:748
@ BLOCK_MATERIAL_DATA
Definition MooseTypes.h:747
bool boundaryRestricted(const std::set< BoundaryID > &boundary_ids)

◆ getMaterialProperty() [1/2]

template<typename T >
const MaterialProperty< T > & MaterialPropertyInterface::getMaterialProperty ( const std::string &  name,
const unsigned int  state = 0 
)
inlineinherited

Definition at line 109 of file MaterialPropertyInterface.h.

111 {
112 return getGenericMaterialProperty<T, false>(name, state);
113 }

◆ getMaterialProperty() [2/2]

template<typename T >
const MaterialProperty< T > & MaterialPropertyInterface::getMaterialProperty ( const std::string &  name,
MaterialData material_data,
const unsigned int  state = 0 
)
inlineinherited

Retrieve the property named "name" for the specified material_data.

state is the property state; 0 = current, 1 = old, 2 = older, etc.

Definition at line 463 of file MaterialPropertyInterface.h.

466 {
467 return getGenericMaterialProperty<T, false>(name, material_data, state);
468 }

◆ getMaterialPropertyBlockNames()

std::vector< SubdomainName > MaterialPropertyInterface::getMaterialPropertyBlockNames ( const std::string &  name)
inherited

Retrieve the block names that the material property is defined.

Parameters
nameThe name of the material property
Returns
A vector the the block names for the property

Definition at line 124 of file MaterialPropertyInterface.C.

125{
127}
virtual std::vector< SubdomainName > getMaterialPropertyBlockNames(const std::string &prop_name)
Get a vector of block id equivalences that the material property is defined on.
Definition SubProblem.C:490

◆ getMaterialPropertyBlocks()

std::set< SubdomainID > MaterialPropertyInterface::getMaterialPropertyBlocks ( const std::string &  name)
inherited

Retrieve the block ids that the material property is defined.

Parameters
nameThe name of the material property
Returns
A vector the the block ids for the property

Definition at line 118 of file MaterialPropertyInterface.C.

119{
121}
virtual std::set< SubdomainID > getMaterialPropertyBlocks(const std::string &prop_name)
Get a vector containing the block ids the material property is defined on.
Definition SubProblem.C:474

Referenced by MaterialPropertyInterface::getBlockMaterialProperty(), and MaterialPropertyInterface::getKokkosBlockMaterialProperty().

◆ getMaterialPropertyBoundaryIDs()

std::set< BoundaryID > MaterialPropertyInterface::getMaterialPropertyBoundaryIDs ( const std::string &  name)
inherited

Retrieve the boundary ids that the material property is defined.

Parameters
nameThe name of the material property
Returns
A vector the the boundary ids for the property

Definition at line 130 of file MaterialPropertyInterface.C.

131{
133}
virtual std::set< BoundaryID > getMaterialPropertyBoundaryIDs(const std::string &prop_name)
Get a vector containing the block ids the material property is defined on.
Definition SubProblem.C:526

◆ getMaterialPropertyBoundaryNames()

std::vector< BoundaryName > MaterialPropertyInterface::getMaterialPropertyBoundaryNames ( const std::string &  name)
inherited

Retrieve the boundary namess that the material property is defined.

Parameters
nameThe name of the material property
Returns
A vector the the boundary names for the property

Definition at line 136 of file MaterialPropertyInterface.C.

137{
139}
virtual std::vector< BoundaryName > getMaterialPropertyBoundaryNames(const std::string &prop_name)
Get a vector of block id equivalences that the material property is defined on.
Definition SubProblem.C:542

◆ getMaterialPropertyByName() [1/2]

template<typename T >
const MaterialProperty< T > & MaterialPropertyInterface::getMaterialPropertyByName ( const MaterialPropertyName &  name,
const unsigned int  state = 0 
)
inlineinherited

Definition at line 146 of file MaterialPropertyInterface.h.

148 {
149 return getGenericMaterialPropertyByName<T, false>(name, state);
150 }

◆ getMaterialPropertyByName() [2/2]

template<typename T >
const MaterialProperty< T > & MaterialPropertyInterface::getMaterialPropertyByName ( const MaterialPropertyName &  name,
MaterialData material_data,
const unsigned int  state = 0 
)
inlineinherited

Retrieve the property named "name" without any deduction for the specified material_data.

state is the property state; 0 = current, 1 = old, 2 = older, etc.

Definition at line 507 of file MaterialPropertyInterface.h.

510 {
511 return getGenericMaterialPropertyByName<T, false>(name, material_data, state);
512 }

◆ getMaterialPropertyCalled()

virtual bool MaterialPropertyInterface::getMaterialPropertyCalled ( ) const
inlinevirtualinherited

◆ getMaterialPropertyName()

MaterialPropertyName MaterialPropertyInterface::getMaterialPropertyName ( const std::string &  name) const
protectedinherited
Returns
The name of the material property associated with name name.

If name is the name of a material property parameter and the parameter is valid, this will return the value of said parameter. Otherwise, it will just return the name.

Definition at line 110 of file MaterialPropertyInterface.C.

111{
112 if (_mi_params.have_parameter<MaterialPropertyName>(name) && _mi_params.isParamValid(name))
113 return _mi_params.get<MaterialPropertyName>(name);
114 return name;
115}
bool have_parameter(std::string_view name) const
A wrapper around the Parameters base class method.

Referenced by InterfaceMaterial::getGenericMaterialProperty(), Material::getGenericMaterialProperty(), MaterialPropertyInterface::getGenericMaterialProperty(), InterfaceMaterial::getGenericNeighborMaterialProperty(), MaterialPropertyInterface::getGenericZeroMaterialProperty(), MaterialPropertyInterface::getKokkosMaterialProperty(), MaterialPropertyInterface::getKokkosMaterialPropertyOld(), MaterialPropertyInterface::getKokkosMaterialPropertyOlder(), MaterialPropertyInterface::hasADMaterialProperty(), MaterialPropertyInterface::hasKokkosMaterialProperty(), and MaterialPropertyInterface::hasMaterialProperty().

◆ getMaterialPropertyOld() [1/2]

template<typename T >
const MaterialProperty< T > & MaterialPropertyInterface::getMaterialPropertyOld ( const std::string &  name)
inlineinherited

Definition at line 120 of file MaterialPropertyInterface.h.

121 {
122 return getMaterialProperty<T>(name, 1);
123 }

◆ getMaterialPropertyOld() [2/2]

template<typename T >
const MaterialProperty< T > & MaterialPropertyInterface::getMaterialPropertyOld ( const std::string &  name,
MaterialData material_data 
)
inlineinherited

Retrieve the old property deduced from the name name for the specified material_data.

Definition at line 529 of file MaterialPropertyInterface.h.

531 {
532 return getMaterialProperty<T>(name, material_data, 1);
533 }

◆ getMaterialPropertyOldByName() [1/2]

template<typename T >
const MaterialProperty< T > & MaterialPropertyInterface::getMaterialPropertyOldByName ( const MaterialPropertyName &  name)
inlineinherited

Definition at line 157 of file MaterialPropertyInterface.h.

158 {
159 return getMaterialPropertyByName<T>(name, 1);
160 }

◆ getMaterialPropertyOldByName() [2/2]

template<typename T >
const MaterialProperty< T > & MaterialPropertyInterface::getMaterialPropertyOldByName ( const MaterialPropertyName &  name,
MaterialData material_data 
)
inlineinherited

Retrieve the old property named name without any deduction for the specified material_data.

Definition at line 551 of file MaterialPropertyInterface.h.

553 {
554 return getMaterialPropertyByName<T>(name, material_data, 1);
555 }

◆ getMaterialPropertyOlder() [1/2]

template<typename T >
const MaterialProperty< T > & MaterialPropertyInterface::getMaterialPropertyOlder ( const std::string &  name)
inlineinherited

Definition at line 125 of file MaterialPropertyInterface.h.

126 {
127 return getMaterialProperty<T>(name, 2);
128 }

◆ getMaterialPropertyOlder() [2/2]

template<typename T >
const MaterialProperty< T > & MaterialPropertyInterface::getMaterialPropertyOlder ( const std::string &  name,
MaterialData material_data 
)
inlineinherited

Retrieve the older property deduced from the name name for the specified material_data.

Definition at line 540 of file MaterialPropertyInterface.h.

542 {
543 return getMaterialProperty<T>(name, material_data, 2);
544 }

◆ getMaterialPropertyOlderByName() [1/2]

template<typename T >
const MaterialProperty< T > & MaterialPropertyInterface::getMaterialPropertyOlderByName ( const MaterialPropertyName &  name)
inlineinherited

Definition at line 162 of file MaterialPropertyInterface.h.

163 {
164 return getMaterialPropertyByName<T>(name, 2);
165 }

◆ getMaterialPropertyOlderByName() [2/2]

template<typename T >
const MaterialProperty< T > & MaterialPropertyInterface::getMaterialPropertyOlderByName ( const MaterialPropertyName &  name,
MaterialData material_data 
)
inlineinherited

Retrieve the older property named name without any deduction for the specified material_data.

Definition at line 562 of file MaterialPropertyInterface.h.

564 {
565 return getMaterialPropertyByName<T>(name, material_data, 2);
566 }

◆ getMatPropDependencies()

virtual const std::unordered_set< unsigned int > & MaterialPropertyInterface::getMatPropDependencies ( ) const
inlinevirtualinherited

◆ getMaxQps()

unsigned int MaterialPropertyInterface::getMaxQps ( ) const
privateinherited

Definition at line 142 of file MaterialPropertyInterface.C.

143{
144 return _mi_feproblem.getMaxQps();
145}
unsigned int getMaxQps() const

Referenced by MaterialPropertyInterface::getGenericZeroMaterialProperty().

◆ getNeighborADMaterialProperty()

template<typename T >
const ADMaterialProperty< T > & TwoMaterialPropertyInterface::getNeighborADMaterialProperty ( const std::string &  name)
inlineinherited

Definition at line 50 of file TwoMaterialPropertyInterface.h.

51 {
52 return getGenericNeighborMaterialProperty<T, true>(name, 0);
53 }

◆ getNeighborADMaterialPropertyByName()

template<typename T >
const ADMaterialProperty< T > & TwoMaterialPropertyInterface::getNeighborADMaterialPropertyByName ( const std::string &  name)
inlineinherited

Definition at line 85 of file TwoMaterialPropertyInterface.h.

86 {
87 return getGenericNeighborMaterialPropertyByName<T, true>(name, 0);
88 }

◆ getNeighborMaterialProperty()

template<typename T >
const MaterialProperty< T > & TwoMaterialPropertyInterface::getNeighborMaterialProperty ( const std::string &  name,
const unsigned int  state = 0 
)
inlineinherited

Definition at line 44 of file TwoMaterialPropertyInterface.h.

46 {
47 return getGenericNeighborMaterialProperty<T, false>(name, state);
48 }

◆ getNeighborMaterialPropertyByName()

template<typename T >
const MaterialProperty< T > & TwoMaterialPropertyInterface::getNeighborMaterialPropertyByName ( const std::string &  name,
const unsigned int  state = 0 
)
inlineinherited

Definition at line 79 of file TwoMaterialPropertyInterface.h.

81 {
82 return getGenericNeighborMaterialPropertyByName<T, false>(name, state);
83 }

◆ getNeighborMaterialPropertyOld()

template<typename T >
const MaterialProperty< T > & TwoMaterialPropertyInterface::getNeighborMaterialPropertyOld ( const std::string &  name)
inlineinherited

Definition at line 55 of file TwoMaterialPropertyInterface.h.

56 {
57 return getGenericNeighborMaterialProperty<T, false>(name, 1);
58 }

◆ getNeighborMaterialPropertyOlder()

template<typename T >
const MaterialProperty< T > & TwoMaterialPropertyInterface::getNeighborMaterialPropertyOlder ( const std::string &  name)
inlineinherited

Definition at line 60 of file TwoMaterialPropertyInterface.h.

61 {
62 return getGenericNeighborMaterialProperty<T, false>(name, 2);
63 }

◆ getOptionalADMaterialProperty()

template<typename T >
const OptionalADMaterialProperty< T > & MaterialPropertyInterface::getOptionalADMaterialProperty ( const std::string &  name)
inlineinherited

Definition at line 260 of file MaterialPropertyInterface.h.

261 {
262 return getGenericOptionalMaterialProperty<T, true>(name);
263 }

◆ getOptionalMaterialProperty()

template<typename T >
const OptionalMaterialProperty< T > & MaterialPropertyInterface::getOptionalMaterialProperty ( const std::string &  name,
const unsigned int  state = 0 
)
inlineinherited

Definition at line 254 of file MaterialPropertyInterface.h.

256 {
257 return getGenericOptionalMaterialProperty<T, false>(name, state);
258 }

◆ getOptionalMaterialPropertyOld()

template<typename T >
const OptionalMaterialProperty< T > & MaterialPropertyInterface::getOptionalMaterialPropertyOld ( const std::string &  name)
inlineinherited

Definition at line 266 of file MaterialPropertyInterface.h.

267 {
268 return getOptionalMaterialProperty<T>(name, 1);
269 }

◆ getOptionalMaterialPropertyOlder()

template<typename T >
const OptionalMaterialProperty< T > & MaterialPropertyInterface::getOptionalMaterialPropertyOlder ( const std::string &  name)
inlineinherited

Definition at line 271 of file MaterialPropertyInterface.h.

272 {
273 return getOptionalMaterialProperty<T>(name, 2);
274 }

◆ getPossiblyConstantGenericMaterialPropertyByName()

template<typename T , bool is_ad>
const GenericMaterialProperty< T, is_ad > & MaterialPropertyInterface::getPossiblyConstantGenericMaterialPropertyByName ( const MaterialPropertyName &  prop_name,
MaterialData material_data,
const unsigned int  state 
)
inherited

Retrieve the generic property named "prop_name" without any deduction for the specified material_data for state state.

This API allows the prop_name to be a constant, e.g. it allows the possibility that prop_name is not a name at all

Definition at line 898 of file MaterialPropertyInterface.h.

900{
901 // Check if it's just a constant
902 if (const auto * default_property = defaultGenericMaterialProperty<T, is_ad>(prop_name))
903 {
905 return *default_property;
906 }
907
908 if (state > 0 && !_stateful_allowed)
909 mooseError("Stateful material properties not allowed for this object."
910 " State ",
911 state,
912 " property for \"",
913 prop_name,
914 "\" was requested.");
915
916 return this->getGenericMaterialPropertyByName<T, is_ad>(prop_name, material_data, state);
917}

◆ getZeroMaterialProperty()

template<typename T , typename... Ts>
const MaterialProperty< T > & MaterialPropertyInterface::getZeroMaterialProperty ( Ts...  args)
inlineinherited

for backwards compatibility

Definition at line 327 of file MaterialPropertyInterface.h.

328 {
329 return getGenericZeroMaterialProperty<T, false>(args...);
330 }

◆ hasADMaterialProperty()

template<typename T >
bool MaterialPropertyInterface::hasADMaterialProperty ( const std::string &  name)
inherited

Definition at line 867 of file MaterialPropertyInterface.h.

868{
869 // Check if the supplied parameter is a valid input parameter key
870 const auto prop_name = getMaterialPropertyName(name);
871 return hasADMaterialPropertyByName<T>(prop_name);
872}

◆ hasADMaterialPropertyByName()

template<typename T >
bool MaterialPropertyInterface::hasADMaterialPropertyByName ( const std::string &  name)
inherited

Definition at line 876 of file MaterialPropertyInterface.h.

877{
878 const auto name = _get_suffix.empty()
879 ? name_in
880 : MooseUtils::join(std::vector<std::string>({name_in, _get_suffix}), "_");
882}
bool haveADProperty(const std::string &prop_name) const
Returns true if the AD material property exists - defined by any material.

◆ hasGenericMaterialProperty()

template<typename T , bool is_ad>
bool MaterialPropertyInterface::hasGenericMaterialProperty ( const std::string &  name)
inlineinherited

generic hasMaterialProperty helper

Definition at line 407 of file MaterialPropertyInterface.h.

408 {
409 if constexpr (is_ad)
410 return hasADMaterialProperty<T>(name);
411 else
412 return hasMaterialProperty<T>(name);
413 }

◆ hasGenericMaterialPropertyByName()

template<typename T , bool is_ad>
bool MaterialPropertyInterface::hasGenericMaterialPropertyByName ( const std::string &  name)
inlineinherited

Definition at line 415 of file MaterialPropertyInterface.h.

416 {
417 if constexpr (is_ad)
418 return hasADMaterialPropertyByName<T>(name);
419 else
420 return hasMaterialPropertyByName<T>(name);
421 }

◆ hasKokkosMaterialProperty()

template<typename T , unsigned int dimension>
bool MaterialPropertyInterface::hasKokkosMaterialProperty ( const std::string &  name)
inherited

Definition at line 982 of file MaterialPropertyInterface.h.

983{
984 // Check if the supplied parameter is a valid input parameter key
985 const auto prop_name = getMaterialPropertyName(name);
986 return hasKokkosMaterialPropertyByName<T, dimension>(prop_name);
987}

◆ hasKokkosMaterialPropertyByName()

template<typename T , unsigned int dimension>
bool MaterialPropertyInterface::hasKokkosMaterialPropertyByName ( const std::string &  name)
inherited

Definition at line 991 of file MaterialPropertyInterface.h.

992{
993 const auto name = _get_suffix.empty()
994 ? name_in
995 : MooseUtils::join(std::vector<std::string>({name_in, _get_suffix}), "_");
996 return _material_data.haveKokkosProperty<T, dimension>(name);
997}
bool haveKokkosProperty(const std::string &prop_name) const
Get whether a Kokkos material property exists.

◆ hasMaterialProperty()

template<typename T >
bool MaterialPropertyInterface::hasMaterialProperty ( const std::string &  name)
inherited

Check if the material property exists.

Parameters
namethe name of the property to query
Returns
true if the property exists, otherwise false

Definition at line 809 of file MaterialPropertyInterface.h.

810{
811 // Check if the supplied parameter is a valid input parameter key
812 const auto prop_name = getMaterialPropertyName(name);
813 return hasMaterialPropertyByName<T>(prop_name);
814}

◆ hasMaterialPropertyByName()

template<typename T >
bool MaterialPropertyInterface::hasMaterialPropertyByName ( const std::string &  name)
inherited

Definition at line 818 of file MaterialPropertyInterface.h.

819{
820 const auto name = _get_suffix.empty()
821 ? name_in
822 : MooseUtils::join(std::vector<std::string>({name_in, _get_suffix}), "_");
824}
bool haveProperty(const std::string &prop_name) const
Returns true if the regular material property exists - defined by any material.

◆ lmDirichlet()

void ElementAndTraceScalarHDGAssemblyHelper::lmDirichlet ( const Moose::Functor< Real > &  dirichlet_value)
inherited

Enforces a Dirichlet value in the facet equation.

Definition at line 83 of file ElementAndTraceScalarHDGAssemblyHelper.C.

84{
85 for (const auto qp : make_range(_qrule_face->n_points()))
86 {
87 const auto scalar_value = dirichlet_value(
90
91 for (const auto i : index_range(_lm_re))
92 _lm_re(i) += _JxW_face[qp] * (_lm_u_sol[qp] - scalar_value) * _lm_phi_face[i][qp];
93 }
94}
const MooseArray< Point > & _q_point_face
Physical face quadrature points.
DenseVector< ADReal > _lm_re
Residual for the facet trace equation.
const TransientInterface & _ti
Transient state used to evaluate boundary functors.
const MooseArray< ADReal > & _lm_u_sol
Facet trace values at face quadrature points.
const MooseArray< std::vector< Real > > & _lm_phi_face
Facet trace test functions evaluated on a face.
const unsigned int & _current_side
Current element-side index.
const libMesh::QBase *const & _qrule_face
Face quadrature rule.
const MooseArray< Real > & _JxW_face
Face quadrature weights including the transformed Jacobian.
Moose::StateArg determineState() const
Create a functor state argument that corresponds to the implicit state of this object.
auto index_range(const T &sizable)
Argument for requesting functor evaluation at quadrature point locations on an element side.

Referenced by IPHDGDirichletBC::compute().

◆ lmFace()

void AdvectionHDGAssemblyHelper::lmFace ( )
overridevirtual

Assembles the facet equation's interior-face contribution.

Implements ElementAndTraceScalarHDGAssemblyHelper.

Definition at line 78 of file AdvectionHDGAssemblyHelper.C.

79{
80 for (const auto qp : make_range(_qrule_face->n_points()))
81 {
82 const auto qp_term = _JxW_face[qp] * computeFlux(qp, _lm_u_sol[qp]);
83 for (const auto i : index_range(_lm_re))
84 _lm_re(i) -= _lm_phi_face[i][qp] * qp_term;
85 }
86}
ADReal computeFlux(unsigned int qp, const ADReal &face_value) const
Computes the upwind face flux.

◆ lmOutflow()

void AdvectionHDGAssemblyHelper::lmOutflow ( )

Prescribes an outflow condition for the facet scalar.

Definition at line 103 of file AdvectionHDGAssemblyHelper.C.

104{
105 for (const auto qp : make_range(_qrule_face->n_points()))
106 {
107#ifndef NDEBUG
108 const auto vdotn = faceVelocity(qp) * _normals[qp];
109 mooseAssert(MetaPhysicL::raw_value(vdotn) >= 0, "The velocity must create outflow conditions");
110#endif
111 const auto qp_term = _JxW_face[qp] * _coeff * (_lm_u_sol[qp] - _u_sol[qp]);
112 for (const auto i : index_range(_lm_re))
113 // Force the facet solution to be equivalent to the interior solution.
114 _lm_re(i) += _lm_phi_face[i][qp] * qp_term;
115 }
116}
auto raw_value(const Eigen::Map< T > &in)

◆ lmPrescribedFlux()

void ElementAndTraceScalarHDGAssemblyHelper::lmPrescribedFlux ( const Moose::Functor< Real > &  flux_value)
inherited

Applies a prescribed flux in the facet equation.

Definition at line 97 of file ElementAndTraceScalarHDGAssemblyHelper.C.

98{
99 for (const auto qp : make_range(_qrule_face->n_points()))
100 {
101 const auto flux = flux_value(
104
105 for (const auto i : index_range(_lm_re))
106 _lm_re(i) += _JxW_face[qp] * flux * _lm_phi_face[i][qp];
107 }
108}

Referenced by IPHDGPrescribedFluxBC::compute().

◆ markMatPropRequested()

void MaterialPropertyInterface::markMatPropRequested ( const std::string &  name)
protectedinherited

A proxy method for _mi_feproblem.markMatPropRequested(name)

Definition at line 172 of file MaterialPropertyInterface.C.

173{
175}
virtual void markMatPropRequested(const std::string &)
Helper method for adding a material property name to the _material_property_requested set.
Definition SubProblem.C:725

Referenced by MaterialPropertyInterface::getGenericMaterialPropertyByName(), MaterialPropertyInterface::getKokkosBlockMaterialProperty(), and MaterialPropertyInterface::getKokkosMaterialPropertyByName().

◆ resizeResiduals()

void ElementAndTraceScalarHDGAssemblyHelper::resizeResiduals ( )
inlineinherited

Resizes the element-interior and facet residual vectors for the current element.

Definition at line 163 of file ElementAndTraceScalarHDGAssemblyHelper.h.

164{
165 _scalar_re.resize(_u_dof_indices.size());
166 _lm_re.resize(_lm_u_dof_indices.size());
167}
const std::vector< dof_id_type > & _lm_u_dof_indices
Degree-of-freedom indices for the facet trace.
DenseVector< ADReal > _scalar_re
Residual for the element-interior scalar equation.
const std::vector< dof_id_type > & _u_dof_indices
Degree-of-freedom indices for the element-interior scalar.

Referenced by ElementAndTraceScalarHDGKernel::compute(), IPHDGDirichletBC::compute(), IPHDGPrescribedFluxBC::compute(), and ElementAndTraceScalarHDGKernel::computeOnSide().

◆ resolveOptionalProperties()

void MaterialPropertyInterface::resolveOptionalProperties ( )
virtualinherited

resolve all optional properties

Reimplemented in Material.

Definition at line 268 of file MaterialPropertyInterface.C.

269{
270 for (auto & proxy : _optional_property_proxies)
271 proxy->resolve(*this);
272}

◆ scalarDirichlet()

void AdvectionHDGAssemblyHelper::scalarDirichlet ( const Moose::Functor< Real > &  dirichlet_value)
overridevirtual

Assembles the element-interior equation on a Dirichlet boundary.

Implements ElementAndTraceScalarHDGAssemblyHelper.

Definition at line 89 of file AdvectionHDGAssemblyHelper.C.

90{
91 for (const auto qp : make_range(_qrule_face->n_points()))
92 {
93 const auto dirichlet_value = dirichlet_functor(
96 const auto qp_term = _JxW_face[qp] * computeFlux(qp, dirichlet_value);
97 for (const auto i : index_range(_scalar_re))
98 _scalar_re(i) += _scalar_phi_face[i][qp] * qp_term;
99 }
100}
const MooseArray< std::vector< Real > > & _scalar_phi_face
Element-interior scalar test functions evaluated on a face.

◆ scalarFace()

void AdvectionHDGAssemblyHelper::scalarFace ( )
overridevirtual

Assembles the element-interior equation's face contribution.

Implements ElementAndTraceScalarHDGAssemblyHelper.

Definition at line 67 of file AdvectionHDGAssemblyHelper.C.

68{
69 for (const auto qp : make_range(_qrule_face->n_points()))
70 {
71 const auto qp_term = _JxW_face[qp] * computeFlux(qp, _lm_u_sol[qp]);
72 for (const auto i : index_range(_scalar_re))
73 _scalar_re(i) += _scalar_phi_face[i][qp] * qp_term;
74 }
75}

◆ scalarVolume()

void AdvectionHDGAssemblyHelper::scalarVolume ( )
overridevirtual

Assembles the element-interior equation's volume contribution.

Implements ElementAndTraceScalarHDGAssemblyHelper.

Definition at line 45 of file AdvectionHDGAssemblyHelper.C.

46{
47 for (const auto qp : make_range(_qrule->n_points()))
48 {
49 const auto advected_quantity = _coeff * _u_sol[qp];
50 const auto qp_term = _JxW[qp] * _velocity[qp] * advected_quantity;
51 for (const auto i : index_range(_scalar_re))
52 _scalar_re(i) -= _grad_scalar_phi[i][qp] * qp_term;
53 }
54}
const MooseArray< Real > & _JxW
Element quadrature weights including the transformed Jacobian.
const libMesh::QBase *const & _qrule
Element quadrature rule.
const MooseArray< std::vector< RealVectorValue > > & _grad_scalar_phi
Gradients of the element-interior scalar test functions.

◆ statefulPropertiesAllowed()

void MaterialPropertyInterface::statefulPropertiesAllowed ( bool  stateful_allowed)
inherited

Derived classes can declare whether or not they work with stateful material properties.

See, for example, DiracKernel. By default, they are allowed.

Definition at line 178 of file MaterialPropertyInterface.C.

179{
180 _stateful_allowed = stateful_allowed;
181}

Referenced by ADDiracKernel::ADDiracKernel(), DiracKernelBase::DiracKernelBase(), and DiracKernelTempl< T >::DiracKernelTempl().

◆ taggingData()

std::array< ADResidualsPacket, 2 > ElementAndTraceScalarHDGAssemblyHelper::taggingData ( ) const
inherited
Returns
The residuals and degree of freedom indices on which this helper operates

Definition at line 70 of file ElementAndTraceScalarHDGAssemblyHelper.C.

71{
74}
const MooseVariableFE< Real > & _u_var
Element-interior scalar variable.
void scalingFactor(const std::vector< Real > &factor)
Set the scaling factor for this variable.
Utility structure for packaging up all of the residual object's information needed to add into the sy...

◆ validParams()

InputParameters AdvectionHDGAssemblyHelper::validParams ( )
static

Definition at line 18 of file AdvectionHDGAssemblyHelper.C.

19{
21 params.addRequiredParam<MaterialPropertyName>(
22 "velocity", "The cell-interior velocity material property used in the volume advection term");
23 params.addRequiredParam<Real>(
24 "coeff", "Constant coefficient multiplying the advected scalar, such as density");
25 return params;
26}

Referenced by AdvectionIPHDGAssemblyHelper::validParams().

Member Data Documentation

◆ _coeff

const Real AdvectionHDGAssemblyHelper::_coeff
protected

Constant coefficient multiplying the advected scalar, such as density.

Definition at line 59 of file AdvectionHDGAssemblyHelper.h.

Referenced by computeFlux(), lmOutflow(), and scalarVolume().

◆ _current_elem

const Elem* const& ElementAndTraceScalarHDGAssemblyHelper::_current_elem
protectedinherited

◆ _current_side

const unsigned int& ElementAndTraceScalarHDGAssemblyHelper::_current_side
protectedinherited

◆ _current_side_elem

const Elem* const& ElementAndTraceScalarHDGAssemblyHelper::_current_side_elem
protectedinherited

Current side element.

Definition at line 132 of file ElementAndTraceScalarHDGAssemblyHelper.h.

◆ _default_properties

std::vector<std::unique_ptr<PropertyValue> > MaterialPropertyInterface::_default_properties
protectedinherited

Storage vector for default properties.

Definition at line 678 of file MaterialPropertyInterface.h.

Referenced by MaterialPropertyInterface::defaultGenericMaterialProperty().

◆ _elem_volume

const Real& ElementAndTraceScalarHDGAssemblyHelper::_elem_volume
protectedinherited

Current element volume.

Definition at line 120 of file ElementAndTraceScalarHDGAssemblyHelper.h.

◆ _face_material_data

MaterialData& ThreeMaterialPropertyInterface::_face_material_data
protectedinherited

◆ _get_material_property_called

bool MaterialPropertyInterface::_get_material_property_called
protectedinherited

◆ _get_suffix

const MaterialPropertyName MaterialPropertyInterface::_get_suffix
protectedinherited

◆ _grad_scalar_phi

const MooseArray<std::vector<RealVectorValue> >& ElementAndTraceScalarHDGAssemblyHelper::_grad_scalar_phi
protectedinherited

Gradients of the element-interior scalar test functions.

Definition at line 111 of file ElementAndTraceScalarHDGAssemblyHelper.h.

Referenced by scalarVolume(), and DiffusionIPHDGAssemblyHelper::scalarVolume().

◆ _interpolated_old

const std::string MaterialPropertyInterface::_interpolated_old = "_interpolated_old"
staticprotectedinherited

name suffixes for interpolated old and older properties

Definition at line 689 of file MaterialPropertyInterface.h.

Referenced by MaterialPropertyInterface::getGenericMaterialPropertyByName(), and Material::getGenericMaterialPropertyByName().

◆ _interpolated_older

const std::string MaterialPropertyInterface::_interpolated_older = "_interpolated_older"
staticprotectedinherited

◆ _is_kokkos_object

const bool MaterialPropertyInterface::_is_kokkos_object
protectedinherited

◆ _JxW

const MooseArray<Real>& ElementAndTraceScalarHDGAssemblyHelper::_JxW
protectedinherited

Element quadrature weights including the transformed Jacobian.

Definition at line 135 of file ElementAndTraceScalarHDGAssemblyHelper.h.

Referenced by scalarVolume(), and DiffusionIPHDGAssemblyHelper::scalarVolume().

◆ _JxW_face

const MooseArray<Real>& ElementAndTraceScalarHDGAssemblyHelper::_JxW_face
protectedinherited

◆ _lm_phi_face

const MooseArray<std::vector<Real> >& ElementAndTraceScalarHDGAssemblyHelper::_lm_phi_face
protectedinherited

◆ _lm_re

DenseVector<ADReal> ElementAndTraceScalarHDGAssemblyHelper::_lm_re
protectedinherited

◆ _lm_u_dof_indices

const std::vector<dof_id_type>& ElementAndTraceScalarHDGAssemblyHelper::_lm_u_dof_indices
protectedinherited

◆ _lm_u_sol

const MooseArray<ADReal>& ElementAndTraceScalarHDGAssemblyHelper::_lm_u_sol
protectedinherited

◆ _material_data

MaterialData& MaterialPropertyInterface::_material_data
protectedinherited

◆ _material_data_type

const Moose::MaterialDataType MaterialPropertyInterface::_material_data_type
protectedinherited

◆ _material_property_dependencies

std::unordered_set<unsigned int> MaterialPropertyInterface::_material_property_dependencies
protectedinherited

◆ _mi_block_ids

const std::set<SubdomainID>& MaterialPropertyInterface::_mi_block_ids
privateinherited

◆ _mi_boundary_ids

const std::set<BoundaryID>& MaterialPropertyInterface::_mi_boundary_ids
privateinherited

◆ _mi_boundary_restricted

const bool MaterialPropertyInterface::_mi_boundary_restricted
privateinherited

BoundaryRestricted flag.

Definition at line 710 of file MaterialPropertyInterface.h.

Referenced by MaterialPropertyInterface::checkMaterialProperty().

◆ _mi_feproblem

FEProblemBase& MaterialPropertyInterface::_mi_feproblem
protectedinherited

◆ _mi_moose_object

const MooseObject& MaterialPropertyInterface::_mi_moose_object
privateinherited

◆ _mi_moose_object_name

const MooseObjectName MaterialPropertyInterface::_mi_moose_object_name
protectedinherited

◆ _mi_name

const std::string MaterialPropertyInterface::_mi_name
protectedinherited

The name of the object that this interface belongs to.

Definition at line 577 of file MaterialPropertyInterface.h.

Referenced by MaterialPropertyInterface::checkMaterialProperty().

◆ _mi_params

const InputParameters& MaterialPropertyInterface::_mi_params
protectedinherited

◆ _mi_subproblem

SubProblem& MaterialPropertyInterface::_mi_subproblem
protectedinherited

Reference to the subproblem.

Definition at line 586 of file MaterialPropertyInterface.h.

◆ _mi_tid

const THREAD_ID MaterialPropertyInterface::_mi_tid
protectedinherited

◆ _neighbor_material_data

MaterialData& TwoMaterialPropertyInterface::_neighbor_material_data
protectedinherited

◆ _normals

const MooseArray<Point>& ElementAndTraceScalarHDGAssemblyHelper::_normals
protectedinherited

◆ _optional_property_proxies

std::vector<std::unique_ptr<OptionalMaterialPropertyProxyBase<MaterialPropertyInterface> > > MaterialPropertyInterface::_optional_property_proxies
privateinherited

◆ _q_point

const MooseArray<Point>& ElementAndTraceScalarHDGAssemblyHelper::_q_point
protectedinherited

Physical element quadrature points.

Definition at line 141 of file ElementAndTraceScalarHDGAssemblyHelper.h.

◆ _q_point_face

const MooseArray<Point>& ElementAndTraceScalarHDGAssemblyHelper::_q_point_face
protectedinherited

◆ _qrule

const libMesh::QBase* const& ElementAndTraceScalarHDGAssemblyHelper::_qrule
protectedinherited

Element quadrature rule.

Definition at line 138 of file ElementAndTraceScalarHDGAssemblyHelper.h.

Referenced by scalarVolume(), and DiffusionIPHDGAssemblyHelper::scalarVolume().

◆ _qrule_face

const libMesh::QBase* const& ElementAndTraceScalarHDGAssemblyHelper::_qrule_face
protectedinherited

◆ _scalar_phi

const MooseArray<std::vector<Real> >& ElementAndTraceScalarHDGAssemblyHelper::_scalar_phi
protectedinherited

Element-interior scalar test functions.

Definition at line 108 of file ElementAndTraceScalarHDGAssemblyHelper.h.

◆ _scalar_phi_face

const MooseArray<std::vector<Real> >& ElementAndTraceScalarHDGAssemblyHelper::_scalar_phi_face
protectedinherited

Element-interior scalar test functions evaluated on a face.

Definition at line 114 of file ElementAndTraceScalarHDGAssemblyHelper.h.

Referenced by scalarDirichlet(), DiffusionIPHDGAssemblyHelper::scalarDirichlet(), scalarFace(), and DiffusionIPHDGAssemblyHelper::scalarFace().

◆ _scalar_re

DenseVector<ADReal> ElementAndTraceScalarHDGAssemblyHelper::_scalar_re
protectedinherited

◆ _side_area

const Real& ElementAndTraceScalarHDGAssemblyHelper::_side_area
protectedinherited

Current side area.

Definition at line 123 of file ElementAndTraceScalarHDGAssemblyHelper.h.

◆ _stateful_allowed

bool MaterialPropertyInterface::_stateful_allowed
protectedinherited

True by default.

If false, this class throws an error if any of the stateful material properties interfaces are used.

Definition at line 668 of file MaterialPropertyInterface.h.

Referenced by MaterialPropertyInterface::getPossiblyConstantGenericMaterialPropertyByName(), and MaterialPropertyInterface::statefulPropertiesAllowed().

◆ _ti

const TransientInterface& ElementAndTraceScalarHDGAssemblyHelper::_ti
protectedinherited

◆ _u_dof_indices

const std::vector<dof_id_type>& ElementAndTraceScalarHDGAssemblyHelper::_u_dof_indices
protectedinherited

◆ _u_face_var

const MooseVariableFE<Real>& ElementAndTraceScalarHDGAssemblyHelper::_u_face_var
protectedinherited

◆ _u_sol

const MooseArray<ADReal>& ElementAndTraceScalarHDGAssemblyHelper::_u_sol
protectedinherited

◆ _u_var

const MooseVariableFE<Real>& ElementAndTraceScalarHDGAssemblyHelper::_u_var
protectedinherited

◆ _use_interpolated_state

const bool MaterialPropertyInterface::_use_interpolated_state
protectedinherited

◆ _velocity

const ADMaterialProperty<RealVectorValue>& AdvectionHDGAssemblyHelper::_velocity
protected

Cell-interior velocity used in the volume advection term.

Definition at line 56 of file AdvectionHDGAssemblyHelper.h.

Referenced by scalarVolume().

◆ default_property_id

constexpr PropertyValue::id_type MaterialPropertyInterface::default_property_id
staticconstexprinherited
Initial value:
=
static constexpr id_type invalid_property_id
The material property ID for an invalid property We only have this because there are a few cases wher...

The material property ID for a default (parsed from input) property.

Definition at line 87 of file MaterialPropertyInterface.h.

Referenced by MaterialPropertyInterface::defaultGenericMaterialProperty().

◆ zero_property_id

constexpr PropertyValue::id_type MaterialPropertyInterface::zero_property_id = PropertyValue::invalid_property_id - 2
staticconstexprinherited

The material property ID for a zero property.

Definition at line 90 of file MaterialPropertyInterface.h.

Referenced by MaterialBase::getGenericZeroMaterialProperty(), and MaterialPropertyInterface::getGenericZeroMaterialProperty().


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