Skip to content

Commit

Permalink
Add adCoupledDotDot method (idaholab#18178)
Browse files Browse the repository at this point in the history
  • Loading branch information
cticenhour committed Jun 25, 2021
1 parent 3aa8304 commit 837f5ad
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
10 changes: 10 additions & 0 deletions framework/include/interfaces/Coupleable.h
Expand Up @@ -773,6 +773,16 @@ class Coupleable
*/
std::vector<const ADVariableValue *> adCoupledDots(const std::string & var_name) const;

/**
* Second time derivative of a coupled variable for ad simulations
* @param var_name Name of coupled variable
* @param comp Component number for vector of coupled variables
* @return Reference to a VariableValue containing the second time derivative of the coupled
* variable
*/
const ADVariableValue & adCoupledDotDot(const std::string & var_name,
unsigned int comp = 0) const;

/**
* Time derivative of a vector coupled variable for ad simulations
* @param var_name Name of vector coupled variable
Expand Down
17 changes: 17 additions & 0 deletions framework/src/interfaces/Coupleable.C
Expand Up @@ -1776,6 +1776,23 @@ Coupleable::adCoupledDot(const std::string & var_name, unsigned int comp) const
return var->adUDotNeighbor();
}

const ADVariableValue &
Coupleable::adCoupledDotDot(const std::string & var_name, unsigned int comp) const
{
const auto * var = getVarHelper<MooseVariableField<Real>>(var_name, comp);

if (!var)
return *getADDefaultValue(var_name);
checkFuncType(var_name, VarType::Dot, FuncAge::Curr);

if (_c_nodal)
mooseError("Not implemented");

if (!_coupleable_neighbor)
return var->adUDotDot();
return var->adUDotDotNeighbor();
}

const ADVectorVariableValue &
Coupleable::adCoupledVectorDot(const std::string & var_name, unsigned int comp) const
{
Expand Down

0 comments on commit 837f5ad

Please sign in to comment.