Skip to content

Commit

Permalink
Add coupledVectorDotDu and coupledVectorDotDotDu
Browse files Browse the repository at this point in the history
  • Loading branch information
cticenhour committed Aug 26, 2019
1 parent d54311d commit cb0c935
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
20 changes: 20 additions & 0 deletions framework/include/interfaces/Coupleable.h
Expand Up @@ -634,6 +634,26 @@ class Coupleable
virtual const VectorVariableValue & coupledVectorDotDotOld(const std::string & var_name,
unsigned int comp = 0);

/**
* Time derivative of a coupled vector variable with respect to the coefficients
* @param var_name Name of coupled vector variable
* @param comp Component number for vector of coupled vector variables
* @return Reference to a VariableValue containing the time derivative of the coupled
* vector variable with respect to the coefficients
*/
virtual const VariableValue & coupledVectorDotDu(const std::string & var_name,
unsigned int comp = 0);

/**
* Second time derivative of a coupled vector variable with respect to the coefficients
* @param var_name Name of coupled vector variable
* @param comp Component number for vector of coupled vector variables
* @return Reference to a VariableValue containing the time derivative of the coupled vector
* variable with respect to the coefficients
*/
virtual const VariableValue & coupledVectorDotDotDu(const std::string & var_name,
unsigned int comp = 0);

/**
* Time derivative of a coupled array variable
* @param var_name Name of coupled array variable
Expand Down
26 changes: 26 additions & 0 deletions framework/src/interfaces/Coupleable.C
Expand Up @@ -758,6 +758,32 @@ Coupleable::coupledVectorDotDotOld(const std::string & var_name, unsigned int co
return var->uDotDotOldNeighbor();
}

const VariableValue &
Coupleable::coupledVectorDotDu(const std::string & var_name, unsigned int comp)
{
VectorMooseVariable * var = getVectorVar(var_name, comp);
if (!var)
return _default_value_zero;
checkFuncType(var_name, VarType::Dot, FuncAge::Curr);

if (!_coupleable_neighbor)
return var->duDotDu();
return var->duDotDuNeighbor();
}

const VariableValue &
Coupleable::coupledVectorDotDotDu(const std::string & var_name, unsigned int comp)
{
VectorMooseVariable * var = getVectorVar(var_name, comp);
if (!var)
return _default_value_zero;
checkFuncType(var_name, VarType::Dot, FuncAge::Curr);

if (!_coupleable_neighbor)
return var->duDotDotDu();
return var->duDotDotDuNeighbor();
}

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

0 comments on commit cb0c935

Please sign in to comment.