www.mooseframework.org
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
InterfaceKernel Class Referenceabstract

InterfaceKernel is responsible for interfacing physics across subdomains. More...

#include <InterfaceKernel.h>

Inheritance diagram for InterfaceKernel:
[legend]

Public Types

enum  TEST_TYPE { ALL, ANY }
 A flag changing the behavior of hasBoundary. More...
 

Public Member Functions

 InterfaceKernel (const InputParameters &parameters)
 
MooseVariablevariable () const
 The master variable that this interface kernel operates on. More...
 
const MooseVariableneighborVariable () const
 The neighbor variable number that this interface kernel operates on. More...
 
SubProblemsubProblem ()
 Return a reference to the subproblem. More...
 
virtual void computeElemNeighResidual (Moose::DGResidualType type)
 Using the passed DGResidual type, selects the correct test function space and residual block, and then calls computeQpResidual. More...
 
virtual void computeElemNeighJacobian (Moose::DGJacobianType type)
 Using the passed DGJacobian type, selects the correct test function and trial function spaces and jacobian block, and then calls computeQpJacobian. More...
 
virtual void computeOffDiagElemNeighJacobian (Moose::DGJacobianType type, unsigned int jvar)
 Using the passed DGJacobian type, selects the correct test function and trial function spaces and jacobian block, and then calls computeQpOffDiagJacobian with the passed jvar. More...
 
virtual void computeElementOffDiagJacobian (unsigned int jvar)
 Selects the correct Jacobian type and routine to call for the master variable jacobian. More...
 
virtual void computeNeighborOffDiagJacobian (unsigned int jvar)
 Selects the correct Jacobian type and routine to call for the slave variable jacobian. More...
 
virtual void computeResidual ()
 Computes the residual for the current side. More...
 
virtual void computeJacobian ()
 Computes the jacobian for the current side. More...
 
const std::string & name () const
 Get the name of the object. More...
 
const InputParametersparameters () const
 Get the parameters of the object. More...
 
template<typename T >
const T & getParam (const std::string &name) const
 Retrieve a parameter for the object. More...
 
bool isParamValid (const std::string &name) const
 Test if the supplied parameter is valid. More...
 
MooseAppgetMooseApp ()
 Get the MooseApp this object is associated with. More...
 
virtual bool enabled ()
 Return the enabled status of the object. More...
 
template<typename... Args>
void mooseError (Args &&...args) const
 
template<typename... Args>
void mooseWarning (Args &&...args) const
 
template<typename... Args>
void mooseDeprecated (Args &&...args) const
 
template<typename... Args>
void mooseInfo (Args &&...args) const
 
virtual const std::set< BoundaryID > & boundaryIDs () const
 Return the boundary IDs for this object. More...
 
const std::vector< BoundaryName > & boundaryNames () const
 Return the boundary names for this object. More...
 
unsigned int numBoundaryIDs () const
 Return the number of boundaries for this object. More...
 
bool hasBoundary (const BoundaryName &name) const
 Test if the supplied boundary name is valid for this object. More...
 
bool hasBoundary (const std::vector< BoundaryName > &names) const
 Test if the supplied vector of boundary names are valid for this object. More...
 
bool hasBoundary (const BoundaryID &id) const
 Test if the supplied boundary ids are valid for this object. More...
 
bool hasBoundary (const std::vector< BoundaryID > &ids, TEST_TYPE type=ALL) const
 Test if the supplied vector boundary ids are valid for this object. More...
 
bool hasBoundary (const std::set< BoundaryID > &ids, TEST_TYPE type=ALL) const
 Test if the supplied set of boundary ids are valid for this object. More...
 
bool isBoundarySubset (const std::set< BoundaryID > &ids) const
 Test if the class boundary ids are a subset of the supplied objects. More...
 
bool isBoundarySubset (const std::vector< BoundaryID > &ids) const
 
template<typename T >
bool hasBoundaryMaterialProperty (const std::string &prop_name) const
 Check if a material property is valid for all boundaries of this object. More...
 
virtual bool boundaryRestricted () const
 Returns true if this object has been restricted to a boundary. More...
 
const std::set< BoundaryID > & meshBoundaryIDs () const
 Returns the set of all boundary ids for the entire mesh. More...
 
virtual void initialSetup ()
 Gets called at the beginning of the simulation before this object is asked to do its job. More...
 
virtual void timestepSetup ()
 Gets called at the beginning of the timestep before this object is asked to do its job. More...
 
virtual void jacobianSetup ()
 Gets called just before the Jacobian is computed and before this object is asked to do its job. More...
 
virtual void residualSetup ()
 Gets called just before the residual is computed and before this object is asked to do its job. More...
 
virtual void subdomainSetup ()
 Gets called when the subdomain changes (i.e. More...
 
virtual const std::vector< ExecFlagType > & execFlags () const
 Get the execution flag for the object. More...
 
ExecFlagType execBitFlags () const
 Build and return the execution flags as a bitfield. More...
 
bool isImplicit ()
 
FunctiongetFunction (const std::string &name)
 Get a function with a given name. More...
 
FunctiongetFunctionByName (const FunctionName &name)
 Get a function with a given name. More...
 
template<class T >
const T & getUserObject (const std::string &name)
 Get an user object with a given parameter name. More...
 
template<class T >
const T & getUserObjectByName (const std::string &name)
 Get an user object with a given name. More...
 
const UserObjectgetUserObjectBase (const std::string &name)
 Get an user object with a given parameter name. More...
 
const UserObjectgetUserObjectBaseByName (const std::string &name)
 Get an user object with a given name. More...
 
virtual const VariableValuecoupledNeighborValue (const std::string &var_name, unsigned int comp=0)
 
virtual const VariableValuecoupledNeighborValueOld (const std::string &var_name, unsigned int comp=0)
 
virtual const VariableValuecoupledNeighborValueOlder (const std::string &var_name, unsigned int comp=0)
 
virtual const VariableGradientcoupledNeighborGradient (const std::string &var_name, unsigned int comp=0)
 
virtual const VariableGradientcoupledNeighborGradientOld (const std::string &var_name, unsigned int comp=0)
 
virtual const VariableGradientcoupledNeighborGradientOlder (const std::string &var_name, unsigned int comp=0)
 
virtual const VariableSecondcoupledNeighborSecond (const std::string &var_name, unsigned int i=0)
 
virtual const DenseVector< Number > & coupledNeighborSolutionDoFs (const std::string &var_name, unsigned int comp=0)
 
virtual const DenseVector< Number > & coupledNeighborSolutionDoFsOld (const std::string &var_name, unsigned int comp=0)
 
virtual const DenseVector< Number > & coupledNeighborSolutionDoFsOlder (const std::string &var_name, unsigned int comp=0)
 
const std::map< std::string, std::vector< MooseVariable * > > & getCoupledVars ()
 Get the list of coupled variables. More...
 
const std::vector< MooseVariable * > & getCoupledMooseVars () const
 Get the list of coupled variables. More...
 
const std::vector< MooseVariableScalar * > & getCoupledMooseScalarVars ()
 Get the list of coupled scalar variables. More...
 
MooseVariablemooseVariable ()
 Get the variable that this object is using. More...
 
const std::set< MooseVariable * > & getMooseVariableDependencies () const
 Retrieve the set of MooseVariables that this object depends on. More...
 
virtual void meshChanged ()
 Called on this object when the mesh changes. More...
 
template<typename T >
const MaterialProperty< T > & getNeighborMaterialProperty (const std::string &name)
 Retrieve the property named "name". More...
 
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 >
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 >
const MaterialProperty< T > & getZeroMaterialProperty (const std::string &prop_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...
 
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 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...
 
const std::set< unsigned int > & getMatPropDependencies () const
 Retrieve the set of material properties that this object depends on. More...
 
template<>
const MaterialProperty< Real > * defaultMaterialProperty (const std::string &name)
 
template<typename T >
const MaterialProperty< T > & getMaterialProperty (const std::string &name)
 Retrieve reference to material property or one of it's old or older values. More...
 
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 >
const MaterialProperty< T > & getMaterialPropertyByName (const MaterialPropertyName &name)
 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 > & getMaterialPropertyOldByName (const MaterialPropertyName &name)
 
template<typename T >
const MaterialProperty< T > & getMaterialPropertyOlderByName (const MaterialPropertyName &name)
 
MaterialgetMaterial (const std::string &name)
 Return a Material reference - usable for computing directly. More...
 
MaterialgetMaterialByName (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)
 

Static Public Member Functions

static bool restricted (const std::set< BoundaryID > &ids)
 Helper for determining if the object is boundary restricted. More...
 
static MultiMooseEnum getExecuteOptions ()
 Returns the available options for the 'execute_on' input parameters. More...
 

Public Attributes

const ConsoleStream _console
 An instance of helper class to write streams to the Console objects. More...
 

Protected Member Functions

virtual Real computeQpResidual (Moose::DGResidualType type)=0
 Compute residuals at quadrature points. More...
 
virtual Real computeQpJacobian (Moose::DGJacobianType type)=0
 Compute jacobians at quadrature points. More...
 
virtual Real computeQpOffDiagJacobian (Moose::DGJacobianType type, unsigned int jvar)
 compute off-diagonal jacobian components at quadrature points More...
 
const Real & getNeighborElemVolume ()
 The volume of the current neighbor. More...
 
bool hasBoundaryMaterialPropertyHelper (const std::string &prop_name) const
 A helper method to avoid circular #include problems. More...
 
virtual bool isCoupled (const std::string &var_name, unsigned int i=0)
 Returns true if a variables has been coupled as name. More...
 
unsigned int coupledComponents (const std::string &var_name)
 Number of coupled components. More...
 
virtual void coupledCallback (const std::string &var_name, bool is_old)
 
virtual unsigned int coupled (const std::string &var_name, unsigned int comp=0)
 Returns the index for a coupled variable by name. More...
 
virtual const VariableValuecoupledValue (const std::string &var_name, unsigned int comp=0)
 Returns value of a coupled variable. More...
 
virtual VariableValuewritableCoupledValue (const std::string &var_name, unsigned int comp=0)
 Returns a writable reference to a coupled variable. More...
 
virtual const VariableValuecoupledValueOld (const std::string &var_name, unsigned int comp=0)
 Returns an old value from previous time step of a coupled variable. More...
 
virtual const VariableValuecoupledValueOlder (const std::string &var_name, unsigned int comp=0)
 Returns an old value from two time steps previous of a coupled variable. More...
 
virtual const VariableValuecoupledValuePreviousNL (const std::string &var_name, unsigned int comp=0)
 Returns value of previous Newton iterate of a coupled variable. More...
 
virtual const VariableGradientcoupledGradient (const std::string &var_name, unsigned int comp=0)
 Returns gradient of a coupled variable. More...
 
virtual const VariableGradientcoupledGradientOld (const std::string &var_name, unsigned int comp=0)
 Returns an old gradient from previous time step of a coupled variable. More...
 
virtual const VariableGradientcoupledGradientOlder (const std::string &var_name, unsigned int comp=0)
 Returns an old gradient from two time steps previous of a coupled variable. More...
 
virtual const VariableGradientcoupledGradientPreviousNL (const std::string &var_name, unsigned int comp=0)
 Returns gradient of a coupled variable for previous Newton iterate. More...
 
virtual const VariableSecondcoupledSecond (const std::string &var_name, unsigned int comp=0)
 Returns second derivative of a coupled variable. More...
 
virtual const VariableSecondcoupledSecondOld (const std::string &var_name, unsigned int comp=0)
 Returns an old second derivative from previous time step of a coupled variable. More...
 
virtual const VariableSecondcoupledSecondOlder (const std::string &var_name, unsigned int comp=0)
 Returns an old second derivative from two time steps previous of a coupled variable. More...
 
virtual const VariableSecondcoupledSecondPreviousNL (const std::string &var_name, unsigned int comp=0)
 Returns second derivative of a coupled variable for the previous Newton iterate. More...
 
virtual const VariableValuecoupledDot (const std::string &var_name, unsigned int comp=0)
 Time derivative of a coupled variable. More...
 
virtual const VariableValuecoupledDotDu (const std::string &var_name, unsigned int comp=0)
 Time derivative of a coupled variable with respect to the coefficients. More...
 
virtual const VariableValuecoupledNodalValue (const std::string &var_name, unsigned int comp=0)
 Returns nodal values of a coupled variable. More...
 
virtual const VariableValuecoupledNodalValueOld (const std::string &var_name, unsigned int comp=0)
 Returns an old nodal value from previous time step of a coupled variable. More...
 
virtual const VariableValuecoupledNodalValueOlder (const std::string &var_name, unsigned int comp=0)
 Returns an old nodal value from two time steps previous of a coupled variable. More...
 
virtual const VariableValuecoupledNodalValuePreviousNL (const std::string &var_name, unsigned int comp=0)
 Returns nodal values of a coupled variable for previous Newton iterate. More...
 
virtual const VariableValuecoupledNodalDot (const std::string &var_name, unsigned int comp=0)
 Nodal values of time derivative of a coupled variable. More...
 
virtual const DenseVector< Number > & coupledSolutionDoFs (const std::string &var_name, unsigned int comp=0)
 Returns DoFs in the current solution vector of a coupled variable for the local element. More...
 
virtual const DenseVector< Number > & coupledSolutionDoFsOld (const std::string &var_name, unsigned int comp=0)
 Returns DoFs in the old solution vector of a coupled variable for the local element. More...
 
virtual const DenseVector< Number > & coupledSolutionDoFsOlder (const std::string &var_name, unsigned int comp=0)
 Returns DoFs in the older solution vector of a coupled variable for the local element. More...
 
MooseVariablegetVar (const std::string &var_name, unsigned int comp)
 Extract pointer to a coupled variable. More...
 
void validateExecutionerType (const std::string &name) const
 Checks to make sure that the current Executioner has set "_it_transient" when old/older values are coupled in. More...
 
VariableValuegetDefaultValue (const std::string &var_name)
 Helper method to return (and insert if necessary) the default value for an uncoupled variable. More...
 
virtual bool isCoupledScalar (const std::string &var_name, unsigned int i=0)
 Returns true if a variables has been coupled_as name. More...
 
virtual unsigned int coupledScalarComponents (const std::string &var_name)
 Return the number of components to the coupled scalar variable. More...
 
virtual unsigned int coupledScalar (const std::string &var_name, unsigned int comp=0)
 Returns the index for a scalar coupled variable by name. More...
 
virtual Order coupledScalarOrder (const std::string &var_name, unsigned int comp=0)
 Returns the order for a scalar coupled variable by name. More...
 
virtual VariableValuecoupledScalarValue (const std::string &var_name, unsigned int comp=0)
 Returns value of a scalar coupled variable. More...
 
virtual VariableValuecoupledScalarValueOld (const std::string &var_name, unsigned int comp=0)
 Returns the old (previous time step) value of a scalar coupled variable. More...
 
virtual VariableValuecoupledScalarValueOlder (const std::string &var_name, unsigned int comp=0)
 Returns the older (two time steps previous) value of a scalar coupled variable. More...
 
virtual VariableValuecoupledScalarDot (const std::string &var_name, unsigned int comp=0)
 Returns the time derivative of a scalar coupled variable. More...
 
virtual VariableValuecoupledScalarDotDu (const std::string &var_name, unsigned int comp=0)
 Time derivative of a scalar coupled variable with respect to the coefficients. More...
 
MooseVariableScalargetScalarVar (const std::string &var_name, unsigned int comp)
 Extract pointer to a scalar coupled variable. More...
 
virtual const VariableValueneighborValue ()
 The value of the variable this object is operating on evaluated on the "neighbor" element. More...
 
virtual const VariableValueneighborValueOld ()
 The old value of the variable this object is operating on evaluated on the "neighbor" element. More...
 
virtual const VariableValueneighborValueOlder ()
 The older value of the variable this object is operating on evaluated on the "neighbor" element. More...
 
virtual const VariableGradientneighborGradient ()
 The gradient of the variable this object is operating on evaluated on the "neighbor" element. More...
 
virtual const VariableGradientneighborGradientOld ()
 The old gradient of the variable this object is operating on evaluated on the "neighbor" element. More...
 
virtual const VariableGradientneighborGradientOlder ()
 The older gradient of the variable this object is operating on evaluated on the "neighbor" element. More...
 
virtual const VariableSecondneighborSecond ()
 The second derivative of the variable this object is operating on evaluated on the "neighbor" element. More...
 
virtual const VariableSecondneighborSecondOld ()
 The old second derivative of the variable this object is operating on evaluated on the "neighbor" element. More...
 
virtual const VariableSecondneighborSecondOlder ()
 The older second derivative of the variable this object is operating on evaluated on the "neighbor" element. More...
 
virtual const VariableTestSecondneighborSecondTest ()
 The second derivative of the neighbor's test function. More...
 
virtual const VariablePhiSecondneighborSecondPhi ()
 The second derivative of the neighbor's shape function. More...
 
virtual const VariableValuevalue ()
 The value of the variable this object is operating on. More...
 
virtual const VariableValuevalueOld ()
 The old value of the variable this object is operating on. More...
 
virtual const VariableValuevalueOlder ()
 The older value of the variable this object is operating on. More...
 
virtual const VariableValuedot ()
 The time derivative of the variable this object is operating on. More...
 
virtual const VariableValuedotDu ()
 The derivative of the time derivative of the variable this object is operating on with respect to this variable's coefficients. More...
 
virtual const VariableGradientgradient ()
 The gradient of the variable this object is operating on. More...
 
virtual const VariableGradientgradientOld ()
 The old gradient of the variable this object is operating on. More...
 
virtual const VariableGradientgradientOlder ()
 The older gradient of the variable this object is operating on. More...
 
virtual const VariableSecondsecond ()
 The second derivative of the variable this object is operating on. More...
 
virtual const VariableSecondsecondOld ()
 The old second derivative of the variable this object is operating on. More...
 
virtual const VariableSecondsecondOlder ()
 The older second derivative of the variable this object is operating on. More...
 
virtual const VariableTestSecondsecondTest ()
 The second derivative of the test function. More...
 
virtual const VariableTestSecondsecondTestFace ()
 The second derivative of the test function on the current face. More...
 
virtual const VariablePhiSecondsecondPhi ()
 The second derivative of the trial function. More...
 
virtual const VariablePhiSecondsecondPhiFace ()
 The second derivative of the trial function on the current face. More...
 
void addMooseVariableDependency (MooseVariable *var)
 Call this function to add the passed in MooseVariable as a variable that this object depends on. More...
 
void addMooseVariableDependency (std::vector< MooseVariable * > vars)
 
template<typename T >
T & declareRestartableData (std::string data_name)
 Declare a piece of data as "restartable". More...
 
template<typename T >
T & declareRestartableData (std::string data_name, const T &init_value)
 Declare a piece of data as "restartable" and initialize it. More...
 
template<typename T >
T & declareRestartableDataWithContext (std::string data_name, void *context)
 Declare a piece of data as "restartable". More...
 
template<typename T >
T & declareRestartableDataWithContext (std::string data_name, const T &init_value, void *context)
 Declare a piece of data as "restartable" and initialize it. More...
 
void checkMaterialProperty (const std::string &name)
 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...
 
std::string deducePropertyName (const std::string &name)
 Small helper to look up a material property name through the input parameter keys. More...
 
template<typename T >
const MaterialProperty< T > * defaultMaterialProperty (const std::string &name)
 Helper function to parse default material property values. More...
 

Protected Attributes

SubProblem_subproblem
 Reference to the controlling finite element problem. More...
 
SystemBase_sys
 Reference to the nonlinear system. More...
 
THREAD_ID _tid
 The thread ID. More...
 
Assembly_assembly
 Problem assembly. More...
 
MooseVariable_var
 The master side MooseVariable. More...
 
MooseMesh_mesh
 The problem mesh. More...
 
const Elem *& _current_elem
 Pointer reference to the current element. More...
 
const Real & _current_elem_volume
 The volume (or length) of the current element. More...
 
const Elem *& _neighbor_elem
 The neighboring element. More...
 
unsigned int & _current_side
 Current side. More...
 
const Elem *& _current_side_elem
 Current side element. More...
 
const Real & _current_side_volume
 The volume (or length) of the current side. More...
 
const Moose::CoordinateSystemType_coord_sys
 Coordinate system. More...
 
unsigned int _qp
 Current quadrature point. More...
 
const MooseArray< Point > & _q_point
 Array that holds element quadrature point coordinates. More...
 
QBase *& _qrule
 Quadrature rule. More...
 
const MooseArray< Real > & _JxW
 Elemtn Jacobian/quadrature weight. More...
 
const MooseArray< Real > & _coord
 Coordinate transformation value; relevant in axisymmetric simulations for example. More...
 
unsigned int _i
 Index for test and trial functions. More...
 
unsigned int _j
 
const VariableValue_u
 Holds the current solution at the current quadrature point on the face. More...
 
const VariableGradient_grad_u
 Holds the current solution gradient at the current quadrature point on the face. More...
 
const VariablePhiValue_phi
 shape function More...
 
const VariablePhiGradient_grad_phi
 Shape function gradient. More...
 
const VariableTestValue_test
 Side shape function. More...
 
const VariableTestGradient_grad_test
 Gradient of side shape function. More...
 
const MooseArray< Point > & _normals
 Normal vectors at the quadrature points. More...
 
MooseVariable_neighbor_var
 Coupled neighbor variable. More...
 
const VariableValue_neighbor_value
 Coupled neighbor variable value. More...
 
const VariableGradient_grad_neighbor_value
 Coupled neighbor variable gradient. More...
 
const VariablePhiValue_phi_neighbor
 Side neighbor shape function. More...
 
const VariablePhiGradient_grad_phi_neighbor
 Gradient of side neighbor shape function. More...
 
const VariableTestValue_test_neighbor
 Side neighbor test function. More...
 
const VariableTestGradient_grad_test_neighbor
 Gradient of side neighbor shape function. More...
 
DenseVector< Number > _local_re
 Holds residual entries as they are accumulated by this InterfaceKernel. More...
 
DenseMatrix< Number > _local_kxx
 Holds residual entries as they are accumulated by this InterfaceKernel. More...
 
MultiMooseEnum _save_in_var_side
 MultiMooseEnum specifying whether residual save-in aux variables correspond to master or slave side. More...
 
std::vector< AuxVariableName > _save_in_strings
 The names of the aux variables that will be used to save-in residuals (includes both master and slave variable names) More...
 
bool _has_master_residuals_saved_in
 Whether there are master residual aux variables. More...
 
std::vector< MooseVariable * > _master_save_in_residual_variables
 The aux variables to save the master residual contributions to. More...
 
bool _has_slave_residuals_saved_in
 Whether there are slave residual aux variables. More...
 
std::vector< MooseVariable * > _slave_save_in_residual_variables
 The aux variables to save the slave contributions to. More...
 
MultiMooseEnum _diag_save_in_var_side
 MultiMooseEnum specifying whether jacobian save-in aux variables correspond to master or slave side. More...
 
std::vector< AuxVariableName > _diag_save_in_strings
 The names of the aux variables that will be used to save-in jacobians (includes both master and slave variable names) More...
 
bool _has_master_jacobians_saved_in
 Whether there are master jacobian aux variables. More...
 
std::vector< MooseVariable * > _master_save_in_jacobian_variables
 The aux variables to save the diagonal Jacobian contributions of the master variables to. More...
 
bool _has_slave_jacobians_saved_in
 Whether there are slave jacobian aux variables. More...
 
std::vector< MooseVariable * > _slave_save_in_jacobian_variables
 The aux variables to save the diagonal Jacobian contributions of the slave variables to. More...
 
MooseApp_app
 The MooseApp this object is associated with. More...
 
const InputParameters_pars
 Parameters of this object, references the InputParameters stored in the InputParametersWarehouse. More...
 
const std::string & _name
 The name of this object, reference to value stored in InputParameters. More...
 
const bool & _enabled
 Reference to the "enable" InputParaemters, used by Controls for toggling on/off MooseObjects. More...
 
std::vector< ExecFlagType_exec_flags
 execution flag (when is the object executed/evaluated) More...
 
const ExecFlagType_current_execute_flag
 Reference to FEProblemBase. More...
 
const InputParameters_ti_params
 
FEProblemBase_ti_feproblem
 
bool _is_implicit
 If the object is using implicit or explicit form. More...
 
Real & _t
 Time. More...
 
int & _t_step
 The number of the time step. More...
 
Real & _dt
 Time step size. More...
 
Real & _dt_old
 Size of the old time step. More...
 
bool _is_transient
 
bool _neighbor_nodal
 
const InputParameters_c_parameters
 
FEProblemBase_c_fe_problem
 
std::map< std::string, std::vector< MooseVariable * > > _coupled_vars
 Coupled vars whose values we provide. More...
 
std::vector< MooseVariable * > _coupled_moose_vars
 Vector of coupled variables. More...
 
bool _c_nodal
 True if we provide coupling to nodal values. More...
 
bool _c_is_implicit
 True if implicit value is required. More...
 
const InputParameters_coupleable_params
 Local InputParameters. More...
 
const InputParameters_coupleable_params
 Local InputParameters. More...
 
std::map< std::string, VariableValue * > _default_value
 Will hold the default value for optional coupled variables. More...
 
std::map< std::string, VariableValue * > _default_value
 Will hold the default value for optional coupled scalar variables. More...
 
VariableValue _default_value_zero
 This will always be zero because the default values for optionally coupled variables is always constant and this is used for time derivative info. More...
 
VariableGradient _default_gradient
 This will always be zero because the default values for optionally coupled variables is always constant. More...
 
VariableSecond _default_second
 This will always be zero because the default values for optionally coupled variables is always constant. More...
 
bool _coupleable_neighbor
 Whether or not this object is a "neighbor" object: ie all of it's coupled values should be neighbor values. More...
 
const InputParameters_sc_parameters
 
FEProblemBase_sc_fe_problem
 
std::map< std::string, std::vector< MooseVariableScalar * > > _coupled_scalar_vars
 Coupled vars whose values we provide. More...
 
std::vector< MooseVariableScalar * > _coupled_moose_scalar_vars
 Vector of coupled variables. More...
 
bool _sc_is_implicit
 True if implicit value is required. More...
 
bool _nodal
 Whether or not this object is acting only at nodes. More...
 
MooseVariable_variable
 The variable this object is acting on. More...
 
Assembly_mvi_assembly
 
FEProblemBase_zi_feproblem
 
THREAD_ID _zi_tid
 
const Real & _real_zero
 
const VariableValue_zero
 
const VariableGradient_grad_zero
 
const VariableSecond_second_zero
 
const VariablePhiSecond_second_phi_zero
 
FEProblemBase_mci_feproblem
 Reference to FEProblemBase instance. More...
 
std::shared_ptr< 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...
 
Moose::MaterialDataType _material_data_type
 The type of data. More...
 
std::shared_ptr< MaterialData_material_data
 Pointer to the material data class that stores properties. More...
 
FEProblemBase_mi_feproblem
 Reference to the FEProblemBase class. More...
 
const THREAD_ID _mi_tid
 Current threaded it. More...
 
bool _stateful_allowed
 True by default. More...
 
bool _get_material_property_called
 Initialized to false. More...
 
std::vector< std::unique_ptr< MaterialProperty< Real > > > _default_real_properties
 Storage vector for MaterialProperty<Real> default objects. More...
 
std::set< unsigned int > _material_property_dependencies
 The set of material properties (as given by their IDs) that this object depends on. More...
 

Static Protected Attributes

static Threads::spin_mutex _resid_vars_mutex
 Mutex that prevents multiple threads from saving into the residual aux_var at the same time. More...
 
static Threads::spin_mutex _jacoby_vars_mutex
 Mutex that prevents multiple threads from saving into the jacobian aux_var at the same time. More...
 

Detailed Description

InterfaceKernel is responsible for interfacing physics across subdomains.

Definition at line 42 of file InterfaceKernel.h.

Member Enumeration Documentation

A flag changing the behavior of hasBoundary.

Enumerator
ALL 
ANY 

Definition at line 40 of file BoundaryRestrictable.h.

Constructor & Destructor Documentation

InterfaceKernel::InterfaceKernel ( const InputParameters parameters)

Definition at line 78 of file InterfaceKernel.C.

79  : MooseObject(parameters),
80  BoundaryRestrictable(this, false), // false for _not_ nodal
81  SetupInterface(this),
82  TransientInterface(this),
83  FunctionInterface(this),
84  UserObjectInterface(this),
86  Restartable(parameters, "InterfaceKernels"),
87  ZeroInterface(parameters),
88  MeshChangedInterface(parameters),
90  _subproblem(*parameters.get<SubProblem *>("_subproblem")),
91  _sys(*parameters.get<SystemBase *>("_sys")),
92  _tid(parameters.get<THREAD_ID>("_tid")),
94  _var(_sys.getVariable(_tid, parameters.get<NonlinearVariableName>("variable"))),
107  _u(_is_implicit ? _var.sln() : _var.slnOld()),
111  _test(_var.phiFace()),
113  _normals(_var.normals()),
114  _neighbor_var(*getVar("neighbor_var", 0)),
121  _save_in_var_side(parameters.get<MultiMooseEnum>("save_in_var_side")),
122  _save_in_strings(parameters.get<std::vector<AuxVariableName>>("save_in")),
123  _diag_save_in_var_side(parameters.get<MultiMooseEnum>("diag_save_in_var_side")),
124  _diag_save_in_strings(parameters.get<std::vector<AuxVariableName>>("diag_save_in"))
125 
126 {
127  if (!parameters.isParamValid("boundary"))
128  mooseError(
129  "In order to use an interface kernel, you must specify a boundary where it will live.");
130 
131  if (parameters.isParamSetByUser("save_in"))
132  {
133  if (_save_in_strings.size() != _save_in_var_side.size())
134  mooseError("save_in and save_in_var_side must be the same length");
135  else
136  {
137  for (unsigned i = 0; i < _save_in_strings.size(); ++i)
138  {
140 
142  mooseError("Trying to use solution variable " + _save_in_strings[i] +
143  " as a save_in variable in " + name());
144 
145  if (_save_in_var_side[i] == "m")
146  {
147  if (var->feType() != _var.feType())
148  mooseError(
149  "Error in " + name() +
150  ". There is a mismatch between the fe_type of the save-in Auxiliary variable "
151  "and the fe_type of the the master side nonlinear "
152  "variable this interface kernel object is acting on.");
153  _master_save_in_residual_variables.push_back(var);
154  }
155  else
156  {
157  if (var->feType() != _neighbor_var.feType())
158  mooseError(
159  "Error in " + name() +
160  ". There is a mismatch between the fe_type of the save-in Auxiliary variable "
161  "and the fe_type of the the slave side nonlinear "
162  "variable this interface kernel object is acting on.");
163  _slave_save_in_residual_variables.push_back(var);
164  }
165 
168  }
169  }
170  }
171 
174 
175  if (parameters.isParamSetByUser("diag_save_in"))
176  {
178  mooseError("diag_save_in and diag_save_in_var_side must be the same length");
179  else
180  {
181  for (unsigned i = 0; i < _diag_save_in_strings.size(); ++i)
182  {
184 
186  mooseError("Trying to use solution variable " + _diag_save_in_strings[i] +
187  " as a save_in variable in " + name());
188 
189  if (_diag_save_in_var_side[i] == "m")
190  {
191  if (var->feType() != _var.feType())
192  mooseError(
193  "Error in " + name() +
194  ". There is a mismatch between the fe_type of the save-in Auxiliary variable "
195  "and the fe_type of the the master side nonlinear "
196  "variable this interface kernel object is acting on.");
197  _master_save_in_jacobian_variables.push_back(var);
198  }
199  else
200  {
201  if (var->feType() != _neighbor_var.feType())
202  mooseError(
203  "Error in " + name() +
204  ". There is a mismatch between the fe_type of the save-in Auxiliary variable "
205  "and the fe_type of the the slave side nonlinear "
206  "variable this interface kernel object is acting on.");
207  _slave_save_in_jacobian_variables.push_back(var);
208  }
209 
212  }
213  }
214  }
215 
218 }
const VariablePhiGradient & _grad_phi
Shape function gradient.
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:47
const VariableGradient & gradSlnNeighbor()
const VariablePhiValue & phiFace()
virtual MooseMesh & mesh()=0
const VariableTestGradient & _grad_test
Gradient of side shape function.
const VariablePhiValue & _phi
shape function
QBase *& qRuleFace()
Returns the reference to the current quadrature being used on a current face.
Definition: Assembly.h:165
MultiMooseEnum _save_in_var_side
MultiMooseEnum specifying whether residual save-in aux variables correspond to master or slave side...
const VariablePhiGradient & _grad_phi_neighbor
Gradient of side neighbor shape function.
const Elem *& _neighbor_elem
The neighboring element.
Restartable(const InputParameters &parameters, std::string system_name, SubProblem *subproblem=NULL)
Class constructor Populates the SubProblem and MooseMesh pointers.
Definition: Restartable.C:20
virtual const std::set< BoundaryID > & boundaryIDs() const
Return the boundary IDs for this object.
const VariableGradient & gradSlnOld()
bool isParamSetByUser(const std::string &name) const
Method returns true if the parameter was by the user.
const MooseArray< Point > & qPointsFace()
Returns the reference to the current quadrature being used.
Definition: Assembly.h:171
bool _has_slave_residuals_saved_in
Whether there are slave residual aux variables.
const FEType & feType() const
Get the type of finite element object.
const MooseArray< Real > & _coord
Coordinate transformation value; relevant in axisymmetric simulations for example.
Class for stuff related to variables.
Definition: MooseVariable.h:43
MultiMooseEnum _diag_save_in_var_side
MultiMooseEnum specifying whether jacobian save-in aux variables correspond to master or slave side...
virtual MooseVariable & getVariable(THREAD_ID tid, const std::string &var_name)=0
Returns the variable reference for requested variable which may be in any system. ...
FunctionInterface(const MooseObject *moose_object)
const Elem *& _current_side_elem
Current side element.
const Elem *& _current_elem
Pointer reference to the current element.
TwoMaterialPropertyInterface(const MooseObject *moose_object)
virtual Assembly & assembly(THREAD_ID tid)=0
const VariableTestGradient & _grad_test_neighbor
Gradient of side neighbor shape function.
MooseVariable & _neighbor_var
Coupled neighbor variable.
MooseObject(const InputParameters &parameters)
Definition: MooseObject.C:35
const Elem *& neighbor()
Return the neighbor element.
Definition: Assembly.h:235
void addMooseVariableDependency(MooseVariable *var)
Call this function to add the passed in MooseVariable as a variable that this object depends on...
const MooseArray< Real > & coordTransformation()
Returns the reference to the coordinate transformation coefficients.
Definition: Assembly.h:153
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:117
const MooseArray< Real > & _JxW
Elemtn Jacobian/quadrature weight.
Base class for a system (of equations)
Definition: SystemBase.h:91
std::vector< MooseVariable * > _master_save_in_residual_variables
The aux variables to save the master residual contributions to.
const VariableValue & _neighbor_value
Coupled neighbor variable value.
const MooseArray< Point > & _normals
Normal vectors at the quadrature points.
const VariablePhiValue & _phi_neighbor
Side neighbor shape function.
unsigned int & side()
Returns the current side.
Definition: Assembly.h:211
bool _has_slave_jacobians_saved_in
Whether there are slave jacobian aux variables.
const VariableGradient & _grad_neighbor_value
Coupled neighbor variable gradient.
TransientInterface(const MooseObject *moose_object)
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.
virtual MooseVariable & getVariable(THREAD_ID tid, const std::string &var_name)
Gets a reference to a variable of with specified name.
Definition: SystemBase.C:103
std::vector< AuxVariableName > _diag_save_in_strings
The names of the aux variables that will be used to save-in jacobians (includes both master and slave...
const VariableValue & slnOld()
const MooseArray< Point > & _q_point
Array that holds element quadrature point coordinates.
const VariablePhiGradient & gradPhiFace()
Definition: Assembly.h:539
const Moose::CoordinateSystemType & _coord_sys
Coordinate system.
const MooseArray< Point > & normals()
const VariableGradient & _grad_u
Holds the current solution gradient at the current quadrature point on the face.
const Real & _current_side_volume
The volume (or length) of the current side.
MeshChangedInterface(const InputParameters &params)
SystemBase & _sys
Reference to the nonlinear system.
const Real & elemVolume()
Returns the reference to the current element volume.
Definition: Assembly.h:205
SetupInterface(const MooseObject *moose_object)
std::vector< MooseVariable * > _master_save_in_jacobian_variables
The aux variables to save the diagonal Jacobian contributions of the master variables to...
virtual bool hasVariable(const std::string &var_name)
Query a system for a variable.
Definition: SystemBase.C:556
const VariableTestValue & _test
Side shape function.
const VariablePhiGradient & gradPhiFaceNeighbor()
const MooseArray< Real > & JxWFace()
Returns the reference to the transformed jacobian weights on a current face.
Definition: Assembly.h:177
const VariablePhiGradient & gradPhiFaceNeighbor()
Definition: Assembly.h:547
NeighborCoupleableMooseVariableDependencyIntermediateInterface(const MooseObject *moose_object, bool nodal, bool neighbor_nodal)
const VariableTestValue & _test_neighbor
Side neighbor test function.
MooseVariable & _var
The master side MooseVariable.
const Elem *& elem()
Return the current element.
Definition: Assembly.h:189
bool _has_master_jacobians_saved_in
Whether there are master jacobian aux variables.
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:53
virtual void addVariableToZeroOnResidual(std::string var_name)
Adds this variable to the list of variables to be zeroed during each residual evaluation.
Definition: SystemBase.C:150
const VariablePhiValue & phiFace()
Definition: Assembly.h:538
const VariableValue & sln()
Assembly & _assembly
Problem assembly.
MooseMesh & _mesh
The problem mesh.
QBase *& _qrule
Quadrature rule.
const VariablePhiGradient & gradPhiFace()
ZeroInterface(const InputParameters &parameters)
Definition: ZeroInterface.C:18
virtual void addVariableToZeroOnJacobian(std::string var_name)
Adds this variable to the list of variables to be zeroed during each Jacobian evaluation.
Definition: SystemBase.C:156
unsigned int size() const
Return the number of items in the MultiMooseEnum.
void mooseError(Args &&...args) const
Definition: MooseObject.h:80
THREAD_ID _tid
The thread ID.
const Real & sideElemVolume()
Returns the reference to the volume of current side element.
Definition: Assembly.h:229
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
bool _has_master_residuals_saved_in
Whether there are master residual aux variables.
const Moose::CoordinateSystemType & coordSystem()
Get the coordinate system type.
Definition: Assembly.h:159
const VariableValue & slnNeighbor()
const Real & _current_elem_volume
The volume (or length) of the current element.
BoundaryRestrictable(const MooseObject *moose_object, bool nodal)
Class constructor Populates the _bnd_ids for the given boundary names supplied with the &#39;boundary&#39; in...
const VariableValue & _u
Holds the current solution at the current quadrature point on the face.
const VariablePhiValue & phiFaceNeighbor()
std::vector< AuxVariableName > _save_in_strings
The names of the aux variables that will be used to save-in residuals (includes both master and slave...
const VariablePhiValue & phiFaceNeighbor()
Definition: Assembly.h:546
SystemBase & sys()
Get the system this variable is part of.
std::vector< MooseVariable * > _slave_save_in_jacobian_variables
The aux variables to save the diagonal Jacobian contributions of the slave variables to...
std::vector< MooseVariable * > _slave_save_in_residual_variables
The aux variables to save the slave contributions to.
const VariableGradient & gradSln()
SubProblem & _subproblem
Reference to the controlling finite element problem.
bool _is_implicit
If the object is using implicit or explicit form.
unsigned int & _current_side
Current side.
const Elem *& sideElem()
Returns the side element.
Definition: Assembly.h:223
unsigned int THREAD_ID
Definition: MooseTypes.h:79
UserObjectInterface(const MooseObject *moose_object)

Member Function Documentation

void MooseVariableDependencyInterface::addMooseVariableDependency ( MooseVariable var)
inlineprotectedinherited

Call this function to add the passed in MooseVariable as a variable that this object depends on.

Definition at line 42 of file MooseVariableDependencyInterface.h.

Referenced by AuxNodalScalarKernel::AuxNodalScalarKernel(), CoupleableMooseVariableDependencyIntermediateInterface::CoupleableMooseVariableDependencyIntermediateInterface(), DGKernel::DGKernel(), ElementIndicator::ElementIndicator(), ElementIntegralVariablePostprocessor::ElementIntegralVariablePostprocessor(), ElementIntegralVariableUserObject::ElementIntegralVariableUserObject(), ElementUserObject::ElementUserObject(), ElementVariablePostprocessor::ElementVariablePostprocessor(), IntegratedBC::IntegratedBC(), InterfaceKernel(), InternalSideIndicator::InternalSideIndicator(), InternalSideUserObject::InternalSideUserObject(), KernelBase::KernelBase(), Marker::Marker(), Material::Material(), NeighborCoupleableMooseVariableDependencyIntermediateInterface::NeighborCoupleableMooseVariableDependencyIntermediateInterface(), NodalBC::NodalBC(), NodalKernel::NodalKernel(), NodalScalarKernel::NodalScalarKernel(), NodalUserObject::NodalUserObject(), QuadraturePointMarker::QuadraturePointMarker(), SideIntegralVariablePostprocessor::SideIntegralVariablePostprocessor(), SideIntegralVariableUserObject::SideIntegralVariableUserObject(), and SideUserObject::SideUserObject().

42 { _moose_variable_dependencies.insert(var); }
std::set< MooseVariable * > _moose_variable_dependencies
void MooseVariableDependencyInterface::addMooseVariableDependency ( std::vector< MooseVariable * >  vars)
inlineprotectedinherited

Definition at line 43 of file MooseVariableDependencyInterface.h.

44  {
45  _moose_variable_dependencies.insert(vars.begin(), vars.end());
46  }
std::set< MooseVariable * > _moose_variable_dependencies
const std::set< BoundaryID > & BoundaryRestrictable::boundaryIDs ( ) const
virtualinherited

Return the boundary IDs for this object.

Returns
A set of all boundary ids for which the object is restricted

Definition at line 153 of file BoundaryRestrictable.C.

Referenced by NonlinearSystemBase::addBoundaryCondition(), NonlinearSystemBase::addInterfaceKernel(), AutoPositionsMultiApp::fillPositions(), Material::getZeroMaterialProperty(), BoundaryRestrictable::hasBoundaryMaterialPropertyHelper(), and Material::registerPropName().

154 {
155  return _bnd_ids;
156 }
std::set< BoundaryID > _bnd_ids
Set of the boundary ids.
const std::vector< BoundaryName > & BoundaryRestrictable::boundaryNames ( ) const
inherited

Return the boundary names for this object.

Returns
A set of all boundary names for which the object is restricted

Definition at line 159 of file BoundaryRestrictable.C.

Referenced by NearestNodeDistanceAux::NearestNodeDistanceAux(), and NearestNodeValueAux::NearestNodeValueAux().

160 {
161  return _boundary_names;
162 }
std::vector< BoundaryName > _boundary_names
Vector the the boundary names.
bool BoundaryRestrictable::boundaryRestricted ( ) const
virtualinherited

Returns true if this object has been restricted to a boundary.

See also
MooseObject

Definition at line 171 of file BoundaryRestrictable.C.

Referenced by DerivativeMaterialInterface< T >::haveMaterialProperty().

172 {
174 }
static bool restricted(const std::set< BoundaryID > &ids)
Helper for determining if the object is boundary restricted.
std::set< BoundaryID > _bnd_ids
Set of the boundary ids.
void MaterialPropertyInterface::checkMaterialProperty ( const std::string &  name)
protectedinherited

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

Definition at line 138 of file MaterialPropertyInterface.C.

Referenced by MaterialPropertyInterface::getMaterialPropertyByName().

139 {
140  // If the material property is boundary restrictable, add to the list of materials to check
142  for (const auto & bnd_id : _mi_boundary_ids)
144 
145  // The default is to assume block restrictions
146  else
147  for (const auto & blk_ids : _mi_block_ids)
149 }
virtual void storeDelayedCheckMatProp(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:253
FEProblemBase & _mi_feproblem
Reference to the FEProblemBase class.
const std::set< SubdomainID > & _mi_block_ids
Storage for the block ids created by BlockRestrictable.
const bool _mi_boundary_restricted
BoundaryRestricted flag.
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.
void InterfaceKernel::computeElementOffDiagJacobian ( unsigned int  jvar)
virtual

Selects the correct Jacobian type and routine to call for the master variable jacobian.

Definition at line 356 of file InterfaceKernel.C.

357 {
358  bool is_jvar_not_interface_var = true;
359  if (jvar == _var.number())
360  {
362  is_jvar_not_interface_var = false;
363  }
364  if (jvar == _neighbor_var.number())
365  {
367  is_jvar_not_interface_var = false;
368  }
369 
370  if (is_jvar_not_interface_var)
371  {
374  }
375 }
virtual void computeOffDiagElemNeighJacobian(Moose::DGJacobianType type, unsigned int jvar)
Using the passed DGJacobian type, selects the correct test function and trial function spaces and jac...
MooseVariable & _neighbor_var
Coupled neighbor variable.
virtual void computeElemNeighJacobian(Moose::DGJacobianType type)
Using the passed DGJacobian type, selects the correct test function and trial function spaces and jac...
MooseVariable & _var
The master side MooseVariable.
unsigned int number() const
Get variable number coming from libMesh.
void InterfaceKernel::computeElemNeighJacobian ( Moose::DGJacobianType  type)
virtual

Using the passed DGJacobian type, selects the correct test function and trial function spaces and jacobian block, and then calls computeQpJacobian.

Definition at line 269 of file InterfaceKernel.C.

Referenced by computeElementOffDiagJacobian(), computeJacobian(), and computeNeighborOffDiagJacobian().

270 {
271  const VariableTestValue & test_space =
273  const VariableTestValue & loc_phi =
275  DenseMatrix<Number> & Kxx =
287 
288  _local_kxx.resize(Kxx.m(), Kxx.n());
289  _local_kxx.zero();
290 
291  for (_qp = 0; _qp < _qrule->n_points(); _qp++)
292  for (_i = 0; _i < test_space.size(); _i++)
293  for (_j = 0; _j < loc_phi.size(); _j++)
295 
296  Kxx += _local_kxx;
297 
299  {
300  auto rows = _local_kxx.m();
301  DenseVector<Number> diag(rows);
302  for (decltype(rows) i = 0; i < rows; i++)
303  diag(i) = _local_kxx(i, i);
304 
305  Threads::spin_mutex::scoped_lock lock(_jacoby_vars_mutex);
306  for (const auto & var : _master_save_in_jacobian_variables)
307  var->sys().solution().add_vector(diag, var->dofIndices());
308  }
310  {
311  auto rows = _local_kxx.m();
312  DenseVector<Number> diag(rows);
313  for (decltype(rows) i = 0; i < rows; i++)
314  diag(i) = _local_kxx(i, i);
315 
316  Threads::spin_mutex::scoped_lock lock(_jacoby_vars_mutex);
317  for (const auto & var : _slave_save_in_jacobian_variables)
318  var->sys().solution().add_vector(diag, var->dofIndicesNeighbor());
319  }
320 }
const VariablePhiValue & _phi
shape function
const MooseArray< Real > & _coord
Coordinate transformation value; relevant in axisymmetric simulations for example.
MooseVariable & _neighbor_var
Coupled neighbor variable.
unsigned int _qp
Current quadrature point.
const MooseArray< Real > & _JxW
Elemtn Jacobian/quadrature weight.
unsigned int _j
DenseMatrix< Number > _local_kxx
Holds residual entries as they are accumulated by this InterfaceKernel.
unsigned int _i
Index for test and trial functions.
const VariablePhiValue & _phi_neighbor
Side neighbor shape function.
bool _has_slave_jacobians_saved_in
Whether there are slave jacobian aux variables.
std::vector< MooseVariable * > _master_save_in_jacobian_variables
The aux variables to save the diagonal Jacobian contributions of the master variables to...
const VariableTestValue & _test
Side shape function.
const VariableTestValue & _test_neighbor
Side neighbor test function.
MooseVariable & _var
The master side MooseVariable.
MatType type
unsigned int number() const
Get variable number coming from libMesh.
virtual Real computeQpJacobian(Moose::DGJacobianType type)=0
Compute jacobians at quadrature points.
bool _has_master_jacobians_saved_in
Whether there are master jacobian aux variables.
unsigned int size() const
The number of elements that can currently be stored in the array.
Definition: MooseArray.h:250
Assembly & _assembly
Problem assembly.
QBase *& _qrule
Quadrature rule.
DenseMatrix< Number > & jacobianBlock(unsigned int ivar, unsigned int jvar)
Definition: Assembly.C:887
static Threads::spin_mutex _jacoby_vars_mutex
Mutex that prevents multiple threads from saving into the jacobian aux_var at the same time...
std::vector< MooseVariable * > _slave_save_in_jacobian_variables
The aux variables to save the diagonal Jacobian contributions of the slave variables to...
DenseMatrix< Number > & jacobianBlockNeighbor(Moose::DGJacobianType type, unsigned int ivar, unsigned int jvar)
Definition: Assembly.C:901
void InterfaceKernel::computeElemNeighResidual ( Moose::DGResidualType  type)
virtual

Using the passed DGResidual type, selects the correct test function space and residual block, and then calls computeQpResidual.

Definition at line 221 of file InterfaceKernel.C.

Referenced by computeResidual().

222 {
223  bool is_elem;
224  if (type == Moose::Element)
225  is_elem = true;
226  else
227  is_elem = false;
228 
229  const VariableTestValue & test_space = is_elem ? _test : _test_neighbor;
230  DenseVector<Number> & re = is_elem ? _assembly.residualBlock(_var.number())
232 
233  _local_re.resize(re.size());
234  _local_re.zero();
235 
236  for (_qp = 0; _qp < _qrule->n_points(); _qp++)
237  for (_i = 0; _i < test_space.size(); _i++)
239 
240  re += _local_re;
241 
242  if (_has_master_residuals_saved_in && is_elem)
243  {
244  Threads::spin_mutex::scoped_lock lock(_resid_vars_mutex);
245  for (const auto & var : _master_save_in_residual_variables)
246  {
247  var->sys().solution().add_vector(_local_re, var->dofIndices());
248  }
249  }
250  else if (_has_slave_residuals_saved_in && !is_elem)
251  {
252  Threads::spin_mutex::scoped_lock lock(_resid_vars_mutex);
253  for (const auto & var : _slave_save_in_residual_variables)
254  var->sys().solution().add_vector(_local_re, var->dofIndicesNeighbor());
255  }
256 }
bool _has_slave_residuals_saved_in
Whether there are slave residual aux variables.
const MooseArray< Real > & _coord
Coordinate transformation value; relevant in axisymmetric simulations for example.
MooseVariable & _neighbor_var
Coupled neighbor variable.
DenseVector< Number > _local_re
Holds residual entries as they are accumulated by this InterfaceKernel.
unsigned int _qp
Current quadrature point.
virtual Real computeQpResidual(Moose::DGResidualType type)=0
Compute residuals at quadrature points.
const MooseArray< Real > & _JxW
Elemtn Jacobian/quadrature weight.
std::vector< MooseVariable * > _master_save_in_residual_variables
The aux variables to save the master residual contributions to.
DenseVector< Number > & residualBlock(unsigned int var_num, Moose::KernelType type=Moose::KT_NONTIME)
Definition: Assembly.h:504
static Threads::spin_mutex _resid_vars_mutex
Mutex that prevents multiple threads from saving into the residual aux_var at the same time...
unsigned int _i
Index for test and trial functions.
const VariableTestValue & _test
Side shape function.
const VariableTestValue & _test_neighbor
Side neighbor test function.
MooseVariable & _var
The master side MooseVariable.
MatType type
unsigned int number() const
Get variable number coming from libMesh.
unsigned int size() const
The number of elements that can currently be stored in the array.
Definition: MooseArray.h:250
Assembly & _assembly
Problem assembly.
QBase *& _qrule
Quadrature rule.
bool _has_master_residuals_saved_in
Whether there are master residual aux variables.
std::vector< MooseVariable * > _slave_save_in_residual_variables
The aux variables to save the slave contributions to.
DenseVector< Number > & residualBlockNeighbor(unsigned int var_num, Moose::KernelType type=Moose::KT_NONTIME)
Definition: Assembly.h:509
void InterfaceKernel::computeJacobian ( )
virtual

Computes the jacobian for the current side.

Definition at line 323 of file InterfaceKernel.C.

324 {
327 }
virtual void computeElemNeighJacobian(Moose::DGJacobianType type)
Using the passed DGJacobian type, selects the correct test function and trial function spaces and jac...
void InterfaceKernel::computeNeighborOffDiagJacobian ( unsigned int  jvar)
virtual

Selects the correct Jacobian type and routine to call for the slave variable jacobian.

Definition at line 378 of file InterfaceKernel.C.

379 {
380  bool is_jvar_not_interface_var = true;
381  if (jvar == _var.number())
382  {
384  is_jvar_not_interface_var = false;
385  }
386  if (jvar == _neighbor_var.number())
387  {
389  is_jvar_not_interface_var = false;
390  }
391 
392  if (is_jvar_not_interface_var)
393  {
396  }
397 }
virtual void computeOffDiagElemNeighJacobian(Moose::DGJacobianType type, unsigned int jvar)
Using the passed DGJacobian type, selects the correct test function and trial function spaces and jac...
MooseVariable & _neighbor_var
Coupled neighbor variable.
virtual void computeElemNeighJacobian(Moose::DGJacobianType type)
Using the passed DGJacobian type, selects the correct test function and trial function spaces and jac...
MooseVariable & _var
The master side MooseVariable.
unsigned int number() const
Get variable number coming from libMesh.
void InterfaceKernel::computeOffDiagElemNeighJacobian ( Moose::DGJacobianType  type,
unsigned int  jvar 
)
virtual

Using the passed DGJacobian type, selects the correct test function and trial function spaces and jacobian block, and then calls computeQpOffDiagJacobian with the passed jvar.

Definition at line 330 of file InterfaceKernel.C.

Referenced by computeElementOffDiagJacobian(), and computeNeighborOffDiagJacobian().

331 {
332  const VariableTestValue & test_space =
334  const VariableTestValue & loc_phi =
336  DenseMatrix<Number> & Kxx =
346 
347  // Prevent calling of Jacobian computation if jvar doesn't lie in the current block
348  if ((Kxx.m() == test_space.size()) && (Kxx.n() == loc_phi.size()))
349  for (_qp = 0; _qp < _qrule->n_points(); _qp++)
350  for (_i = 0; _i < test_space.size(); _i++)
351  for (_j = 0; _j < loc_phi.size(); _j++)
352  Kxx(_i, _j) += _JxW[_qp] * _coord[_qp] * computeQpOffDiagJacobian(type, jvar);
353 }
const VariablePhiValue & _phi
shape function
const MooseArray< Real > & _coord
Coordinate transformation value; relevant in axisymmetric simulations for example.
virtual Real computeQpOffDiagJacobian(Moose::DGJacobianType type, unsigned int jvar)
compute off-diagonal jacobian components at quadrature points
MooseVariable & _neighbor_var
Coupled neighbor variable.
unsigned int _qp
Current quadrature point.
const MooseArray< Real > & _JxW
Elemtn Jacobian/quadrature weight.
unsigned int _j
unsigned int _i
Index for test and trial functions.
const VariablePhiValue & _phi_neighbor
Side neighbor shape function.
const VariableTestValue & _test
Side shape function.
const VariableTestValue & _test_neighbor
Side neighbor test function.
MooseVariable & _var
The master side MooseVariable.
MatType type
unsigned int number() const
Get variable number coming from libMesh.
unsigned int size() const
The number of elements that can currently be stored in the array.
Definition: MooseArray.h:250
Assembly & _assembly
Problem assembly.
QBase *& _qrule
Quadrature rule.
DenseMatrix< Number > & jacobianBlock(unsigned int ivar, unsigned int jvar)
Definition: Assembly.C:887
DenseMatrix< Number > & jacobianBlockNeighbor(Moose::DGJacobianType type, unsigned int ivar, unsigned int jvar)
Definition: Assembly.C:901
virtual Real InterfaceKernel::computeQpJacobian ( Moose::DGJacobianType  type)
protectedpure virtual

Compute jacobians at quadrature points.

Referenced by computeElemNeighJacobian().

Real InterfaceKernel::computeQpOffDiagJacobian ( Moose::DGJacobianType  type,
unsigned int  jvar 
)
protectedvirtual

compute off-diagonal jacobian components at quadrature points

Definition at line 400 of file InterfaceKernel.C.

Referenced by computeOffDiagElemNeighJacobian().

401 {
402  return 0.;
403 }
virtual Real InterfaceKernel::computeQpResidual ( Moose::DGResidualType  type)
protectedpure virtual

Compute residuals at quadrature points.

Referenced by computeElemNeighResidual().

void InterfaceKernel::computeResidual ( )
virtual

Computes the residual for the current side.

Definition at line 259 of file InterfaceKernel.C.

260 {
261  // Compute the residual for this element
263 
264  // Compute the residual for the neighbor
266 }
virtual void computeElemNeighResidual(Moose::DGResidualType type)
Using the passed DGResidual type, selects the correct test function space and residual block...
unsigned int Coupleable::coupled ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtualinherited

Returns the index for a coupled variable by name.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Index of coupled variable, if this is an optionally coupled variable that wasn't provided this will return a unique "invalid" index.

Reimplemented in ShapeUserObject< ElementUserObject >, and ShapeUserObject< SideUserObject >.

Definition at line 136 of file Coupleable.C.

Referenced by NodalEqualValueConstraint::NodalEqualValueConstraint().

137 {
138  if (!isCoupled(var_name))
139  return _optional_var_index[var_name];
140 
141  MooseVariable * var = getVar(var_name, comp);
142  switch (var->kind())
143  {
145  return var->number();
147  return std::numeric_limits<unsigned int>::max() - var->number();
148  }
149  mooseError("Unknown variable kind. Corrupted binary?");
150 }
Class for stuff related to variables.
Definition: MooseVariable.h:43
Moose::VarKindType kind() const
Kind of the variable (Nonlinear, Auxiliary, ...)
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:117
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:91
unsigned int number() const
Get variable number coming from libMesh.
std::map< std::string, unsigned int > _optional_var_index
Unique indices for optionally coupled vars that weren&#39;t provided.
Definition: Coupleable.h:378
void Coupleable::coupledCallback ( const std::string &  var_name,
bool  is_old 
)
protectedvirtualinherited
unsigned int Coupleable::coupledComponents ( const std::string &  var_name)
protectedinherited

Number of coupled components.

Parameters
var_nameName of the variable
Returns
number of components this variable has (usually 1)

Definition at line 111 of file Coupleable.C.

Referenced by NodalEqualValueConstraint::NodalEqualValueConstraint(), SphericalAverage::SphericalAverage(), and VolumeHistogram::VolumeHistogram().

112 {
113  return _coupled_vars[var_name].size();
114 }
std::map< std::string, std::vector< MooseVariable * > > _coupled_vars
Coupled vars whose values we provide.
Definition: Coupleable.h:321
const VariableValue & Coupleable::coupledDot ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtualinherited

Time derivative of a coupled variable.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableValue containing the time derivative of the coupled variable
See also
Kernel::dot

Reimplemented in AuxKernel.

Definition at line 296 of file Coupleable.C.

Referenced by AuxKernel::coupledDot().

297 {
298  if (!isCoupled(var_name)) // Return default 0
299  return _default_value_zero;
300 
301  MooseVariable * var = getVar(var_name, comp);
302 
304  {
305  if (_c_nodal)
306  return var->nodalSlnDot();
307  else
308  return var->uDot();
309  }
310  else
311  {
312  if (_c_nodal)
313  return var->nodalSlnDotNeighbor();
314  else
315  return var->uDotNeighbor();
316  }
317 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:327
Class for stuff related to variables.
Definition: MooseVariable.h:43
const VariableValue & uDotNeighbor()
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:339
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:117
const VariableValue & nodalSlnDot()
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:91
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:363
const VariableValue & uDot()
const VariableValue & nodalSlnDotNeighbor()
const VariableValue & Coupleable::coupledDotDu ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtualinherited

Time derivative of a coupled variable with respect to the coefficients.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableValue containing the time derivative of the coupled variable with respect to the coefficients
See also
Kernel:dotDu

Reimplemented in AuxKernel.

Definition at line 320 of file Coupleable.C.

Referenced by AuxKernel::coupledDotDu().

321 {
322  if (!isCoupled(var_name)) // Return default 0
323  return _default_value_zero;
324 
325  MooseVariable * var = getVar(var_name, comp);
326 
328  {
329  if (_c_nodal)
330  return var->nodalSlnDuDotDu();
331  else
332  return var->duDotDu();
333  }
334  else
335  {
336  if (_c_nodal)
337  return var->nodalSlnDuDotDu();
338  else
339  return var->duDotDu();
340  }
341 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:327
Class for stuff related to variables.
Definition: MooseVariable.h:43
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:339
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:117
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:91
const VariableValue & duDotDu()
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:363
const VariableValue & nodalSlnDuDotDu()
const VariableGradient & Coupleable::coupledGradient ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtualinherited

Returns gradient of a coupled variable.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableGradient containing the gradient of the coupled variable
See also
Kernel::gradient

Definition at line 344 of file Coupleable.C.

345 {
346  if (!isCoupled(var_name)) // Return default 0
347  return _default_gradient;
348 
349  coupledCallback(var_name, false);
350  if (_c_nodal)
351  mooseError("Nodal variables do not have gradients");
352 
353  MooseVariable * var = getVar(var_name, comp);
354 
356  return (_c_is_implicit) ? var->gradSln() : var->gradSlnOld();
357  else
358  return (_c_is_implicit) ? var->gradSlnNeighbor() : var->gradSlnOldNeighbor();
359 }
const VariableGradient & gradSlnNeighbor()
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:327
const VariableGradient & gradSlnOld()
Class for stuff related to variables.
Definition: MooseVariable.h:43
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
const VariableGradient & gradSlnOldNeighbor()
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:117
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:330
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:91
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:86
VariableGradient _default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:342
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:363
const VariableGradient & gradSln()
const VariableGradient & Coupleable::coupledGradientOld ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtualinherited

Returns an old gradient from previous time step of a coupled variable.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableGradient containing the old gradient of the coupled variable
See also
Kernel::gradientOld

Definition at line 362 of file Coupleable.C.

363 {
364  if (!isCoupled(var_name)) // Return default 0
365  return _default_gradient;
366 
367  coupledCallback(var_name, true);
368  if (_c_nodal)
369  mooseError("Nodal variables do not have gradients");
370 
371  validateExecutionerType(var_name);
372  MooseVariable * var = getVar(var_name, comp);
373 
375  return (_c_is_implicit) ? var->gradSlnOld() : var->gradSlnOlder();
376  else
377  return (_c_is_implicit) ? var->gradSlnOldNeighbor() : var->gradSlnOlderNeighbor();
378 }
void validateExecutionerType(const std::string &name) const
Checks to make sure that the current Executioner has set "_it_transient" when old/older values are co...
Definition: Coupleable.C:646
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:327
const VariableGradient & gradSlnOld()
Class for stuff related to variables.
Definition: MooseVariable.h:43
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
const VariableGradient & gradSlnOldNeighbor()
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:117
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:330
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:91
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:86
VariableGradient _default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:342
const VariableGradient & gradSlnOlderNeighbor()
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:363
const VariableGradient & gradSlnOlder()
const VariableGradient & Coupleable::coupledGradientOlder ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtualinherited

Returns an old gradient from two time steps previous of a coupled variable.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableGradient containing the older gradient of the coupled variable
See also
Kernel::gradientOlder

Definition at line 381 of file Coupleable.C.

382 {
383  if (!isCoupled(var_name)) // Return default 0
384  return _default_gradient;
385 
386  coupledCallback(var_name, true);
387  if (_c_nodal)
388  mooseError("Nodal variables do not have gradients");
389 
390  validateExecutionerType(var_name);
391  MooseVariable * var = getVar(var_name, comp);
392 
393  if (_c_is_implicit)
394  {
396  return var->gradSlnOlder();
397  else
398  return var->gradSlnOlderNeighbor();
399  }
400  else
401  mooseError("Older values not available for explicit schemes");
402 }
void validateExecutionerType(const std::string &name) const
Checks to make sure that the current Executioner has set "_it_transient" when old/older values are co...
Definition: Coupleable.C:646
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:327
Class for stuff related to variables.
Definition: MooseVariable.h:43
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:117
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:330
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:91
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:86
VariableGradient _default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:342
const VariableGradient & gradSlnOlderNeighbor()
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:363
const VariableGradient & gradSlnOlder()
const VariableGradient & Coupleable::coupledGradientPreviousNL ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtualinherited

Returns gradient of a coupled variable for previous Newton iterate.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableGradient containing the gradient of the coupled variable

Definition at line 405 of file Coupleable.C.

406 {
407  if (!isCoupled(var_name)) // Return default 0
408  return _default_gradient;
409 
411  coupledCallback(var_name, true);
412  if (_c_nodal)
413  mooseError("Nodal variables do not have gradients");
414 
415  MooseVariable * var = getVar(var_name, comp);
416 
418  return var->gradSlnPreviousNL();
419  else
420  return var->gradSlnPreviousNLNeighbor();
421 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:327
Class for stuff related to variables.
Definition: MooseVariable.h:43
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:117
const VariableGradient & gradSlnPreviousNLNeighbor()
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:318
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:91
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:86
VariableGradient _default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:342
const VariableGradient & gradSlnPreviousNL()
void needsPreviousNewtonIteration(bool state)
Set a flag that indicated that user required values for the previous Newton iterate.
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:363
const VariableGradient & NeighborCoupleable::coupledNeighborGradient ( const std::string &  var_name,
unsigned int  comp = 0 
)
virtualinherited

Definition at line 77 of file NeighborCoupleable.C.

78 {
79  if (_neighbor_nodal)
80  mooseError("Nodal variables do not have gradients");
81 
82  MooseVariable * var = getVar(var_name, comp);
83  return (_c_is_implicit) ? var->gradSlnNeighbor() : var->gradSlnOldNeighbor();
84 }
const VariableGradient & gradSlnNeighbor()
Class for stuff related to variables.
Definition: MooseVariable.h:43
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
const VariableGradient & gradSlnOldNeighbor()
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:117
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:330
const VariableGradient & NeighborCoupleable::coupledNeighborGradientOld ( const std::string &  var_name,
unsigned int  comp = 0 
)
virtualinherited

Definition at line 87 of file NeighborCoupleable.C.

88 {
89  if (_neighbor_nodal)
90  mooseError("Nodal variables do not have gradients");
91 
92  validateExecutionerType(var_name);
93  MooseVariable * var = getVar(var_name, comp);
94  return (_c_is_implicit) ? var->gradSlnOldNeighbor() : var->gradSlnOlderNeighbor();
95 }
void validateExecutionerType(const std::string &name) const
Checks to make sure that the current Executioner has set "_it_transient" when old/older values are co...
Definition: Coupleable.C:646
Class for stuff related to variables.
Definition: MooseVariable.h:43
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
const VariableGradient & gradSlnOldNeighbor()
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:117
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:330
const VariableGradient & gradSlnOlderNeighbor()
const VariableGradient & NeighborCoupleable::coupledNeighborGradientOlder ( const std::string &  var_name,
unsigned int  comp = 0 
)
virtualinherited

Definition at line 98 of file NeighborCoupleable.C.

99 {
100  if (_neighbor_nodal)
101  mooseError("Nodal variables do not have gradients");
102 
103  validateExecutionerType(var_name);
104  MooseVariable * var = getVar(var_name, comp);
105  if (_c_is_implicit)
106  return var->gradSlnOlderNeighbor();
107  else
108  mooseError("Older values not available for explicit schemes");
109 }
void validateExecutionerType(const std::string &name) const
Checks to make sure that the current Executioner has set "_it_transient" when old/older values are co...
Definition: Coupleable.C:646
Class for stuff related to variables.
Definition: MooseVariable.h:43
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:117
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:330
const VariableGradient & gradSlnOlderNeighbor()
const VariableSecond & NeighborCoupleable::coupledNeighborSecond ( const std::string &  var_name,
unsigned int  i = 0 
)
virtualinherited

Definition at line 112 of file NeighborCoupleable.C.

113 {
114  if (_neighbor_nodal)
115  mooseError("Nodal variables do not have second derivatives");
116 
117  MooseVariable * var = getVar(var_name, comp);
118  return (_c_is_implicit) ? var->secondSlnNeighbor() : var->secondSlnOldNeighbor();
119 }
const VariableSecond & secondSlnOldNeighbor()
Class for stuff related to variables.
Definition: MooseVariable.h:43
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:117
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:330
const VariableSecond & secondSlnNeighbor()
const DenseVector< Number > & NeighborCoupleable::coupledNeighborSolutionDoFs ( const std::string &  var_name,
unsigned int  comp = 0 
)
virtualinherited

Definition at line 122 of file NeighborCoupleable.C.

123 {
124  if (_neighbor_nodal)
125  mooseError("nodal objects should not call coupledSolutionDoFs");
126 
127  MooseVariable * var = getVar(var_name, comp);
129 }
Class for stuff related to variables.
Definition: MooseVariable.h:43
const DenseVector< Number > & solutionDoFsNeighbor()
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:117
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:330
const DenseVector< Number > & solutionDoFsOldNeighbor()
const DenseVector< Number > & NeighborCoupleable::coupledNeighborSolutionDoFsOld ( const std::string &  var_name,
unsigned int  comp = 0 
)
virtualinherited

Definition at line 132 of file NeighborCoupleable.C.

133 {
134  if (_neighbor_nodal)
135  mooseError("nodal objects should not call coupledSolutionDoFsOld");
136 
137  MooseVariable * var = getVar(var_name, comp);
139 }
Class for stuff related to variables.
Definition: MooseVariable.h:43
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:117
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:330
const DenseVector< Number > & solutionDoFsOlderNeighbor()
const DenseVector< Number > & solutionDoFsOldNeighbor()
const DenseVector< Number > & NeighborCoupleable::coupledNeighborSolutionDoFsOlder ( const std::string &  var_name,
unsigned int  comp = 0 
)
virtualinherited

Definition at line 142 of file NeighborCoupleable.C.

144 {
145  if (_neighbor_nodal)
146  mooseError("nodal objects should not call coupledSolutionDoFsOlder");
147 
148  MooseVariable * var = getVar(var_name, comp);
149  if (_c_is_implicit)
150  return var->solutionDoFsOlderNeighbor();
151  else
152  mooseError("Older values not available for explicit schemes");
153 }
Class for stuff related to variables.
Definition: MooseVariable.h:43
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:117
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:330
const DenseVector< Number > & solutionDoFsOlderNeighbor()
const VariableValue & NeighborCoupleable::coupledNeighborValue ( const std::string &  var_name,
unsigned int  comp = 0 
)
virtualinherited

Definition at line 33 of file NeighborCoupleable.C.

34 {
35  MooseVariable * var = getVar(var_name, comp);
36  if (_neighbor_nodal)
37  return (_c_is_implicit) ? var->nodalSlnNeighbor() : var->nodalSlnOldNeighbor();
38  else
39  return (_c_is_implicit) ? var->slnNeighbor() : var->slnOldNeighbor();
40 }
Class for stuff related to variables.
Definition: MooseVariable.h:43
const VariableValue & nodalSlnNeighbor()
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:117
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:330
const VariableValue & nodalSlnOldNeighbor()
const VariableValue & slnOldNeighbor()
const VariableValue & slnNeighbor()
const VariableValue & NeighborCoupleable::coupledNeighborValueOld ( const std::string &  var_name,
unsigned int  comp = 0 
)
virtualinherited

Definition at line 43 of file NeighborCoupleable.C.

44 {
45  validateExecutionerType(var_name);
46 
47  MooseVariable * var = getVar(var_name, comp);
48  if (_neighbor_nodal)
49  return (_c_is_implicit) ? var->nodalSlnOldNeighbor() : var->nodalSlnOlderNeighbor();
50  else
51  return (_c_is_implicit) ? var->slnOldNeighbor() : var->slnOlderNeighbor();
52 }
void validateExecutionerType(const std::string &name) const
Checks to make sure that the current Executioner has set "_it_transient" when old/older values are co...
Definition: Coupleable.C:646
Class for stuff related to variables.
Definition: MooseVariable.h:43
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:117
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:330
const VariableValue & nodalSlnOldNeighbor()
const VariableValue & nodalSlnOlderNeighbor()
const VariableValue & slnOlderNeighbor()
const VariableValue & slnOldNeighbor()
const VariableValue & NeighborCoupleable::coupledNeighborValueOlder ( const std::string &  var_name,
unsigned int  comp = 0 
)
virtualinherited

Definition at line 55 of file NeighborCoupleable.C.

56 {
57  validateExecutionerType(var_name);
58 
59  MooseVariable * var = getVar(var_name, comp);
60  if (_neighbor_nodal)
61  {
62  if (_c_is_implicit)
63  return var->nodalSlnOlderNeighbor();
64  else
65  mooseError("Older values not available for explicit schemes");
66  }
67  else
68  {
69  if (_c_is_implicit)
70  return var->slnOlderNeighbor();
71  else
72  mooseError("Older values not available for explicit schemes");
73  }
74 }
void validateExecutionerType(const std::string &name) const
Checks to make sure that the current Executioner has set "_it_transient" when old/older values are co...
Definition: Coupleable.C:646
Class for stuff related to variables.
Definition: MooseVariable.h:43
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:117
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:330
const VariableValue & nodalSlnOlderNeighbor()
const VariableValue & slnOlderNeighbor()
const VariableValue & Coupleable::coupledNodalDot ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtualinherited

Nodal values of time derivative of a coupled variable.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableValue containing the nodal values of time derivative of the coupled variable

Definition at line 568 of file Coupleable.C.

569 {
570  if (!isCoupled(var_name)) // Return default 0
571  return _default_value_zero;
572 
573  coupledCallback(var_name, false);
574  MooseVariable * var = getVar(var_name, comp);
575 
577  return var->nodalValueDot();
578  else
579  return var->nodalValueDotNeighbor();
580 }
Class for stuff related to variables.
Definition: MooseVariable.h:43
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:339
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:117
const VariableValue & nodalValueDotNeighbor()
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:91
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:86
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:363
const VariableValue & nodalValueDot()
const VariableValue & Coupleable::coupledNodalValue ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtualinherited

Returns nodal values of a coupled variable.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableValue for the coupled variable

Definition at line 501 of file Coupleable.C.

502 {
503  if (!isCoupled(var_name))
504  return *getDefaultValue(var_name);
505 
506  coupledCallback(var_name, false);
507  MooseVariable * var = getVar(var_name, comp);
508 
510  return (_c_is_implicit) ? var->nodalValue() : var->nodalValueOld();
511  else
512  return (_c_is_implicit) ? var->nodalValueNeighbor() : var->nodalValueOldNeighbor();
513 }
const VariableValue & nodalValue()
Class for stuff related to variables.
Definition: MooseVariable.h:43
const VariableValue & nodalValueNeighbor()
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:117
VariableValue * getDefaultValue(const std::string &var_name)
Helper method to return (and insert if necessary) the default value for an uncoupled variable...
Definition: Coupleable.C:153
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:330
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:91
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:86
const VariableValue & nodalValueOldNeighbor()
const VariableValue & nodalValueOld()
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:363
const VariableValue & Coupleable::coupledNodalValueOld ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtualinherited

Returns an old nodal value from previous time step of a coupled variable.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableValue containing the old value of the coupled variable

Definition at line 516 of file Coupleable.C.

517 {
518  if (!isCoupled(var_name))
519  return *getDefaultValue(var_name);
520 
521  validateExecutionerType(var_name);
522  coupledCallback(var_name, true);
523  MooseVariable * var = getVar(var_name, comp);
524 
526  return (_c_is_implicit) ? var->nodalValueOld() : var->nodalValueOlder();
527  else
529 }
void validateExecutionerType(const std::string &name) const
Checks to make sure that the current Executioner has set "_it_transient" when old/older values are co...
Definition: Coupleable.C:646
Class for stuff related to variables.
Definition: MooseVariable.h:43
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:117
VariableValue * getDefaultValue(const std::string &var_name)
Helper method to return (and insert if necessary) the default value for an uncoupled variable...
Definition: Coupleable.C:153
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:330
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:91
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:86
const VariableValue & nodalValueOldNeighbor()
const VariableValue & nodalValueOld()
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:363
const VariableValue & nodalValueOlderNeighbor()
const VariableValue & nodalValueOlder()
const VariableValue & Coupleable::coupledNodalValueOlder ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtualinherited

Returns an old nodal value from two time steps previous of a coupled variable.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableValue containing the older value of the coupled variable

Definition at line 532 of file Coupleable.C.

533 {
534  if (!isCoupled(var_name))
535  return *getDefaultValue(var_name);
536 
537  validateExecutionerType(var_name);
538  coupledCallback(var_name, true);
539  MooseVariable * var = getVar(var_name, comp);
540  if (_c_is_implicit)
541  {
543  return var->nodalValueOlder();
544  else
545  return var->nodalValueOlderNeighbor();
546  }
547  else
548  mooseError("Older values not available for explicit schemes");
549 }
void validateExecutionerType(const std::string &name) const
Checks to make sure that the current Executioner has set "_it_transient" when old/older values are co...
Definition: Coupleable.C:646
Class for stuff related to variables.
Definition: MooseVariable.h:43
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:117
VariableValue * getDefaultValue(const std::string &var_name)
Helper method to return (and insert if necessary) the default value for an uncoupled variable...
Definition: Coupleable.C:153
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:330
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:91
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:86
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:363
const VariableValue & nodalValueOlderNeighbor()
const VariableValue & nodalValueOlder()
const VariableValue & Coupleable::coupledNodalValuePreviousNL ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtualinherited

Returns nodal values of a coupled variable for previous Newton iterate.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableValue for the coupled variable

Definition at line 552 of file Coupleable.C.

553 {
554  if (!isCoupled(var_name))
555  return *getDefaultValue(var_name);
556 
558  coupledCallback(var_name, true);
559  MooseVariable * var = getVar(var_name, comp);
560 
562  return var->nodalValuePreviousNL();
563  else
564  return var->nodalValuePreviousNLNeighbor();
565 }
Class for stuff related to variables.
Definition: MooseVariable.h:43
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:117
VariableValue * getDefaultValue(const std::string &var_name)
Helper method to return (and insert if necessary) the default value for an uncoupled variable...
Definition: Coupleable.C:153
const VariableValue & nodalValuePreviousNL()
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:318
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:91
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:86
void needsPreviousNewtonIteration(bool state)
Set a flag that indicated that user required values for the previous Newton iterate.
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:363
const VariableValue & nodalValuePreviousNLNeighbor()
unsigned int ScalarCoupleable::coupledScalar ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtualinherited

Returns the index for a scalar coupled variable by name.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Index of coupled variable

Definition at line 99 of file ScalarCoupleable.C.

Referenced by ParsedODEKernel::ParsedODEKernel().

100 {
101  return getScalarVar(var_name, comp)->number();
102 }
MooseVariableScalar * getScalarVar(const std::string &var_name, unsigned int comp)
Extract pointer to a scalar coupled variable.
unsigned int number() const
Get variable number coming from libMesh.
unsigned int ScalarCoupleable::coupledScalarComponents ( const std::string &  var_name)
protectedvirtualinherited

Return the number of components to the coupled scalar variable.

Parameters
var_nameThe of the coupled variable

Definition at line 189 of file ScalarCoupleable.C.

190 {
191  return _coupled_scalar_vars[var_name].size();
192 }
std::map< std::string, std::vector< MooseVariableScalar * > > _coupled_scalar_vars
Coupled vars whose values we provide.
VariableValue & ScalarCoupleable::coupledScalarDot ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtualinherited

Returns the time derivative of a scalar coupled variable.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a time derivative VariableValue for the coupled variable

Definition at line 161 of file ScalarCoupleable.C.

162 {
163  MooseVariableScalar * var = getScalarVar(var_name, comp);
164  return var->uDot();
165 }
VariableValue & uDot()
MooseVariableScalar * getScalarVar(const std::string &var_name, unsigned int comp)
Extract pointer to a scalar coupled variable.
Class for scalar variables (they are different).
VariableValue & ScalarCoupleable::coupledScalarDotDu ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtualinherited

Time derivative of a scalar coupled variable with respect to the coefficients.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableValue containing the time derivative of the coupled variable with respect to the coefficients

Definition at line 168 of file ScalarCoupleable.C.

169 {
170  MooseVariableScalar * var = getScalarVar(var_name, comp);
171  return var->duDotDu();
172 }
VariableValue & duDotDu()
MooseVariableScalar * getScalarVar(const std::string &var_name, unsigned int comp)
Extract pointer to a scalar coupled variable.
Class for scalar variables (they are different).
Order ScalarCoupleable::coupledScalarOrder ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtualinherited

Returns the order for a scalar coupled variable by name.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Order of coupled variable

Definition at line 105 of file ScalarCoupleable.C.

106 {
107  if (!isCoupledScalar(var_name, comp))
109 
110  return getScalarVar(var_name, comp)->order();
111 }
virtual bool isCoupledScalar(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled_as name.
FEProblemBase & _sc_fe_problem
Order getMaxScalarOrder() const
MooseVariableScalar * getScalarVar(const std::string &var_name, unsigned int comp)
Extract pointer to a scalar coupled variable.
Order order() const
Get the order of this variable Note: Order enum can be implicitly converted to unsigned int...
VariableValue & ScalarCoupleable::coupledScalarValue ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtualinherited

Returns value of a scalar coupled variable.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableValue for the coupled variable

Definition at line 128 of file ScalarCoupleable.C.

Referenced by ParsedODEKernel::ParsedODEKernel().

129 {
130  if (!isCoupledScalar(var_name, comp))
131  return *getDefaultValue(var_name);
132 
133  MooseVariableScalar * var = getScalarVar(var_name, comp);
134  return (_sc_is_implicit) ? var->sln() : var->slnOld();
135 }
VariableValue & sln()
virtual bool isCoupledScalar(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled_as name.
VariableValue * getDefaultValue(const std::string &var_name)
Helper method to return (and insert if necessary) the default value for an uncoupled variable...
MooseVariableScalar * getScalarVar(const std::string &var_name, unsigned int comp)
Extract pointer to a scalar coupled variable.
bool _sc_is_implicit
True if implicit value is required.
Class for scalar variables (they are different).
VariableValue & slnOld()
VariableValue & ScalarCoupleable::coupledScalarValueOld ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtualinherited

Returns the old (previous time step) value of a scalar coupled variable.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a old VariableValue for the coupled variable

Definition at line 138 of file ScalarCoupleable.C.

139 {
140  if (!isCoupledScalar(var_name, comp))
141  return *getDefaultValue(var_name);
142 
143  MooseVariableScalar * var = getScalarVar(var_name, comp);
144  return (_sc_is_implicit) ? var->slnOld() : var->slnOlder();
145 }
virtual bool isCoupledScalar(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled_as name.
VariableValue * getDefaultValue(const std::string &var_name)
Helper method to return (and insert if necessary) the default value for an uncoupled variable...
MooseVariableScalar * getScalarVar(const std::string &var_name, unsigned int comp)
Extract pointer to a scalar coupled variable.
bool _sc_is_implicit
True if implicit value is required.
Class for scalar variables (they are different).
VariableValue & slnOlder()
VariableValue & slnOld()
VariableValue & ScalarCoupleable::coupledScalarValueOlder ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtualinherited

Returns the older (two time steps previous) value of a scalar coupled variable.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a older VariableValue for the coupled variable

Definition at line 148 of file ScalarCoupleable.C.

149 {
150  if (!isCoupledScalar(var_name, comp))
151  return *getDefaultValue(var_name);
152 
153  MooseVariableScalar * var = getScalarVar(var_name, comp);
154  if (_sc_is_implicit)
155  return var->slnOlder();
156  else
157  mooseError("Older values not available for explicit schemes");
158 }
virtual bool isCoupledScalar(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled_as name.
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
VariableValue * getDefaultValue(const std::string &var_name)
Helper method to return (and insert if necessary) the default value for an uncoupled variable...
MooseVariableScalar * getScalarVar(const std::string &var_name, unsigned int comp)
Extract pointer to a scalar coupled variable.
bool _sc_is_implicit
True if implicit value is required.
Class for scalar variables (they are different).
VariableValue & slnOlder()
const VariableSecond & Coupleable::coupledSecond ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtualinherited

Returns second derivative of a coupled variable.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableSecond containing the second derivative of the coupled variable
See also
Kernel::second

Definition at line 424 of file Coupleable.C.

425 {
426  if (!isCoupled(var_name)) // Return default 0
427  return _default_second;
428 
429  coupledCallback(var_name, false);
430  if (_c_nodal)
431  mooseError("Nodal variables do not have second derivatives");
432 
433  MooseVariable * var = getVar(var_name, comp);
434 
436  return (_c_is_implicit) ? var->secondSln() : var->secondSlnOlder();
437  else
438  return (_c_is_implicit) ? var->secondSlnNeighbor() : var->secondSlnOlderNeighbor();
439 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:327
Class for stuff related to variables.
Definition: MooseVariable.h:43
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
const VariableSecond & secondSln()
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:117
const VariableSecond & secondSlnOlder()
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:330
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:91
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:86
VariableSecond _default_second
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:345
const VariableSecond & secondSlnOlderNeighbor()
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:363
const VariableSecond & secondSlnNeighbor()
const VariableSecond & Coupleable::coupledSecondOld ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtualinherited

Returns an old second derivative from previous time step of a coupled variable.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableSecond containing the old second derivative of the coupled variable
See also
Kernel::secondOld

Definition at line 442 of file Coupleable.C.

443 {
444  if (!isCoupled(var_name)) // Return default 0
445  return _default_second;
446 
447  coupledCallback(var_name, true);
448  if (_c_nodal)
449  mooseError("Nodal variables do not have second derivatives");
450 
451  validateExecutionerType(var_name);
452  MooseVariable * var = getVar(var_name, comp);
454  return (_c_is_implicit) ? var->secondSlnOld() : var->secondSlnOlder();
455  else
457 }
void validateExecutionerType(const std::string &name) const
Checks to make sure that the current Executioner has set "_it_transient" when old/older values are co...
Definition: Coupleable.C:646
const VariableSecond & secondSlnOldNeighbor()
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:327
Class for stuff related to variables.
Definition: MooseVariable.h:43
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:117
const VariableSecond & secondSlnOld()
const VariableSecond & secondSlnOlder()
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:330
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:91
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:86
VariableSecond _default_second
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:345
const VariableSecond & secondSlnOlderNeighbor()
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:363
const VariableSecond & Coupleable::coupledSecondOlder ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtualinherited

Returns an old second derivative from two time steps previous of a coupled variable.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableSecond containing the older second derivative of the coupled variable
See also
Kernel::secondOlder

Definition at line 460 of file Coupleable.C.

461 {
462  if (!isCoupled(var_name)) // Return default 0
463  return _default_second;
464 
465  coupledCallback(var_name, true);
466  if (_c_nodal)
467  mooseError("Nodal variables do not have second derivatives");
468 
469  validateExecutionerType(var_name);
470  MooseVariable * var = getVar(var_name, comp);
471  if (_c_is_implicit)
472  {
474  return var->secondSlnOlder();
475  else
476  return var->secondSlnOlderNeighbor();
477  }
478  else
479  mooseError("Older values not available for explicit schemes");
480 }
void validateExecutionerType(const std::string &name) const
Checks to make sure that the current Executioner has set "_it_transient" when old/older values are co...
Definition: Coupleable.C:646
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:327
Class for stuff related to variables.
Definition: MooseVariable.h:43
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:117
const VariableSecond & secondSlnOlder()
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:330
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:91
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:86
VariableSecond _default_second
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:345
const VariableSecond & secondSlnOlderNeighbor()
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:363
const VariableSecond & Coupleable::coupledSecondPreviousNL ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtualinherited

Returns second derivative of a coupled variable for the previous Newton iterate.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableSecond containing the second derivative of the coupled variable

Definition at line 483 of file Coupleable.C.

484 {
485  if (!isCoupled(var_name)) // Return default 0
486  return _default_second;
487 
489  coupledCallback(var_name, true);
490  if (_c_nodal)
491  mooseError("Nodal variables do not have second derivatives");
492 
493  MooseVariable * var = getVar(var_name, comp);
495  return var->secondSlnPreviousNL();
496  else
497  return var->secondSlnPreviousNLNeighbor();
498 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:327
const VariableSecond & secondSlnPreviousNL()
Class for stuff related to variables.
Definition: MooseVariable.h:43
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:117
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:318
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:91
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:86
VariableSecond _default_second
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:345
void needsPreviousNewtonIteration(bool state)
Set a flag that indicated that user required values for the previous Newton iterate.
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:363
const VariableSecond & secondSlnPreviousNLNeighbor()
const DenseVector< Number > & Coupleable::coupledSolutionDoFs ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtualinherited

Returns DoFs in the current solution vector of a coupled variable for the local element.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a DenseVector for the DoFs of the coupled variable

Definition at line 583 of file Coupleable.C.

584 {
585  // default coupling is not available for elemental solutions
586  if (!isCoupled(var_name))
587  mooseError("invalid variable name for coupledSolutionDoFs");
588 
589  if (_c_nodal)
590  mooseError("nodal objects should not call coupledSolutionDoFs");
591 
592  coupledCallback(var_name, false);
593  MooseVariable * var = getVar(var_name, comp);
594 
596  return (_c_is_implicit) ? var->solutionDoFs() : var->solutionDoFsOld();
597  else
599 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:327
const DenseVector< Number > & solutionDoFsOld()
Class for stuff related to variables.
Definition: MooseVariable.h:43
const DenseVector< Number > & solutionDoFsNeighbor()
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:117
const DenseVector< Number > & solutionDoFs()
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:330
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:91
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:86
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:363
const DenseVector< Number > & solutionDoFsOldNeighbor()
const DenseVector< Number > & Coupleable::coupledSolutionDoFsOld ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtualinherited

Returns DoFs in the old solution vector of a coupled variable for the local element.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a DenseVector for the old DoFs of the coupled variable

Definition at line 602 of file Coupleable.C.

603 {
604  // default coupling is not available for elemental solutions
605  if (!isCoupled(var_name))
606  mooseError("invalid variable name for coupledSolutionDoFsOld");
607 
608  if (_c_nodal)
609  mooseError("nodal objects should not call coupledSolutionDoFsOld");
610 
611  validateExecutionerType(var_name);
612  coupledCallback(var_name, true);
613  MooseVariable * var = getVar(var_name, comp);
614 
616  return (_c_is_implicit) ? var->solutionDoFsOld() : var->solutionDoFsOlder();
617  else
619 }
void validateExecutionerType(const std::string &name) const
Checks to make sure that the current Executioner has set "_it_transient" when old/older values are co...
Definition: Coupleable.C:646
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:327
const DenseVector< Number > & solutionDoFsOld()
Class for stuff related to variables.
Definition: MooseVariable.h:43
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:117
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:330
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:91
const DenseVector< Number > & solutionDoFsOlder()
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:86
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:363
const DenseVector< Number > & solutionDoFsOlderNeighbor()
const DenseVector< Number > & solutionDoFsOldNeighbor()
const DenseVector< Number > & Coupleable::coupledSolutionDoFsOlder ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtualinherited

Returns DoFs in the older solution vector of a coupled variable for the local element.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a DenseVector for the older DoFs of the coupled variable

Definition at line 622 of file Coupleable.C.

623 {
624  // default coupling is not available for elemental solutions
625  if (!isCoupled(var_name))
626  mooseError("invalid variable name for coupledSolutionDoFsOlder");
627 
628  if (_c_nodal)
629  mooseError("nodal objects should not call coupledSolutionDoFsOlder");
630 
631  validateExecutionerType(var_name);
632  coupledCallback(var_name, true);
633  MooseVariable * var = getVar(var_name, comp);
634  if (_c_is_implicit)
635  {
637  return var->solutionDoFsOlder();
638  else
639  return var->solutionDoFsOlderNeighbor();
640  }
641  else
642  mooseError("Older values not available for explicit schemes");
643 }
void validateExecutionerType(const std::string &name) const
Checks to make sure that the current Executioner has set "_it_transient" when old/older values are co...
Definition: Coupleable.C:646
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:327
Class for stuff related to variables.
Definition: MooseVariable.h:43
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:117
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:330
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:91
const DenseVector< Number > & solutionDoFsOlder()
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:86
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:363
const DenseVector< Number > & solutionDoFsOlderNeighbor()
const VariableValue & Coupleable::coupledValue ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtualinherited

Returns value of a coupled variable.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableValue for the coupled variable
See also
Kernel::value

Definition at line 167 of file Coupleable.C.

Referenced by NodalEqualValueConstraint::NodalEqualValueConstraint(), ParsedAux::ParsedAux(), SphericalAverage::SphericalAverage(), VariableTimeIntegrationAux::VariableTimeIntegrationAux(), and Coupleable::writableCoupledValue().

168 {
169  if (!isCoupled(var_name))
170  return *getDefaultValue(var_name);
171 
172  coupledCallback(var_name, false);
173  MooseVariable * var = getVar(var_name, comp);
174 
176  {
177  if (_c_nodal)
178  return (_c_is_implicit) ? var->nodalSln() : var->nodalSlnOld();
179  else
180  return (_c_is_implicit) ? var->sln() : var->slnOld();
181  }
182  else
183  {
184  if (_c_nodal)
185  return (_c_is_implicit) ? var->nodalSlnNeighbor() : var->nodalSlnOldNeighbor();
186  else
187  return (_c_is_implicit) ? var->slnNeighbor() : var->slnOldNeighbor();
188  }
189 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:327
Class for stuff related to variables.
Definition: MooseVariable.h:43
const VariableValue & nodalSlnNeighbor()
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:117
VariableValue * getDefaultValue(const std::string &var_name)
Helper method to return (and insert if necessary) the default value for an uncoupled variable...
Definition: Coupleable.C:153
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:330
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:91
const VariableValue & nodalSlnOldNeighbor()
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:86
const VariableValue & slnOld()
const VariableValue & nodalSlnOld()
const VariableValue & slnOldNeighbor()
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:363
const VariableValue & nodalSln()
const VariableValue & sln()
const VariableValue & slnNeighbor()
const VariableValue & Coupleable::coupledValueOld ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtualinherited

Returns an old value from previous time step of a coupled variable.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableValue containing the old value of the coupled variable
See also
Kernel::valueOld

Definition at line 198 of file Coupleable.C.

Referenced by VariableTimeIntegrationAux::VariableTimeIntegrationAux().

199 {
200  if (!isCoupled(var_name))
201  return *getDefaultValue(var_name);
202 
203  validateExecutionerType(var_name);
204  coupledCallback(var_name, true);
205  MooseVariable * var = getVar(var_name, comp);
206 
208  {
209  if (_c_nodal)
210  return (_c_is_implicit) ? var->nodalSlnOld() : var->nodalSlnOlder();
211  else
212  return (_c_is_implicit) ? var->slnOld() : var->slnOlder();
213  }
214  else
215  {
216  if (_c_nodal)
217  return (_c_is_implicit) ? var->nodalSlnOldNeighbor() : var->nodalSlnOlderNeighbor();
218  else
219  return (_c_is_implicit) ? var->slnOldNeighbor() : var->slnOlderNeighbor();
220  }
221 }
void validateExecutionerType(const std::string &name) const
Checks to make sure that the current Executioner has set "_it_transient" when old/older values are co...
Definition: Coupleable.C:646
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:327
Class for stuff related to variables.
Definition: MooseVariable.h:43
const VariableValue & slnOlder()
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:117
VariableValue * getDefaultValue(const std::string &var_name)
Helper method to return (and insert if necessary) the default value for an uncoupled variable...
Definition: Coupleable.C:153
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:330
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:91
const VariableValue & nodalSlnOldNeighbor()
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:86
const VariableValue & slnOld()
const VariableValue & nodalSlnOlderNeighbor()
const VariableValue & nodalSlnOld()
const VariableValue & slnOlderNeighbor()
const VariableValue & nodalSlnOlder()
const VariableValue & slnOldNeighbor()
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:363
const VariableValue & Coupleable::coupledValueOlder ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtualinherited

Returns an old value from two time steps previous of a coupled variable.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableValue containing the older value of the coupled variable
See also
Kernel::valueOlder

Definition at line 224 of file Coupleable.C.

Referenced by VariableTimeIntegrationAux::VariableTimeIntegrationAux().

225 {
226  if (!isCoupled(var_name))
227  return *getDefaultValue(var_name);
228 
229  validateExecutionerType(var_name);
230  coupledCallback(var_name, true);
231  MooseVariable * var = getVar(var_name, comp);
232 
234  {
235  if (_c_nodal)
236  {
237  if (_c_is_implicit)
238  return var->nodalSlnOlder();
239  else
240  mooseError("Older values not available for explicit schemes");
241  }
242  else
243  {
244  if (_c_is_implicit)
245  return var->slnOlder();
246  else
247  mooseError("Older values not available for explicit schemes");
248  }
249  }
250  else
251  {
252  if (_c_nodal)
253  {
254  if (_c_is_implicit)
255  return var->nodalSlnOlderNeighbor();
256  else
257  mooseError("Older values not available for explicit schemes");
258  }
259  else
260  {
261  if (_c_is_implicit)
262  return var->slnOlderNeighbor();
263  else
264  mooseError("Older values not available for explicit schemes");
265  }
266  }
267 }
void validateExecutionerType(const std::string &name) const
Checks to make sure that the current Executioner has set "_it_transient" when old/older values are co...
Definition: Coupleable.C:646
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:327
Class for stuff related to variables.
Definition: MooseVariable.h:43
const VariableValue & slnOlder()
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:117
VariableValue * getDefaultValue(const std::string &var_name)
Helper method to return (and insert if necessary) the default value for an uncoupled variable...
Definition: Coupleable.C:153
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:330
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:91
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:86
const VariableValue & nodalSlnOlderNeighbor()
const VariableValue & slnOlderNeighbor()
const VariableValue & nodalSlnOlder()
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:363
const VariableValue & Coupleable::coupledValuePreviousNL ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtualinherited

Returns value of previous Newton iterate of a coupled variable.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableValue containing the older value of the coupled variable

Definition at line 270 of file Coupleable.C.

271 {
272  if (!isCoupled(var_name))
273  return *getDefaultValue(var_name);
274 
276  coupledCallback(var_name, true);
277  MooseVariable * var = getVar(var_name, comp);
278 
280  {
281  if (_c_nodal)
282  return var->nodalSlnPreviousNL();
283  else
284  return var->slnPreviousNL();
285  }
286  else
287  {
288  if (_c_nodal)
289  return var->nodalSlnPreviousNLNeighbor();
290  else
291  return var->slnPreviousNLNeighbor();
292  }
293 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:327
Class for stuff related to variables.
Definition: MooseVariable.h:43
const VariableValue & nodalSlnPreviousNL()
const VariableValue & slnPreviousNLNeighbor()
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:117
VariableValue * getDefaultValue(const std::string &var_name)
Helper method to return (and insert if necessary) the default value for an uncoupled variable...
Definition: Coupleable.C:153
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:318
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:91
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:86
const VariableValue & nodalSlnPreviousNLNeighbor()
void needsPreviousNewtonIteration(bool state)
Set a flag that indicated that user required values for the previous Newton iterate.
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:363
const VariableValue & slnPreviousNL()
template<typename T >
T & Restartable::declareRestartableData ( std::string  data_name)
protectedinherited

Declare a piece of data as "restartable".

This means that in the event of a restart this piece of data will be restored back to its previous value.

NOTE: This returns a reference! Make sure you store it in a reference!

Parameters
data_nameThe name of the data (usually just use the same name as the member variable)

Definition at line 224 of file Restartable.h.

225 {
226  return declareRestartableDataWithContext<T>(data_name, NULL);
227 }
template<typename T >
T & Restartable::declareRestartableData ( std::string  data_name,
const T &  init_value 
)
protectedinherited

Declare a piece of data as "restartable" and initialize it.

This means that in the event of a restart this piece of data will be restored back to its previous value.

NOTE: This returns a reference! Make sure you store it in a reference!

Parameters
data_nameThe name of the data (usually just use the same name as the member variable)
init_valueThe initial value of the data

Definition at line 231 of file Restartable.h.

232 {
233  return declareRestartableDataWithContext<T>(data_name, init_value, NULL);
234 }
template<typename T >
T & Restartable::declareRestartableDataWithContext ( std::string  data_name,
void *  context 
)
protectedinherited

Declare a piece of data as "restartable".

This means that in the event of a restart this piece of data will be restored back to its previous value.

NOTE: This returns a reference! Make sure you store it in a reference!

Parameters
data_nameThe name of the data (usually just use the same name as the member variable)
contextContext pointer that will be passed to the load and store functions

Definition at line 238 of file Restartable.h.

239 {
241  mooseError("No valid SubProblem found for ", _restartable_system_name, "/", _restartable_name);
242 
243  std::string full_name = _restartable_system_name + "/" + _restartable_name + "/" + data_name;
244  RestartableData<T> * data_ptr = new RestartableData<T>(full_name, context);
245 
247 
248  return data_ptr->get();
249 }
std::string _restartable_system_name
The system name this object is in.
Definition: Restartable.h:202
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
std::string _restartable_name
The name of the object.
Definition: Restartable.h:196
void registerRestartableDataOnSubProblem(std::string name, RestartableDataValue *data, THREAD_ID tid)
Helper function so we don&#39;t have to include SubProblem in the header.
Definition: Restartable.C:49
Concrete definition of a parameter value for a specified type.
SubProblem * _restartable_subproblem
Pointer to the SubProblem class.
Definition: Restartable.h:208
THREAD_ID _restartable_tid
The thread ID for this object.
Definition: Restartable.h:205
template<typename T >
T & Restartable::declareRestartableDataWithContext ( std::string  data_name,
const T &  init_value,
void *  context 
)
protectedinherited

Declare a piece of data as "restartable" and initialize it.

This means that in the event of a restart this piece of data will be restored back to its previous value.

NOTE: This returns a reference! Make sure you store it in a reference!

Parameters
data_nameThe name of the data (usually just use the same name as the member variable)
init_valueThe initial value of the data
contextContext pointer that will be passed to the load and store functions

Definition at line 253 of file Restartable.h.

256 {
258  mooseError("No valid SubProblem found for ", _restartable_system_name, "/", _restartable_name);
259 
260  std::string full_name = _restartable_system_name + "/" + _restartable_name + "/" + data_name;
261  RestartableData<T> * data_ptr = new RestartableData<T>(full_name, context);
262 
263  data_ptr->set() = init_value;
264 
266 
267  return data_ptr->get();
268 }
std::string _restartable_system_name
The system name this object is in.
Definition: Restartable.h:202
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
std::string _restartable_name
The name of the object.
Definition: Restartable.h:196
void registerRestartableDataOnSubProblem(std::string name, RestartableDataValue *data, THREAD_ID tid)
Helper function so we don&#39;t have to include SubProblem in the header.
Definition: Restartable.C:49
Concrete definition of a parameter value for a specified type.
SubProblem * _restartable_subproblem
Pointer to the SubProblem class.
Definition: Restartable.h:208
THREAD_ID _restartable_tid
The thread ID for this object.
Definition: Restartable.h:205
std::string MaterialPropertyInterface::deducePropertyName ( const std::string &  name)
protectedinherited
template<typename T >
const MaterialProperty< T > * MaterialPropertyInterface::defaultMaterialProperty ( const std::string &  name)
protectedinherited

Helper function to parse default material property values.

This is implemented as a specialization for supported types and returns NULL in all other cases.

Definition at line 345 of file MaterialPropertyInterface.h.

346 {
347  return NULL;
348 }
const MaterialProperty< Real > * MaterialPropertyInterface::defaultMaterialProperty ( const std::string &  name)
inherited

Definition at line 87 of file MaterialPropertyInterface.C.

88 {
89  std::istringstream ss(name);
90  Real real_value;
91 
92  // check if the string parsed cleanly into a Real number
93  if (ss >> real_value && ss.eof())
94  {
95  _default_real_properties.emplace_back(libmesh_make_unique<MaterialProperty<Real>>());
96  auto & default_property = _default_real_properties.back();
97 
98  // resize to accomodate maximum number obf qpoints
99  auto nqp = _mi_feproblem.getMaxQps();
100  default_property->resize(nqp);
101 
102  // set values for all qpoints to the given default
103  for (decltype(nqp) qp = 0; qp < nqp; ++qp)
104  (*default_property)[qp] = real_value;
105 
106  // return the raw pointer inside the shared pointer
107  return default_property.get();
108  }
109 
110  return nullptr;
111 }
FEProblemBase & _mi_feproblem
Reference to the FEProblemBase class.
std::vector< std::unique_ptr< MaterialProperty< Real > > > _default_real_properties
Storage vector for MaterialProperty<Real> default objects.
unsigned int getMaxQps() const
const VariableValue & MooseVariableInterface::dot ( )
protectedvirtualinherited

The time derivative of the variable this object is operating on.

Returns
The reference to be stored off and used later.

Definition at line 83 of file MooseVariableInterface.C.

84 {
85  if (_nodal)
86  return _variable->nodalSlnDot();
87  else
88  return _variable->uDot();
89 }
bool _nodal
Whether or not this object is acting only at nodes.
const VariableValue & nodalSlnDot()
const VariableValue & uDot()
MooseVariable * _variable
The variable this object is acting on.
const VariableValue & MooseVariableInterface::dotDu ( )
protectedvirtualinherited

The derivative of the time derivative of the variable this object is operating on with respect to this variable's coefficients.

This is useful for creating Jacobian entries for residual statements that use _u_dot

Returns
The reference to be stored off and used later.

Definition at line 92 of file MooseVariableInterface.C.

93 {
94  if (_nodal)
95  return _variable->nodalSlnDuDotDu();
96  else
97  return _variable->duDotDu();
98 }
bool _nodal
Whether or not this object is acting only at nodes.
const VariableValue & duDotDu()
const VariableValue & nodalSlnDuDotDu()
MooseVariable * _variable
The variable this object is acting on.
virtual bool MooseObject::enabled ( )
inlinevirtualinherited

Return the enabled status of the object.

Reimplemented in EigenKernel.

Definition at line 77 of file MooseObject.h.

Referenced by EigenKernel::enabled().

77 { return _enabled; }
const bool & _enabled
Reference to the "enable" InputParaemters, used by Controls for toggling on/off MooseObjects.
Definition: MooseObject.h:117
ExecFlagType SetupInterface::execBitFlags ( ) const
inherited

Build and return the execution flags as a bitfield.

Definition at line 100 of file SetupInterface.C.

Referenced by EigenExecutionerBase::init().

101 {
102  unsigned int exec_bit_field = EXEC_NONE;
103  for (unsigned int i = 0; i < _exec_flags.size(); ++i)
104  exec_bit_field |= _exec_flags[i];
105 
106  return static_cast<ExecFlagType>(exec_bit_field);
107 }
std::vector< ExecFlagType > _exec_flags
execution flag (when is the object executed/evaluated)
ExecFlagType
Execution flags - when is the object executed/evaluated.
Definition: MooseTypes.h:90
const std::vector< ExecFlagType > & SetupInterface::execFlags ( ) const
virtualinherited

Get the execution flag for the object.

Reimplemented in MultiAppTransfer.

Definition at line 94 of file SetupInterface.C.

Referenced by ExecuteMooseObjectWarehouse< T >::addObjectMask(), and MultiAppTransfer::execFlags().

95 {
96  return _exec_flags;
97 }
std::vector< ExecFlagType > _exec_flags
execution flag (when is the object executed/evaluated)
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 411 of file MaterialPropertyInterface.h.

412 {
413  if (_mi_block_ids.empty())
414  mooseError("getBlockMaterialProperty must be called by a block restrictable object");
415 
416  if (!hasMaterialPropertyByName<T>(name))
417  return std::pair<const MaterialProperty<T> *, std::set<SubdomainID>>(NULL,
418  std::set<SubdomainID>());
419 
420  _material_property_dependencies.insert(_material_data->getPropertyId(name));
421 
422  return std::pair<const MaterialProperty<T> *, std::set<SubdomainID>>(
423  &_material_data->getProperty<T>(name), _mi_feproblem.getMaterialPropertyBlocks(name));
424 }
FEProblemBase & _mi_feproblem
Reference to the FEProblemBase class.
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:182
std::set< unsigned int > _material_property_dependencies
The set of material properties (as given by their IDs) that this object depends on.
std::shared_ptr< MaterialData > _material_data
Pointer to the material data class that stores properties.
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:114
Concrete definition of a parameter value for a specified type.
const std::vector< MooseVariableScalar * > & ScalarCoupleable::getCoupledMooseScalarVars ( )
inherited

Get the list of coupled scalar variables.

Returns
The list of coupled variables

Definition at line 72 of file ScalarCoupleable.C.

Referenced by AuxScalarKernel::AuxScalarKernel(), and ScalarInitialCondition::ScalarInitialCondition().

73 {
75 }
std::vector< MooseVariableScalar * > _coupled_moose_scalar_vars
Vector of coupled variables.
const std::vector<MooseVariable *>& Coupleable::getCoupledMooseVars ( ) const
inlineinherited
const std::map<std::string, std::vector<MooseVariable *> >& Coupleable::getCoupledVars ( )
inlineinherited

Get the list of coupled variables.

Returns
The list of coupled variables

Definition at line 54 of file Coupleable.h.

Referenced by AuxKernel::AuxKernel(), and InitialCondition::InitialCondition().

55  {
56  return _coupled_vars;
57  }
std::map< std::string, std::vector< MooseVariable * > > _coupled_vars
Coupled vars whose values we provide.
Definition: Coupleable.h:321
VariableValue * ScalarCoupleable::getDefaultValue ( const std::string &  var_name)
protectedinherited

Helper method to return (and insert if necessary) the default value for an uncoupled variable.

Parameters
var_namethe name of the variable for which to retrieve a default value
Returns
VariableValue * a pointer to the associated VarirableValue.

Definition at line 114 of file ScalarCoupleable.C.

Referenced by ScalarCoupleable::coupledScalarValue(), ScalarCoupleable::coupledScalarValueOld(), and ScalarCoupleable::coupledScalarValueOlder().

115 {
116  std::map<std::string, VariableValue *>::iterator default_value_it = _default_value.find(var_name);
117  if (default_value_it == _default_value.end())
118  {
121  default_value_it = _default_value.insert(std::make_pair(var_name, value)).first;
122  }
123 
124  return default_value_it->second;
125 }
MooseArray< Real > VariableValue
FEProblemBase & _sc_fe_problem
Order getMaxScalarOrder() const
const InputParameters & _coupleable_params
Local InputParameters.
std::map< std::string, VariableValue * > _default_value
Will hold the default value for optional coupled scalar variables.
Real defaultCoupledValue(const std::string &coupling_name) const
Get the default value for an optionally coupled variable.
MultiMooseEnum SetupInterface::getExecuteOptions ( )
staticinherited

Returns the available options for the 'execute_on' input parameters.

Returns
A MooseEnum with the available 'execute_on' options, the default is 'residual'

Definition at line 110 of file SetupInterface.C.

Referenced by AddNodalNormalsAction::act(), AdvancedOutput::addValidParams(), AdvancedOutput::initExecutionTypes(), OutputOnWarehouse::OutputOnWarehouse(), validParams< CommonOutputAction >(), validParams< Output >(), and validParams< SetupInterface >().

111 {
112  return MultiMooseEnum("none=0x00 initial=0x01 linear=0x02 nonlinear=0x04 timestep_end=0x08 "
113  "timestep_begin=0x10 final=0x20 custom=0x100",
114  "linear");
115 }
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Function & FunctionInterface::getFunction ( const std::string &  name)
inherited

Get a function with a given name.

Parameters
nameThe name of the parameter key of the function to retrieve
Returns
The function with name associated with the parameter 'name'

Definition at line 35 of file FunctionInterface.C.

36 {
37  return _fni_feproblem.getFunction(_fni_params.get<FunctionName>(name), _fni_tid);
38 }
virtual Function & getFunction(const std::string &name, THREAD_ID tid=0)
FEProblemBase & _fni_feproblem
Reference to FEProblemBase instance.
const InputParameters & _fni_params
Parameters of the object with this interface.
THREAD_ID _fni_tid
Thread ID.
Function & FunctionInterface::getFunctionByName ( const FunctionName &  name)
inherited

Get a function with a given name.

Parameters
nameThe name of the function to retrieve
Returns
The function with name 'name'

Definition at line 41 of file FunctionInterface.C.

Referenced by CompositeFunction::CompositeFunction(), FunctionScalarAux::FunctionScalarAux(), FunctionScalarIC::FunctionScalarIC(), GenericFunctionMaterial::GenericFunctionMaterial(), LinearCombinationFunction::LinearCombinationFunction(), and LineFunctionSampler::LineFunctionSampler().

42 {
43  return _fni_feproblem.getFunction(name, _fni_tid);
44 }
virtual Function & getFunction(const std::string &name, THREAD_ID tid=0)
FEProblemBase & _fni_feproblem
Reference to FEProblemBase instance.
THREAD_ID _fni_tid
Thread ID.
Material & MaterialPropertyInterface::getMaterial ( const std::string &  name)
inherited

Return a Material 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 164 of file MaterialPropertyInterface.C.

165 {
166  return getMaterialByName(_mi_params.get<MaterialName>(name));
167 }
Material & getMaterialByName(const std::string &name, bool no_warn=false)
const InputParameters & _mi_params
Parameters of the object with this interface.
Material & MaterialPropertyInterface::getMaterialByName ( const std::string &  name,
bool  no_warn = false 
)
inherited

Definition at line 170 of file MaterialPropertyInterface.C.

Referenced by MaterialPropertyInterface::getMaterial(), and MaterialVectorPostprocessor::MaterialVectorPostprocessor().

171 {
172  std::shared_ptr<Material> discrete =
174 
175  // Check block compatibility
176  if (!discrete->hasBlocks(_mi_block_ids))
177  {
178  std::ostringstream oss;
179  oss << "The Material object '" << discrete->name()
180  << "' is defined on blocks that are incompatible with the retrieving object '" << _mi_name
181  << "':\n";
182  oss << " " << discrete->name();
183  for (const auto & sbd_id : discrete->blockIDs())
184  oss << " " << sbd_id;
185  oss << "\n";
186  oss << " " << _mi_name;
187  for (const auto & block_id : _mi_block_ids)
188  oss << " " << block_id;
189  oss << "\n";
190  mooseError(oss.str());
191  }
192 
193  // Check boundary compatibility
194  if (!discrete->hasBoundary(_mi_boundary_ids))
195  {
196  std::ostringstream oss;
197  oss << "The Material object '" << discrete->name()
198  << "' is defined on boundaries that are incompatible with the retrieving object '"
199  << _mi_name << "':\n";
200  oss << " " << discrete->name();
201  for (const auto & bnd_id : discrete->boundaryIDs())
202  oss << " " << bnd_id;
203  oss << "\n";
204  oss << " " << _mi_name;
205  for (const auto & bnd_id : _mi_boundary_ids)
206  oss << " " << bnd_id;
207  oss << "\n";
208  mooseError(oss.str());
209  }
210 
211  return *discrete;
212 }
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.
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
Moose::MaterialDataType _material_data_type
The type of data.
std::shared_ptr< Material > getMaterial(std::string name, Moose::MaterialDataType type, THREAD_ID tid=0, bool no_warn=false)
Return a pointer to a Material object.
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.
template<typename T >
const MaterialProperty< T > & MaterialPropertyInterface::getMaterialProperty ( const std::string &  name)
inherited

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
Returns
Reference to the desired material property

Definition at line 287 of file MaterialPropertyInterface.h.

288 {
289  // Check if the supplied parameter is a valid input parameter key
290  std::string prop_name = deducePropertyName(name);
291 
292  // Check if it's just a constant
293  const MaterialProperty<T> * default_property = defaultMaterialProperty<T>(prop_name);
294  if (default_property)
295  return *default_property;
296 
297  return getMaterialPropertyByName<T>(prop_name);
298 }
std::string deducePropertyName(const std::string &name)
Small helper to look up a material property name through the input parameter keys.
Concrete definition of a parameter value for a specified type.
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 120 of file MaterialPropertyInterface.C.

121 {
123 }
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:130
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 114 of file MaterialPropertyInterface.C.

115 {
117 }
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:114
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 126 of file MaterialPropertyInterface.C.

127 {
129 }
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:171
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 132 of file MaterialPropertyInterface.C.

133 {
135 }
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:187
template<typename T >
const MaterialProperty< T > & MaterialPropertyInterface::getMaterialPropertyByName ( const MaterialPropertyName &  name)
inherited

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
Returns
Reference to the material property with the name 'name'

Definition at line 357 of file MaterialPropertyInterface.h.

358 {
360  checkMaterialProperty(name);
361 
362  // mark property as requested
363  markMatPropRequested(name);
364 
365  // Update the boolean flag.
367 
368  _material_property_dependencies.insert(_material_data->getPropertyId(name));
369 
370  return _material_data->getProperty<T>(name);
371 }
std::set< unsigned int > _material_property_dependencies
The set of material properties (as given by their IDs) that this object depends on.
void markMatPropRequested(const std::string &)
A proxy method for _mi_feproblem.markMatPropRequested(name)
std::shared_ptr< MaterialData > _material_data
Pointer to the material data class that stores properties.
void checkMaterialProperty(const std::string &name)
A helper method for checking material properties This method was required to avoid a compiler problem...
bool _get_material_property_called
Initialized to false.
void checkExecutionStage()
Check and throw an error if the execution has progressed past the construction stage.
bool MaterialPropertyInterface::getMaterialPropertyCalled ( ) const
inlineinherited

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

Definition at line 173 of file MaterialPropertyInterface.h.

bool _get_material_property_called
Initialized to false.
template<typename T >
const MaterialProperty< T > & MaterialPropertyInterface::getMaterialPropertyOld ( const std::string &  name)
inherited

Definition at line 302 of file MaterialPropertyInterface.h.

303 {
304  if (!_stateful_allowed)
305  mooseError("Stateful material properties not allowed for this object."
306  " Old property for \"",
307  name,
308  "\" was requested.");
309 
310  // Check if the supplied parameter is a valid input parameter key
311  std::string prop_name = deducePropertyName(name);
312 
313  // Check if it's just a constant
314  const MaterialProperty<T> * default_property = defaultMaterialProperty<T>(prop_name);
315  if (default_property)
316  return *default_property;
317 
318  return getMaterialPropertyOldByName<T>(prop_name);
319 }
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
std::string deducePropertyName(const std::string &name)
Small helper to look up a material property name through the input parameter keys.
Concrete definition of a parameter value for a specified type.
bool _stateful_allowed
True by default.
template<typename T >
const MaterialProperty< T > & MaterialPropertyInterface::getMaterialPropertyOldByName ( const MaterialPropertyName &  name)
inherited

Definition at line 375 of file MaterialPropertyInterface.h.

376 {
377  if (!_stateful_allowed)
378  mooseError("Stateful material properties not allowed for this object."
379  " Old property for \"",
380  name,
381  "\" was requested.");
382 
383  // mark property as requested
384  markMatPropRequested(name);
385 
386  _material_property_dependencies.insert(_material_data->getPropertyId(name));
387 
388  return _material_data->getPropertyOld<T>(name);
389 }
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
std::set< unsigned int > _material_property_dependencies
The set of material properties (as given by their IDs) that this object depends on.
void markMatPropRequested(const std::string &)
A proxy method for _mi_feproblem.markMatPropRequested(name)
std::shared_ptr< MaterialData > _material_data
Pointer to the material data class that stores properties.
bool _stateful_allowed
True by default.
template<typename T >
const MaterialProperty< T > & MaterialPropertyInterface::getMaterialPropertyOlder ( const std::string &  name)
inherited

Definition at line 323 of file MaterialPropertyInterface.h.

324 {
325  if (!_stateful_allowed)
326  mooseError("Stateful material properties not allowed for this object."
327  " Older property for \"",
328  name,
329  "\" was requested.");
330 
331  // Check if the supplied parameter is a valid input parameter key
332  std::string prop_name = deducePropertyName(name);
333 
334  // Check if it's just a constant
335  const MaterialProperty<T> * default_property = defaultMaterialProperty<T>(prop_name);
336  if (default_property)
337  return *default_property;
338 
339  return getMaterialPropertyOlderByName<T>(prop_name);
340 }
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
std::string deducePropertyName(const std::string &name)
Small helper to look up a material property name through the input parameter keys.
Concrete definition of a parameter value for a specified type.
bool _stateful_allowed
True by default.
template<typename T >
const MaterialProperty< T > & MaterialPropertyInterface::getMaterialPropertyOlderByName ( const MaterialPropertyName &  name)
inherited

Definition at line 393 of file MaterialPropertyInterface.h.

394 {
395  if (!_stateful_allowed)
396  mooseError("Stateful material properties not allowed for this object."
397  " Older property for \"",
398  name,
399  "\" was requested.");
400 
401  // mark property as requested
402  markMatPropRequested(name);
403 
404  _material_property_dependencies.insert(_material_data->getPropertyId(name));
405 
406  return _material_data->getPropertyOlder<T>(name);
407 }
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
std::set< unsigned int > _material_property_dependencies
The set of material properties (as given by their IDs) that this object depends on.
void markMatPropRequested(const std::string &)
A proxy method for _mi_feproblem.markMatPropRequested(name)
std::shared_ptr< MaterialData > _material_data
Pointer to the material data class that stores properties.
bool _stateful_allowed
True by default.
const std::set<unsigned int>& MaterialPropertyInterface::getMatPropDependencies ( ) const
inlineinherited

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

Definition at line 181 of file MaterialPropertyInterface.h.

Referenced by LineMaterialSamplerBase< T >::execute().

182  {
184  }
std::set< unsigned int > _material_property_dependencies
The set of material properties (as given by their IDs) that this object depends on.
MooseApp& MooseObject::getMooseApp ( )
inlineinherited

Get the MooseApp this object is associated with.

Definition at line 72 of file MooseObject.h.

Referenced by RestartableDataIO::createBackup(), RestartableDataIO::deserializeRestartableData(), Resurrector::restartRestartableData(), and RestartableDataIO::restoreBackup().

72 { return _app; }
MooseApp & _app
The MooseApp this object is associated with.
Definition: MooseObject.h:108
const std::set<MooseVariable *>& MooseVariableDependencyInterface::getMooseVariableDependencies ( ) const
inlineinherited

Retrieve the set of MooseVariables that this object depends on.

Returns
The MooseVariables that MUST be reinited before evaluating this object

Definition at line 32 of file MooseVariableDependencyInterface.h.

33  {
35  }
std::set< MooseVariable * > _moose_variable_dependencies
const Real & InterfaceKernel::getNeighborElemVolume ( )
protected

The volume of the current neighbor.

Definition at line 424 of file InterfaceKernel.C.

425 {
426  return _assembly.neighborVolume();
427 }
const Real & neighborVolume()
Returns the reference to the current neighbor volume.
Definition: Assembly.C:353
Assembly & _assembly
Problem assembly.
template<typename T >
const MaterialProperty< T > & TwoMaterialPropertyInterface::getNeighborMaterialProperty ( const std::string &  name)
inherited

Retrieve the property named "name".

Definition at line 60 of file TwoMaterialPropertyInterface.h.

61 {
62  // Check if the supplied parameter is a valid input parameter key
63  std::string prop_name = deducePropertyName(name);
64 
65  // Check if it's just a constant
66  const MaterialProperty<T> * default_property = defaultMaterialProperty<T>(prop_name);
67  if (default_property)
68  return *default_property;
69  else
70  return _neighbor_material_data->getProperty<T>(prop_name);
71 }
std::string deducePropertyName(const std::string &name)
Small helper to look up a material property name through the input parameter keys.
std::shared_ptr< MaterialData > _neighbor_material_data
Concrete definition of a parameter value for a specified type.
template<typename T >
const MaterialProperty< T > & TwoMaterialPropertyInterface::getNeighborMaterialPropertyOld ( const std::string &  name)
inherited

Definition at line 75 of file TwoMaterialPropertyInterface.h.

76 {
77  // Check if the supplied parameter is a valid input parameter key
78  std::string prop_name = deducePropertyName(name);
79 
80  // Check if it's just a constant
81  const MaterialProperty<T> * default_property = defaultMaterialProperty<T>(prop_name);
82  if (default_property)
83  return *default_property;
84  else
85  return _neighbor_material_data->getPropertyOld<T>(prop_name);
86 }
std::string deducePropertyName(const std::string &name)
Small helper to look up a material property name through the input parameter keys.
std::shared_ptr< MaterialData > _neighbor_material_data
Concrete definition of a parameter value for a specified type.
template<typename T >
const MaterialProperty< T > & TwoMaterialPropertyInterface::getNeighborMaterialPropertyOlder ( const std::string &  name)
inherited

Definition at line 90 of file TwoMaterialPropertyInterface.h.

91 {
92  // Check if the supplied parameter is a valid input parameter key
93  std::string prop_name = deducePropertyName(name);
94 
95  // Check if it's just a constant
96  const MaterialProperty<T> * default_property = defaultMaterialProperty<T>(prop_name);
97  if (default_property)
98  return *default_property;
99  else
100  return _neighbor_material_data->getPropertyOlder<T>(prop_name);
101 }
std::string deducePropertyName(const std::string &name)
Small helper to look up a material property name through the input parameter keys.
std::shared_ptr< MaterialData > _neighbor_material_data
Concrete definition of a parameter value for a specified type.
template<typename T >
const T & MooseObject::getParam ( const std::string &  name) const
inherited

Retrieve a parameter for the object.

Parameters
nameThe name of the parameter
Returns
The value of the parameter

Definition at line 122 of file MooseObject.h.

Referenced by FEProblemBase::addMaterial(), ConstraintWarehouse::addObject(), BicubicSplineFunction::BicubicSplineFunction(), Piecewise::buildFromXandY(), EigenKernel::EigenKernel(), FieldSplitPreconditioner::FieldSplitPreconditioner(), FiniteDifferencePreconditioner::FiniteDifferencePreconditioner(), GenericConstantRankTwoTensor::GenericConstantRankTwoTensor(), TimeSequenceStepper::init(), BlockRestrictable::initializeBlockRestrictable(), BoundaryRestrictable::initializeBoundaryRestrictable(), Console::initialSetup(), AdvancedOutput::initialSetup(), SideSetsBetweenSubdomains::modify(), AddExtraNodeset::modify(), MeshExtruder::modify(), SideSetsAroundSubdomain::modify(), RenameBlock::modify(), MooseObject::parameters(), ParsedAddSideset::ParsedAddSideset(), ParsedAux::ParsedAux(), ParsedODEKernel::ParsedODEKernel(), ParsedSubdomainMeshModifier::ParsedSubdomainMeshModifier(), PhysicsBasedPreconditioner::PhysicsBasedPreconditioner(), SingleMatrixPreconditioner::SingleMatrixPreconditioner(), TimePeriod::TimePeriod(), and VectorOfPostprocessors::VectorOfPostprocessors().

123 {
124  return InputParameters::getParamHelper(name, _pars, static_cast<T *>(0));
125 }
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:47
static const T & getParamHelper(const std::string &name, const InputParameters &pars, const T *the_type)
const InputParameters & _pars
Parameters of this object, references the InputParameters stored in the InputParametersWarehouse.
Definition: MooseObject.h:111
MooseVariableScalar * ScalarCoupleable::getScalarVar ( const std::string &  var_name,
unsigned int  comp 
)
protectedinherited

Extract pointer to a scalar coupled variable.

Parameters
var_nameName of parameter desired
compComponent number of multiple coupled variables
Returns
Pointer to the desired variable

Definition at line 175 of file ScalarCoupleable.C.

Referenced by ScalarCoupleable::coupledScalar(), ScalarCoupleable::coupledScalarDot(), ScalarCoupleable::coupledScalarDotDu(), ScalarCoupleable::coupledScalarOrder(), ScalarCoupleable::coupledScalarValue(), ScalarCoupleable::coupledScalarValueOld(), ScalarCoupleable::coupledScalarValueOlder(), and ParsedODEKernel::ParsedODEKernel().

176 {
177  if (_coupled_scalar_vars.find(var_name) != _coupled_scalar_vars.end())
178  {
179  if (comp < _coupled_scalar_vars[var_name].size())
180  return _coupled_scalar_vars[var_name][comp];
181  else
182  mooseError("Trying to get a non-existent component of variable '" + var_name + "'");
183  }
184  else
185  mooseError("Trying to get a non-existent variable '" + var_name + "'");
186 }
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
std::map< std::string, std::vector< MooseVariableScalar * > > _coupled_scalar_vars
Coupled vars whose values we provide.
template<class T >
const T & UserObjectInterface::getUserObject ( const std::string &  name)
inherited

Get an user object with a given parameter name.

Parameters
nameThe name of the parameter key of the user object to retrieve
Returns
The user object with name associated with the parameter 'name'

Definition at line 85 of file UserObjectInterface.h.

86 {
87  unsigned int tid = isDiscreteUserObject(getUserObjectBase(name)) ? _uoi_tid : 0;
88  return _uoi_feproblem.getUserObject<T>(_uoi_params.get<UserObjectName>(name), tid);
89 }
bool isDiscreteUserObject(const UserObject &uo) const
Check if the user object is a DiscreteElementUserObject.
const InputParameters & _uoi_params
Parameters of the object with this interface.
FEProblemBase & _uoi_feproblem
Reference to the FEProblemBase instance.
THREAD_ID _uoi_tid
Thread ID.
const T & getUserObject(const std::string &name, unsigned int tid=0)
Get the user object by its name.
const UserObject & getUserObjectBase(const std::string &name)
Get an user object with a given parameter name.
const UserObject & UserObjectInterface::getUserObjectBase ( const std::string &  name)
inherited

Get an user object with a given parameter name.

Parameters
nameThe name of the parameter key of the user object to retrieve
Returns
The user object with name associated with the parameter 'name'

Definition at line 28 of file UserObjectInterface.C.

Referenced by UserObjectInterface::getUserObject(), InitialCondition::getUserObjectBase(), and AuxKernel::getUserObjectBase().

29 {
30  return _uoi_feproblem.getUserObjectBase(_uoi_params.get<UserObjectName>(name));
31 }
const InputParameters & _uoi_params
Parameters of the object with this interface.
FEProblemBase & _uoi_feproblem
Reference to the FEProblemBase instance.
const UserObject & getUserObjectBase(const std::string &name)
Get the user object by its name.
const UserObject & UserObjectInterface::getUserObjectBaseByName ( const std::string &  name)
inherited

Get an user object with a given name.

Parameters
nameThe name of the user object to retrieve
Returns
The user object with the name

Definition at line 34 of file UserObjectInterface.C.

Referenced by UserObjectInterface::getUserObjectByName().

35 {
36  return _uoi_feproblem.getUserObjectBase(name);
37 }
FEProblemBase & _uoi_feproblem
Reference to the FEProblemBase instance.
const UserObject & getUserObjectBase(const std::string &name)
Get the user object by its name.
template<class T >
const T & UserObjectInterface::getUserObjectByName ( const std::string &  name)
inherited

Get an user object with a given name.

Parameters
nameThe name of the user object to retrieve
Returns
The user object with the name

Definition at line 93 of file UserObjectInterface.h.

94 {
95  unsigned int tid = isDiscreteUserObject(getUserObjectBaseByName(name)) ? _uoi_tid : 0;
96  return _uoi_feproblem.getUserObject<T>(name, tid);
97 }
bool isDiscreteUserObject(const UserObject &uo) const
Check if the user object is a DiscreteElementUserObject.
const UserObject & getUserObjectBaseByName(const std::string &name)
Get an user object with a given name.
FEProblemBase & _uoi_feproblem
Reference to the FEProblemBase instance.
THREAD_ID _uoi_tid
Thread ID.
const T & getUserObject(const std::string &name, unsigned int tid=0)
Get the user object by its name.
MooseVariable * Coupleable::getVar ( const std::string &  var_name,
unsigned int  comp 
)
protectedinherited

Extract pointer to a coupled variable.

Parameters
var_nameName of parameter desired
compComponent number of multiple coupled variables
Returns
Pointer to the desired variable

Definition at line 117 of file Coupleable.C.

Referenced by ShapeUserObject< T >::coupled(), Coupleable::coupled(), AuxKernel::coupledDot(), Coupleable::coupledDot(), AuxKernel::coupledDotDu(), Coupleable::coupledDotDu(), Coupleable::coupledGradient(), Coupleable::coupledGradientOld(), Coupleable::coupledGradientOlder(), Coupleable::coupledGradientPreviousNL(), NeighborCoupleable::coupledNeighborGradient(), NeighborCoupleable::coupledNeighborGradientOld(), NeighborCoupleable::coupledNeighborGradientOlder(), NeighborCoupleable::coupledNeighborSecond(), NeighborCoupleable::coupledNeighborSolutionDoFs(), NeighborCoupleable::coupledNeighborSolutionDoFsOld(), NeighborCoupleable::coupledNeighborSolutionDoFsOlder(), NeighborCoupleable::coupledNeighborValue(), NeighborCoupleable::coupledNeighborValueOld(), NeighborCoupleable::coupledNeighborValueOlder(), Coupleable::coupledNodalDot(), Coupleable::coupledNodalValue(), Coupleable::coupledNodalValueOld(), Coupleable::coupledNodalValueOlder(), Coupleable::coupledNodalValuePreviousNL(), Coupleable::coupledSecond(), Coupleable::coupledSecondOld(), Coupleable::coupledSecondOlder(), Coupleable::coupledSecondPreviousNL(), Coupleable::coupledSolutionDoFs(), Coupleable::coupledSolutionDoFsOld(), Coupleable::coupledSolutionDoFsOlder(), Coupleable::coupledValue(), Coupleable::coupledValueOld(), Coupleable::coupledValueOlder(), Coupleable::coupledValuePreviousNL(), ParsedAux::ParsedAux(), PiecewiseLinearInterpolationMaterial::PiecewiseLinearInterpolationMaterial(), and SphericalAverage::SphericalAverage().

118 {
119  if (_coupled_vars.find(var_name) != _coupled_vars.end())
120  {
121  if (comp < _coupled_vars[var_name].size())
122  {
123  // Error check - don't couple elemental to nodal
124  if (!(_coupled_vars[var_name][comp])->isNodal() && _c_nodal)
125  mooseError("You cannot couple an elemental variable to a nodal variable");
126  return _coupled_vars[var_name][comp];
127  }
128  else
129  mooseError("Trying to get a non-existent component of variable '" + var_name + "'");
130  }
131  else
132  mooseError("Trying to get a non-existent variable '" + var_name + "'");
133 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:327
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
std::map< std::string, std::vector< MooseVariable * > > _coupled_vars
Coupled vars whose values we provide.
Definition: Coupleable.h:321
template<typename T >
const MaterialProperty< T > & MaterialPropertyInterface::getZeroMaterialProperty ( const std::string &  prop_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 444 of file MaterialPropertyInterface.h.

445 {
446  // static zero property storage
447  static MaterialProperty<T> zero;
448 
449  // resize to accomodate maximum number of qpoints
450  // (in multiapp scenarios getMaxQps can return different values in each app; we need the max)
451  unsigned int nqp = _mi_feproblem.getMaxQps();
452  if (nqp > zero.size())
453  zero.resize(nqp);
454 
455  // set values for all qpoints to zero
456  for (unsigned int qp = 0; qp < nqp; ++qp)
457  mooseSetToZero<T>(zero[qp]);
458 
459  return zero;
460 }
FEProblemBase & _mi_feproblem
Reference to the FEProblemBase class.
virtual void resize(int n)
Resizes the property to the size n.
unsigned int getMaxQps() const
Concrete definition of a parameter value for a specified type.
unsigned int size() const
const VariableGradient & MooseVariableInterface::gradient ( )
protectedvirtualinherited

The gradient of the variable this object is operating on.

This is computed by default and should already be available as _grad_u

Returns
The reference to be stored off and used later.

Definition at line 101 of file MooseVariableInterface.C.

102 {
103  if (_nodal)
104  mooseError("Nodal variables do not have gradients");
105 
106  return _variable->gradSln();
107 }
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
bool _nodal
Whether or not this object is acting only at nodes.
MooseVariable * _variable
The variable this object is acting on.
const VariableGradient & gradSln()
const VariableGradient & MooseVariableInterface::gradientOld ( )
protectedvirtualinherited

The old gradient of the variable this object is operating on.

Returns
The reference to be stored off and used later.

Definition at line 110 of file MooseVariableInterface.C.

111 {
112  if (_nodal)
113  mooseError("Nodal variables do not have gradients");
114 
115  return _variable->gradSlnOld();
116 }
const VariableGradient & gradSlnOld()
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
bool _nodal
Whether or not this object is acting only at nodes.
MooseVariable * _variable
The variable this object is acting on.
const VariableGradient & MooseVariableInterface::gradientOlder ( )
protectedvirtualinherited

The older gradient of the variable this object is operating on.

Returns
The reference to be stored off and used later.

Definition at line 119 of file MooseVariableInterface.C.

120 {
121  if (_nodal)
122  mooseError("Nodal variables do not have gradients");
123 
124  return _variable->gradSlnOlder();
125 }
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
bool _nodal
Whether or not this object is acting only at nodes.
const VariableGradient & gradSlnOlder()
MooseVariable * _variable
The variable this object is acting on.
bool BoundaryRestrictable::hasBoundary ( const BoundaryName &  name) const
inherited

Test if the supplied boundary name is valid for this object.

Parameters
nameA BoundaryName to check
Returns
True if the given id is valid for this object

Definition at line 183 of file BoundaryRestrictable.C.

Referenced by BoundaryRestrictable::hasBoundary(), and BoundaryRestrictable::hasBoundaryMaterialPropertyHelper().

184 {
185  // Create a vector and utilize the getBoundaryIDs function, which
186  // handles the ANY_BOUNDARY_ID (getBoundaryID does not)
187  return hasBoundary(_bnd_mesh->getBoundaryIDs({name}));
188 }
std::vector< BoundaryID > getBoundaryIDs(const Elem *const elem, const unsigned short int side) const
Returns a vector of boundary IDs for the requested element on the requested side. ...
Definition: MooseMesh.C:1951
MooseMesh * _bnd_mesh
Point to mesh.
bool hasBoundary(const BoundaryName &name) const
Test if the supplied boundary name is valid for this object.
bool BoundaryRestrictable::hasBoundary ( const std::vector< BoundaryName > &  names) const
inherited

Test if the supplied vector of boundary names are valid for this object.

Parameters
namesA vector of BoundaryNames to check
Returns
True if the given ids are valid for this object

Definition at line 191 of file BoundaryRestrictable.C.

192 {
193  return hasBoundary(_bnd_mesh->getBoundaryIDs(names));
194 }
std::vector< BoundaryID > getBoundaryIDs(const Elem *const elem, const unsigned short int side) const
Returns a vector of boundary IDs for the requested element on the requested side. ...
Definition: MooseMesh.C:1951
MooseMesh * _bnd_mesh
Point to mesh.
bool hasBoundary(const BoundaryName &name) const
Test if the supplied boundary name is valid for this object.
bool BoundaryRestrictable::hasBoundary ( const BoundaryID id) const
inherited

Test if the supplied boundary ids are valid for this object.

Parameters
idA BoundaryID to check
Returns
True if the given id is valid for this object

Definition at line 197 of file BoundaryRestrictable.C.

198 {
199  if (_bnd_ids.empty() || _bnd_ids.find(Moose::ANY_BOUNDARY_ID) != _bnd_ids.end())
200  return true;
201  else
202  return _bnd_ids.find(id) != _bnd_ids.end();
203 }
std::set< BoundaryID > _bnd_ids
Set of the boundary ids.
const BoundaryID ANY_BOUNDARY_ID
Definition: MooseTypes.h:119
bool BoundaryRestrictable::hasBoundary ( const std::vector< BoundaryID > &  ids,
TEST_TYPE  type = ALL 
) const
inherited

Test if the supplied vector boundary ids are valid for this object.

Parameters
idsA vector of BoundaryIDs ids to check
typeA flag for the type of matching to perform: ALL requires that all supplied ids must match those of the object; ANY requires that any one of the supplied ids must match those of the object
Returns
True if the all of the given ids are found within the ids for this object

Definition at line 206 of file BoundaryRestrictable.C.

207 {
208  std::set<BoundaryID> ids_set(ids.begin(), ids.end());
209  return hasBoundary(ids_set, type);
210 }
bool hasBoundary(const BoundaryName &name) const
Test if the supplied boundary name is valid for this object.
MatType type
bool BoundaryRestrictable::hasBoundary ( const std::set< BoundaryID > &  ids,
TEST_TYPE  type = ALL 
) const
inherited

Test if the supplied set of boundary ids are valid for this object.

Parameters
idsA std::set of BoundaryIDs to check
typeA flag for the type of matching to perform: ALL requires that all supplied ids must match those of the object; ANY requires that any one of the supplied ids must match those of the object
Returns
True if the all of the given ids are found within the ids for this object
See also
isSubset

Definition at line 213 of file BoundaryRestrictable.C.

214 {
215  // An empty input is assumed to be ANY_BOUNDARY_ID
216  if (ids.empty() || ids.find(Moose::ANY_BOUNDARY_ID) != ids.end())
217  return true;
218 
219  // All supplied IDs must match those of the object
220  else if (type == ALL)
221  {
222  if (_bnd_ids.find(Moose::ANY_BOUNDARY_ID) != _bnd_ids.end())
223  return true;
224  else
225  return std::includes(_bnd_ids.begin(), _bnd_ids.end(), ids.begin(), ids.end());
226  }
227  // Any of the supplied IDs must match those of the object
228  else
229  {
230  // Loop through the supplied ids
231  for (const auto & id : ids)
232  {
233  // Test the current supplied id
234  bool test = hasBoundary(id);
235 
236  // If the id exists in the stored ids, then return true, otherwise
237  if (test)
238  return true;
239  }
240  return false;
241  }
242 }
std::set< BoundaryID > _bnd_ids
Set of the boundary ids.
bool hasBoundary(const BoundaryName &name) const
Test if the supplied boundary name is valid for this object.
MatType type
const BoundaryID ANY_BOUNDARY_ID
Definition: MooseTypes.h:119
template<typename T >
bool BoundaryRestrictable::hasBoundaryMaterialProperty ( const std::string &  prop_name) const
inherited

Check if a material property is valid for all boundaries of this object.

This method returns true if the supplied property name has been declared in a Material object on the boundary ids for this object.

Template Parameters
TThe type of material property
Parameters
prop_namethe name of the property to query
Returns
true if the property exists for all boundary ids of the object, otherwise false

Definition at line 228 of file BoundaryRestrictable.h.

229 {
230  // If you get here the supplied property is defined on all boundaries, but is still subject
231  // existence in the MateialData class
232  return hasBoundaryMaterialPropertyHelper(prop_name) &&
233  _bnd_material_data->haveProperty<T>(prop_name);
234 }
bool hasBoundaryMaterialPropertyHelper(const std::string &prop_name) const
A helper method to avoid circular #include problems.
std::shared_ptr< MaterialData > _bnd_material_data
Pointer to MaterialData for boundary (.
bool BoundaryRestrictable::hasBoundaryMaterialPropertyHelper ( const std::string &  prop_name) const
protectedinherited

A helper method to avoid circular #include problems.

See also
hasBoundaryMaterialProperty

Definition at line 274 of file BoundaryRestrictable.C.

Referenced by BoundaryRestrictable::hasBoundaryMaterialProperty().

275 {
276  // Reference to MaterialWarehouse for testing and retrieving boundary ids
278 
279  // Complete set of BoundaryIDs that this object is defined
280  const std::set<BoundaryID> & ids =
282 
283  // Loop over each BoundaryID for this object
284  for (const auto & id : ids)
285  {
286  // Storage of material properties that have been DECLARED on this BoundaryID
287  std::set<std::string> declared_props;
288 
289  // If boundary materials exist, populated the set of properties that were declared
290  if (warehouse.hasActiveBoundaryObjects(id))
291  {
292  const std::vector<std::shared_ptr<Material>> & mats = warehouse.getActiveBoundaryObjects(id);
293  for (const auto & mat : mats)
294  {
295  const std::set<std::string> & mat_props = mat->getSuppliedItems();
296  declared_props.insert(mat_props.begin(), mat_props.end());
297  }
298  }
299 
300  // If the supplied property is not in the list of properties on the current id, return false
301  if (declared_props.find(prop_name) == declared_props.end())
302  return false;
303  }
304 
305  // If you get here the supplied property is defined on all boundaries
306  return true;
307 }
virtual const std::set< BoundaryID > & boundaryIDs() const
Return the boundary IDs for this object.
const std::map< BoundaryID, std::vector< std::shared_ptr< T > > > & getActiveBoundaryObjects(THREAD_ID tid=0) const
Material objects are special in that they have additional objects created automatically (see FEProble...
const std::set< BoundaryID > & meshBoundaryIDs() const
Returns the set of all boundary ids for the entire mesh.
bool hasActiveBoundaryObjects(THREAD_ID tid=0) const
bool hasBoundary(const BoundaryName &name) const
Test if the supplied boundary name is valid for this object.
const MaterialWarehouse & getMaterialWarehouse()
FEProblemBase * _bnd_feproblem
Pointer to FEProblemBase.
const BoundaryID ANY_BOUNDARY_ID
Definition: MooseTypes.h:119
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 428 of file MaterialPropertyInterface.h.

429 {
430  // Check if the supplied parameter is a valid input parameter key
431  std::string prop_name = deducePropertyName(name);
432  return _material_data->haveProperty<T>(prop_name);
433 }
std::string deducePropertyName(const std::string &name)
Small helper to look up a material property name through the input parameter keys.
std::shared_ptr< MaterialData > _material_data
Pointer to the material data class that stores properties.
template<typename T >
bool MaterialPropertyInterface::hasMaterialPropertyByName ( const std::string &  name)
inherited

Definition at line 437 of file MaterialPropertyInterface.h.

438 {
439  return _material_data->haveProperty<T>(name);
440 }
std::shared_ptr< MaterialData > _material_data
Pointer to the material data class that stores properties.
void SetupInterface::initialSetup ( )
virtualinherited
bool BoundaryRestrictable::isBoundarySubset ( const std::set< BoundaryID > &  ids) const
inherited

Test if the class boundary ids are a subset of the supplied objects.

Parameters
idsA std::set of boundaries to check
Returns
True if all of the boundary ids for this class are found within the given ids (opposite of hasBoundary)
See also
hasBoundary

Definition at line 245 of file BoundaryRestrictable.C.

Referenced by BoundaryRestrictable::isBoundarySubset().

246 {
247  // An empty input is assumed to be ANY_BOUNDARY_ID
248  if (ids.empty() || ids.find(Moose::ANY_BOUNDARY_ID) != ids.end())
249  return true;
250 
251  if (_bnd_ids.find(Moose::ANY_BOUNDARY_ID) != _bnd_ids.end())
252  return std::includes(ids.begin(),
253  ids.end(),
254  _bnd_mesh->meshBoundaryIds().begin(),
255  _bnd_mesh->meshBoundaryIds().end());
256  else
257  return std::includes(ids.begin(), ids.end(), _bnd_ids.begin(), _bnd_ids.end());
258 }
const std::set< BoundaryID > & meshBoundaryIds() const
Returns a read-only reference to the set of boundary IDs currently present in the Mesh...
Definition: MooseMesh.C:2110
MooseMesh * _bnd_mesh
Point to mesh.
std::set< BoundaryID > _bnd_ids
Set of the boundary ids.
const BoundaryID ANY_BOUNDARY_ID
Definition: MooseTypes.h:119
bool BoundaryRestrictable::isBoundarySubset ( const std::vector< BoundaryID > &  ids) const
inherited

Definition at line 261 of file BoundaryRestrictable.C.

262 {
263  std::set<BoundaryID> ids_set(ids.begin(), ids.end());
264  return isBoundarySubset(ids_set);
265 }
bool isBoundarySubset(const std::set< BoundaryID > &ids) const
Test if the class boundary ids are a subset of the supplied objects.
bool Coupleable::isCoupled ( const std::string &  var_name,
unsigned int  i = 0 
)
protectedvirtualinherited

Returns true if a variables has been coupled as name.

Parameters
var_nameThe name the kernel wants to refer to the variable as.
iBy default 0, in general the index to test in a vector of MooseVariable pointers.
Returns
True if a coupled variable has the supplied name

Definition at line 91 of file Coupleable.C.

Referenced by Coupleable::coupled(), Coupleable::coupledDot(), Coupleable::coupledDotDu(), Coupleable::coupledGradient(), Coupleable::coupledGradientOld(), Coupleable::coupledGradientOlder(), Coupleable::coupledGradientPreviousNL(), Coupleable::coupledNodalDot(), Coupleable::coupledNodalValue(), Coupleable::coupledNodalValueOld(), Coupleable::coupledNodalValueOlder(), Coupleable::coupledNodalValuePreviousNL(), Coupleable::coupledSecond(), Coupleable::coupledSecondOld(), Coupleable::coupledSecondOlder(), Coupleable::coupledSecondPreviousNL(), Coupleable::coupledSolutionDoFs(), Coupleable::coupledSolutionDoFsOld(), Coupleable::coupledSolutionDoFsOlder(), Coupleable::coupledValue(), Coupleable::coupledValueOld(), Coupleable::coupledValueOlder(), and Coupleable::coupledValuePreviousNL().

92 {
93  std::map<std::string, std::vector<MooseVariable *>>::iterator it = _coupled_vars.find(var_name);
94  if (it != _coupled_vars.end())
95  return (i < it->second.size());
96  else
97  {
98  // Make sure the user originally requested this value in the InputParameter syntax
99  if (!_coupleable_params.hasCoupledValue(var_name))
100  mooseError("The coupled variable \"",
101  var_name,
102  "\&qu