https://mooseframework.inl.gov
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
IPHDGAssemblyHelper Class Referenceabstract

Base class that declares all the methods for assembling a hybridized interior penalty discontinuous Galerkin (IPDG-H), which is a type of HDG method, discretization of an equation. More...

#include <IPHDGAssemblyHelper.h>

Inheritance diagram for IPHDGAssemblyHelper:
[legend]

Public Member Functions

 IPHDGAssemblyHelper (const MooseObject *const moose_obj, MooseVariableDependencyInterface *const mvdi, const TransientInterface *const ti, SystemBase &sys, const Assembly &assembly, const THREAD_ID tid, const std::set< SubdomainID > &blocks_ids, const std::set< BoundaryID > &boundary_ids)
 
void resizeResiduals ()
 
virtual void scalarVolume ()=0
 
virtual void scalarFace ()=0
 
virtual void lmFace ()=0
 
virtual void scalarDirichlet (const Moose::Functor< Real > &dirichlet_value)=0
 
void lmDirichlet (const Moose::Functor< Real > &dirichlet_value)
 
void lmPrescribedFlux (const Moose::Functor< Real > &flux_value)
 
std::array< ADResidualsPacket, 2 > taggingData () const
 
std::set< std::string > additionalROVariables ()
 
virtual ~IPHDGAssemblyHelper ()=default
 
template<typename T >
const MaterialProperty< T > & getFaceMaterialProperty (const std::string &name)
 Retrieve the property deduced from the name name. More...
 
template<typename T >
const MaterialProperty< T > & getFaceMaterialPropertyByName (const std::string &name)
 Retrieve the property named "name" without any deduction. More...
 
template<typename T >
const ADMaterialProperty< T > & getFaceADMaterialProperty (const std::string &name)
 Retrieve the ADMaterialProperty named "name". More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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 material_data. More...
 
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. More...
 
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. More...
 
template<typename T , unsigned int dimension = 0, unsigned int state = 0>
Moose::Kokkos::MaterialProperty< T, dimension > getKokkosMaterialPropertyByName (const std::string &prop_name)
 Get a Kokkos material property by property name for any state. More...
 
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. More...
 
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. More...
 
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. More...
 
template<typename T , unsigned int dimension = 0>
Moose::Kokkos::MaterialProperty< T, dimension > getKokkosMaterialPropertyOld (const std::string &name)
 Get an old Kokkos material property. More...
 
template<typename T , unsigned int dimension = 0>
Moose::Kokkos::MaterialProperty< T, dimension > getKokkosMaterialPropertyOlder (const std::string &name)
 Get an older Kokkos material property. More...
 
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. More...
 
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. More...
 
template<typename T , bool is_ad>
const GenericMaterialProperty< T, is_ad > & getGenericZeroMaterialProperty ()
 Return a constant zero anonymous material property. More...
 
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 More...
 
std::set< SubdomainIDgetMaterialPropertyBlocks (const std::string &name)
 Retrieve the block ids that the material property is defined. More...
 
std::vector< SubdomainName > getMaterialPropertyBlockNames (const std::string &name)
 Retrieve the block names that the material property is defined. More...
 
std::set< BoundaryIDgetMaterialPropertyBoundaryIDs (const std::string &name)
 Retrieve the boundary ids that the material property is defined. More...
 
std::vector< BoundaryName > getMaterialPropertyBoundaryNames (const std::string &name)
 Retrieve the boundary namess that the material property is defined. More...
 
void checkBlockAndBoundaryCompatibility (std::shared_ptr< MaterialBase > discrete)
 Check if block and boundary restrictions of a given material are compatible with the current material. More...
 
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 More...
 
void statefulPropertiesAllowed (bool)
 Derived classes can declare whether or not they work with stateful material properties. More...
 
bool getMaterialPropertyCalled () const
 Returns true if getMaterialProperty() has been called, false otherwise. More...
 
virtual const std::unordered_set< unsigned int > & getMatPropDependencies () const
 Retrieve the set of material properties that this object depends on. More...
 
virtual void resolveOptionalProperties ()
 resolve all optional properties More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
MaterialBasegetMaterialByName (const std::string &name, bool no_warn=false)
 
template<typename T >
bool hasMaterialProperty (const std::string &name)
 Check if the material property exists. More...
 
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 More...
 
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. More...
 
static constexpr PropertyValue::id_type zero_property_id = PropertyValue::invalid_property_id - 2
 The material property ID for a zero property. More...
 

Protected Member Functions

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. More...
 
void markMatPropRequested (const std::string &)
 A proxy method for _mi_feproblem.markMatPropRequested(name) More...
 
MaterialPropertyName getMaterialPropertyName (const std::string &name) const
 
void checkExecutionStage ()
 Check and throw an error if the execution has progressed past the construction stage. More...
 
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 TransientInterface_ti
 
const MooseVariableFE< Real > & _u_var
 
const MooseVariableFE< Real > & _u_face_var
 
const std::vector< dof_id_type > & _u_dof_indices
 
const std::vector< dof_id_type > & _lm_u_dof_indices
 
const MooseArray< ADReal > & _u_sol
 
const MooseArray< ADRealVectorValue > & _grad_u_sol
 
const MooseArray< ADReal > & _lm_u_sol
 
const MooseArray< std::vector< Real > > & _scalar_phi
 
const MooseArray< std::vector< RealVectorValue > > & _grad_scalar_phi
 
const MooseArray< std::vector< Real > > & _scalar_phi_face
 
const MooseArray< std::vector< RealVectorValue > > & _grad_scalar_phi_face
 
const MooseArray< std::vector< Real > > & _lm_phi_face
 
const Real_elem_volume
 The current element volume. More...
 
const Real_side_area
 The current element side area. More...
 
const Elem *const & _ip_current_elem
 The current element. More...
 
const unsigned int_ip_current_side
 The current element side. More...
 
const MooseArray< Real > & _ip_JxW
 The element JxW. More...
 
const QBase *const & _ip_qrule
 The element qrule. More...
 
const MooseArray< Point > & _ip_q_point
 The physical quadrature point locations in the element volume. More...
 
const MooseArray< Real > & _ip_JxW_face
 The face JxW. More...
 
const QBase *const & _ip_qrule_face
 The face qrule. More...
 
const MooseArray< Point > & _ip_q_point_face
 The physical quadrature point locations on the face. More...
 
const MooseArray< Point > & _ip_normals
 The normal vector on the face. More...
 
DenseVector< ADReal_scalar_re
 
DenseVector< ADReal_lm_re
 
MaterialData_face_material_data
 
MaterialData_neighbor_material_data
 
const InputParameters_mi_params
 Parameters of the object with this interface. More...
 
const std::string _mi_name
 The name of the object that this interface belongs to. More...
 
const MooseObjectName _mi_moose_object_name
 The "complete" name of the object that this interface belongs for material property output. More...
 
FEProblemBase_mi_feproblem
 Reference to the FEProblemBase class. More...
 
SubProblem_mi_subproblem
 Reference to the subproblem. More...
 
const THREAD_ID _mi_tid
 Current threaded it. More...
 
const bool _is_kokkos_object
 Whether the MOOSE object is a Kokkos object. More...
 
const Moose::MaterialDataType _material_data_type
 The type of data. More...
 
MaterialData_material_data
 The material data class that stores properties. More...
 
bool _stateful_allowed
 True by default. More...
 
bool _get_material_property_called
 Initialized to false. More...
 
std::vector< std::unique_ptr< PropertyValue > > _default_properties
 Storage vector for default properties. More...
 
std::unordered_set< unsigned int_material_property_dependencies
 The set of material properties (as given by their IDs) that this object depends on. More...
 
const MaterialPropertyName _get_suffix
 
const bool _use_interpolated_state
 Use the interpolated state set up through the ProjectedStatefulMaterialStorageAction. More...
 

Static Protected Attributes

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

Detailed Description

Base class that declares all the methods for assembling a hybridized interior penalty discontinuous Galerkin (IPDG-H), which is a type of HDG method, discretization of an equation.

These routines may be called by both HDG kernels and integrated boundary conditions.

Definition at line 41 of file IPHDGAssemblyHelper.h.

Constructor & Destructor Documentation

◆ IPHDGAssemblyHelper()

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

Definition at line 31 of file IPHDGAssemblyHelper.C.

39  : ThreeMaterialPropertyInterface(moose_obj, block_ids, boundary_ids),
40  _ti(*ti),
41  _u_var(sys.getFieldVariable<Real>(tid, moose_obj->getParam<NonlinearVariableName>("variable"))),
42  _u_face_var(sys.getFieldVariable<Real>(
43  tid, moose_obj->getParam<NonlinearVariableName>("face_variable"))),
46  _u_sol(_u_var.adSln()),
54  _elem_volume(assembly.elemVolume()),
55  _side_area(assembly.sideElemVolume()),
56  _ip_current_elem(assembly.elem()),
57  _ip_current_side(assembly.side()),
58  _ip_JxW(assembly.JxW()),
59  _ip_qrule(assembly.qRule()),
60  _ip_q_point(assembly.qPoints()),
61  _ip_JxW_face(assembly.JxWFace()),
62  _ip_qrule_face(assembly.qRuleFace()),
63  _ip_q_point_face(assembly.qPointsFace()),
64  _ip_normals(assembly.normals())
65 {
68 }
const Elem *const & elem() const
Return the current element.
Definition: Assembly.h:414
const T & getParam(const std::string &name) const
Retrieve a parameter for the object.
Definition: MooseBase.h:388
const libMesh::QBase *const & qRuleFace() const
Returns the reference to the current quadrature being used on a current face.
Definition: Assembly.h:322
const MooseArray< ADRealVectorValue > & _grad_u_sol
const unsigned int & _ip_current_side
The current element side.
const MooseArray< std::vector< RealVectorValue > > & _grad_scalar_phi
const MooseArray< std::vector< Real > > & _lm_phi_face
const MooseArray< Point > & qPoints() const
Returns the reference to the quadrature points.
Definition: Assembly.h:258
const QBase *const & _ip_qrule_face
The face qrule.
const TransientInterface & _ti
const Elem *const & _ip_current_elem
The current element.
const MooseArray< Real > & _ip_JxW
The element JxW.
const std::vector< dof_id_type > & _u_dof_indices
const MooseVariableFE< Real > & _u_var
const std::vector< dof_id_type > & dofIndices() const final
Get local DoF indices.
const MooseVariableFE< Real > & _u_face_var
const MooseArray< Point > & normals() const
Returns the array of normals for quadrature points on a current side.
Definition: Assembly.h:357
const MooseArray< Point > & _ip_normals
The normal vector on the face.
const FieldVariablePhiValue & phi() const override
Return the variable&#39;s elemental shape functions.
const QBase *const & _ip_qrule
The element qrule.
const MooseArray< Point > & _ip_q_point_face
The physical quadrature point locations on the face.
const Real & _elem_volume
The current element volume.
const ADTemplateVariableValue< OutputType > & adSln() const override
AD.
const MooseArray< ADReal > & _lm_u_sol
const MooseArray< Real > & JxW() const
Returns the reference to the transformed jacobian weights.
Definition: Assembly.h:276
const MooseArray< Real > & JxWFace() const
Returns the reference to the transformed jacobian weights on a current face.
Definition: Assembly.h:351
const std::vector< dof_id_type > & _lm_u_dof_indices
void addMooseVariableDependency(MooseVariableFieldBase *var)
Call this function to add the passed in MooseVariableFieldBase as a variable that this object depends...
const Real & _side_area
The current element side area.
const MooseArray< ADReal > & _u_sol
const ADTemplateVariableGradient< OutputType > & adGradSln() const override
AD grad solution getter.
MooseVariableFE< T > & getFieldVariable(THREAD_ID tid, const std::string &var_name)
Gets a reference to a variable of with specified name.
Definition: SystemBase.C:111
const MooseArray< Real > & _ip_JxW_face
The face JxW.
const MooseArray< std::vector< Real > > & _scalar_phi_face
const MooseArray< Point > & qPointsFace() const
Returns the reference to the current quadrature being used.
Definition: Assembly.h:345
const MooseArray< std::vector< RealVectorValue > > & _grad_scalar_phi_face
const libMesh::QBase *const & qRule() const
Returns the reference to the current quadrature being used.
Definition: Assembly.h:235
const FieldVariablePhiValue & phiFace() const override final
Return the variable&#39;s shape functions on an element face.
const MooseArray< Point > & _ip_q_point
The physical quadrature point locations in the element volume.
const Real & elemVolume() const
Returns the reference to the current element volume.
Definition: Assembly.h:440
const unsigned int & side() const
Returns the current side.
Definition: Assembly.h:446
const FieldVariablePhiGradient & gradPhi() const override final
Return the gradients of the variable&#39;s elemental shape functions.
ThreeMaterialPropertyInterface(const MooseObject *moose_object, const std::set< SubdomainID > &blocks_ids, const std::set< BoundaryID > &boundary_ids)
const Real & sideElemVolume() const
Returns the reference to the volume of current side element.
Definition: Assembly.h:464
const FieldVariablePhiGradient & gradPhiFace() const override final
Return the gradients of the variable&#39;s shape functions on an element face.
const MooseArray< std::vector< Real > > & _scalar_phi

◆ ~IPHDGAssemblyHelper()

virtual IPHDGAssemblyHelper::~IPHDGAssemblyHelper ( )
virtualdefault

Member Function Documentation

◆ additionalROVariables()

std::set< std::string > IPHDGAssemblyHelper::additionalROVariables ( )
Returns
The LM facet variable as a set

Definition at line 78 of file IPHDGAssemblyHelper.C.

Referenced by IPHDGKernel::additionalROVariables().

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

◆ 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 245 of file MaterialPropertyInterface.C.

246 {
247  std::unordered_map<SubdomainID, std::vector<MaterialBase *>> required_mats;
248  const auto & mwh = _mi_feproblem.getMaterialWarehouse();
249  for (const auto id : _mi_block_ids)
250  {
251  const auto & mats = mwh[_material_data_type].getActiveBlockObjects(id, _mi_tid);
252  std::array<const MaterialPropertyInterface *, 1> consumers = {{this}};
253  const auto block_required =
254  MaterialBase::buildRequiredMaterials(consumers, mats, allow_stateful);
255  required_mats[id].insert(
256  required_mats[id].begin(), block_required.begin(), block_required.end());
257  }
258  return required_mats;
259 }
FEProblemBase & _mi_feproblem
Reference to the FEProblemBase class.
const THREAD_ID _mi_tid
Current threaded it.
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
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.
Definition: MaterialBase.h:535
const Moose::MaterialDataType _material_data_type
The type of data.

◆ 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 186 of file MaterialPropertyInterface.C.

Referenced by MaterialPropertyInterface::getMaterialByName().

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

◆ checkExecutionStage()

void MaterialPropertyInterface::checkExecutionStage ( )
protectedinherited

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

Definition at line 262 of file MaterialPropertyInterface.C.

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

263 {
265  mooseError("Material properties must be retrieved during object construction. This is a code "
266  "problem.");
267 }
FEProblemBase & _mi_feproblem
Reference to the FEProblemBase class.
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
virtual bool startedInitialSetup()
Returns true if we are in or beyond the initialSetup stage.

◆ 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 Material, Moose::Kokkos::Material< Derived >, and Moose::Kokkos::Material< KokkosGenericConstantMaterial >.

Definition at line 157 of file MaterialPropertyInterface.C.

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

158 {
159  if (state == 0)
160  {
161  // If the material property is boundary restrictable, add to the list of materials to check
163  for (const auto & bnd_id : _mi_boundary_ids)
165 
166  // The default is to assume block restrictions
167  else
168  for (const auto & blk_ids : _mi_block_ids)
170  }
171 }
FEProblemBase & _mi_feproblem
Reference to the FEProblemBase class.
const std::set< SubdomainID > & _mi_block_ids
Storage for the block ids created by BlockRestrictable.
virtual void storeSubdomainDelayedCheckMatProp(const std::string &requestor, SubdomainID block_id, const std::string &name)
Adds to a map based on block ids of material properties to validate.
Definition: SubProblem.C:607
const bool _mi_boundary_restricted
BoundaryRestricted flag.
virtual void storeBoundaryDelayedCheckMatProp(const std::string &requestor, BoundaryID boundary_id, const std::string &name)
Adds to a map based on boundary ids of material properties to validate.
Definition: SubProblem.C:615
const std::set< BoundaryID > & _mi_boundary_ids
Storage for the boundary ids created by BoundaryRestrictable.
const std::string _mi_name
The name of the object that this interface belongs to.

◆ defaultADMaterialProperty()

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

Definition at line 621 of file MaterialPropertyInterface.h.

622  {
623  return defaultGenericMaterialProperty<T, true>(name);
624  }
std::string name(const ElemQuality q)

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

719 {
720  if constexpr (std::is_same_v<T, Real> || std::is_same_v<T, RealVectorValue>)
721  {
722  std::istringstream ss(name);
723  Real real_value;
724 
725  // check if the string parsed cleanly into a Real number
726  if (ss >> real_value && ss.eof())
727  {
728  using prop_type = GenericMaterialProperty<T, is_ad>;
729 
730  const auto nqp = Moose::constMaxQpsPerElem;
731  auto & property =
732  _default_properties.emplace_back(std::make_unique<prop_type>(default_property_id));
733  auto & T_property = static_cast<prop_type &>(*property);
734 
735  T_property.resize(nqp);
736  for (const auto qp : make_range(nqp))
737  T_property[qp] = real_value;
738 
739  return &T_property;
740  }
741  }
742 
743  return nullptr;
744 }
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:230
std::vector< std::unique_ptr< PropertyValue > > _default_properties
Storage vector for default properties.
typename GenericMaterialPropertyStruct< T, is_ad >::type GenericMaterialProperty
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
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 616 of file MaterialPropertyInterface.h.

617  {
618  return defaultGenericMaterialProperty<T, false>(name);
619  }
std::string name(const ElemQuality q)

◆ 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  }
std::string name(const ElemQuality q)

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

461  {
462  return getGenericMaterialProperty<T, true>(name, material_data, 0);
463  }
std::string name(const ElemQuality q)

◆ 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  }
std::string name(const ElemQuality q)

◆ 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 material_data.

Definition at line 502 of file MaterialPropertyInterface.h.

504  {
505  return getGenericMaterialPropertyByName<T, true>(name, material_data, 0);
506  }
std::string name(const ElemQuality q)

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

749 {
750  const auto name = _get_suffix.empty()
751  ? static_cast<const std::string &>(name_in)
752  : MooseUtils::join(std::vector<std::string>({name_in, _get_suffix}), "_");
753 
754  if (_mi_block_ids.empty())
755  mooseError("getBlockMaterialProperty must be called by a block restrictable object");
756 
757  using pair_type = std::pair<const MaterialProperty<T> *, std::set<SubdomainID>>;
758 
759  if (!hasMaterialPropertyByName<T>(name))
760  return pair_type(nullptr, {});
761 
762  // Call first so that the ID gets registered
763  const auto & prop = _material_data.getProperty<T, false>(name, 0, _mi_moose_object);
764  auto blocks = getMaterialPropertyBlocks(name);
765  auto prop_blocks_pair = pair_type(&prop, std::move(blocks));
766 
768 
769  // Update consumed properties in MaterialPropertyDebugOutput
771 
772  return prop_blocks_pair;
773 }
std::string name(const ElemQuality q)
std::string join(Iterator begin, Iterator end, const std::string &delimiter)
Python-like join function for strings over an iterator range.
Definition: MooseUtils.h:142
const MooseObjectName _mi_moose_object_name
The "complete" name of the object that this interface belongs for material property output...
const std::set< SubdomainID > & _mi_block_ids
Storage for the block ids created by BlockRestrictable.
char ** blocks
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
unsigned int getPropertyId(const std::string &prop_name) const
Wrapper for MaterialStorage::getPropertyId.
Definition: MaterialData.C:80
MaterialData & _material_data
The material data class that stores properties.
std::set< SubdomainID > getMaterialPropertyBlocks(const std::string &name)
Retrieve the block ids that the material property is defined.
const MaterialPropertyName _get_suffix
GenericMaterialProperty< T, is_ad > & getProperty(const std::string &prop_name, const unsigned int state, const MooseObject &requestor)
Retrieves a material property.
Definition: MaterialData.h:127
void addConsumedPropertyName(const MooseObjectName &obj_name, const std::string &prop_name)
const MooseObject & _mi_moose_object
The MooseObject creating the MaterialPropertyInterface.
std::unordered_set< unsigned int > _material_property_dependencies
The set of material properties (as given by their IDs) that this object depends on.

◆ 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 }
std::string name(const ElemQuality q)

◆ 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 }
std::string name(const ElemQuality q)

◆ 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 }
std::string name(const ElemQuality q)

◆ 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 }
std::string name(const ElemQuality q)

◆ 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 }
std::string name(const ElemQuality q)

◆ 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  }
std::string name(const ElemQuality q)

◆ 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  }
std::string name(const ElemQuality q)
MaterialData & _material_data
The material data class that stores properties.

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

889 {
890  // Check if the supplied parameter is a valid input parameter key
891  const auto prop_name = getMaterialPropertyName(name);
892 
893  return getPossiblyConstantGenericMaterialPropertyByName<T, is_ad>(
894  prop_name, material_data, state);
895 }
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  }
std::string name(const ElemQuality q)
MaterialData & _material_data
The material data class that stores properties.

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

902 {
903  if (_is_kokkos_object)
904  mooseError("Attempted to retrieve a standard MOOSE material property from a Kokkos object.");
905 
907  {
908  if (state == 1)
909  return getGenericMaterialPropertyByName<T, is_ad>(
910  name_in + _interpolated_old, material_data, 0);
911  if (state == 2)
912  return getGenericMaterialPropertyByName<T, is_ad>(
913  name_in + _interpolated_older, material_data, 0);
914  }
915 
916  const auto name = _get_suffix.empty()
917  ? static_cast<const std::string &>(name_in)
918  : MooseUtils::join(std::vector<std::string>({name_in, _get_suffix}), "_");
919 
921  checkMaterialProperty(name, state);
922 
923  // mark property as requested
924  markMatPropRequested(name);
925 
926  // Update the boolean flag.
928 
929  // Call first so that the ID gets registered
930  auto & prop = material_data.getProperty<T, is_ad>(name, state, _mi_moose_object);
931 
932  // Does the material data used here matter?
933  _material_property_dependencies.insert(material_data.getPropertyId(name));
934 
935  if (state == 0)
937 
938  return prop;
939 }
std::string name(const ElemQuality q)
static const std::string _interpolated_old
name suffixes for interpolated old and older properties
std::string join(Iterator begin, Iterator end, const std::string &delimiter)
Python-like join function for strings over an iterator range.
Definition: MooseUtils.h:142
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...
const MooseObjectName _mi_moose_object_name
The "complete" name of the object that this interface belongs for material property output...
const bool _is_kokkos_object
Whether the MOOSE object is a Kokkos object.
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
static const std::string _interpolated_older
void markMatPropRequested(const std::string &)
A proxy method for _mi_feproblem.markMatPropRequested(name)
const MaterialPropertyName _get_suffix
const bool _use_interpolated_state
Use the interpolated state set up through the ProjectedStatefulMaterialStorageAction.
void addConsumedPropertyName(const MooseObjectName &obj_name, const std::string &prop_name)
bool _get_material_property_called
Initialized to false.
void checkExecutionStage()
Check and throw an error if the execution has progressed past the construction stage.
const MooseObject & _mi_moose_object
The MooseObject creating the MaterialPropertyInterface.
std::unordered_set< unsigned int > _material_property_dependencies
The set of material properties (as given by their IDs) that this object depends on.

◆ 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  }
std::string name(const ElemQuality q)

◆ 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  }
std::string name(const ElemQuality q)

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

856 {
857  auto proxy = std::make_unique<OptionalMaterialPropertyProxy<MaterialPropertyInterface, T, is_ad>>(
858  name, state);
859  auto & optional_property = proxy->value();
860  _optional_property_proxies.push_back(std::move(proxy));
861  return optional_property;
862 }
std::string name(const ElemQuality q)
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 ( 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 796 of file MaterialPropertyInterface.h.

797 {
798  const auto prop_name = getMaterialPropertyName(name);
799  return getGenericZeroMaterialPropertyByName<T, is_ad>(prop_name);
800 }
MaterialPropertyName getMaterialPropertyName(const std::string &name) const

◆ getGenericZeroMaterialProperty() [2/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 815 of file MaterialPropertyInterface.h.

816 {
817  // static zero property storage
819 
820  // resize to accomodate maximum number of qpoints
821  // (in multiapp scenarios getMaxQps can return different values in each app; we need the max)
822  unsigned int nqp = getMaxQps();
823  if (nqp > zero.size())
824  zero.resize(nqp);
825 
826  // set values for all qpoints to zero
827  for (unsigned int qp = 0; qp < nqp; ++qp)
828  MathUtils::mooseSetToZero(zero[qp]);
829 
830  return zero;
831 }
void mooseSetToZero(T &v)
Helper function templates to set a variable to zero.
Definition: MathUtils.h:372
const Number zero
typename GenericMaterialPropertyStruct< T, is_ad >::type GenericMaterialProperty
static constexpr PropertyValue::id_type zero_property_id
The material property ID for a zero property.

◆ getGenericZeroMaterialPropertyByName()

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

Definition at line 804 of file MaterialPropertyInterface.h.

805 {
806  // if found return the requested property
807  if (hasGenericMaterialPropertyByName<T, is_ad>(prop_name))
808  return getGenericMaterialPropertyByName<T, is_ad>(prop_name);
809 
810  return getGenericZeroMaterialProperty<T, is_ad>();
811 }

◆ 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  }
MaterialPropertyName getMaterialPropertyName(const std::string &name) const

◆ getKokkosMaterialPropertyByName()

template<typename T , unsigned int dimension, unsigned int state>
Moose::Kokkos::MaterialProperty< T, dimension > MaterialPropertyInterface::getKokkosMaterialPropertyByName ( const std::string &  prop_name)
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_nameThe property name
Returns
The Kokkos material property

Definition at line 963 of file MaterialPropertyInterface.h.

964 {
965  if (!_is_kokkos_object)
966  mooseError("Attempted to retrieve a Kokkos material property from a standard MOOSE object.");
967 
968  if constexpr (std::is_same_v<T, Real>)
969  {
970  std::istringstream ss(prop_name);
971  Real value;
972 
973  // Check if the string parsed cleanly into a Real number
974  if (ss >> value && ss.eof())
976  }
977 
979  checkMaterialProperty(prop_name, state);
980 
981  // Mark property as requested
982  markMatPropRequested(prop_name);
983 
984  // Update the boolean flag
986 
987  // Call first so that the ID gets registered
988  auto prop = _material_data.getKokkosProperty<T, dimension, state>(prop_name);
989 
990  // Does the material data used here matter?
992 
993  if constexpr (state == 0)
995 
996  return prop;
997 }
Moose::Kokkos::MaterialProperty< T, dimension > getKokkosProperty(const std::string &prop_name)
Get a Kokkos material property.
Definition: MaterialData.h:455
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...
const MooseObjectName _mi_moose_object_name
The "complete" name of the object that this interface belongs for material property output...
const bool _is_kokkos_object
Whether the MOOSE object is a Kokkos object.
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
unsigned int getPropertyId(const std::string &prop_name) const
Wrapper for MaterialStorage::getPropertyId.
Definition: MaterialData.C:80
void markMatPropRequested(const std::string &)
A proxy method for _mi_feproblem.markMatPropRequested(name)
MaterialData & _material_data
The material data class that stores properties.
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addConsumedPropertyName(const MooseObjectName &obj_name, const std::string &prop_name)
bool _get_material_property_called
Initialized to false.
void checkExecutionStage()
Check and throw an error if the execution has progressed past the construction stage.
The Kokkos material property class.
std::unordered_set< unsigned int > _material_property_dependencies
The set of material properties (as given by their IDs) that this object depends on.

◆ 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  }
MaterialPropertyName getMaterialPropertyName(const std::string &name) const

◆ 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  }
MaterialPropertyName getMaterialPropertyName(const std::string &name) const

◆ 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 229 of file MaterialPropertyInterface.C.

230 {
231  return getMaterialByName(_mi_params.get<MaterialName>(name));
232 }
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.
const InputParameters & _mi_params
Parameters of the object with this interface.
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 235 of file MaterialPropertyInterface.C.

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

236 {
237  std::shared_ptr<MaterialBase> discrete =
239 
241  return *discrete;
242 }
FEProblemBase & _mi_feproblem
Reference to the FEProblemBase class.
const THREAD_ID _mi_tid
Current threaded it.
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...
const Moose::MaterialDataType _material_data_type
The type of data.

◆ 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  }
std::string name(const ElemQuality q)

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

449  {
450  return getGenericMaterialProperty<T, false>(name, material_data, state);
451  }
std::string name(const ElemQuality q)

◆ 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 126 of file MaterialPropertyInterface.C.

127 {
129 }
FEProblemBase & _mi_feproblem
Reference to the FEProblemBase class.
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:489

◆ 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 120 of file MaterialPropertyInterface.C.

Referenced by MaterialPropertyInterface::getBlockMaterialProperty().

121 {
123 }
FEProblemBase & _mi_feproblem
Reference to the FEProblemBase class.
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:473

◆ 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 132 of file MaterialPropertyInterface.C.

133 {
135 }
FEProblemBase & _mi_feproblem
Reference to the FEProblemBase class.
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:525

◆ 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 138 of file MaterialPropertyInterface.C.

139 {
141 }
FEProblemBase & _mi_feproblem
Reference to the FEProblemBase class.
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:541

◆ 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  }
std::string name(const ElemQuality q)

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

493  {
494  return getGenericMaterialPropertyByName<T, false>(name, material_data, state);
495  }
std::string name(const ElemQuality q)

◆ getMaterialPropertyCalled()

bool MaterialPropertyInterface::getMaterialPropertyCalled ( ) const
inlineinherited

Returns true if getMaterialProperty() has been called, false otherwise.

Definition at line 417 of file MaterialPropertyInterface.h.

bool _get_material_property_called
Initialized to false.

◆ 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 112 of file MaterialPropertyInterface.C.

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

113 {
114  if (_mi_params.have_parameter<MaterialPropertyName>(name) && _mi_params.isParamValid(name))
115  return _mi_params.get<MaterialPropertyName>(name);
116  return name;
117 }
std::string name(const ElemQuality q)
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.
const InputParameters & _mi_params
Parameters of the object with this interface.
bool have_parameter(std::string_view name) const
A wrapper around the Parameters base class method.
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.

◆ 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  }
std::string name(const ElemQuality q)

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

514  {
515  return getMaterialProperty<T>(name, material_data, 1);
516  }
std::string name(const ElemQuality q)

◆ 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  }
std::string name(const ElemQuality q)

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

536  {
537  return getMaterialPropertyByName<T>(name, material_data, 1);
538  }
std::string name(const ElemQuality q)

◆ 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  }
std::string name(const ElemQuality q)

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

525  {
526  return getMaterialProperty<T>(name, material_data, 2);
527  }
std::string name(const ElemQuality q)

◆ 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  }
std::string name(const ElemQuality q)

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

547  {
548  return getMaterialPropertyByName<T>(name, material_data, 2);
549  }
std::string name(const ElemQuality q)

◆ getMatPropDependencies()

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

Retrieve the set of material properties that this object depends on.

Returns
The IDs corresponding to the material properties that MUST be reinited before evaluating this object

Reimplemented in Material, Moose::Kokkos::Material< Derived >, Moose::Kokkos::Material< KokkosGenericConstantMaterial >, InterfaceMaterial, IPHDGKernel, and IPHDGBC.

Definition at line 425 of file MaterialPropertyInterface.h.

Referenced by IPHDGBC::getMatPropDependencies(), IPHDGKernel::getMatPropDependencies(), InterfaceMaterial::getMatPropDependencies(), Moose::Kokkos::Material< KokkosGenericConstantMaterial >::getMatPropDependencies(), Material::getMatPropDependencies(), NodalPatchRecovery::reinitPatch(), ComputeUserObjectsThread::subdomainChanged(), and MooseObjectWarehouseBase< Indicator >::updateMatPropDependencyHelper().

426  {
428  }
std::unordered_set< unsigned int > _material_property_dependencies
The set of material properties (as given by their IDs) that this object depends on.

◆ 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  }
std::string name(const ElemQuality q)

◆ 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  }
std::string name(const ElemQuality q)

◆ 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  }
std::string name(const ElemQuality q)

◆ 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  }
std::string name(const ElemQuality q)

◆ 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  }
std::string name(const ElemQuality q)

◆ 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  }
std::string name(const ElemQuality q)

◆ 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  }
std::string name(const ElemQuality q)

◆ 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  }
std::string name(const ElemQuality q)

◆ 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  }
std::string name(const ElemQuality q)

◆ 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  }
std::string name(const ElemQuality q)

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

868 {
869  // Check if it's just a constant
870  if (const auto * default_property = defaultGenericMaterialProperty<T, is_ad>(prop_name))
871  return *default_property;
872 
873  if (state > 0 && !_stateful_allowed)
874  mooseError("Stateful material properties not allowed for this object."
875  " State ",
876  state,
877  " property for \"",
878  prop_name,
879  "\" was requested.");
880 
881  return this->getGenericMaterialPropertyByName<T, is_ad>(prop_name, material_data, state);
882 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
bool _stateful_allowed
True by default.

◆ getZeroMaterialProperty()

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

for backwards compatibility

Definition at line 310 of file MaterialPropertyInterface.h.

311  {
312  return getGenericZeroMaterialProperty<T, false>(args...);
313  }

◆ hasADMaterialProperty()

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

Definition at line 835 of file MaterialPropertyInterface.h.

836 {
837  // Check if the supplied parameter is a valid input parameter key
838  const auto prop_name = getMaterialPropertyName(name);
839  return hasADMaterialPropertyByName<T>(prop_name);
840 }
MaterialPropertyName getMaterialPropertyName(const std::string &name) const

◆ hasADMaterialPropertyByName()

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

Definition at line 844 of file MaterialPropertyInterface.h.

845 {
846  const auto name = _get_suffix.empty()
847  ? name_in
848  : MooseUtils::join(std::vector<std::string>({name_in, _get_suffix}), "_");
850 }
std::string name(const ElemQuality q)
std::string join(Iterator begin, Iterator end, const std::string &delimiter)
Python-like join function for strings over an iterator range.
Definition: MooseUtils.h:142
MaterialData & _material_data
The material data class that stores properties.
const MaterialPropertyName _get_suffix
bool haveADProperty(const std::string &prop_name) const
Returns true if the AD material property exists - defined by any material.
Definition: MaterialData.h:100

◆ hasGenericMaterialProperty()

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

generic hasMaterialProperty helper

Definition at line 390 of file MaterialPropertyInterface.h.

391  {
392  if constexpr (is_ad)
393  return hasADMaterialProperty<T>(name);
394  else
395  return hasMaterialProperty<T>(name);
396  }
std::string name(const ElemQuality q)

◆ hasGenericMaterialPropertyByName()

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

Definition at line 398 of file MaterialPropertyInterface.h.

399  {
400  if constexpr (is_ad)
401  return hasADMaterialPropertyByName<T>(name);
402  else
403  return hasMaterialPropertyByName<T>(name);
404  }
std::string name(const ElemQuality q)

◆ hasKokkosMaterialProperty()

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

Definition at line 944 of file MaterialPropertyInterface.h.

945 {
946  // Check if the supplied parameter is a valid input parameter key
947  const auto prop_name = getMaterialPropertyName(name);
948  return hasKokkosMaterialPropertyByName<T, dimension>(prop_name);
949 }
MaterialPropertyName getMaterialPropertyName(const std::string &name) const

◆ hasKokkosMaterialPropertyByName()

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

Definition at line 953 of file MaterialPropertyInterface.h.

954 {
955  const auto name = _get_suffix.empty()
956  ? name_in
957  : MooseUtils::join(std::vector<std::string>({name_in, _get_suffix}), "_");
958  return _material_data.haveKokkosProperty<T, dimension>(name);
959 }
std::string name(const ElemQuality q)
std::string join(Iterator begin, Iterator end, const std::string &delimiter)
Python-like join function for strings over an iterator range.
Definition: MooseUtils.h:142
MaterialData & _material_data
The material data class that stores properties.
const MaterialPropertyName _get_suffix
bool haveKokkosProperty(const std::string &prop_name) const
Get whether a Kokkos material property exists.
Definition: MaterialData.h:444

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

778 {
779  // Check if the supplied parameter is a valid input parameter key
780  const auto prop_name = getMaterialPropertyName(name);
781  return hasMaterialPropertyByName<T>(prop_name);
782 }
MaterialPropertyName getMaterialPropertyName(const std::string &name) const

◆ hasMaterialPropertyByName()

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

Definition at line 786 of file MaterialPropertyInterface.h.

787 {
788  const auto name = _get_suffix.empty()
789  ? name_in
790  : MooseUtils::join(std::vector<std::string>({name_in, _get_suffix}), "_");
791  return _material_data.haveProperty<T>(name);
792 }
std::string name(const ElemQuality q)
std::string join(Iterator begin, Iterator end, const std::string &delimiter)
Python-like join function for strings over an iterator range.
Definition: MooseUtils.h:142
bool haveProperty(const std::string &prop_name) const
Returns true if the regular material property exists - defined by any material.
Definition: MaterialData.h:93
MaterialData & _material_data
The material data class that stores properties.
const MaterialPropertyName _get_suffix

◆ lmDirichlet()

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

Definition at line 84 of file IPHDGAssemblyHelper.C.

85 {
86  for (const auto qp : make_range(_ip_qrule_face->n_points()))
87  {
88  const auto scalar_value = dirichlet_value(
92 
93  for (const auto i : index_range(_lm_re))
94  _lm_re(i) += _ip_JxW_face[qp] * (_lm_u_sol[qp] - scalar_value) * _lm_phi_face[i][qp];
95  }
96 }
DenseVector< ADReal > _lm_re
const unsigned int & _ip_current_side
The current element side.
Moose::StateArg determineState() const
Create a functor state argument that corresponds to the implicit state of this object.
const MooseArray< std::vector< Real > > & _lm_phi_face
const QBase *const & _ip_qrule_face
The face qrule.
const TransientInterface & _ti
const Elem *const & _ip_current_elem
The current element.
const MooseArray< Point > & _ip_q_point_face
The physical quadrature point locations on the face.
unsigned int n_points() const
const MooseArray< ADReal > & _lm_u_sol
const MooseArray< Real > & _ip_JxW_face
The face JxW.
IntRange< T > make_range(T beg, T end)
auto index_range(const T &sizable)
Argument for requesting functor evaluation at quadrature point locations on an element side...

◆ lmFace()

virtual void IPHDGAssemblyHelper::lmFace ( )
pure virtual

◆ lmPrescribedFlux()

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

Definition at line 99 of file IPHDGAssemblyHelper.C.

100 {
101  for (const auto qp : make_range(_ip_qrule_face->n_points()))
102  {
103  const auto flux = flux_value(
106  _ti.determineState());
107 
108  for (const auto i : index_range(_lm_re))
109  _lm_re(i) += _ip_JxW_face[qp] * flux * _lm_phi_face[i][qp];
110  }
111 }
DenseVector< ADReal > _lm_re
const unsigned int & _ip_current_side
The current element side.
Moose::StateArg determineState() const
Create a functor state argument that corresponds to the implicit state of this object.
const MooseArray< std::vector< Real > > & _lm_phi_face
const QBase *const & _ip_qrule_face
The face qrule.
const TransientInterface & _ti
const Elem *const & _ip_current_elem
The current element.
const MooseArray< Point > & _ip_q_point_face
The physical quadrature point locations on the face.
unsigned int n_points() const
const MooseArray< Real > & _ip_JxW_face
The face JxW.
IntRange< T > make_range(T beg, T end)
auto index_range(const T &sizable)
Argument for requesting functor evaluation at quadrature point locations on an element side...

◆ markMatPropRequested()

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

A proxy method for _mi_feproblem.markMatPropRequested(name)

Definition at line 174 of file MaterialPropertyInterface.C.

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

175 {
177 }
FEProblemBase & _mi_feproblem
Reference to the FEProblemBase class.
virtual void markMatPropRequested(const std::string &)
Helper method for adding a material property name to the _material_property_requested set...
Definition: SubProblem.C:724

◆ resizeResiduals()

void IPHDGAssemblyHelper::resizeResiduals ( )
inline

Definition at line 145 of file IPHDGAssemblyHelper.h.

146 {
147  _scalar_re.resize(_u_dof_indices.size());
148  _lm_re.resize(_lm_u_dof_indices.size());
149 }
DenseVector< ADReal > _scalar_re
DenseVector< ADReal > _lm_re
const std::vector< dof_id_type > & _u_dof_indices
const std::vector< dof_id_type > & _lm_u_dof_indices

◆ resolveOptionalProperties()

void MaterialPropertyInterface::resolveOptionalProperties ( )
virtualinherited

resolve all optional properties

Reimplemented in Material.

Definition at line 270 of file MaterialPropertyInterface.C.

271 {
272  for (auto & proxy : _optional_property_proxies)
273  proxy->resolve(*this);
274 }
std::vector< std::unique_ptr< OptionalMaterialPropertyProxyBase< MaterialPropertyInterface > > > _optional_property_proxies
optional material properties

◆ scalarDirichlet()

virtual void IPHDGAssemblyHelper::scalarDirichlet ( const Moose::Functor< Real > &  dirichlet_value)
pure virtual

◆ scalarFace()

virtual void IPHDGAssemblyHelper::scalarFace ( )
pure virtual

◆ scalarVolume()

virtual void IPHDGAssemblyHelper::scalarVolume ( )
pure virtual

◆ 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 180 of file MaterialPropertyInterface.C.

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

181 {
182  _stateful_allowed = stateful_allowed;
183 }
bool _stateful_allowed
True by default.

◆ taggingData()

std::array< ADResidualsPacket, 2 > IPHDGAssemblyHelper::taggingData ( ) const
Returns
The various residuals and degree of freedom indices this helper operators on

Definition at line 71 of file IPHDGAssemblyHelper.C.

72 {
75 }
DenseVector< ADReal > _scalar_re
DenseVector< ADReal > _lm_re
const std::vector< dof_id_type > & _u_dof_indices
const MooseVariableFE< Real > & _u_var
const MooseVariableFE< Real > & _u_face_var
Utility structure for packaging up all of the residual object&#39;s information needed to add into the sy...
const std::vector< dof_id_type > & _lm_u_dof_indices
void scalingFactor(const std::vector< Real > &factor)
Set the scaling factor for this variable.

◆ validParams()

InputParameters IPHDGAssemblyHelper::validParams ( )
static

Definition at line 24 of file IPHDGAssemblyHelper.C.

Referenced by AdvectionIPHDGAssemblyHelper::validParams(), and DiffusionIPHDGAssemblyHelper::validParams().

25 {
26  auto params = emptyInputParameters();
27  params.addRequiredParam<NonlinearVariableName>("face_variable", "The face variable");
28  return params;
29 }
InputParameters emptyInputParameters()

Member Data Documentation

◆ _default_properties

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

Storage vector for default properties.

Definition at line 646 of file MaterialPropertyInterface.h.

Referenced by MaterialPropertyInterface::defaultGenericMaterialProperty().

◆ _elem_volume

const Real& IPHDGAssemblyHelper::_elem_volume
protected

◆ _face_material_data

MaterialData& ThreeMaterialPropertyInterface::_face_material_data
protectedinherited

◆ _get_material_property_called

bool MaterialPropertyInterface::_get_material_property_called
protectedinherited

Initialized to false.

Gets set to true when getMaterialProperty() is called. Clients of this class can inquire whether getMaterialProperty() has been called by calling getMaterialPropertyCalled().

Definition at line 643 of file MaterialPropertyInterface.h.

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

◆ _get_suffix

const MaterialPropertyName MaterialPropertyInterface::_get_suffix
protectedinherited

◆ _grad_scalar_phi

const MooseArray<std::vector<RealVectorValue> >& IPHDGAssemblyHelper::_grad_scalar_phi
protected

◆ _grad_scalar_phi_face

const MooseArray<std::vector<RealVectorValue> >& IPHDGAssemblyHelper::_grad_scalar_phi_face
protected

◆ _grad_u_sol

const MooseArray<ADRealVectorValue>& IPHDGAssemblyHelper::_grad_u_sol
protected

◆ _interpolated_old

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

name suffixes for interpolated old and older properties

Definition at line 657 of file MaterialPropertyInterface.h.

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

◆ _interpolated_older

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

◆ _ip_current_elem

const Elem* const& IPHDGAssemblyHelper::_ip_current_elem
protected

◆ _ip_current_side

const unsigned int& IPHDGAssemblyHelper::_ip_current_side
protected

◆ _ip_JxW

const MooseArray<Real>& IPHDGAssemblyHelper::_ip_JxW
protected

◆ _ip_JxW_face

const MooseArray<Real>& IPHDGAssemblyHelper::_ip_JxW_face
protected

◆ _ip_normals

const MooseArray<Point>& IPHDGAssemblyHelper::_ip_normals
protected

◆ _ip_q_point

const MooseArray<Point>& IPHDGAssemblyHelper::_ip_q_point
protected

The physical quadrature point locations in the element volume.

Definition at line 126 of file IPHDGAssemblyHelper.h.

◆ _ip_q_point_face

const MooseArray<Point>& IPHDGAssemblyHelper::_ip_q_point_face
protected

The physical quadrature point locations on the face.

Definition at line 135 of file IPHDGAssemblyHelper.h.

Referenced by lmDirichlet(), lmPrescribedFlux(), AdvectionIPHDGAssemblyHelper::scalarDirichlet(), and DiffusionIPHDGAssemblyHelper::scalarDirichlet().

◆ _ip_qrule

const QBase* const& IPHDGAssemblyHelper::_ip_qrule
protected

◆ _ip_qrule_face

const QBase* const& IPHDGAssemblyHelper::_ip_qrule_face
protected

◆ _is_kokkos_object

const bool MaterialPropertyInterface::_is_kokkos_object
protectedinherited

◆ _lm_phi_face

const MooseArray<std::vector<Real> >& IPHDGAssemblyHelper::_lm_phi_face
protected

◆ _lm_re

DenseVector<ADReal> IPHDGAssemblyHelper::_lm_re
protected

◆ _lm_u_dof_indices

const std::vector<dof_id_type>& IPHDGAssemblyHelper::_lm_u_dof_indices
protected

Definition at line 91 of file IPHDGAssemblyHelper.h.

Referenced by resizeResiduals(), and taggingData().

◆ _lm_u_sol

const MooseArray<ADReal>& IPHDGAssemblyHelper::_lm_u_sol
protected

◆ _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_feproblem

FEProblemBase& MaterialPropertyInterface::_mi_feproblem
protectedinherited

◆ _mi_moose_object_name

const MooseObjectName MaterialPropertyInterface::_mi_moose_object_name
protectedinherited

The "complete" name of the object that this interface belongs for material property output.

Definition at line 563 of file MaterialPropertyInterface.h.

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

◆ _mi_name

const std::string MaterialPropertyInterface::_mi_name
protectedinherited

The name of the object that this interface belongs to.

Definition at line 560 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 569 of file MaterialPropertyInterface.h.

◆ _mi_tid

const THREAD_ID MaterialPropertyInterface::_mi_tid
protectedinherited

◆ _neighbor_material_data

MaterialData& TwoMaterialPropertyInterface::_neighbor_material_data
protectedinherited

◆ _scalar_phi

const MooseArray<std::vector<Real> >& IPHDGAssemblyHelper::_scalar_phi
protected

Definition at line 99 of file IPHDGAssemblyHelper.h.

◆ _scalar_phi_face

const MooseArray<std::vector<Real> >& IPHDGAssemblyHelper::_scalar_phi_face
protected

◆ _scalar_re

DenseVector<ADReal> IPHDGAssemblyHelper::_scalar_re
protected

◆ _side_area

const Real& IPHDGAssemblyHelper::_side_area
protected

◆ _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 636 of file MaterialPropertyInterface.h.

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

◆ _ti

const TransientInterface& IPHDGAssemblyHelper::_ti
protected

◆ _u_dof_indices

const std::vector<dof_id_type>& IPHDGAssemblyHelper::_u_dof_indices
protected

◆ _u_face_var

const MooseVariableFE<Real>& IPHDGAssemblyHelper::_u_face_var
protected

Definition at line 87 of file IPHDGAssemblyHelper.h.

Referenced by additionalROVariables(), IPHDGAssemblyHelper(), and taggingData().

◆ _u_sol

const MooseArray<ADReal>& IPHDGAssemblyHelper::_u_sol
protected

◆ _u_var

const MooseVariableFE<Real>& IPHDGAssemblyHelper::_u_var
protected

Definition at line 86 of file IPHDGAssemblyHelper.h.

Referenced by IPHDGAssemblyHelper(), and taggingData().

◆ _use_interpolated_state

const bool MaterialPropertyInterface::_use_interpolated_state
protectedinherited

◆ default_property_id

constexpr PropertyValue::id_type MaterialPropertyInterface::default_property_id
staticinherited
Initial value:

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
staticinherited

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: