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

IC that calls vectorValue method of a Function object. More...

#include <VectorFunctionIC.h>

Inheritance diagram for VectorFunctionIC:
[legend]

Public Types

typedef FEGenericBase< T > FEBaseType
 
typedef OutputTools< T >::OutputShape ValueType
 
typedef OutputTools< T >::OutputGradient GradientType
 
enum  TEST_TYPE { ALL, ANY }
 A flag changing the behavior of hasBoundary. More...
 

Public Member Functions

 VectorFunctionIC (const InputParameters &parameters)
 
virtual RealVectorValue value (const Point &p) override
 The value of the variable at a point. More...
 
virtual MooseVariableFEBasevariable () override
 retrieves the MOOSE variable that this initial condition acts upon More...
 
virtual void compute () override
 Workhorse method for projecting the initial conditions for block initial conditions. More...
 
virtual void computeNodal (const Point &p) override
 Workhorse method for projecting the initial conditions for boundary restricted initial conditions. More...
 
virtual GradientType gradient (const Point &)
 The gradient of the variable at a point. More...
 
void setCZeroVertices ()
 set the temporary solution vector for node projections of C0 variables More...
 
template<>
void setCZeroVertices ()
 
void setHermiteVertices ()
 set the temporary solution vector for node projections of Hermite variables More...
 
template<>
void setHermiteVertices ()
 
void setOtherCOneVertices ()
 set the temporary solution vector for node projections of non-Hermitian C1 variables More...
 
template<>
void setOtherCOneVertices ()
 
Real dotHelper (const GradientType &op1, const GradientType &op2)
 Helps perform multiplication of GradientTypes: a normal dot product for vectors and a contraction for tensors. More...
 
template<>
Real dotHelper (const GradientType &op1, const GradientType &op2)
 
void choleskySolve (bool is_volume)
 Perform the cholesky solves for edge, side, and interior projections. More...
 
const std::set< std::string > & getDependObjects () const
 getter method for dependent user objects More...
 
virtual void initialSetup ()
 Gets called at the beginning of the simulation before this object is asked to do its job. More...
 
virtual const std::set< std::string > & getRequestedItems () override
 Return a set containing the names of items requested by the object. More...
 
virtual const std::set< std::string > & getSuppliedItems () override
 Return a set containing the names of items owned by the object. More...
 
template<typename T2 >
const T2 & getUserObject (const std::string &name)
 reimplements the getUserObject method from UserObjectInterface More...
 
template<typename T >
const T & getUserObject (const std::string &name)
 
template<typename T2 >
const T2 & getUserObjectByName (const UserObjectName &name)
 reimplements the getUserObjectByName method from UserObjectInterface More...
 
template<typename T >
const T & getUserObjectByName (const UserObjectName &name)
 
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)
 reimplements the getUserObjectBase method from UserObjectInterface More...
 
const std::string & type () const
 Get the type of this object. 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...
 
template<typename T >
getCheckedPointerParam (const std::string &name, const std::string &error_string="") const
 Verifies that the requested parameter exists and is not NULL and returns it to the caller. More...
 
bool isParamValid (const std::string &name) const
 Test if the supplied parameter is valid. More...
 
MooseAppgetMooseApp () const
 Get the MooseApp this object is associated with. More...
 
virtual bool enabled () const
 Return the enabled status of the object. More...
 
template<typename... Args>
void paramError (const std::string &param, Args... args)
 Emits an error prefixed with the file and line number of the given param (from the input file) along with the full parameter path+name followed by the given args as the message. More...
 
template<typename... Args>
void paramWarning (const std::string &param, Args... args)
 Emits a warning prefixed with the file and line number of the given param (from the input file) along with the full parameter path+name followed by the given args as the message. More...
 
template<typename... Args>
void paramInfo (const std::string &param, Args... args)
 Emits an informational message prefixed with the file and line number of the given param (from the input file) along with the full parameter path+name followed by the given args as the message. 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
 
const std::vector< SubdomainName > & blocks () const
 Return the block names for this object. More...
 
unsigned int numBlocks () const
 Return the number of blocks for this object. More...
 
virtual const std::set< SubdomainID > & blockIDs () const
 Return the block subdomain ids for this object. More...
 
bool hasBlocks (const SubdomainName &name) const
 Test if the supplied block name is valid for this object. More...
 
bool hasBlocks (const std::vector< SubdomainName > &names) const
 Test if the supplied vector of block names are valid for this object. More...
 
bool hasBlocks (const SubdomainID &id) const
 Test if the supplied block ids are valid for this object. More...
 
bool hasBlocks (const std::vector< SubdomainID > &ids) const
 Test if the supplied vector block ids are valid for this object. More...
 
bool hasBlocks (const std::set< SubdomainID > &ids) const
 Test if the supplied set of block ids are valid for this object. More...
 
bool isBlockSubset (const std::set< SubdomainID > &ids) const
 Test if the class block ids are a subset of the supplied objects. More...
 
bool isBlockSubset (const std::vector< SubdomainID > &ids) const
 Test if the class block ids are a subset of the supplied objects. More...
 
template<typename T >
bool hasBlockMaterialProperty (const std::string &prop_name)
 Check if a material property is valid for all blocks of this object. More...
 
const std::set< SubdomainID > & meshBlockIDs () const
 Return all of the SubdomainIDs for the mesh. More...
 
virtual bool blockRestricted () const
 Returns true if this object has been restricted to a boundary. More...
 
void checkVariable (const MooseVariableFEBase &variable) const
 Helper for checking that the ids for this object are in agreement with the variables on the supplied variable. More...
 
const std::map< std::string, std::vector< MooseVariableFEBase * > > & getCoupledVars ()
 Get the list of coupled variables. More...
 
const std::vector< MooseVariableFEBase * > & getCoupledMooseVars () const
 Get the list of all coupled variables. More...
 
const std::vector< MooseVariable * > & getCoupledStandardMooseVars () const
 Get the list of standard coupled variables. More...
 
const std::vector< VectorMooseVariable * > & getCoupledVectorMooseVars () const
 Get the list of vector coupled variables. More...
 
void addFEVariableCoupleableVectorTag (TagID tag)
 
void addFEVariableCoupleableMatrixTag (TagID tag)
 
std::set< TagID > & getFEVariableCoupleableVectorTags ()
 
std::set< TagID > & getFEVariableCoupleableMatrixTags ()
 
template<ComputeStage compute_stage>
ADVariableValue * getADDefaultValue (const std::string &var_name)
 Helper method to return (and insert if necessary) the default value for Automatic Differentiation for an uncoupled variable. More...
 
template<>
VariableValuegetADDefaultValue (const std::string &var_name)
 
template<>
VariableValuegetADDefaultValue (const std::string &var_name)
 
template<ComputeStage compute_stage>
ADVectorVariableValue * getADDefaultVectorValue (const std::string &var_name)
 Helper method to return (and insert if necessary) the default vector value for Automatic Differentiation for an uncoupled variable. More...
 
template<>
VectorVariableValuegetADDefaultVectorValue (const std::string &var_name)
 
template<>
VectorVariableValuegetADDefaultVectorValue (const std::string &var_name)
 
template<ComputeStage compute_stage>
ADVariableGradient & getADDefaultGradient ()
 Helper method to return (and insert if necessary) the default gradient for Automatic Differentiation for an uncoupled variable. More...
 
template<>
VariableGradientgetADDefaultGradient ()
 
template<>
VariableGradientgetADDefaultGradient ()
 
template<ComputeStage compute_stage>
ADVectorVariableGradient & getADDefaultVectorGradient ()
 Helper method to return (and insert if necessary) the default gradient for Automatic Differentiation for an uncoupled vector variable. More...
 
template<>
VectorVariableGradientgetADDefaultVectorGradient ()
 
template<>
VectorVariableGradientgetADDefaultVectorGradient ()
 
template<ComputeStage compute_stage>
ADVariableSecond & getADDefaultSecond ()
 Helper method to return (and insert if necessary) the default second derivatives for Automatic Differentiation for an uncoupled variable. More...
 
template<>
VariableSecondgetADDefaultSecond ()
 
template<>
VariableSecondgetADDefaultSecond ()
 
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...
 
const UserObjectgetUserObjectBaseByName (const std::string &name)
 Get an user object with a given name. More...
 
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...
 

Static Public Member Functions

static bool restricted (const std::set< BoundaryID > &ids)
 Helper for determining if the object is boundary restricted. More...
 
template<typename T >
static void sort (typename std::vector< T > &vector)
 Given a vector, sort using the getRequested/SuppliedItems sets. More...
 
template<typename T >
static void cyclicDependencyError (CyclicDependencyException< T > &e, const std::string &header)
 A helper method for cyclic errors. More...
 

Public Attributes

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

Protected Member Functions

virtual bool hasBlockMaterialPropertyHelper (const std::string &prop_name)
 A helper method to allow the Material object to specialize the behavior of hasBlockMaterialProperty. More...
 
void initializeBlockRestrictable (const MooseObject *moose_object)
 An initialization routine needed for dual constructors. More...
 
Moose::CoordinateSystemType getBlockCoordSystem ()
 Check if the blocks this object operates on all have the same coordinate system, and if so return it. 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...
 
template<ComputeStage compute_stage>
const ADVariableValue & adCoupledValueTemplate (const std::string &var_name, unsigned int comp=0)
 Returns value of a coupled variable for use in Automatic Differentiation. More...
 
template<ComputeStage compute_stage>
const ADVectorVariableValue & adCoupledVectorValueTemplate (const std::string &var_name, unsigned int comp=0)
 Returns value of a coupled vector variable for use in Automatic Differentiation. More...
 
virtual const VariableValuecoupledVectorTagValue (const std::string &var_name, TagID tag, unsigned int comp=0)
 Returns value of a coupled variable for a given tag. More...
 
virtual const VariableValuecoupledMatrixTagValue (const std::string &var_name, TagID tag, unsigned int comp=0)
 Returns value of a coupled variable for a given tag. More...
 
virtual const VectorVariableValuecoupledVectorValue (const std::string &var_name, unsigned int comp=0)
 Returns value of a coupled vector 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 VectorVariableValuecoupledVectorValueOld (const std::string &var_name, unsigned int comp=0)
 Returns an old value from previous time step of a coupled vector variable. More...
 
virtual const VectorVariableValuecoupledVectorValueOlder (const std::string &var_name, unsigned int comp=0)
 Returns an old value from two time steps previous of a coupled vector variable. More...
 
virtual const VariableGradientcoupledGradient (const std::string &var_name, unsigned int comp=0)
 Returns gradient of a coupled variable. More...
 
template<ComputeStage compute_stage>
const ADVariableGradient & adCoupledGradientTemplate (const std::string &var_name, unsigned int comp=0)
 Returns gradient of a coupled variable for use in Automatic Differentation. More...
 
template<ComputeStage compute_stage>
const ADVectorVariableGradient & adCoupledVectorGradientTemplate (const std::string &var_name, unsigned int comp=0)
 Returns gradient of a coupled vector variable for use in Automatic Differentation. More...
 
template<ComputeStage compute_stage>
const ADVariableSecond & adCoupledSecondTemplate (const std::string &var_name, unsigned int comp=0)
 Returns second derivatives of a coupled variable for use in Automatic Differentation. More...
 
template<ComputeStage compute_stage>
const ADVectorVariableSecond & adCoupledVectorSecondTemplate (const std::string &var_name, unsigned int comp=0)
 Returns second derivatives of a coupled vector variable for use in Automatic Differentation. 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 VariableGradientcoupledGradientDot (const std::string &var_name, unsigned int comp=0)
 Time derivative of the gradient of a coupled variable. More...
 
virtual const VariableGradientcoupledGradientDotDot (const std::string &var_name, unsigned int comp=0)
 Second time derivative of the gradient of a coupled variable. More...
 
virtual const VectorVariableGradientcoupledVectorGradient (const std::string &var_name, unsigned int comp=0)
 Returns gradient of a coupled vector variable. More...
 
virtual const VectorVariableGradientcoupledVectorGradientOld (const std::string &var_name, unsigned int comp=0)
 Returns an old gradient from previous time step of a coupled vector variable. More...
 
virtual const VectorVariableGradientcoupledVectorGradientOlder (const std::string &var_name, unsigned int comp=0)
 Returns an old gradient from two time steps previous of a coupled vector variable. More...
 
virtual const VectorVariableCurlcoupledCurl (const std::string &var_name, unsigned int comp=0)
 Returns curl of a coupled variable. More...
 
virtual const VectorVariableCurlcoupledCurlOld (const std::string &var_name, unsigned int comp=0)
 Returns an old curl from previous time step of a coupled variable. More...
 
virtual const VectorVariableCurlcoupledCurlOlder (const std::string &var_name, unsigned int comp=0)
 Returns an old curl from two time steps previous of a coupled variable. 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 VariableValuecoupledDotDot (const std::string &var_name, unsigned int comp=0)
 Second time derivative of a coupled variable. More...
 
virtual const VariableValuecoupledDotOld (const std::string &var_name, unsigned int comp=0)
 Old time derivative of a coupled variable. More...
 
virtual const VariableValuecoupledDotDotOld (const std::string &var_name, unsigned int comp=0)
 Old second time derivative of a coupled variable. More...
 
template<ComputeStage compute_stage>
const ADVariableValue & adCoupledDotTemplate (const std::string &var_name, unsigned int comp=0)
 Time derivative of a coupled variable for ad simulations. More...
 
template<ComputeStage compute_stage>
const ADVectorVariableValue & adCoupledVectorDotTemplate (const std::string &var_name, unsigned int comp=0)
 Time derivative of a vector coupled variable for ad simulations. More...
 
virtual const VectorVariableValuecoupledVectorDot (const std::string &var_name, unsigned int comp=0)
 Time derivative of a coupled vector variable. More...
 
virtual const VectorVariableValuecoupledVectorDotDot (const std::string &var_name, unsigned int comp=0)
 Second time derivative of a coupled vector variable. More...
 
virtual const VectorVariableValuecoupledVectorDotOld (const std::string &var_name, unsigned int comp=0)
 Old time derivative of a coupled vector variable. More...
 
virtual const VectorVariableValuecoupledVectorDotDotOld (const std::string &var_name, unsigned int comp=0)
 Old second time derivative of a coupled vector 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 VariableValuecoupledDotDotDu (const std::string &var_name, unsigned int comp=0)
 Second time derivative of a coupled variable with respect to the coefficients. More...
 
template<typename T >
const T & coupledNodalValue (const std::string &var_name, unsigned int comp=0)
 Returns nodal values of a coupled variable. More...
 
template<typename T , ComputeStage compute_stage>
const Moose::ValueType< T, compute_stage >::typeadCoupledNodalValueTemplate (const std::string &var_name, unsigned int comp=0)
 Returns AD nodal values of a coupled variable. More...
 
template<typename T >
const T & coupledNodalValueOld (const std::string &var_name, unsigned int comp=0)
 Returns an old nodal value from previous time step of a coupled variable. More...
 
template<typename T >
const T & coupledNodalValueOlder (const std::string &var_name, unsigned int comp=0)
 Returns an old nodal value from two time steps previous of a coupled variable. More...
 
template<typename T >
const T & coupledNodalValuePreviousNL (const std::string &var_name, unsigned int comp=0)
 Returns nodal values of a coupled variable for previous Newton iterate. More...
 
template<typename T >
const T & coupledNodalDot (const std::string &var_name, unsigned int comp=0)
 Nodal values of time derivative of a coupled variable. More...
 
template<typename T >
const T & getNodalDefaultValue (const std::string &var_name, unsigned int comp=0)
 Get nodal default value. More...
 
template<>
const RealVectorValue & getNodalDefaultValue (const std::string &var_name, unsigned int)
 
virtual const VariableValuecoupledNodalDotDot (const std::string &var_name, unsigned int comp=0)
 Nodal values of second time derivative of a coupled variable. More...
 
virtual const VariableValuecoupledNodalDotOld (const std::string &var_name, unsigned int comp=0)
 Nodal values of old time derivative of a coupled variable. More...
 
virtual const VariableValuecoupledNodalDotDotOld (const std::string &var_name, unsigned int comp=0)
 Nodal values of old second time derivative of a coupled variable. More...
 
virtual const VariableValuecoupledDofValues (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 VariableValuecoupledDofValuesOld (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 VariableValuecoupledDofValuesOlder (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...
 
template<ComputeStage compute_stage>
const ADVariableValue & adZeroValueTemplate ()
 Template method that returns _zero to RESIDUAL computing objects and _ad_zero to JACOBIAN computing objects. More...
 
template<>
const VariableValueadZeroValueTemplate ()
 
template<>
const VariableValueadZeroValueTemplate ()
 
template<ComputeStage compute_stage>
const ADVariableGradient & adZeroGradientTemplate ()
 Template method that returns _grad_zero to RESIDUAL computing objects and _ad_grad_zero to JACOBIAN computing objects. More...
 
template<>
const VariableGradientadZeroGradientTemplate ()
 
template<>
const VariableGradientadZeroGradientTemplate ()
 
template<ComputeStage compute_stage>
const ADVariableSecond & adZeroSecondTemplate ()
 Retrieve a zero second for automatic differentiation. More...
 
template<>
const VariableSecondadZeroSecondTemplate ()
 
template<>
const VariableSecondadZeroSecondTemplate ()
 
void checkVar (const std::string &var_name)
 Check that the right kind of variable is being coupled in. More...
 
MooseVariableFEBasegetFEVar (const std::string &var_name, unsigned int comp)
 Extract pointer to a base finite element coupled variable. More...
 
template<typename T >
MooseVariableFE< T > * getVarHelper (const std::string &var_name, unsigned int comp)
 Helper that segues off to either getVar of getVectorVar depending on template paramter. More...
 
MooseVariablegetVar (const std::string &var_name, unsigned int comp)
 Extract pointer to a coupled variable. More...
 
VectorMooseVariablegetVectorVar (const std::string &var_name, unsigned int comp)
 Extract pointer to a coupled vector variable. More...
 
void validateExecutionerType (const std::string &name, const std::string &fn_name) const
 Checks to make sure that the current Executioner has set "_is_transient" when old/older values are coupled in. More...
 
bool hasBoundaryMaterialPropertyHelper (const std::string &prop_name) const
 A helper method to avoid circular #include problems. More...
 
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...
 
template<typename T >
T & declareRecoverableData (std::string data_name)
 Declare a piece of data as "recoverable". More...
 
template<typename T >
T & declareRecoverableData (std::string data_name, const T &init_value)
 Declare a piece of data as "restartable" and initialize it. More...
 
template<typename T >
T & declareRestartableDataWithObjectName (std::string data_name, std::string object_name)
 Declare a piece of data as "restartable". More...
 
template<typename T >
T & declareRestartableDataWithObjectNameWithContext (std::string data_name, std::string object_name, void *context)
 Declare a piece of data as "restartable". More...
 

Protected Attributes

Function_function
 Optional vectorValue function. More...
 
Function_function_x
 Optional component function value. More...
 
Function_function_y
 
Function_function_z
 
FEProblemBase_fe_problem
 
THREAD_ID _tid
 
Assembly_assembly
 
Real & _t
 Time. More...
 
const Moose::CoordinateSystemType_coord_sys
 The coordinate system type for this problem, references the value in Assembly. More...
 
MooseVariableFE< T > & _var
 The variable that this initial condition is acting upon. More...
 
const Elem *const & _current_elem
 The current element we are on will retrieving values at specific points in the domain. More...
 
const Node * _current_node
 The current node if the point we are evaluating at also happens to be a node. More...
 
unsigned int _qp
 The current quadrature point, contains the "nth" node number when visiting nodes. More...
 
DenseMatrix< Real > _Ke
 Matrix storage member. More...
 
DenseVector< Number > _Fe
 Linear b vector. More...
 
DenseVector< Number > _Ue
 Linear solution vector. More...
 
const FEType & _fe_type
 The finite element type for the IC variable. More...
 
FEContinuity _cont
 The type of continuity, e.g. C0, C1. More...
 
std::vector< dof_id_type > _dof_indices
 The global DOF indices. More...
 
std::vector< unsigned int > _side_dofs
 Side/edge DOF indices. More...
 
unsigned int _n_qp
 The number of quadrature points for a given element. More...
 
unsigned int _n_nodes
 The number of nodes for a given element. More...
 
std::vector< char > _dof_is_fixed
 Whether the degree of freedom is fixed (true/false) More...
 
std::vector< int > _free_dof
 Stores the ids of the free dofs. More...
 
dof_id_type _free_dofs
 The number of free dofs. More...
 
dof_id_type _current_dof
 The current dof being operated on. More...
 
dof_id_type _nc
 number of dofs per node per variable More...
 
const std::vector< std::vector< ValueType > > * _phi
 pointers to shape functions More...
 
const std::vector< std::vector< GradientType > > * _dphi
 pointers to shape function gradients More...
 
const std::vector< Real > * _JxW
 pointers to the Jacobian * quadrature weights for current element More...
 
const std::vector< Point > * _xyz_values
 pointers to the xyz coordinates of the quadrature points for the current element More...
 
unsigned int _n
 node counter More...
 
unsigned int _dim
 the mesh dimension More...
 
SystemBase_sys
 The system object. More...
 
std::set< std::string > _depend_vars
 Dependent variables. More...
 
std::set< std::string > _supplied_vars
 Supplied variables. More...
 
std::set< std::string > _depend_uo
 Depend UserObjects. More...
 
const bool _ignore_uo_dependency
 If set, UOs retrieved by this IC will not be executed before this IC. More...
 
const InputParameters_pars
 Parameters of this object, references the InputParameters stored in the InputParametersWarehouse. More...
 
MooseApp_app
 The MooseApp this object is associated with. More...
 
const std::string & _type
 The type of this object (the Class name) 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::shared_ptr< MaterialData_blk_material_data
 Pointer to the MaterialData class for this object. More...
 
const InputParameters_c_parameters
 
const std::string & _c_name
 The name of the object this interface is part of. More...
 
FEProblemBase_c_fe_problem
 
std::map< std::string, std::vector< MooseVariableFEBase * > > _coupled_vars
 Coupled vars whose values we provide. More...
 
std::vector< MooseVariableFEBase * > _coupled_moose_vars
 Vector of all coupled variables. More...
 
std::vector< MooseVariable * > _coupled_standard_moose_vars
 Vector of standard coupled variables. More...
 
std::vector< VectorMooseVariable * > _coupled_vector_moose_vars
 Vector of vector 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...
 
THREAD_ID _c_tid
 Thread ID of the thread using this object. More...
 
std::map< std::string, std::vector< VariableValue * > > _default_value
 Will hold the default value for optional coupled variables. More...
 
std::map< std::string, MooseArray< DualReal > * > _ad_default_value
 Will hold the default value for optional coupled variables for automatic differentiation. More...
 
std::map< std::string, VectorVariableValue * > _default_vector_value
 Will hold the default value for optional vector coupled variables. More...
 
std::map< std::string, MooseArray< DualRealVectorValue > * > _ad_default_vector_value
 Will hold the default value for optional vector coupled variables for automatic differentiation. 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...
 
MooseArray< DualRealVectorValue_ad_default_gradient
 This will always be zero because the default values for optionally coupled variables is always constant. More...
 
MooseArray< DualRealTensorValue_ad_default_vector_gradient
 This will always be zero because the default values for optionally coupled vector 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...
 
MooseArray< DualRealTensorValue_ad_default_second
 This will always be zero because the default values for optionally coupled variables is always constant. More...
 
const VariableValue_zero
 Zero value of a variable. More...
 
const MooseArray< DualReal > & _ad_zero
 
const VariableGradient_grad_zero
 Zero gradient of a variable. More...
 
const MooseArray< DualRealVectorValue > & _ad_grad_zero
 
const VariableSecond_second_zero
 Zero second derivative of a variable. More...
 
const MooseArray< DualRealTensorValue > & _ad_second_zero
 
const VariablePhiSecond_second_phi_zero
 Zero second derivative of a test function. More...
 
const VectorVariableValue_vector_zero
 Zero value of a vector variable. More...
 
const VectorVariableCurl_vector_curl_zero
 Zero value of the curl of a vector variable. More...
 
VectorVariableValue _default_vector_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...
 
VectorVariableGradient _default_vector_gradient
 This will always be zero because the default values for optionally coupled variables is always constant. More...
 
VectorVariableCurl _default_vector_curl
 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...
 

Detailed Description

IC that calls vectorValue method of a Function object.

Definition at line 33 of file VectorFunctionIC.h.

Member Typedef Documentation

◆ FEBaseType

template<typename T >
typedef FEGenericBase<T> InitialConditionTempl< T >::FEBaseType
inherited

Definition at line 40 of file InitialConditionTempl.h.

◆ GradientType

template<typename T >
typedef OutputTools<T>::OutputGradient InitialConditionTempl< T >::GradientType
inherited

Definition at line 42 of file InitialConditionTempl.h.

◆ ValueType

template<typename T >
typedef OutputTools<T>::OutputShape InitialConditionTempl< T >::ValueType
inherited

Definition at line 41 of file InitialConditionTempl.h.

Member Enumeration Documentation

◆ TEST_TYPE

A flag changing the behavior of hasBoundary.

Enumerator
ALL 
ANY 

Definition at line 34 of file BoundaryRestrictable.h.

Constructor & Destructor Documentation

◆ VectorFunctionIC()

VectorFunctionIC::VectorFunctionIC ( const InputParameters parameters)

Definition at line 35 of file VectorFunctionIC.C.

37  _function(isParamValid("function") ? &getFunction("function") : nullptr),
38  _function_x(getFunction("function_x")),
39  _function_y(getFunction("function_y")),
40  _function_z(getFunction("function_z"))
41 {
42  if (_function && parameters.isParamSetByUser("function_x"))
43  paramError("function_x", "The 'function' and 'function_x' parameters cannot both be set.");
44  if (_function && parameters.isParamSetByUser("function_y"))
45  paramError("function_y", "The 'function' and 'function_y' parameters cannot both be set.");
46  if (_function && parameters.isParamSetByUser("function_z"))
47  paramError("function_z", "The 'function' and 'function_z' parameters cannot both be set.");
48 }
Function * _function
Optional vectorValue function.
Function & _function_y
Function & getFunction(const std::string &name)
Get a function with a given name.
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:65
Function & _function_x
Optional component function value.
InitialConditionTempl< RealVectorValue > VectorInitialCondition
void paramError(const std::string &param, Args... args)
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
Definition: MooseObject.h:108
bool isParamSetByUser(const std::string &name) const
Method returns true if the parameter was by the user.
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
Definition: MooseObject.h:89
Function & _function_z

Member Function Documentation

◆ adCoupledDotTemplate()

template<ComputeStage compute_stage>
const ADVariableValue & Coupleable::adCoupledDotTemplate ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedinherited

Time derivative of a coupled variable for ad simulations.

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

Definition at line 1050 of file Coupleable.h.

1051 {
1052  checkVar(var_name);
1053  if (!isCoupled(var_name)) // Return default 0
1054  return *getADDefaultValue<compute_stage>(var_name);
1055 
1056  MooseVariable * var = getVar(var_name, comp);
1057  if (var == nullptr)
1058  mooseError("Call corresponding vector variable method");
1059 
1060  if (!_coupleable_neighbor)
1061  {
1062  if (_c_nodal)
1063  mooseError("Not implemented");
1064  else
1065  return var->adUDot<compute_stage>();
1066  }
1067  else
1068  {
1069  if (_c_nodal)
1070  mooseError("Not implemented");
1071  else
1072  return var->adUDotNeighbor<compute_stage>();
1073  }
1074 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:749
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:207
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:241
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:144
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:866
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ adCoupledGradientTemplate()

template<ComputeStage compute_stage>
const ADVariableGradient & Coupleable::adCoupledGradientTemplate ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedinherited

Returns gradient of a coupled variable for use in Automatic Differentation.

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 984 of file Coupleable.h.

985 {
986  if (!isCoupled(var_name)) // Return default 0
987  return getADDefaultGradient<compute_stage>();
988 
989  coupledCallback(var_name, false);
990  if (_c_nodal)
991  mooseError("Nodal variables do not have gradients");
992 
993  MooseVariable * var = getVar(var_name, comp);
994 
996  {
997  if (_c_is_implicit)
998  return var->adGradSln<compute_stage>();
999  else
1000  mooseError("Not implemented");
1001  }
1002  else
1003  {
1004  if (_c_is_implicit)
1005  return var->adGradSlnNeighbor<compute_stage>();
1006  else
1007  mooseError("Not implemented");
1008  }
1009 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:749
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:207
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:241
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:752
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:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
const VariableGradientType< OutputType, compute_stage >::type & adGradSlnNeighbor() const
const VariableGradientType< OutputType, compute_stage >::type & adGradSln() const
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:866

◆ adCoupledNodalValueTemplate()

template<typename T , ComputeStage compute_stage>
template const libMesh::VectorValue< DualReal > & Coupleable::adCoupledNodalValueTemplate< RealVectorValue, JACOBIAN > ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedinherited

Returns AD 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 1537 of file Coupleable.C.

1538 {
1539  static const typename Moose::ValueType<T, compute_stage>::type zero = 0;
1540  if (!isCoupled(var_name))
1541  return zero;
1542 
1543  if (!_c_nodal)
1544  mooseError("The adCoupledNodalValue method should only be called for nodal computing objects");
1546  mooseError(
1547  "The adCoupledNodalValue method shouldn't be called for neighbor computing objects. I "
1548  "don't even know what that would mean, although maybe someone could explain it to me.");
1549  if (!_c_is_implicit)
1550  mooseError("If you're going to use an explicit scheme, then use coupledNodalValue instead of "
1551  "adCoupledNodalValue");
1552 
1553  coupledCallback(var_name, false);
1554  MooseVariableFE<T> * var = getVarHelper<T>(var_name, comp);
1555 
1556  return var->template adNodalValue<compute_stage>();
1557 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:749
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:207
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:752
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:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
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:866

◆ adCoupledSecondTemplate()

template<ComputeStage compute_stage>
const ADVariableSecond & Coupleable::adCoupledSecondTemplate ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedinherited

Returns second derivatives of a coupled variable for use in Automatic Differentation.

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

Definition at line 1013 of file Coupleable.h.

1014 {
1015  if (!isCoupled(var_name)) // Return default 0
1016  return getADDefaultSecond<compute_stage>();
1017 
1018  coupledCallback(var_name, false);
1019  if (_c_nodal)
1020  mooseError("Nodal variables do not have second derivatives");
1021 
1022  MooseVariable * var = getVar(var_name, comp);
1023 
1024  if (!_coupleable_neighbor)
1025  {
1026  if (_c_is_implicit)
1027  return var->adSecondSln<compute_stage>();
1028  else
1029  mooseError("Not implemented");
1030  }
1031  else
1032  {
1033  if (_c_is_implicit)
1034  return var->adSecondSlnNeighbor<compute_stage>();
1035  else
1036  mooseError("Not implemented");
1037  }
1038 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:749
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:207
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:241
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:752
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:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
const VariableSecondType< OutputType, compute_stage >::type & adSecondSln() const
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:866
const VariableSecondType< OutputType, compute_stage >::type & adSecondSlnNeighbor() const

◆ adCoupledValueTemplate()

template<ComputeStage compute_stage>
const ADVariableValue & Coupleable::adCoupledValueTemplate ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedinherited

Returns value of a coupled variable for use in Automatic Differentiation.

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 948 of file Coupleable.h.

949 {
950  if (!isCoupled(var_name))
951  return *getADDefaultValue<compute_stage>(var_name);
952 
953  coupledCallback(var_name, false);
954  MooseVariable * var = getVar(var_name, comp);
955 
957  {
958  if (_c_nodal)
959  mooseError("Not implemented");
960  else
961  {
962  if (_c_is_implicit)
963  return var->adSln<compute_stage>();
964  else
965  mooseError("Not implemented");
966  }
967  }
968  else
969  {
970  if (_c_nodal)
971  mooseError("Not implemented");
972  else
973  {
974  if (_c_is_implicit)
975  return var->adSlnNeighbor<compute_stage>();
976  else
977  mooseError("Not implemented");
978  }
979  }
980 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:749
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:207
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:241
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:752
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:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
const VariableValueType< OutputType, compute_stage >::type & adSln() const
AD.
const VariableValueType< OutputType, compute_stage >::type & adSlnNeighbor() const
neighbor AD
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:866

◆ adCoupledVectorDotTemplate()

template<ComputeStage compute_stage>
const ADVectorVariableValue & Coupleable::adCoupledVectorDotTemplate ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedinherited

Time derivative of a vector coupled variable for ad simulations.

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

Definition at line 1078 of file Coupleable.h.

1079 {
1080  checkVar(var_name);
1081  if (!isCoupled(var_name)) // Return default 0
1082  return *getADDefaultVectorValue<compute_stage>(var_name);
1083 
1084  VectorMooseVariable * var = getVectorVar(var_name, comp);
1085  if (var == nullptr)
1086  mooseError("Try calling corresponding standard variable method");
1087 
1088  if (!_coupleable_neighbor)
1089  {
1090  if (_c_nodal)
1091  mooseError("Not implemented");
1092  else
1093  return var->adUDot<compute_stage>();
1094  }
1095  else
1096  {
1097  if (_c_nodal)
1098  mooseError("Not implemented");
1099  else
1100  return var->adUDotNeighbor<compute_stage>();
1101  }
1102 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:749
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:247
Class for stuff related to variables.
Definition: Adaptivity.h:29
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:207
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:144
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:866
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ adCoupledVectorGradientTemplate()

template<ComputeStage compute_stage>
const ADVectorVariableGradient & Coupleable::adCoupledVectorGradientTemplate ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedinherited

Returns gradient of a coupled vector variable for use in Automatic Differentation.

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

Definition at line 1142 of file Coupleable.h.

1143 {
1144 
1145  if (!isCoupled(var_name)) // Return default 0
1146  return getADDefaultVectorGradient<compute_stage>();
1147 
1148  coupledCallback(var_name, false);
1149  if (_c_nodal)
1150  mooseError("Nodal variables do not have gradients");
1151 
1152  VectorMooseVariable * var = getVectorVar(var_name, comp);
1153 
1154  if (!_coupleable_neighbor)
1155  {
1156  if (_c_is_implicit)
1157  return var->adGradSln<compute_stage>();
1158  else
1159  mooseError("Not implemented");
1160  }
1161  else
1162  {
1163  if (_c_is_implicit)
1164  return var->adGradSlnNeighbor<compute_stage>();
1165  else
1166  mooseError("Not implemented");
1167  }
1168 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:749
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:247
Class for stuff related to variables.
Definition: Adaptivity.h:29
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:207
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:752
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:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
const VariableGradientType< OutputType, compute_stage >::type & adGradSlnNeighbor() const
const VariableGradientType< OutputType, compute_stage >::type & adGradSln() const
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:866

◆ adCoupledVectorSecondTemplate()

template<ComputeStage compute_stage>
const ADVectorVariableSecond& Coupleable::adCoupledVectorSecondTemplate ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedinherited

Returns second derivatives of a coupled vector variable for use in Automatic Differentation.

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

◆ adCoupledVectorValueTemplate()

template<ComputeStage compute_stage>
const ADVectorVariableValue & Coupleable::adCoupledVectorValueTemplate ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedinherited

Returns value of a coupled vector variable for use in Automatic Differentiation.

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

Definition at line 1106 of file Coupleable.h.

1107 {
1108  if (!isCoupled(var_name))
1109  return *getADDefaultVectorValue<compute_stage>(var_name);
1110 
1111  coupledCallback(var_name, false);
1112  VectorMooseVariable * var = getVectorVar(var_name, comp);
1113 
1114  if (!_coupleable_neighbor)
1115  {
1116  if (_c_nodal)
1117  mooseError("Not implemented");
1118  else
1119  {
1120  if (_c_is_implicit)
1121  return var->adSln<compute_stage>();
1122  else
1123  mooseError("Not implemented");
1124  }
1125  }
1126  else
1127  {
1128  if (_c_nodal)
1129  mooseError("Not implemented");
1130  else
1131  {
1132  if (_c_is_implicit)
1133  return var->adSlnNeighbor<compute_stage>();
1134  else
1135  mooseError("Not implemented");
1136  }
1137  }
1138 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:749
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:247
Class for stuff related to variables.
Definition: Adaptivity.h:29
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:207
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:752
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:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
const VariableValueType< OutputType, compute_stage >::type & adSln() const
AD.
const VariableValueType< OutputType, compute_stage >::type & adSlnNeighbor() const
neighbor AD
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:866

◆ addFEVariableCoupleableMatrixTag()

void Coupleable::addFEVariableCoupleableMatrixTag ( TagID  tag)
inlineinherited

Definition at line 115 of file Coupleable.h.

Referenced by Coupleable::coupledMatrixTagValue().

115 { _fe_coupleable_matrix_tags.insert(tag); }
std::set< TagID > _fe_coupleable_matrix_tags
Definition: Coupleable.h:943

◆ addFEVariableCoupleableVectorTag()

void Coupleable::addFEVariableCoupleableVectorTag ( TagID  tag)
inlineinherited

Definition at line 113 of file Coupleable.h.

Referenced by Coupleable::coupledVectorTagValue().

113 { _fe_coupleable_vector_tags.insert(tag); }
std::set< TagID > _fe_coupleable_vector_tags
Definition: Coupleable.h:941

◆ adZeroGradientTemplate() [1/3]

template<ComputeStage compute_stage>
const ADVariableGradient & Coupleable::adZeroGradientTemplate ( )
protectedinherited

Template method that returns _grad_zero to RESIDUAL computing objects and _ad_grad_zero to JACOBIAN computing objects.

Definition at line 1249 of file Coupleable.h.

1250 {
1251  return _ad_grad_zero;
1252 }
const MooseArray< DualRealVectorValue > & _ad_grad_zero
Definition: Coupleable.h:796

◆ adZeroGradientTemplate() [2/3]

template<>
const VariableGradient& Coupleable::adZeroGradientTemplate ( )
protectedinherited

◆ adZeroGradientTemplate() [3/3]

template<>
const VariableGradient& Coupleable::adZeroGradientTemplate ( )
protectedinherited

Definition at line 1523 of file Coupleable.C.

1524 {
1525  return _grad_zero;
1526 }
const VariableGradient & _grad_zero
Zero gradient of a variable.
Definition: Coupleable.h:795

◆ adZeroSecondTemplate() [1/3]

template<ComputeStage compute_stage>
const ADVariableSecond & Coupleable::adZeroSecondTemplate ( )
protectedinherited

Retrieve a zero second for automatic differentiation.

Definition at line 1256 of file Coupleable.h.

1257 {
1258  return _ad_second_zero;
1259 }
const MooseArray< DualRealTensorValue > & _ad_second_zero
Definition: Coupleable.h:800

◆ adZeroSecondTemplate() [2/3]

template<>
const VariableSecond& Coupleable::adZeroSecondTemplate ( )
protectedinherited

◆ adZeroSecondTemplate() [3/3]

template<>
const VariableSecond& Coupleable::adZeroSecondTemplate ( )
protectedinherited

Definition at line 1530 of file Coupleable.C.

1531 {
1532  return _second_zero;
1533 }
const VariableSecond & _second_zero
Zero second derivative of a variable.
Definition: Coupleable.h:799

◆ adZeroValueTemplate() [1/3]

template<ComputeStage compute_stage>
const ADVariableValue & Coupleable::adZeroValueTemplate ( )
protectedinherited

Template method that returns _zero to RESIDUAL computing objects and _ad_zero to JACOBIAN computing objects.

Definition at line 1242 of file Coupleable.h.

1243 {
1244  return _ad_zero;
1245 }
const MooseArray< DualReal > & _ad_zero
Definition: Coupleable.h:792

◆ adZeroValueTemplate() [2/3]

template<>
const VariableValue& Coupleable::adZeroValueTemplate ( )
protectedinherited

◆ adZeroValueTemplate() [3/3]

template<>
const VariableValue& Coupleable::adZeroValueTemplate ( )
protectedinherited

Definition at line 1516 of file Coupleable.C.

1517 {
1518  return _zero;
1519 }
const VariableValue & _zero
Zero value of a variable.
Definition: Coupleable.h:791

◆ blockIDs()

const std::set< SubdomainID > & BlockRestrictable::blockIDs ( ) const
virtualinherited

Return the block subdomain ids for this object.

Returns
a set of SudomainIDs that are valid for this object

Definition at line 167 of file BlockRestrictable.C.

Referenced by BlockRestrictable::getBlockCoordSystem(), Material::getZeroMaterialProperty(), BlockRestrictable::hasBlockMaterialPropertyHelper(), and Material::registerPropName().

168 {
169  return _blk_ids;
170 }
std::set< SubdomainID > _blk_ids
Set of block ids supplied by the user via the input file (for error reporting)

◆ blockRestricted()

bool BlockRestrictable::blockRestricted ( ) const
virtualinherited

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

See also
MooseObject

Definition at line 155 of file BlockRestrictable.C.

Referenced by MooseObjectWarehouseBase< Indicator >::addObject(), BlockRestrictable::checkVariable(), BlockRestrictable::getBlockCoordSystem(), and BlockRestrictable::hasBlockMaterialPropertyHelper().

156 {
157  return _blk_ids.find(Moose::ANY_BLOCK_ID) == _blk_ids.end();
158 }
const SubdomainID ANY_BLOCK_ID
Definition: MooseTypes.C:15
std::set< SubdomainID > _blk_ids
Set of block ids supplied by the user via the input file (for error reporting)

◆ blocks()

const std::vector< SubdomainName > & BlockRestrictable::blocks ( ) const
inherited

Return the block names for this object.

Note, if the 'blocks' input parameter was not utilized this will return an empty vector.

Returns
vector of SubdomainNames that are valid for this object

Definition at line 161 of file BlockRestrictable.C.

Referenced by MaterialOutputAction::getParams().

162 {
163  return _blocks;
164 }
std::vector< SubdomainName > _blocks
Vector the block names supplied by the user via the input file.

◆ boundaryIDs()

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 148 of file BoundaryRestrictable.C.

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

149 {
150  return _bnd_ids;
151 }
std::set< BoundaryID > _bnd_ids
Set of the boundary ids.

◆ boundaryNames()

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 154 of file BoundaryRestrictable.C.

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

155 {
156  return _boundary_names;
157 }
std::vector< BoundaryName > _boundary_names
Vector the the boundary names.

◆ boundaryRestricted()

bool BoundaryRestrictable::boundaryRestricted ( ) const
virtualinherited

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

See also
MooseObject

Definition at line 166 of file BoundaryRestrictable.C.

Referenced by MaterialOutputAction::getParams(), and DerivativeMaterialInterface< Material >::haveMaterialProperty().

167 {
169 }
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.

◆ checkVar()

void Coupleable::checkVar ( const std::string &  var_name)
protectedinherited

Check that the right kind of variable is being coupled in.

Parameters
var_nameThe name of the coupled variable

Definition at line 180 of file Coupleable.C.

Referenced by Coupleable::adCoupledDotTemplate(), Coupleable::adCoupledVectorDotTemplate(), Coupleable::coupled(), Coupleable::coupledDofValues(), Coupleable::coupledDofValuesOld(), Coupleable::coupledDofValuesOlder(), Coupleable::coupledDot(), Coupleable::coupledDotDot(), Coupleable::coupledDotDotDu(), Coupleable::coupledDotDotOld(), Coupleable::coupledDotDu(), Coupleable::coupledDotOld(), Coupleable::coupledGradient(), Coupleable::coupledGradientDot(), Coupleable::coupledGradientDotDot(), Coupleable::coupledGradientOld(), Coupleable::coupledGradientOlder(), Coupleable::coupledGradientPreviousNL(), Coupleable::coupledMatrixTagValue(), Coupleable::coupledNodalDot(), Coupleable::coupledNodalDotDot(), Coupleable::coupledNodalDotDotOld(), Coupleable::coupledNodalDotOld(), Coupleable::coupledNodalValue(), Coupleable::coupledNodalValueOld(), Coupleable::coupledNodalValueOlder(), Coupleable::coupledNodalValuePreviousNL(), Coupleable::coupledSecond(), Coupleable::coupledSecondOld(), Coupleable::coupledSecondOlder(), Coupleable::coupledSecondPreviousNL(), Coupleable::coupledValue(), Coupleable::coupledValueOld(), Coupleable::coupledValueOlder(), Coupleable::coupledValuePreviousNL(), Coupleable::coupledVectorDot(), Coupleable::coupledVectorDotDot(), Coupleable::coupledVectorDotDotOld(), Coupleable::coupledVectorDotOld(), Coupleable::coupledVectorGradient(), Coupleable::coupledVectorGradientOld(), Coupleable::coupledVectorGradientOlder(), and Coupleable::coupledVectorTagValue().

181 {
182  auto it = _c_coupled_scalar_vars.find(var_name);
183  if (it != _c_coupled_scalar_vars.end())
184  {
185  std::string cvars;
186  for (auto jt : it->second)
187  cvars += " " + jt->name();
189  ": Trying to couple a scalar variable where field variable is expected, '",
190  var_name,
191  " =",
192  cvars,
193  "'");
194  }
195  // NOTE: non-existent variables are handled in the constructor
196 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:207
std::map< std::string, std::vector< MooseVariableScalar * > > _c_coupled_scalar_vars
Scalar variables coupled into this object (for error checking)
Definition: Coupleable.h:939
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:731

◆ checkVariable()

void BlockRestrictable::checkVariable ( const MooseVariableFEBase variable) const
inherited

Helper for checking that the ids for this object are in agreement with the variables on the supplied variable.

Parameters
variableThe variable to check against.

Definition at line 307 of file BlockRestrictable.C.

308 {
309  if (!isBlockSubset(variable.activeSubdomains()))
310  {
311  std::string var_ids = Moose::stringify(variable.activeSubdomains(), ", ");
312  std::string obj_ids = Moose::stringify(blockRestricted() ? _blk_ids : meshBlockIDs(), ", ");
313  mooseError("The 'block' parameter of the object '",
314  _blk_name,
315  "' must be a subset of the 'block' parameter of the variable '",
316  variable.name(),
317  "':\n Object '",
318  _blk_name,
319  "': ",
320  obj_ids,
321  "\n Variable '",
322  variable.name(),
323  "': ",
324  var_ids);
325  }
326 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:207
virtual bool blockRestricted() const
Returns true if this object has been restricted to a boundary.
virtual const std::set< SubdomainID > & activeSubdomains() const =0
The subdomains the variable is active on.
bool isBlockSubset(const std::set< SubdomainID > &ids) const
Test if the class block ids are a subset of the supplied objects.
std::string stringify(const T &t)
conversion to string
Definition: Conversion.h:60
const std::string & name() const
Get the variable name.
const std::set< SubdomainID > & meshBlockIDs() const
Return all of the SubdomainIDs for the mesh.
std::set< SubdomainID > _blk_ids
Set of block ids supplied by the user via the input file (for error reporting)
const std::string & _blk_name
Name of the object.

◆ choleskySolve()

template<typename T >
void InitialConditionTempl< T >::choleskySolve ( bool  is_volume)
inherited

Perform the cholesky solves for edge, side, and interior projections.

Definition at line 415 of file InitialConditionTempl.C.

416 {
417  _Ke.resize(_free_dofs, _free_dofs);
418  _Ke.zero();
419  _Fe.resize(_free_dofs);
420  _Fe.zero();
421  // The new edge coefficients
422  DenseVector<Number> U(_free_dofs);
423 
424  // Loop over the quadrature points
425  for (_qp = 0; _qp < _n_qp; _qp++)
426  {
427  // solution at the quadrature point
428  auto fineval = value((*_xyz_values)[_qp]);
429  // solution grad at the quadrature point
430  GradientType finegrad;
431  if (_cont == C_ONE)
432  finegrad = gradient((*_xyz_values)[_qp]);
433 
434  auto dofs_size = is_volume ? _dof_indices.size() : _side_dofs.size();
435 
436  // Form edge projection matrix
437  for (decltype(dofs_size) geomi = 0, freei = 0; geomi != dofs_size; ++geomi)
438  {
439  auto i = is_volume ? geomi : _side_dofs[geomi];
440 
441  // fixed DoFs aren't test functions
442  if (_dof_is_fixed[i])
443  continue;
444  for (decltype(dofs_size) geomj = 0, freej = 0; geomj != dofs_size; ++geomj)
445  {
446  auto j = is_volume ? geomj : _side_dofs[geomj];
447  if (_dof_is_fixed[j])
448  _Fe(freei) -= (*_phi)[i][_qp] * (*_phi)[j][_qp] * (*_JxW)[_qp] * _Ue(j);
449  else
450  _Ke(freei, freej) += (*_phi)[i][_qp] * (*_phi)[j][_qp] * (*_JxW)[_qp];
451  if (_cont == C_ONE)
452  {
453  if (_dof_is_fixed[j])
454  _Fe(freei) -= dotHelper((*_dphi)[i][_qp], (*_dphi)[j][_qp]) * (*_JxW)[_qp] * _Ue(j);
455  else
456  _Ke(freei, freej) += dotHelper((*_dphi)[i][_qp], (*_dphi)[j][_qp]) * (*_JxW)[_qp];
457  }
458  if (!_dof_is_fixed[j])
459  freej++;
460  }
461  _Fe(freei) += (*_phi)[i][_qp] * fineval * (*_JxW)[_qp];
462  if (_cont == C_ONE)
463  _Fe(freei) += dotHelper(finegrad, (*_dphi)[i][_qp]) * (*_JxW)[_qp];
464  freei++;
465  }
466  }
467 
468  _Ke.cholesky_solve(_Fe, U);
469 
470  // Transfer new edge solutions to element
471  for (unsigned int i = 0; i != _free_dofs; ++i)
472  {
473  auto the_dof = is_volume ? _free_dof[i] : _side_dofs[_free_dof[i]];
474  Number & ui = _Ue(the_dof);
475  libmesh_assert(std::abs(ui) < TOLERANCE || std::abs(ui - U(i)) < TOLERANCE);
476  ui = U(i);
477  _dof_is_fixed[the_dof] = true;
478  }
479 }
std::vector< unsigned int > _side_dofs
Side/edge DOF indices.
MetaPhysicL::DualNumber< T, D > abs(const MetaPhysicL::DualNumber< T, D > &in)
OutputTools< T >::OutputGradient GradientType
DenseMatrix< Real > _Ke
Matrix storage member.
std::vector< char > _dof_is_fixed
Whether the degree of freedom is fixed (true/false)
std::vector< int > _free_dof
Stores the ids of the free dofs.
unsigned int _qp
The current quadrature point, contains the "nth" node number when visiting nodes. ...
unsigned int _n_qp
The number of quadrature points for a given element.
const std::vector< Point > * _xyz_values
pointers to the xyz coordinates of the quadrature points for the current element
virtual ValueType value(const Point &p)=0
The value of the variable at a point.
DenseVector< Number > _Fe
Linear b vector.
DenseVector< Number > _Ue
Linear solution vector.
FEContinuity _cont
The type of continuity, e.g. C0, C1.
dof_id_type _free_dofs
The number of free dofs.
Real dotHelper(const GradientType &op1, const GradientType &op2)
Helps perform multiplication of GradientTypes: a normal dot product for vectors and a contraction for...
std::vector< dof_id_type > _dof_indices
The global DOF indices.
const std::vector< std::vector< GradientType > > * _dphi
pointers to shape function gradients
virtual GradientType gradient(const Point &)
The gradient of the variable at a point.

◆ compute()

template<typename T >
void InitialConditionTempl< T >::compute ( )
overridevirtualinherited

Workhorse method for projecting the initial conditions for block initial conditions.

Implements InitialConditionBase.

Definition at line 55 of file InitialConditionTempl.C.

56 {
57  // -- NOTE ----
58  // The following code is a copy from libMesh project_vector.C plus it adds some features, so we
59  // can couple variable values
60  // and we also do not call any callbacks, but we use our initial condition system directly.
61  // ------------
62 
63  // The dimension of the current element
64  _dim = _current_elem->dim();
65  // The element type
66  const ElemType elem_type = _current_elem->type();
67  // The number of nodes on the new element
68  const unsigned int n_nodes = _current_elem->n_nodes();
69 
70  // Get FE objects of the appropriate type
71  // We cannot use the FE object in Assembly, since the following code is messing with the
72  // quadrature rules
73  // for projections and would screw it up. However, if we implement projections from one mesh to
74  // another,
75  // this code should use that implementation.
76  std::unique_ptr<FEBaseType> fe(FEBaseType::build(_dim, _fe_type));
77 
78  // Prepare variables for projection
79  std::unique_ptr<QBase> qrule(_fe_type.default_quadrature_rule(_dim));
80  std::unique_ptr<QBase> qedgerule(_fe_type.default_quadrature_rule(1));
81  std::unique_ptr<QBase> qsiderule(_fe_type.default_quadrature_rule(_dim - 1));
82 
83  // The values of the shape functions at the quadrature points
84  _phi = &fe->get_phi();
85 
86  // The gradients of the shape functions at the quadrature points on the child element.
87  _dphi = nullptr;
88 
89  _cont = fe->get_continuity();
90 
91  if (_cont == C_ONE)
92  {
93  const std::vector<std::vector<GradientType>> & ref_dphi = fe->get_dphi();
94  _dphi = &ref_dphi;
95  }
96 
97  // The Jacobian * quadrature weight at the quadrature points
98  _JxW = &fe->get_JxW();
99  // The XYZ locations of the quadrature points
100  _xyz_values = &fe->get_xyz();
101 
102  // Update the DOF indices for this element based on the current mesh
103  _var.prepareIC();
105 
106  // The number of DOFs on the element
107  const unsigned int n_dofs = _dof_indices.size();
108  if (n_dofs == 0)
109  return;
110 
111  // Fixed vs. free DoFs on edge/face projections
112  _dof_is_fixed.clear();
113  _dof_is_fixed.resize(n_dofs, false);
114  _free_dof.clear();
115  _free_dof.resize(n_dofs, 0);
116 
117  // Zero the interpolated values
118  _Ue.resize(n_dofs);
119  _Ue.zero();
120 
121  // In general, we need a series of
122  // projections to ensure a unique and continuous
123  // solution. We start by interpolating nodes, then
124  // hold those fixed and project edges, then
125  // hold those fixed and project faces, then
126  // hold those fixed and project interiors
127 
128  // Interpolate node values first
129  _current_dof = 0;
130  for (_n = 0; _n != n_nodes; ++_n)
131  {
132  // FIXME: this should go through the DofMap,
133  // not duplicate _dof_indices code badly!
134  _nc = FEInterface::n_dofs_at_node(_dim, _fe_type, elem_type, _n);
135  if (!_current_elem->is_vertex(_n))
136  {
137  _current_dof += _nc;
138  continue;
139  }
140  if (_cont == DISCONTINUOUS)
141  libmesh_assert(_nc == 0);
142  else if (_cont == C_ZERO)
144  else if (_fe_type.family == HERMITE)
146  else if (_cont == C_ONE)
148  else
149  libmesh_error();
150  } // loop over nodes
151 
152  // From here on out we won't be sampling at nodes anymore
153  _current_node = nullptr;
154 
155  // In 3D, project any edge values next
156  if (_dim > 2 && _cont != DISCONTINUOUS)
157  for (unsigned int e = 0; e != _current_elem->n_edges(); ++e)
158  {
159  FEInterface::dofs_on_edge(_current_elem, _dim, _fe_type, e, _side_dofs);
160 
161  // Some edge dofs are on nodes and already
162  // fixed, others are free to calculate
163  _free_dofs = 0;
164  for (unsigned int i = 0; i != _side_dofs.size(); ++i)
165  if (!_dof_is_fixed[_side_dofs[i]])
166  _free_dof[_free_dofs++] = i;
167 
168  // There may be nothing to project
169  if (!_free_dofs)
170  continue;
171 
172  // Initialize FE data on the edge
173  fe->attach_quadrature_rule(qedgerule.get());
174  fe->edge_reinit(_current_elem, e);
175  _n_qp = qedgerule->n_points();
176 
177  choleskySolve(false);
178  }
179 
180  // Project any side values (edges in 2D, faces in 3D)
181  if (_dim > 1 && _cont != DISCONTINUOUS)
182  for (unsigned int s = 0; s != _current_elem->n_sides(); ++s)
183  {
184  FEInterface::dofs_on_side(_current_elem, _dim, _fe_type, s, _side_dofs);
185 
186  // Some side dofs are on nodes/edges and already
187  // fixed, others are free to calculate
188  _free_dofs = 0;
189  for (unsigned int i = 0; i != _side_dofs.size(); ++i)
190  if (!_dof_is_fixed[_side_dofs[i]])
191  _free_dof[_free_dofs++] = i;
192 
193  // There may be nothing to project
194  if (!_free_dofs)
195  continue;
196 
197  // Initialize FE data on the side
198  fe->attach_quadrature_rule(qsiderule.get());
199  fe->reinit(_current_elem, s);
200  _n_qp = qsiderule->n_points();
201 
202  choleskySolve(false);
203  }
204 
205  // Project the interior values, finally
206 
207  // Some interior dofs are on nodes/edges/sides and
208  // already fixed, others are free to calculate
209  _free_dofs = 0;
210  for (unsigned int i = 0; i != n_dofs; ++i)
211  if (!_dof_is_fixed[i])
212  _free_dof[_free_dofs++] = i;
213 
214  // There may be nothing to project
215  if (_free_dofs)
216  {
217  // Initialize FE data
218  fe->attach_quadrature_rule(qrule.get());
219  fe->reinit(_current_elem);
220  _n_qp = qrule->n_points();
221 
222  choleskySolve(true);
223  } // if there are free interior dofs
224 
225  // Make sure every DoF got reached!
226  for (unsigned int i = 0; i != n_dofs; ++i)
227  libmesh_assert(_dof_is_fixed[i]);
228 
229  NumericVector<Number> & solution = _var.sys().solution();
230 
231  // 'first' and 'last' are no longer used, see note about subdomain-restricted variables below
232  // const dof_id_type
233  // first = solution.first_local_index(),
234  // last = solution.last_local_index();
235 
236  // Lock the new_vector since it is shared among threads.
237  {
238  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
239 
240  for (unsigned int i = 0; i < n_dofs; i++)
241  // We may be projecting a new zero value onto
242  // an old nonzero approximation - RHS
243  // if (_Ue(i) != 0.)
244 
245  // This is commented out because of subdomain restricted variables.
246  // It can be the case that if a subdomain restricted variable's boundary
247  // aligns perfectly with a processor boundary that the variable will get
248  // no value. To counteract this we're going to let every processor set a
249  // value at every node and then let PETSc figure it out.
250  // Later we can choose to do something different / better.
251  // if ((_dof_indices[i] >= first) && (_dof_indices[i] < last))
252  {
253  solution.set(_dof_indices[i], _Ue(i));
254  }
256  }
257 }
std::vector< unsigned int > _side_dofs
Side/edge DOF indices.
MooseVariableFE< T > & _var
The variable that this initial condition is acting upon.
const std::vector< std::vector< ValueType > > * _phi
pointers to shape functions
void setOtherCOneVertices()
set the temporary solution vector for node projections of non-Hermitian C1 variables ...
std::vector< char > _dof_is_fixed
Whether the degree of freedom is fixed (true/false)
std::vector< int > _free_dof
Stores the ids of the free dofs.
const std::vector< Real > * _JxW
pointers to the Jacobian * quadrature weights for current element
const FEType & _fe_type
The finite element type for the IC variable.
virtual void prepareIC() override
Prepare the initial condition.
unsigned int _n_qp
The number of quadrature points for a given element.
const std::vector< Point > * _xyz_values
pointers to the xyz coordinates of the quadrature points for the current element
const Node * _current_node
The current node if the point we are evaluating at also happens to be a node.
const std::vector< dof_id_type > & dofIndices() const final
Get local DoF indices.
void setCZeroVertices()
set the temporary solution vector for node projections of C0 variables
unsigned int _n
node counter
void setDofValues(const DenseVector< Number > &value) override
Set values for this variable to keep everything up to date.
void setHermiteVertices()
set the temporary solution vector for node projections of Hermite variables
DenseVector< Number > _Ue
Linear solution vector.
unsigned int _dim
the mesh dimension
dof_id_type _current_dof
The current dof being operated on.
FEContinuity _cont
The type of continuity, e.g. C0, C1.
dof_id_type _free_dofs
The number of free dofs.
dof_id_type _nc
number of dofs per node per variable
void choleskySolve(bool is_volume)
Perform the cholesky solves for edge, side, and interior projections.
virtual NumericVector< Number > & solution()=0
std::vector< dof_id_type > _dof_indices
The global DOF indices.
const Elem *const & _current_elem
The current element we are on will retrieving values at specific points in the domain.
const std::vector< std::vector< GradientType > > * _dphi
pointers to shape function gradients
SystemBase & sys()
Get the system this variable is part of.

◆ computeNodal()

template<typename T >
void InitialConditionTempl< T >::computeNodal ( const Point &  p)
overridevirtualinherited

Workhorse method for projecting the initial conditions for boundary restricted initial conditions.

Implements InitialConditionBase.

Definition at line 483 of file InitialConditionTempl.C.

484 {
485  _var.reinitNode();
486  _var.computeNodalValues(); // has to call this to resize the internal array
487  auto return_value = value(p);
488 
489  _var.setNodalValue(return_value); // update variable data, which is referenced by others, so the
490  // value is up-to-date
491 
492  // We are done, so update the solution vector
493  {
494  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
495  _var.insert(_var.sys().solution());
496  }
497 }
MooseVariableFE< T > & _var
The variable that this initial condition is acting upon.
virtual void computeNodalValues() override
Compute nodal values of this variable.
virtual ValueType value(const Point &p)=0
The value of the variable at a point.
void insert(NumericVector< Number > &residual) override
void setNodalValue(OutputType value, unsigned int idx=0)
virtual NumericVector< Number > & solution()=0
void reinitNode() override
SystemBase & sys()
Get the system this variable is part of.

◆ coupled()

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 253 of file Coupleable.C.

Referenced by FunctionMaterialBase::FunctionMaterialBase(), KernelBase::KernelBase(), and NodalEqualValueConstraint::NodalEqualValueConstraint().

254 {
255  checkVar(var_name);
256 
257  if (!isCoupled(var_name))
258  {
259  // make sure we don't try to access default var ids that were not provided
260  if (comp + 1 > _optional_var_index[var_name].size())
262  ": Requested component ",
263  comp,
264  " of coupled value ",
265  var_name,
266  " is out of range.");
267  return _optional_var_index[var_name][comp];
268  }
269 
270  MooseVariableFEBase * var = getFEVar(var_name, comp);
271  switch (var->kind())
272  {
274  return var->number();
276  return std::numeric_limits<unsigned int>::max() - var->number();
277  default:
278  mooseError(_c_name, ": Unknown variable kind. Corrupted binary?");
279  }
280 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:207
unsigned int number() const
Get variable number coming from libMesh.
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:144
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:731
Moose::VarKindType kind() const
Kind of the variable (Nonlinear, Auxiliary, ...)
std::map< std::string, std::vector< unsigned int > > _optional_var_index
Unique indices for optionally coupled vars that weren&#39;t provided.
Definition: Coupleable.h:936
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180
MooseVariableFEBase * getFEVar(const std::string &var_name, unsigned int comp)
Extract pointer to a base finite element coupled variable.
Definition: Coupleable.C:199

◆ coupledCallback()

void Coupleable::coupledCallback ( const std::string &  var_name,
bool  is_old 
)
protectedvirtualinherited

Reimplemented in AuxKernelTempl< ComputeValueType >.

Definition at line 139 of file Coupleable.C.

Referenced by Coupleable::adCoupledGradientTemplate(), Coupleable::adCoupledNodalValueTemplate(), Coupleable::adCoupledSecondTemplate(), Coupleable::adCoupledValueTemplate(), Coupleable::adCoupledVectorGradientTemplate(), Coupleable::adCoupledVectorValueTemplate(), Coupleable::coupledCurl(), Coupleable::coupledCurlOld(), Coupleable::coupledCurlOlder(), Coupleable::coupledDofValues(), Coupleable::coupledDofValuesOld(), Coupleable::coupledDofValuesOlder(), Coupleable::coupledGradient(), Coupleable::coupledGradientDot(), Coupleable::coupledGradientDotDot(), Coupleable::coupledGradientOld(), Coupleable::coupledGradientOlder(), Coupleable::coupledGradientPreviousNL(), Coupleable::coupledMatrixTagValue(), Coupleable::coupledNodalDot(), Coupleable::coupledNodalDotDot(), Coupleable::coupledNodalDotDotOld(), Coupleable::coupledNodalDotOld(), Coupleable::coupledNodalValue(), Coupleable::coupledNodalValueOld(), Coupleable::coupledNodalValueOlder(), Coupleable::coupledNodalValuePreviousNL(), Coupleable::coupledSecond(), Coupleable::coupledSecondOld(), Coupleable::coupledSecondOlder(), Coupleable::coupledSecondPreviousNL(), Coupleable::coupledValue(), Coupleable::coupledValueOld(), Coupleable::coupledValueOlder(), Coupleable::coupledValuePreviousNL(), Coupleable::coupledVectorGradient(), Coupleable::coupledVectorGradientOld(), Coupleable::coupledVectorGradientOlder(), Coupleable::coupledVectorTagValue(), Coupleable::coupledVectorValue(), Coupleable::coupledVectorValueOld(), and Coupleable::coupledVectorValueOlder().

140 {
141 }

◆ coupledComponents()

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 166 of file Coupleable.C.

Referenced by KernelBase::KernelBase(), NodalEqualValueConstraint::NodalEqualValueConstraint(), SpatialAverageBase::SpatialAverageBase(), and VolumeHistogram::VolumeHistogram().

167 {
168  if (isCoupled(var_name))
169  return _coupled_vars[var_name].size();
170  else
171  {
173  return _c_parameters.numberDefaultCoupledValues(var_name);
174  else
175  return 0;
176  }
177 }
unsigned int numberDefaultCoupledValues(const std::string &coupling_name) const
Get the number of defaulted coupled value entries.
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:144
bool hasDefaultCoupledValue(const std::string &coupling_name) const
Return whether or not the requested parameter has a default coupled value.
std::map< std::string, std::vector< MooseVariableFEBase * > > _coupled_vars
Coupled vars whose values we provide.
Definition: Coupleable.h:737
const InputParameters & _c_parameters
Definition: Coupleable.h:728

◆ coupledCurl()

const VectorVariableCurl & Coupleable::coupledCurl ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtualinherited

Returns curl of a coupled variable.

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

Definition at line 1078 of file Coupleable.C.

1079 {
1080  if (!isCoupled(var_name)) // Return default 0
1081  return _default_vector_curl;
1082 
1083  coupledCallback(var_name, false);
1084  if (_c_nodal)
1085  mooseError("Nodal variables do not have curls");
1086 
1087  VectorMooseVariable * var = getVectorVar(var_name, comp);
1088  if (var == NULL)
1089  mooseError("Call corresponding scalar field variable method");
1090 
1091  if (!_coupleable_neighbor)
1092  return (_c_is_implicit) ? var->curlSln() : var->curlSlnOld();
1093  else
1094  return (_c_is_implicit) ? var->curlSlnNeighbor() : var->curlSlnOldNeighbor();
1095 }
const FieldVariableCurl & curlSlnNeighbor() const
neighbor solution curls
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:749
VectorVariableCurl _default_vector_curl
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:818
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:247
Class for stuff related to variables.
Definition: Adaptivity.h:29
const FieldVariableCurl & curlSlnOldNeighbor() const
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:207
const FieldVariableCurl & curlSlnOld() const
const FieldVariableCurl & curlSln() const
element curls
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:752
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:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
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:866

◆ coupledCurlOld()

const VectorVariableCurl & Coupleable::coupledCurlOld ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtualinherited

Returns an old curl 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 VectorVariableCurl containing the old curl of the coupled variable
See also
Kernel::_curl_u_old

Definition at line 1098 of file Coupleable.C.

1099 {
1100  if (!isCoupled(var_name)) // Return default 0
1101  return _default_vector_curl;
1102 
1103  coupledCallback(var_name, true);
1104  if (_c_nodal)
1105  mooseError("Nodal variables do not have curls");
1106 
1107  validateExecutionerType(var_name, "coupledCurlOld");
1108  VectorMooseVariable * var = getVectorVar(var_name, comp);
1109  if (var == NULL)
1110  mooseError("Call corresponding scalar field variable method");
1111 
1112  if (!_coupleable_neighbor)
1113  return (_c_is_implicit) ? var->curlSlnOld() : var->curlSlnOlder();
1114  else
1115  return (_c_is_implicit) ? var->curlSlnOldNeighbor() : var->curlSlnOlderNeighbor();
1116 }
void validateExecutionerType(const std::string &name, const std::string &fn_name) const
Checks to make sure that the current Executioner has set "_is_transient" when old/older values are co...
Definition: Coupleable.C:1467
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:749
VectorVariableCurl _default_vector_curl
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:818
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:247
Class for stuff related to variables.
Definition: Adaptivity.h:29
const FieldVariableCurl & curlSlnOldNeighbor() const
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:207
const FieldVariableCurl & curlSlnOld() const
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:752
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:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
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:866
const FieldVariableCurl & curlSlnOlder() const
const FieldVariableCurl & curlSlnOlderNeighbor() const

◆ coupledCurlOlder()

const VectorVariableCurl & Coupleable::coupledCurlOlder ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtualinherited

Returns an old curl 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 VectorVariableCurl containing the older curl of the coupled variable
See also
Kernel::_curl_u_older

Definition at line 1119 of file Coupleable.C.

1120 {
1121  if (!isCoupled(var_name)) // Return default 0
1122  return _default_vector_curl;
1123 
1124  coupledCallback(var_name, true);
1125  if (_c_nodal)
1126  mooseError("Nodal variables do not have curls");
1127 
1128  validateExecutionerType(var_name, "coupledCurlOlder");
1129  VectorMooseVariable * var = getVectorVar(var_name, comp);
1130  if (var == NULL)
1131  mooseError("Call corresponding scalar field variable method");
1132 
1133  if (_c_is_implicit)
1134  {
1135  if (!_coupleable_neighbor)
1136  return var->curlSlnOlder();
1137  else
1138  return var->curlSlnOlderNeighbor();
1139  }
1140  else
1141  mooseError("Older values not available for explicit schemes");
1142 }
void validateExecutionerType(const std::string &name, const std::string &fn_name) const
Checks to make sure that the current Executioner has set "_is_transient" when old/older values are co...
Definition: Coupleable.C:1467
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:749
VectorVariableCurl _default_vector_curl
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:818
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:247
Class for stuff related to variables.
Definition: Adaptivity.h:29
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:207
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:752
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:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
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:866
const FieldVariableCurl & curlSlnOlder() const
const FieldVariableCurl & curlSlnOlderNeighbor() const

◆ coupledDofValues()

const VariableValue & Coupleable::coupledDofValues ( 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 VariableValue for the DoFs of the coupled variable

Definition at line 1410 of file Coupleable.C.

1411 {
1412  checkVar(var_name);
1413 
1414  if (!isCoupled(var_name))
1415  return *getDefaultValue(var_name, comp);
1416 
1417  coupledCallback(var_name, false);
1418  MooseVariableFEBase * var = getFEVar(var_name, comp);
1419 
1420  if (!_coupleable_neighbor)
1421  return (_c_is_implicit) ? var->dofValues() : var->dofValuesOld();
1422  else
1423  return (_c_is_implicit) ? var->dofValuesNeighbor() : var->dofValuesOldNeighbor();
1424 }
VariableValue * getDefaultValue(const std::string &var_name, unsigned int comp)
Helper method to return (and insert if necessary) the default value for an uncoupled variable...
Definition: Coupleable.C:283
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:752
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:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
virtual const MooseArray< Number > & dofValues()=0
Returns dof solution on element.
virtual const MooseArray< Number > & dofValuesOld()=0
Returns old dof solution on element.
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:866
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180
virtual const MooseArray< Number > & dofValuesOldNeighbor()=0
Returns old dof solution on neighbor element.
MooseVariableFEBase * getFEVar(const std::string &var_name, unsigned int comp)
Extract pointer to a base finite element coupled variable.
Definition: Coupleable.C:199
virtual const MooseArray< Number > & dofValuesNeighbor()=0
Returns dof solution on neighbor element.

◆ coupledDofValuesOld()

const VariableValue & Coupleable::coupledDofValuesOld ( 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 VariableValue for the old DoFs of the coupled variable

Definition at line 1427 of file Coupleable.C.

1428 {
1429  checkVar(var_name);
1430 
1431  if (!isCoupled(var_name))
1432  return *getDefaultValue(var_name, comp);
1433 
1434  validateExecutionerType(var_name, "coupledDofValuesOld");
1435  coupledCallback(var_name, true);
1436  MooseVariableFEBase * var = getFEVar(var_name, comp);
1437 
1438  if (!_coupleable_neighbor)
1439  return (_c_is_implicit) ? var->dofValuesOld() : var->dofValuesOlder();
1440  else
1441  return (_c_is_implicit) ? var->dofValuesOldNeighbor() : var->dofValuesOlderNeighbor();
1442 }
void validateExecutionerType(const std::string &name, const std::string &fn_name) const
Checks to make sure that the current Executioner has set "_is_transient" when old/older values are co...
Definition: Coupleable.C:1467
VariableValue * getDefaultValue(const std::string &var_name, unsigned int comp)
Helper method to return (and insert if necessary) the default value for an uncoupled variable...
Definition: Coupleable.C:283
virtual const MooseArray< Number > & dofValuesOlderNeighbor()=0
Returns older dof solution on neighbor element.
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:752
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:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
virtual const MooseArray< Number > & dofValuesOld()=0
Returns old dof solution on element.
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:866
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180
virtual const MooseArray< Number > & dofValuesOldNeighbor()=0
Returns old dof solution on neighbor element.
virtual const MooseArray< Number > & dofValuesOlder()=0
Returns older dof solution on element.
MooseVariableFEBase * getFEVar(const std::string &var_name, unsigned int comp)
Extract pointer to a base finite element coupled variable.
Definition: Coupleable.C:199

◆ coupledDofValuesOlder()

const VariableValue & Coupleable::coupledDofValuesOlder ( 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 VariableValue for the older DoFs of the coupled variable

Definition at line 1445 of file Coupleable.C.

1446 {
1447  checkVar(var_name);
1448 
1449  if (!isCoupled(var_name))
1450  return *getDefaultValue(var_name, comp);
1451 
1452  validateExecutionerType(var_name, "coupledDofValuesOlder");
1453  coupledCallback(var_name, true);
1454  MooseVariableFEBase * var = getFEVar(var_name, comp);
1455  if (_c_is_implicit)
1456  {
1457  if (!_coupleable_neighbor)
1458  return var->dofValuesOlder();
1459  else
1460  return var->dofValuesOlderNeighbor();
1461  }
1462  else
1463  mooseError(_c_name, ": Older values not available for explicit schemes");
1464 }
void validateExecutionerType(const std::string &name, const std::string &fn_name) const
Checks to make sure that the current Executioner has set "_is_transient" when old/older values are co...
Definition: Coupleable.C:1467
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:207
VariableValue * getDefaultValue(const std::string &var_name, unsigned int comp)
Helper method to return (and insert if necessary) the default value for an uncoupled variable...
Definition: Coupleable.C:283
virtual const MooseArray< Number > & dofValuesOlderNeighbor()=0
Returns older dof solution on neighbor element.
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:752
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:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:731
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:866
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180
virtual const MooseArray< Number > & dofValuesOlder()=0
Returns older dof solution on element.
MooseVariableFEBase * getFEVar(const std::string &var_name, unsigned int comp)
Extract pointer to a base finite element coupled variable.
Definition: Coupleable.C:199

◆ coupledDot()

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

Reimplemented in AuxKernelTempl< ComputeValueType >.

Definition at line 624 of file Coupleable.C.

Referenced by AuxKernelTempl< ComputeValueType >::coupledDot().

625 {
626  checkVar(var_name);
627  if (!isCoupled(var_name)) // Return default 0
628  return _default_value_zero;
629 
630  validateExecutionerType(var_name, "coupledDot");
631  MooseVariable * var = getVar(var_name, comp);
632 
634  {
635  if (_c_nodal)
636  return var->dofValuesDot();
637  else
638  return var->uDot();
639  }
640  else
641  {
642  if (_c_nodal)
643  return var->dofValuesDotNeighbor();
644  else
645  return var->uDotNeighbor();
646  }
647 }
void validateExecutionerType(const std::string &name, const std::string &fn_name) const
Checks to make sure that the current Executioner has set "_is_transient" when old/older values are co...
Definition: Coupleable.C:1467
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:749
const MooseArray< Number > & dofValuesDot() override
Returns time derivative of degrees of freedom.
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:773
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:241
const FieldVariableValue & uDot() const
element dots
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:144
const MooseArray< Number > & dofValuesDotNeighbor() override
Returns time derivative of neighboring degrees of freedom.
const FieldVariableValue & uDotNeighbor() const
neighbor dots
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:866
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ coupledDotDot()

const VariableValue & Coupleable::coupledDotDot ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtualinherited

Second 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

Definition at line 650 of file Coupleable.C.

651 {
652  checkVar(var_name);
653  if (!isCoupled(var_name)) // Return default 0
654  return _default_value_zero;
655 
656  validateExecutionerType(var_name, "coupledDotDot");
657  MooseVariable * var = getVar(var_name, comp);
658 
660  {
661  if (_c_nodal)
662  return var->dofValuesDotDot();
663  else
664  return var->uDotDot();
665  }
666  else
667  {
668  if (_c_nodal)
669  return var->dofValuesDotDotNeighbor();
670  else
671  return var->uDotDotNeighbor();
672  }
673 }
void validateExecutionerType(const std::string &name, const std::string &fn_name) const
Checks to make sure that the current Executioner has set "_is_transient" when old/older values are co...
Definition: Coupleable.C:1467
const FieldVariableValue & uDotDotNeighbor() const
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:749
const MooseArray< Number > & dofValuesDotDot() override
Returns second time derivative of degrees of freedom.
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:773
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:241
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:144
const MooseArray< Number > & dofValuesDotDotNeighbor() override
Returns second time derivative of neighboring degrees of freedom.
const FieldVariableValue & uDotDot() const
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:866
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ coupledDotDotDu()

const VariableValue & Coupleable::coupledDotDotDu ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtualinherited

Second 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

Definition at line 866 of file Coupleable.C.

867 {
868  checkVar(var_name);
869  if (!isCoupled(var_name)) // Return default 0
870  return _default_value_zero;
871 
872  validateExecutionerType(var_name, "coupledDotDotDu");
873  MooseVariable * var = getVar(var_name, comp);
874 
876  {
877  if (_c_nodal)
878  return var->dofValuesDuDotDotDu();
879  else
880  return var->duDotDotDu();
881  }
882  else
883  {
884  if (_c_nodal)
885  return var->dofValuesDuDotDotDuNeighbor();
886  else
887  return var->duDotDotDu();
888  }
889 }
void validateExecutionerType(const std::string &name, const std::string &fn_name) const
Checks to make sure that the current Executioner has set "_is_transient" when old/older values are co...
Definition: Coupleable.C:1467
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:749
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:773
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:241
const VariableValue & duDotDotDu() const
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:144
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:866
const MooseArray< Number > & dofValuesDuDotDotDu() override
Returns derivative of second time derivative of degrees of freedom.
const MooseArray< Number > & dofValuesDuDotDotDuNeighbor() override
Returns derivative of second time derivative of neighboring degrees of freedom.
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ coupledDotDotOld()

const VariableValue & Coupleable::coupledDotDotOld ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtualinherited

Old second 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

Definition at line 702 of file Coupleable.C.

703 {
704  checkVar(var_name);
705  if (!isCoupled(var_name)) // Return default 0
706  return _default_value_zero;
707 
708  validateExecutionerType(var_name, "coupledDotDotOld");
709  MooseVariable * var = getVar(var_name, comp);
710 
712  {
713  if (_c_nodal)
714  return var->dofValuesDotDotOld();
715  else
716  return var->uDotDotOld();
717  }
718  else
719  {
720  if (_c_nodal)
721  return var->dofValuesDotDotOldNeighbor();
722  else
723  return var->uDotDotOldNeighbor();
724  }
725 }
const MooseArray< Number > & dofValuesDotDotOldNeighbor() override
Returns old second time derivative of neighboring degrees of freedom.
void validateExecutionerType(const std::string &name, const std::string &fn_name) const
Checks to make sure that the current Executioner has set "_is_transient" when old/older values are co...
Definition: Coupleable.C:1467
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:749
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:773
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:241
const MooseArray< Number > & dofValuesDotDotOld() override
Returns old second time derivative of degrees of freedom.
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:144
const FieldVariableValue & uDotDotOldNeighbor() const
const FieldVariableValue & uDotDotOld() const
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:866
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ coupledDotDu()

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

Reimplemented in AuxKernelTempl< ComputeValueType >.

Definition at line 840 of file Coupleable.C.

Referenced by AuxKernelTempl< ComputeValueType >::coupledDotDu().

841 {
842  checkVar(var_name);
843  if (!isCoupled(var_name)) // Return default 0
844  return _default_value_zero;
845 
846  validateExecutionerType(var_name, "coupledDotDu");
847  MooseVariable * var = getVar(var_name, comp);
848 
850  {
851  if (_c_nodal)
852  return var->dofValuesDuDotDu();
853  else
854  return var->duDotDu();
855  }
856  else
857  {
858  if (_c_nodal)
859  return var->dofValuesDuDotDuNeighbor();
860  else
861  return var->duDotDuNeighbor();
862  }
863 }
void validateExecutionerType(const std::string &name, const std::string &fn_name) const
Checks to make sure that the current Executioner has set "_is_transient" when old/older values are co...
Definition: Coupleable.C:1467
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:749
const VariableValue & duDotDuNeighbor() const
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:773
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:241
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:144
const MooseArray< Number > & dofValuesDuDotDu() override
Returns derivative of time derivative of degrees of freedom.
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:866
const MooseArray< Number > & dofValuesDuDotDuNeighbor() override
Returns derivative of time derivative of neighboring degrees of freedom.
const VariableValue & duDotDu() const
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ coupledDotOld()

const VariableValue & Coupleable::coupledDotOld ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtualinherited

Old 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

Definition at line 676 of file Coupleable.C.

677 {
678  checkVar(var_name);
679  if (!isCoupled(var_name)) // Return default 0
680  return _default_value_zero;
681 
682  validateExecutionerType(var_name, "coupledDotOld");
683  MooseVariable * var = getVar(var_name, comp);
684 
686  {
687  if (_c_nodal)
688  return var->dofValuesDotOld();
689  else
690  return var->uDotOld();
691  }
692  else
693  {
694  if (_c_nodal)
695  return var->dofValuesDotOldNeighbor();
696  else
697  return var->uDotOldNeighbor();
698  }
699 }
void validateExecutionerType(const std::string &name, const std::string &fn_name) const
Checks to make sure that the current Executioner has set "_is_transient" when old/older values are co...
Definition: Coupleable.C:1467
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:749
const MooseArray< Number > & dofValuesDotOld() override
Returns old time derivative of degrees of freedom.
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:773
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:241
const FieldVariableValue & uDotOld() const
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:144
const MooseArray< Number > & dofValuesDotOldNeighbor() override
Returns old time derivative of neighboring degrees of freedom.
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:866
const FieldVariableValue & uDotOldNeighbor() const
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ coupledGradient()

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 892 of file Coupleable.C.

Referenced by NodeElemConstraint::coupledSlaveGradient(), and NodeFaceConstraint::coupledSlaveGradient().

893 {
894  checkVar(var_name);
895  if (!isCoupled(var_name)) // Return default 0
896  return _default_gradient;
897 
898  coupledCallback(var_name, false);
899  if (_c_nodal)
900  mooseError(_c_name, ": Nodal variables do not have gradients");
901 
902  MooseVariable * var = getVar(var_name, comp);
903 
905  return (_c_is_implicit) ? var->gradSln() : var->gradSlnOld();
906  else
907  return (_c_is_implicit) ? var->gradSlnNeighbor() : var->gradSlnOldNeighbor();
908 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:749
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:207
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:241
const FieldVariableGradient & gradSlnOldNeighbor() const
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:752
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:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
VariableGradient _default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:776
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:731
const FieldVariableGradient & gradSlnOld() const
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:866
const FieldVariableGradient & gradSlnNeighbor() const
neighbor solution gradients
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180
const FieldVariableGradient & gradSln() const
element gradients

◆ coupledGradientDot()

const VariableGradient & Coupleable::coupledGradientDot ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtualinherited

Time derivative of the 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 time derivative of the gradient of a coupled variable

Definition at line 976 of file Coupleable.C.

977 {
978  checkVar(var_name);
979  if (!isCoupled(var_name)) // Return default 0
980  return _default_gradient;
981 
982  coupledCallback(var_name, false);
983  if (_c_nodal)
984  mooseError(_c_name, ": Nodal variables do not have gradients");
985 
986  MooseVariable * var = getVar(var_name, comp);
987 
989  return var->gradSlnDot();
990  else
991  return var->gradSlnNeighborDot();
992 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:749
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:207
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:241
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:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
VariableGradient _default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:776
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:731
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:866
const FieldVariableGradient & gradSlnNeighborDot() const
neighbor grad dots
const FieldVariableGradient & gradSlnDot() const
element gradient dots
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ coupledGradientDotDot()

const VariableGradient & Coupleable::coupledGradientDotDot ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtualinherited

Second time derivative of the 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 time derivative of the gradient of a coupled variable

Definition at line 995 of file Coupleable.C.

996 {
997  checkVar(var_name);
998  if (!isCoupled(var_name)) // Return default 0
999  return _default_gradient;
1000 
1001  coupledCallback(var_name, false);
1002  if (_c_nodal)
1003  mooseError(_c_name, ": Nodal variables do not have gradients");
1004 
1005  MooseVariable * var = getVar(var_name, comp);
1006 
1007  if (!_coupleable_neighbor)
1008  return var->gradSlnDotDot();
1009  else
1010  return var->gradSlnNeighborDotDot();
1011 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:749
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:207
const FieldVariableGradient & gradSlnNeighborDotDot() const
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:241
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:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
VariableGradient _default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:776
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:731
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:866
const FieldVariableGradient & gradSlnDotDot() const
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ coupledGradientOld()

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 911 of file Coupleable.C.

Referenced by NodeElemConstraint::coupledSlaveGradientOld(), and NodeFaceConstraint::coupledSlaveGradientOld().

912 {
913  checkVar(var_name);
914  if (!isCoupled(var_name)) // Return default 0
915  return _default_gradient;
916 
917  coupledCallback(var_name, true);
918  if (_c_nodal)
919  mooseError(_c_name, ": Nodal compute objects do not support gradients");
920 
921  validateExecutionerType(var_name, "coupledGradientOld");
922  MooseVariable * var = getVar(var_name, comp);
923 
925  return (_c_is_implicit) ? var->gradSlnOld() : var->gradSlnOlder();
926  else
927  return (_c_is_implicit) ? var->gradSlnOldNeighbor() : var->gradSlnOlderNeighbor();
928 }
void validateExecutionerType(const std::string &name, const std::string &fn_name) const
Checks to make sure that the current Executioner has set "_is_transient" when old/older values are co...
Definition: Coupleable.C:1467
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:749
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:207
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:241
const FieldVariableGradient & gradSlnOlderNeighbor() const
const FieldVariableGradient & gradSlnOldNeighbor() const
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:752
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:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
VariableGradient _default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:776
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:731
const FieldVariableGradient & gradSlnOld() const
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:866
const FieldVariableGradient & gradSlnOlder() const
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ coupledGradientOlder()

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 931 of file Coupleable.C.

Referenced by NodeElemConstraint::coupledSlaveGradientOlder(), and NodeFaceConstraint::coupledSlaveGradientOlder().

932 {
933  checkVar(var_name);
934  if (!isCoupled(var_name)) // Return default 0
935  return _default_gradient;
936 
937  coupledCallback(var_name, true);
938  if (_c_nodal)
939  mooseError(_c_name, ": Nodal compute objects do not support gradients");
940 
941  validateExecutionerType(var_name, "coupledGradientOlder");
942  MooseVariable * var = getVar(var_name, comp);
943 
944  if (_c_is_implicit)
945  {
947  return var->gradSlnOlder();
948  else
949  return var->gradSlnOlderNeighbor();
950  }
951  else
952  mooseError(_c_name, ": Older values not available for explicit schemes");
953 }
void validateExecutionerType(const std::string &name, const std::string &fn_name) const
Checks to make sure that the current Executioner has set "_is_transient" when old/older values are co...
Definition: Coupleable.C:1467
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:749
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:207
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:241
const FieldVariableGradient & gradSlnOlderNeighbor() const
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:752
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:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
VariableGradient _default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:776
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:731
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:866
const FieldVariableGradient & gradSlnOlder() const
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ coupledGradientPreviousNL()

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 956 of file Coupleable.C.

957 {
958  checkVar(var_name);
959  if (!isCoupled(var_name)) // Return default 0
960  return _default_gradient;
961 
963  coupledCallback(var_name, true);
964  if (_c_nodal)
965  mooseError(_c_name, ": Nodal compute objects do not support gradients");
966 
967  MooseVariable * var = getVar(var_name, comp);
968 
970  return var->gradSlnPreviousNL();
971  else
972  return var->gradSlnPreviousNLNeighbor();
973 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:749
const FieldVariableGradient & gradSlnPreviousNL() const
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:207
const FieldVariableGradient & gradSlnPreviousNLNeighbor() const
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:241
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:734
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:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
VariableGradient _default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:776
void needsPreviousNewtonIteration(bool state)
Set a flag that indicated that user required values for the previous Newton iterate.
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:731
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:866
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ coupledMatrixTagValue()

const VariableValue & Coupleable::coupledMatrixTagValue ( const std::string &  var_name,
TagID  tag,
unsigned int  comp = 0 
)
protectedvirtualinherited

Returns value of a coupled variable for a given tag.

This couples the diag vector of matrix

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

Definition at line 406 of file Coupleable.C.

407 {
408  checkVar(var_name);
409  if (!isCoupled(var_name))
410  mooseError(var_name, ": invalid variable name for coupledMatrixTagValue");
411 
413 
414  coupledCallback(var_name, false);
415  MooseVariable * var = getVar(var_name, comp);
416 
417  if (_c_nodal)
418  return var->nodalMatrixTagValue(tag);
419  else
420  return var->matrixTagValue(tag);
421 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:749
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:207
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:241
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:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
const FieldVariableValue & matrixTagValue(TagID tag)
void addFEVariableCoupleableMatrixTag(TagID tag)
Definition: Coupleable.h:115
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180
const MooseArray< Real > & nodalMatrixTagValue(TagID tag)

◆ coupledNodalDot()

template<typename T >
template const RealVectorValue & Coupleable::coupledNodalDot< RealVectorValue > ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedinherited

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 1333 of file Coupleable.C.

1334 {
1335  checkVar(var_name);
1336  static const T zero = 0;
1337  if (!isCoupled(var_name)) // Return default 0
1338  return zero;
1339 
1340  validateExecutionerType(var_name, "coupledNodalDot");
1341  coupledCallback(var_name, false);
1342  MooseVariableFE<T> * var = getVarHelper<T>(var_name, comp);
1343  if (var == NULL)
1344  mooseError("Call corresponding vector variable method");
1345 
1346  if (!_coupleable_neighbor)
1347  return var->nodalValueDot();
1348  else
1349  mooseError("Neighbor version not implemented");
1350 }
void validateExecutionerType(const std::string &name, const std::string &fn_name) const
Checks to make sure that the current Executioner has set "_is_transient" when old/older values are co...
Definition: Coupleable.C:1467
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:207
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:144
const OutputType & nodalValueDot()
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
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:866
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ coupledNodalDotDot()

const VariableValue & Coupleable::coupledNodalDotDot ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtualinherited

Nodal values of second 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 second time derivative of the coupled variable

Definition at line 1353 of file Coupleable.C.

1354 {
1355  checkVar(var_name);
1356  if (!isCoupled(var_name)) // Return default 0
1357  return _default_value_zero;
1358 
1359  validateExecutionerType(var_name, "coupledNodalDotDot");
1360  coupledCallback(var_name, false);
1361  MooseVariable * var = getVar(var_name, comp);
1362  if (var == NULL)
1363  mooseError("Call corresponding vector variable method");
1364 
1365  if (!_coupleable_neighbor)
1366  return var->dofValuesDotDot();
1367  else
1368  return var->dofValuesDotDotNeighbor();
1369 }
void validateExecutionerType(const std::string &name, const std::string &fn_name) const
Checks to make sure that the current Executioner has set "_is_transient" when old/older values are co...
Definition: Coupleable.C:1467
const MooseArray< Number > & dofValuesDotDot() override
Returns second time derivative of degrees of freedom.
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:207
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:773
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:241
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:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
const MooseArray< Number > & dofValuesDotDotNeighbor() override
Returns second time derivative of neighboring degrees of freedom.
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:866
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ coupledNodalDotDotOld()

const VariableValue & Coupleable::coupledNodalDotDotOld ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtualinherited

Nodal values of old second 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 second time derivative of the coupled variable

Definition at line 1391 of file Coupleable.C.

1392 {
1393  checkVar(var_name);
1394  if (!isCoupled(var_name)) // Return default 0
1395  return _default_value_zero;
1396 
1397  validateExecutionerType(var_name, "coupledNodalDotDotOld");
1398  coupledCallback(var_name, false);
1399  MooseVariable * var = getVar(var_name, comp);
1400  if (var == NULL)
1401  mooseError("Call corresponding vector variable method");
1402 
1403  if (!_coupleable_neighbor)
1404  return var->dofValuesDotDotOld();
1405  else
1406  return var->dofValuesDotDotOldNeighbor();
1407 }
const MooseArray< Number > & dofValuesDotDotOldNeighbor() override
Returns old second time derivative of neighboring degrees of freedom.
void validateExecutionerType(const std::string &name, const std::string &fn_name) const
Checks to make sure that the current Executioner has set "_is_transient" when old/older values are co...
Definition: Coupleable.C:1467
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:207
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:773
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:241
const MooseArray< Number > & dofValuesDotDotOld() override
Returns old second time derivative of degrees of freedom.
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:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
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:866
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ coupledNodalDotOld()

const VariableValue & Coupleable::coupledNodalDotOld ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtualinherited

Nodal values of old 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 1372 of file Coupleable.C.

1373 {
1374  checkVar(var_name);
1375  if (!isCoupled(var_name)) // Return default 0
1376  return _default_value_zero;
1377 
1378  validateExecutionerType(var_name, "coupledNodalDotOld");
1379  coupledCallback(var_name, false);
1380  MooseVariable * var = getVar(var_name, comp);
1381  if (var == NULL)
1382  mooseError("Call corresponding vector variable method");
1383 
1384  if (!_coupleable_neighbor)
1385  return var->dofValuesDotOld();
1386  else
1387  return var->dofValuesDotOldNeighbor();
1388 }
void validateExecutionerType(const std::string &name, const std::string &fn_name) const
Checks to make sure that the current Executioner has set "_is_transient" when old/older values are co...
Definition: Coupleable.C:1467
const MooseArray< Number > & dofValuesDotOld() override
Returns old time derivative of degrees of freedom.
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:207
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:773
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:241
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:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
const MooseArray< Number > & dofValuesDotOldNeighbor() override
Returns old time derivative of neighboring degrees of freedom.
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:866
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ coupledNodalValue()

template<typename T >
template const RealVectorValue & Coupleable::coupledNodalValue< RealVectorValue > ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedinherited

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 1235 of file Coupleable.C.

1236 {
1237  checkVar(var_name);
1238  if (!isCoupled(var_name))
1239  return getNodalDefaultValue<T>(var_name, comp);
1240 
1241  coupledCallback(var_name, false);
1242  MooseVariableFE<T> * var = getVarHelper<T>(var_name, comp);
1243  if (var == NULL)
1244  mooseError("Call corresponding vector variable method");
1245  if (!var->isNodal())
1247  ": Trying to get nodal values of variable '",
1248  var->name(),
1249  "', but it is not nodal.");
1250 
1251  if (!_coupleable_neighbor)
1252  return (_c_is_implicit) ? var->nodalValue() : var->nodalValueOld();
1253  else
1254  return (_c_is_implicit) ? var->nodalValueNeighbor() : var->nodalValueOldNeighbor();
1255 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:207
const OutputType & nodalValueOld()
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:752
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:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
const OutputType & nodalValueNeighbor()
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:731
const OutputType & nodalValue()
Methods for retrieving values of variables at the nodes.
const OutputType & nodalValueOldNeighbor()
bool isNodal() const override
Is this variable nodal.
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:866
const std::string & name() const
Get the variable name.
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ coupledNodalValueOld()

template<typename T >
template const RealVectorValue & Coupleable::coupledNodalValueOld< RealVectorValue > ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedinherited

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 1259 of file Coupleable.C.

1260 {
1261  checkVar(var_name);
1262  if (!isCoupled(var_name))
1263  return getNodalDefaultValue<T>(var_name, comp);
1264 
1265  validateExecutionerType(var_name, "coupledNodalValueOld");
1266  coupledCallback(var_name, true);
1267  MooseVariableFE<T> * var = getVarHelper<T>(var_name, comp);
1268  if (var == NULL)
1269  mooseError("Call corresponding vector variable method");
1270  if (!var->isNodal())
1272  ": Trying to get old nodal values of variable '",
1273  var->name(),
1274  "', but it is not nodal.");
1275 
1276  if (!_coupleable_neighbor)
1277  return (_c_is_implicit) ? var->nodalValueOld() : var->nodalValueOlder();
1278  else
1280 }
void validateExecutionerType(const std::string &name, const std::string &fn_name) const
Checks to make sure that the current Executioner has set "_is_transient" when old/older values are co...
Definition: Coupleable.C:1467
const OutputType & nodalValueOlderNeighbor()
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:207
const OutputType & nodalValueOld()
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:752
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:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:731
const OutputType & nodalValueOldNeighbor()
bool isNodal() const override
Is this variable nodal.
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:866
const std::string & name() const
Get the variable name.
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180
const OutputType & nodalValueOlder()

◆ coupledNodalValueOlder()

template<typename T >
template const RealVectorValue & Coupleable::coupledNodalValueOlder< RealVectorValue > ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedinherited

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 1284 of file Coupleable.C.

1285 {
1286  checkVar(var_name);
1287  if (!isCoupled(var_name))
1288  return getNodalDefaultValue<T>(var_name, comp);
1289 
1290  validateExecutionerType(var_name, "coupledNodalValueOlder");
1291  coupledCallback(var_name, true);
1292  MooseVariableFE<T> * var = getVarHelper<T>(var_name, comp);
1293  if (var == NULL)
1294  mooseError("Call corresponding vector variable method");
1295  if (!var->isNodal())
1297  ": Trying to get older nodal values of variable '",
1298  var->name(),
1299  "', but it is not nodal.");
1300  if (_c_is_implicit)
1301  {
1302  if (!_coupleable_neighbor)
1303  return var->nodalValueOlder();
1304  else
1305  return var->nodalValueOlderNeighbor();
1306  }
1307  else
1308  mooseError(_c_name, ": Older values not available for explicit schemes");
1309 }
void validateExecutionerType(const std::string &name, const std::string &fn_name) const
Checks to make sure that the current Executioner has set "_is_transient" when old/older values are co...
Definition: Coupleable.C:1467
const OutputType & nodalValueOlderNeighbor()
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:207
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:752
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:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:731
bool isNodal() const override
Is this variable nodal.
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:866
const std::string & name() const
Get the variable name.
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180
const OutputType & nodalValueOlder()

◆ coupledNodalValuePreviousNL()

template<typename T >
template const RealVectorValue & Coupleable::coupledNodalValuePreviousNL< RealVectorValue > ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedinherited

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 1313 of file Coupleable.C.

1314 {
1315  checkVar(var_name);
1316  if (!isCoupled(var_name))
1317  return getNodalDefaultValue<T>(var_name, comp);
1318 
1320  coupledCallback(var_name, true);
1321  MooseVariableFE<T> * var = getVarHelper<T>(var_name, comp);
1322  if (var == NULL)
1323  mooseError("Call corresponding vector variable method");
1324 
1325  if (!_coupleable_neighbor)
1326  return var->nodalValuePreviousNL();
1327  else
1328  return var->nodalValuePreviousNLNeighbor();
1329 }
const OutputType & nodalValuePreviousNL()
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:207
const OutputType & nodalValuePreviousNLNeighbor()
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:734
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:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
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:866
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ coupledSecond()

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 1145 of file Coupleable.C.

Referenced by NodeElemConstraint::coupledSlaveSecond(), and NodeFaceConstraint::coupledSlaveSecond().

1146 {
1147  checkVar(var_name);
1148  if (!isCoupled(var_name)) // Return default 0
1149  return _default_second;
1150 
1151  coupledCallback(var_name, false);
1152  if (_c_nodal)
1153  mooseError(_c_name, ": Nodal variables do not have second derivatives");
1154 
1155  MooseVariable * var = getVar(var_name, comp);
1156  if (var == NULL)
1157  mooseError("Call corresponding vector variable method");
1158 
1159  if (!_coupleable_neighbor)
1160  return (_c_is_implicit) ? var->secondSln() : var->secondSlnOlder();
1161  else
1162  return (_c_is_implicit) ? var->secondSlnNeighbor() : var->secondSlnOlderNeighbor();
1163 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:749
const FieldVariableSecond & secondSlnOlderNeighbor() const
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:207
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:241
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:752
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:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
const FieldVariableSecond & secondSlnNeighbor() const
neighbor solution seconds
VariableSecond _default_second
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:785
const FieldVariableSecond & secondSlnOlder() const
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:731
const FieldVariableSecond & secondSln() const
element seconds
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:866
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ coupledSecondOld()

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 1166 of file Coupleable.C.

1167 {
1168  checkVar(var_name);
1169  if (!isCoupled(var_name)) // Return default 0
1170  return _default_second;
1171 
1172  coupledCallback(var_name, true);
1173  if (_c_nodal)
1174  mooseError(_c_name, ": Nodal variables do not have second derivatives");
1175 
1176  validateExecutionerType(var_name, "coupledSecondOld");
1177  MooseVariable * var = getVar(var_name, comp);
1178  if (var == NULL)
1179  mooseError("Call corresponding vector variable method");
1180  if (!_coupleable_neighbor)
1181  return (_c_is_implicit) ? var->secondSlnOld() : var->secondSlnOlder();
1182  else
1183  return (_c_is_implicit) ? var->secondSlnOldNeighbor() : var->secondSlnOlderNeighbor();
1184 }
void validateExecutionerType(const std::string &name, const std::string &fn_name) const
Checks to make sure that the current Executioner has set "_is_transient" when old/older values are co...
Definition: Coupleable.C:1467
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:749
const FieldVariableSecond & secondSlnOlderNeighbor() const
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:207
const FieldVariableSecond & secondSlnOld() const
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:241
const FieldVariableSecond & secondSlnOldNeighbor() const
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:752
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:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
VariableSecond _default_second
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:785
const FieldVariableSecond & secondSlnOlder() const
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:731
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:866
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ coupledSecondOlder()

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 1187 of file Coupleable.C.

1188 {
1189  checkVar(var_name);
1190  if (!isCoupled(var_name)) // Return default 0
1191  return _default_second;
1192 
1193  coupledCallback(var_name, true);
1194  if (_c_nodal)
1195  mooseError(_c_name, ": Nodal variables do not have second derivatives");
1196 
1197  validateExecutionerType(var_name, "coupledSecondOlder");
1198  MooseVariable * var = getVar(var_name, comp);
1199  if (var == NULL)
1200  mooseError("Call corresponding vector variable method");
1201  if (_c_is_implicit)
1202  {
1203  if (!_coupleable_neighbor)
1204  return var->secondSlnOlder();
1205  else
1206  return var->secondSlnOlderNeighbor();
1207  }
1208  else
1209  mooseError(_c_name, ": Older values not available for explicit schemes");
1210 }
void validateExecutionerType(const std::string &name, const std::string &fn_name) const
Checks to make sure that the current Executioner has set "_is_transient" when old/older values are co...
Definition: Coupleable.C:1467
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:749
const FieldVariableSecond & secondSlnOlderNeighbor() const
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:207
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:241
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:752
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:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
VariableSecond _default_second
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:785
const FieldVariableSecond & secondSlnOlder() const
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:731
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:866
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ coupledSecondPreviousNL()

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 1213 of file Coupleable.C.

1214 {
1215  checkVar(var_name);
1216  if (!isCoupled(var_name)) // Return default 0
1217  return _default_second;
1218 
1220  coupledCallback(var_name, true);
1221  if (_c_nodal)
1222  mooseError(_c_name, ": Nodal variables do not have second derivatives");
1223 
1224  MooseVariable * var = getVar(var_name, comp);
1225  if (var == NULL)
1226  mooseError("Call corresponding vector variable method");
1227  if (!_coupleable_neighbor)
1228  return var->secondSlnPreviousNL();
1229  else
1230  return var->secondSlnPreviousNLNeighbor();
1231 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:749
const FieldVariableSecond & secondSlnPreviousNLNeighbor() const
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:207
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:241
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:734
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:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
const FieldVariableSecond & secondSlnPreviousNL() const
VariableSecond _default_second
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:785
void needsPreviousNewtonIteration(bool state)
Set a flag that indicated that user required values for the previous Newton iterate.
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:731
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:866
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ coupledValue()

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::_u

Definition at line 361 of file Coupleable.C.

Referenced by NodeElemConstraint::coupledSlaveValue(), NodeFaceConstraint::coupledSlaveValue(), FunctionMaterialBase::FunctionMaterialBase(), NodalEqualValueConstraint::NodalEqualValueConstraint(), ParsedAux::ParsedAux(), SpatialAverageBase::SpatialAverageBase(), VariableTimeIntegrationAux::VariableTimeIntegrationAux(), and Coupleable::writableCoupledValue().

362 {
363  checkVar(var_name);
364  if (!isCoupled(var_name))
365  return *getDefaultValue(var_name, comp);
366 
367  coupledCallback(var_name, false);
368  MooseVariable * var = getVar(var_name, comp);
369  // var should be a valid pointer at this point, otherwise an error has been thrown in getVar
370 
372  {
373  if (_c_nodal)
374  return (_c_is_implicit) ? var->dofValues() : var->dofValuesOld();
375  else
376  return (_c_is_implicit) ? var->sln() : var->slnOld();
377  }
378  else
379  {
380  if (_c_nodal)
381  return (_c_is_implicit) ? var->dofValuesNeighbor() : var->dofValuesOldNeighbor();
382  else
383  return (_c_is_implicit) ? var->slnNeighbor() : var->slnOldNeighbor();
384  }
385 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:749
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:241
const FieldVariableValue & sln() const
element solutions
VariableValue * getDefaultValue(const std::string &var_name, unsigned int comp)
Helper method to return (and insert if necessary) the default value for an uncoupled variable...
Definition: Coupleable.C:283
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:752
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:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
const FieldVariableValue & slnOld() const
const MooseArray< Number > & dofValuesOld() override
Returns old dof solution on element.
const FieldVariableValue & slnNeighbor() const
neighbor solutions
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:866
const MooseArray< Number > & dofValuesNeighbor() override
Returns dof solution on neighbor element.
const FieldVariableValue & slnOldNeighbor() const
const MooseArray< Number > & dofValuesOldNeighbor() override
Returns old dof solution on neighbor element.
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180
const MooseArray< Number > & dofValues() override
Returns dof solution on element.

◆ coupledValueOld()

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 457 of file Coupleable.C.

Referenced by NodeElemConstraint::coupledSlaveValueOld(), NodeFaceConstraint::coupledSlaveValueOld(), and VariableTimeIntegrationAux::VariableTimeIntegrationAux().

458 {
459  checkVar(var_name);
460  if (!isCoupled(var_name))
461  return *getDefaultValue(var_name, comp);
462 
463  validateExecutionerType(var_name, "coupledValueOld");
464  coupledCallback(var_name, true);
465  MooseVariable * var = getVar(var_name, comp);
466 
468  {
469  if (_c_nodal)
470  return (_c_is_implicit) ? var->dofValuesOld() : var->dofValuesOlder();
471  else
472  return (_c_is_implicit) ? var->slnOld() : var->slnOlder();
473  }
474  else
475  {
476  if (_c_nodal)
478  else
479  return (_c_is_implicit) ? var->slnOldNeighbor() : var->slnOlderNeighbor();
480  }
481 }
void validateExecutionerType(const std::string &name, const std::string &fn_name) const
Checks to make sure that the current Executioner has set "_is_transient" when old/older values are co...
Definition: Coupleable.C:1467
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:749
const MooseArray< Number > & dofValuesOlder() override
Returns older dof solution on element.
const FieldVariableValue & slnOlderNeighbor() const
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:241
VariableValue * getDefaultValue(const std::string &var_name, unsigned int comp)
Helper method to return (and insert if necessary) the default value for an uncoupled variable...
Definition: Coupleable.C:283
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:752
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:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
const FieldVariableValue & slnOld() const
const MooseArray< Number > & dofValuesOld() override
Returns old dof solution on element.
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:866
const FieldVariableValue & slnOldNeighbor() const
const FieldVariableValue & slnOlder() const
const MooseArray< Number > & dofValuesOlderNeighbor() override
Returns older dof solution on neighbor element.
const MooseArray< Number > & dofValuesOldNeighbor() override
Returns old dof solution on neighbor element.
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ coupledValueOlder()

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 484 of file Coupleable.C.

Referenced by NodeElemConstraint::coupledSlaveValueOlder(), NodeFaceConstraint::coupledSlaveValueOlder(), and VariableTimeIntegrationAux::VariableTimeIntegrationAux().

485 {
486  checkVar(var_name);
487  if (!isCoupled(var_name))
488  return *getDefaultValue(var_name, comp);
489 
490  validateExecutionerType(var_name, "coupledValueOlder");
491  coupledCallback(var_name, true);
492  MooseVariable * var = getVar(var_name, comp);
493 
495  {
496  if (_c_nodal)
497  {
498  if (_c_is_implicit)
499  return var->dofValuesOlder();
500  else
501  mooseError(_c_name, ": Older values not available for explicit schemes");
502  }
503  else
504  {
505  if (_c_is_implicit)
506  return var->slnOlder();
507  else
508  mooseError(_c_name, ": Older values not available for explicit schemes");
509  }
510  }
511  else
512  {
513  if (_c_nodal)
514  {
515  if (_c_is_implicit)
516  return var->dofValuesOlderNeighbor();
517  else
518  mooseError(_c_name, ": Older values not available for explicit schemes");
519  }
520  else
521  {
522  if (_c_is_implicit)
523  return var->slnOlderNeighbor();
524  else
525  mooseError(_c_name, ": Older values not available for explicit schemes");
526  }
527  }
528 }
void validateExecutionerType(const std::string &name, const std::string &fn_name) const
Checks to make sure that the current Executioner has set "_is_transient" when old/older values are co...
Definition: Coupleable.C:1467
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:749
const MooseArray< Number > & dofValuesOlder() override
Returns older dof solution on element.
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:207
const FieldVariableValue & slnOlderNeighbor() const
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:241
VariableValue * getDefaultValue(const std::string &var_name, unsigned int comp)
Helper method to return (and insert if necessary) the default value for an uncoupled variable...
Definition: Coupleable.C:283
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:752
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:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:731
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:866
const FieldVariableValue & slnOlder() const
const MooseArray< Number > & dofValuesOlderNeighbor() override
Returns older dof solution on neighbor element.
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ coupledValuePreviousNL()

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 531 of file Coupleable.C.

532 {
533  checkVar(var_name);
534  if (!isCoupled(var_name))
535  return *getDefaultValue(var_name, comp);
536 
538  coupledCallback(var_name, true);
539  MooseVariable * var = getVar(var_name, comp);
540 
542  {
543  if (_c_nodal)
544  return var->dofValuesPreviousNL();
545  else
546  return var->slnPreviousNL();
547  }
548  else
549  {
550  if (_c_nodal)
551  return var->dofValuesPreviousNLNeighbor();
552  else
553  return var->slnPreviousNLNeighbor();
554  }
555 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:749
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:241
VariableValue * getDefaultValue(const std::string &var_name, unsigned int comp)
Helper method to return (and insert if necessary) the default value for an uncoupled variable...
Definition: Coupleable.C:283
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:734
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:144
const MooseArray< Number > & dofValuesPreviousNL() override
Returns previous nl solution on element.
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
const FieldVariableValue & slnPreviousNL() const
void needsPreviousNewtonIteration(bool state)
Set a flag that indicated that user required values for the previous Newton iterate.
const MooseArray< Number > & dofValuesPreviousNLNeighbor() override
Returns previous nl solution on neighbor element.
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:866
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180
const FieldVariableValue & slnPreviousNLNeighbor() const

◆ coupledVectorDot()

const VectorVariableValue & Coupleable::coupledVectorDot ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtualinherited

Time derivative of a coupled vector variable.

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

Definition at line 728 of file Coupleable.C.

729 {
730  checkVar(var_name);
731  if (!isCoupled(var_name)) // Return default 0
733 
734  validateExecutionerType(var_name, "coupledVectorDot");
735  VectorMooseVariable * var = getVectorVar(var_name, comp);
736 
738  {
739  if (_c_nodal)
740  mooseError("Vector variables are not required to be continuous and so should not be used "
741  "with nodal compute objects");
742  else
743  return var->uDot();
744  }
745  else
746  {
747  if (_c_nodal)
748  mooseError("Vector variables are not required to be continuous and so should not be used "
749  "with nodal compute objects");
750  else
751  return var->uDotNeighbor();
752  }
753 }
void validateExecutionerType(const std::string &name, const std::string &fn_name) const
Checks to make sure that the current Executioner has set "_is_transient" when old/older values are co...
Definition: Coupleable.C:1467
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:749
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:247
Class for stuff related to variables.
Definition: Adaptivity.h:29
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:207
const FieldVariableValue & uDot() const
element dots
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:144
const FieldVariableValue & uDotNeighbor() const
neighbor dots
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:866
VectorVariableValue _default_vector_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:812
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ coupledVectorDotDot()

const VectorVariableValue & Coupleable::coupledVectorDotDot ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtualinherited

Second time derivative of a coupled vector variable.

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

Definition at line 756 of file Coupleable.C.

757 {
758  checkVar(var_name);
759  if (!isCoupled(var_name)) // Return default 0
761 
762  validateExecutionerType(var_name, "coupledVectorDotDot");
763  VectorMooseVariable * var = getVectorVar(var_name, comp);
764 
766  {
767  if (_c_nodal)
768  mooseError("Vector variables are not required to be continuous and so should not be used "
769  "with nodal compute objects");
770  else
771  return var->uDotDot();
772  }
773  else
774  {
775  if (_c_nodal)
776  mooseError("Vector variables are not required to be continuous and so should not be used "
777  "with nodal compute objects");
778  else
779  return var->uDotDotNeighbor();
780  }
781 }
void validateExecutionerType(const std::string &name, const std::string &fn_name) const
Checks to make sure that the current Executioner has set "_is_transient" when old/older values are co...
Definition: Coupleable.C:1467
const FieldVariableValue & uDotDotNeighbor() const
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:749
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:247
Class for stuff related to variables.
Definition: Adaptivity.h:29
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:207
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:144
const FieldVariableValue & uDotDot() const
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:866
VectorVariableValue _default_vector_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:812
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ coupledVectorDotDotOld()

const VectorVariableValue & Coupleable::coupledVectorDotDotOld ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtualinherited

Old second time derivative of a coupled vector variable.

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

Definition at line 812 of file Coupleable.C.

813 {
814  checkVar(var_name);
815  if (!isCoupled(var_name)) // Return default 0
817 
818  validateExecutionerType(var_name, "coupledVectorDotDotOld");
819  VectorMooseVariable * var = getVectorVar(var_name, comp);
820 
822  {
823  if (_c_nodal)
824  mooseError("Vector variables are not required to be continuous and so should not be used "
825  "with nodal compute objects");
826  else
827  return var->uDotDotOld();
828  }
829  else
830  {
831  if (_c_nodal)
832  mooseError("Vector variables are not required to be continuous and so should not be used "
833  "with nodal compute objects");
834  else
835  return var->uDotDotOldNeighbor();
836  }
837 }
void validateExecutionerType(const std::string &name, const std::string &fn_name) const
Checks to make sure that the current Executioner has set "_is_transient" when old/older values are co...
Definition: Coupleable.C:1467
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:749
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:247
Class for stuff related to variables.
Definition: Adaptivity.h:29
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:207
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:144
const FieldVariableValue & uDotDotOldNeighbor() const
const FieldVariableValue & uDotDotOld() const
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:866
VectorVariableValue _default_vector_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:812
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ coupledVectorDotOld()

const VectorVariableValue & Coupleable::coupledVectorDotOld ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtualinherited

Old time derivative of a coupled vector variable.

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

Definition at line 784 of file Coupleable.C.

785 {
786  checkVar(var_name);
787  if (!isCoupled(var_name)) // Return default 0
789 
790  validateExecutionerType(var_name, "coupledVectorDotOld");
791  VectorMooseVariable * var = getVectorVar(var_name, comp);
792 
794  {
795  if (_c_nodal)
796  mooseError("Vector variables are not required to be continuous and so should not be used "
797  "with nodal compute objects");
798  else
799  return var->uDotOld();
800  }
801  else
802  {
803  if (_c_nodal)
804  mooseError("Vector variables are not required to be continuous and so should not be used "
805  "with nodal compute objects");
806  else
807  return var->uDotOldNeighbor();
808  }
809 }
void validateExecutionerType(const std::string &name, const std::string &fn_name) const
Checks to make sure that the current Executioner has set "_is_transient" when old/older values are co...
Definition: Coupleable.C:1467
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:749
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:247
Class for stuff related to variables.
Definition: Adaptivity.h:29
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:207
const FieldVariableValue & uDotOld() const
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:144
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:866
VectorVariableValue _default_vector_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:812
const FieldVariableValue & uDotOldNeighbor() const
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ coupledVectorGradient()

const VectorVariableGradient & Coupleable::coupledVectorGradient ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtualinherited

Returns gradient of a coupled vector variable.

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

Definition at line 1014 of file Coupleable.C.

1015 {
1016  checkVar(var_name);
1017  if (!isCoupled(var_name)) // Return default 0
1018  return _default_vector_gradient;
1019 
1020  coupledCallback(var_name, false);
1021  if (_c_nodal)
1022  mooseError(_c_name, ": Gradients are non-sensical with nodal compute objects");
1023 
1024  VectorMooseVariable * var = getVectorVar(var_name, comp);
1025 
1026  if (!_coupleable_neighbor)
1027  return (_c_is_implicit) ? var->gradSln() : var->gradSlnOld();
1028  else
1029  return (_c_is_implicit) ? var->gradSlnNeighbor() : var->gradSlnOldNeighbor();
1030 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:749
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:247
Class for stuff related to variables.
Definition: Adaptivity.h:29
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:207
const FieldVariableGradient & gradSlnOldNeighbor() const
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:752
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:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:731
const FieldVariableGradient & gradSlnOld() const
VectorVariableGradient _default_vector_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:815
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:866
const FieldVariableGradient & gradSlnNeighbor() const
neighbor solution gradients
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180
const FieldVariableGradient & gradSln() const
element gradients

◆ coupledVectorGradientOld()

const VectorVariableGradient & Coupleable::coupledVectorGradientOld ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtualinherited

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

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

Definition at line 1033 of file Coupleable.C.

1034 {
1035  checkVar(var_name);
1036  if (!isCoupled(var_name)) // Return default 0
1037  return _default_vector_gradient;
1038 
1039  coupledCallback(var_name, true);
1040  if (_c_nodal)
1041  mooseError(_c_name, ": Gradients are non-sensical with nodal compute objects");
1042 
1043  validateExecutionerType(var_name, "coupledGradientOld");
1044  VectorMooseVariable * var = getVectorVar(var_name, comp);
1045 
1046  if (!_coupleable_neighbor)
1047  return (_c_is_implicit) ? var->gradSlnOld() : var->gradSlnOlder();
1048  else
1049  return (_c_is_implicit) ? var->gradSlnOldNeighbor() : var->gradSlnOlderNeighbor();
1050 }
void validateExecutionerType(const std::string &name, const std::string &fn_name) const
Checks to make sure that the current Executioner has set "_is_transient" when old/older values are co...
Definition: Coupleable.C:1467
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:749
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:247
Class for stuff related to variables.
Definition: Adaptivity.h:29
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:207
const FieldVariableGradient & gradSlnOlderNeighbor() const
const FieldVariableGradient & gradSlnOldNeighbor() const
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:752
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:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:731
const FieldVariableGradient & gradSlnOld() const
VectorVariableGradient _default_vector_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:815
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:866
const FieldVariableGradient & gradSlnOlder() const
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ coupledVectorGradientOlder()

const VectorVariableGradient & Coupleable::coupledVectorGradientOlder ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtualinherited

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

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

Definition at line 1053 of file Coupleable.C.

1054 {
1055  checkVar(var_name);
1056  if (!isCoupled(var_name)) // Return default 0
1057  return _default_vector_gradient;
1058 
1059  coupledCallback(var_name, true);
1060  if (_c_nodal)
1061  mooseError(_c_name, ": Gradients are non-sensical with nodal compute objects");
1062 
1063  validateExecutionerType(var_name, "coupledGradientOlder");
1064  VectorMooseVariable * var = getVectorVar(var_name, comp);
1065 
1066  if (_c_is_implicit)
1067  {
1068  if (!_coupleable_neighbor)
1069  return var->gradSlnOlder();
1070  else
1071  return var->gradSlnOlderNeighbor();
1072  }
1073  else
1074  mooseError(_c_name, ": Older values not available for explicit schemes");
1075 }
void validateExecutionerType(const std::string &name, const std::string &fn_name) const
Checks to make sure that the current Executioner has set "_is_transient" when old/older values are co...
Definition: Coupleable.C:1467
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:749
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:247
Class for stuff related to variables.
Definition: Adaptivity.h:29
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:207
const FieldVariableGradient & gradSlnOlderNeighbor() const
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:752
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:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:731
VectorVariableGradient _default_vector_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:815
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:866
const FieldVariableGradient & gradSlnOlder() const
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ coupledVectorTagValue()

const VariableValue & Coupleable::coupledVectorTagValue ( const std::string &  var_name,
TagID  tag,
unsigned int  comp = 0 
)
protectedvirtualinherited

Returns value of a coupled variable for a given tag.

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

Definition at line 388 of file Coupleable.C.

389 {
390  checkVar(var_name);
391  if (!isCoupled(var_name))
392  mooseError(var_name, ": invalid variable name for coupledVectorTagValue");
393 
395 
396  coupledCallback(var_name, false);
397  MooseVariable * var = getVar(var_name, comp);
398 
399  if (_c_nodal)
400  return var->nodalVectorTagValue(tag);
401  else
402  return var->vectorTagValue(tag);
403 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:749
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:207
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:241
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:144
const FieldVariableValue & vectorTagValue(TagID tag)
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
void addFEVariableCoupleableVectorTag(TagID tag)
Definition: Coupleable.h:113
const MooseArray< Real > & nodalVectorTagValue(TagID tag)
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ coupledVectorValue()

const VectorVariableValue & Coupleable::coupledVectorValue ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtualinherited

Returns value of a coupled vector variable.

Parameters
var_nameName of coupled vector variable
compComponent number for vector of coupled vector variables
Returns
Reference to a VectorVariableValue for the coupled vector variable
See also
VectorKernel::_u

Definition at line 424 of file Coupleable.C.

425 {
426  if (!isCoupled(var_name))
427  return *getDefaultVectorValue(var_name);
428 
429  coupledCallback(var_name, false);
430  VectorMooseVariable * var = getVectorVar(var_name, comp);
431 
433  {
434  if (_c_nodal)
435  mooseError("Vector variables are not required to be continuous and so should not be used "
436  "with nodal compute objects");
437  else
438  return (_c_is_implicit) ? var->sln() : var->slnOld();
439  }
440  else
441  {
442  if (_c_nodal)
443  mooseError("Vector variables are not required to be continuous and so should not be used "
444  "with nodal compute objects");
445  else
446  return (_c_is_implicit) ? var->slnNeighbor() : var->slnOldNeighbor();
447  }
448 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:749
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:247
Class for stuff related to variables.
Definition: Adaptivity.h:29
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:207
const FieldVariableValue & sln() const
element solutions
VectorVariableValue * getDefaultVectorValue(const std::string &var_name)
Helper method to return (and insert if necessary) the default value for an uncoupled vector variable...
Definition: Coupleable.C:310
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:752
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:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
const FieldVariableValue & slnOld() const
const FieldVariableValue & slnNeighbor() const
neighbor solutions
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:866
const FieldVariableValue & slnOldNeighbor() const

◆ coupledVectorValueOld()

const VectorVariableValue & Coupleable::coupledVectorValueOld ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtualinherited

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

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

Definition at line 558 of file Coupleable.C.

559 {
560  if (!isCoupled(var_name))
561  return *getDefaultVectorValue(var_name);
562 
563  validateExecutionerType(var_name, "coupledVectorValueOld");
564  coupledCallback(var_name, true);
565  VectorMooseVariable * var = getVectorVar(var_name, comp);
566 
568  {
569  if (_c_nodal)
570  mooseError("Vector variables are not required to be continuous and so should not be used "
571  "with nodal compute objects");
572  else
573  return (_c_is_implicit) ? var->slnOld() : var->slnOlder();
574  }
575  else
576  {
577  if (_c_nodal)
578  mooseError("Vector variables are not required to be continuous and so should not be used "
579  "with nodal compute objects");
580  else
581  return (_c_is_implicit) ? var->slnOldNeighbor() : var->slnOlderNeighbor();
582  }
583 }
void validateExecutionerType(const std::string &name, const std::string &fn_name) const
Checks to make sure that the current Executioner has set "_is_transient" when old/older values are co...
Definition: Coupleable.C:1467
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:749
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:247
Class for stuff related to variables.
Definition: Adaptivity.h:29
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:207
const FieldVariableValue & slnOlderNeighbor() const
VectorVariableValue * getDefaultVectorValue(const std::string &var_name)
Helper method to return (and insert if necessary) the default value for an uncoupled vector variable...
Definition: Coupleable.C:310
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:752
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:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
const FieldVariableValue & slnOld() const
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:866
const FieldVariableValue & slnOldNeighbor() const
const FieldVariableValue & slnOlder() const

◆ coupledVectorValueOlder()

const VectorVariableValue & Coupleable::coupledVectorValueOlder ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtualinherited

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

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

Definition at line 586 of file Coupleable.C.

587 {
588  if (!isCoupled(var_name))
589  return *getDefaultVectorValue(var_name);
590 
591  validateExecutionerType(var_name, "coupledVectorValueOlder");
592  coupledCallback(var_name, true);
593  VectorMooseVariable * var = getVectorVar(var_name, comp);
594 
596  {
597  if (_c_nodal)
598  mooseError("Vector variables are not required to be continuous and so should not be used "
599  "with nodal compute objects");
600  else
601  {
602  if (_c_is_implicit)
603  return var->slnOlder();
604  else
605  mooseError("Older values not available for explicit schemes");
606  }
607  }
608  else
609  {
610  if (_c_nodal)
611  mooseError("Vector variables are not required to be continuous and so should not be used "
612  "with nodal compute objects");
613  else
614  {
615  if (_c_is_implicit)
616  return var->slnOlderNeighbor();
617  else
618  mooseError("Older values not available for explicit schemes");
619  }
620  }
621 }
void validateExecutionerType(const std::string &name, const std::string &fn_name) const
Checks to make sure that the current Executioner has set "_is_transient" when old/older values are co...
Definition: Coupleable.C:1467
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:749
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:247
Class for stuff related to variables.
Definition: Adaptivity.h:29
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:207
const FieldVariableValue & slnOlderNeighbor() const
VectorVariableValue * getDefaultVectorValue(const std::string &var_name)
Helper method to return (and insert if necessary) the default value for an uncoupled vector variable...
Definition: Coupleable.C:310
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:752
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:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
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:866
const FieldVariableValue & slnOlder() const

◆ cyclicDependencyError()

template<typename T >
void DependencyResolverInterface::cyclicDependencyError ( CyclicDependencyException< T > &  e,
const std::string &  header 
)
staticinherited

A helper method for cyclic errors.

Definition at line 94 of file DependencyResolverInterface.h.

96 {
97  std::ostringstream oss;
98 
99  oss << header << ":\n";
100  const typename std::multimap<T, T> & depends = e.getCyclicDependencies();
101  for (typename std::multimap<T, T>::const_iterator it = depends.begin(); it != depends.end(); ++it)
102  oss << (static_cast<T>(it->first))->name() << " -> " << (static_cast<T>(it->second))->name()
103  << "\n";
104  mooseError(oss.str());
105 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:207
const std::multimap< T, T > & getCyclicDependencies() const

◆ declareRecoverableData() [1/2]

template<typename T >
T & Restartable::declareRecoverableData ( std::string  data_name)
protectedinherited

Declare a piece of data as "recoverable".

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

Note - this data will NOT be restored on Restart!

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 270 of file Restartable.h.

271 {
272  std::string full_name = _restartable_system_name + "/" + _restartable_name + "/" + data_name;
273 
274  registerRecoverableDataOnApp(full_name);
275 
276  return declareRestartableDataWithContext<T>(data_name, nullptr);
277 }
std::string _restartable_system_name
The system name this object is in.
Definition: Restartable.h:195
std::string _restartable_name
The name of the object.
Definition: Restartable.h:192
void registerRecoverableDataOnApp(std::string name)
Helper function for actually registering the restartable data.
Definition: Restartable.C:54

◆ declareRecoverableData() [2/2]

template<typename T >
T & Restartable::declareRecoverableData ( 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 data will NOT be restored on Restart!

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 281 of file Restartable.h.

282 {
283  std::string full_name = _restartable_system_name + "/" + _restartable_name + "/" + data_name;
284 
285  registerRecoverableDataOnApp(full_name);
286 
287  return declareRestartableDataWithContext<T>(data_name, init_value, nullptr);
288 }
std::string _restartable_system_name
The system name this object is in.
Definition: Restartable.h:195
std::string _restartable_name
The name of the object.
Definition: Restartable.h:192
void registerRecoverableDataOnApp(std::string name)
Helper function for actually registering the restartable data.
Definition: Restartable.C:54

◆ declareRestartableData() [1/2]

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 203 of file Restartable.h.

204 {
205  return declareRestartableDataWithContext<T>(data_name, nullptr);
206 }

◆ declareRestartableData() [2/2]

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 210 of file Restartable.h.

211 {
212  return declareRestartableDataWithContext<T>(data_name, init_value, nullptr);
213 }

◆ declareRestartableDataWithContext() [1/2]

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 217 of file Restartable.h.

218 {
219  std::string full_name = _restartable_system_name + "/" + _restartable_name + "/" + data_name;
220  auto data_ptr = libmesh_make_unique<RestartableData<T>>(full_name, context);
221  T & restartable_data_ref = data_ptr->get();
222 
223  registerRestartableDataOnApp(full_name, std::move(data_ptr), _restartable_tid);
224 
225  return restartable_data_ref;
226 }
std::string _restartable_system_name
The system name this object is in.
Definition: Restartable.h:195
std::string _restartable_name
The name of the object.
Definition: Restartable.h:192
THREAD_ID _restartable_tid
The thread ID for this object.
Definition: Restartable.h:198
void registerRestartableDataOnApp(std::string name, std::unique_ptr< RestartableDataValue > data, THREAD_ID tid)
Helper function for actually registering the restartable data.
Definition: Restartable.C:46

◆ declareRestartableDataWithContext() [2/2]

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 230 of file Restartable.h.

233 {
234  std::string full_name = _restartable_system_name + "/" + _restartable_name + "/" + data_name;
235  auto data_ptr = libmesh_make_unique<RestartableData<T>>(full_name, context);
236  data_ptr->set() = init_value;
237 
238  T & restartable_data_ref = data_ptr->get();
239  registerRestartableDataOnApp(full_name, std::move(data_ptr), _restartable_tid);
240 
241  return restartable_data_ref;
242 }
std::string _restartable_system_name
The system name this object is in.
Definition: Restartable.h:195
std::string _restartable_name
The name of the object.
Definition: Restartable.h:192
THREAD_ID _restartable_tid
The thread ID for this object.
Definition: Restartable.h:198
void registerRestartableDataOnApp(std::string name, std::unique_ptr< RestartableDataValue > data, THREAD_ID tid)
Helper function for actually registering the restartable data.
Definition: Restartable.C:46

◆ declareRestartableDataWithObjectName()

template<typename T >
T & Restartable::declareRestartableDataWithObjectName ( std::string  data_name,
std::string  object_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)
object_nameA supplied name for the object that is declaring this data.

Definition at line 246 of file Restartable.h.

247 {
248  return declareRestartableDataWithObjectNameWithContext<T>(data_name, object_name, nullptr);
249 }

◆ declareRestartableDataWithObjectNameWithContext()

template<typename T >
T & Restartable::declareRestartableDataWithObjectNameWithContext ( std::string  data_name,
std::string  object_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)
object_nameA supplied name for the object that is declaring this data.
contextContext pointer that will be passed to the load and store functions

Definition at line 253 of file Restartable.h.

256 {
257  std::string old_name = _restartable_name;
258 
259  _restartable_name = object_name;
260 
261  T & value = declareRestartableDataWithContext<T>(data_name, context);
262 
263  _restartable_name = old_name;
264 
265  return value;
266 }
std::string _restartable_name
The name of the object.
Definition: Restartable.h:192

◆ dotHelper() [1/2]

template<typename T >
Real InitialConditionTempl< T >::dotHelper ( const GradientType op1,
const GradientType op2 
)
inherited

Helps perform multiplication of GradientTypes: a normal dot product for vectors and a contraction for tensors.

Definition at line 400 of file InitialConditionTempl.C.

401 {
402  return op1 * op2;
403 }

◆ dotHelper() [2/2]

template<>
Real InitialConditionTempl< RealVectorValue >::dotHelper ( const GradientType op1,
const GradientType op2 
)
inherited

Definition at line 407 of file InitialConditionTempl.C.

409 {
410  return op1.contract(op2);
411 }

◆ enabled()

virtual bool MooseObject::enabled ( ) const
inlinevirtualinherited

Return the enabled status of the object.

Reimplemented in EigenKernel.

Definition at line 99 of file MooseObject.h.

Referenced by EigenKernel::enabled().

99 { return _enabled; }
const bool & _enabled
Reference to the "enable" InputParaemters, used by Controls for toggling on/off MooseObjects.
Definition: MooseObject.h:186

◆ getADDefaultGradient() [1/3]

template<ComputeStage compute_stage>