Skip to content

Commit

Permalink
Modify member types and methods for dotDu and dotDotDu
Browse files Browse the repository at this point in the history
Needed due to new coupledVectorDotDu and coupledVectorDotDotDu methods.

Refs idaholab#13913
  • Loading branch information
cticenhour committed Aug 26, 2019
1 parent b58216d commit b0022f3
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 29 deletions.
16 changes: 8 additions & 8 deletions framework/include/variables/MooseVariableData.h
Expand Up @@ -340,13 +340,13 @@ class MooseVariableData

const FieldVariableValue & uDotDotOld() const;

const VariableValue & duDotDu() const
const FieldVariableValue & duDotDu() const
{
_need_du_dot_du = true;
return _du_dot_du;
}

const VariableValue & duDotDotDu() const
const FieldVariableValue & duDotDotDu() const
{
_need_du_dotdot_du = true;
return _du_dotdot_du;
Expand Down Expand Up @@ -447,8 +447,8 @@ class MooseVariableData
const DoFValue & dofValuesDotOld() const;
const DoFValue & dofValuesDotDot() const;
const DoFValue & dofValuesDotDotOld() const;
const MooseArray<Number> & dofValuesDuDotDu() const;
const MooseArray<Number> & dofValuesDuDotDotDu() const;
const DoFValue & dofValuesDuDotDu() const;
const DoFValue & dofValuesDuDotDotDu() const;

/**
* Return the AD dof values
Expand Down Expand Up @@ -649,9 +649,9 @@ class MooseVariableData
/// nodal values of u_dotdot_old
DoFValue _dof_values_dotdot_old;
/// nodal values of derivative of u_dot wrt u
MooseArray<Number> _dof_du_dot_du;
DoFValue _dof_du_dot_du;
/// nodal values of derivative of u_dotdot wrt u
MooseArray<Number> _dof_du_dotdot_du;
DoFValue _dof_du_dotdot_du;

/// u
FieldVariableValue _u;
Expand Down Expand Up @@ -703,10 +703,10 @@ class MooseVariableData
FieldVariableValue _u_dotdot_old, _u_dotdot_old_bak;

/// derivative of u_dot wrt u
VariableValue _du_dot_du;
FieldVariableValue _du_dot_du;

/// derivative of u_dotdot wrt u
VariableValue _du_dotdot_du, _du_dotdot_du_bak;
FieldVariableValue _du_dotdot_du, _du_dotdot_du_bak;

/// The current qrule. This has to be a reference because the current qrule will be constantly
/// changing. If we initialized this to point to one qrule, then in the next calculation we would
Expand Down
16 changes: 8 additions & 8 deletions framework/include/variables/MooseVariableFE.h
Expand Up @@ -354,8 +354,8 @@ class MooseVariableFE : public MooseVariableFEBase
const FieldVariableValue & uDotDot() const { return _element_data->uDotDot(); }
const FieldVariableValue & uDotOld() const { return _element_data->uDotOld(); }
const FieldVariableValue & uDotDotOld() const { return _element_data->uDotDotOld(); }
const VariableValue & duDotDu() const { return _element_data->duDotDu(); }
const VariableValue & duDotDotDu() const { return _element_data->duDotDotDu(); }
const FieldVariableValue & duDotDu() const { return _element_data->duDotDu(); }
const FieldVariableValue & duDotDotDu() const { return _element_data->duDotDotDu(); }

/// neighbor solutions
const FieldVariableValue & slnNeighbor() const { return _neighbor_data->sln(Moose::Current); }
Expand Down Expand Up @@ -428,8 +428,8 @@ class MooseVariableFE : public MooseVariableFEBase
const FieldVariableValue & uDotDotNeighbor() const { return _neighbor_data->uDotDot(); }
const FieldVariableValue & uDotOldNeighbor() const { return _neighbor_data->uDotOld(); }
const FieldVariableValue & uDotDotOldNeighbor() const { return _neighbor_data->uDotDotOld(); }
const VariableValue & duDotDuNeighbor() const { return _neighbor_data->duDotDu(); }
const VariableValue & duDotDotDuNeighbor() const { return _neighbor_data->duDotDotDu(); }
const FieldVariableValue & duDotDuNeighbor() const { return _neighbor_data->duDotDu(); }
const FieldVariableValue & duDotDotDuNeighbor() const { return _neighbor_data->duDotDotDu(); }

/// lower-d element solution
template <ComputeStage compute_stage>
Expand Down Expand Up @@ -527,10 +527,10 @@ class MooseVariableFE : public MooseVariableFEBase
const DoFValue & dofValuesDotDotNeighbor();
const DoFValue & dofValuesDotDotOld();
const DoFValue & dofValuesDotDotOldNeighbor();
const MooseArray<Number> & dofValuesDuDotDu();
const MooseArray<Number> & dofValuesDuDotDuNeighbor();
const MooseArray<Number> & dofValuesDuDotDotDu();
const MooseArray<Number> & dofValuesDuDotDotDuNeighbor();
const DoFValue & dofValuesDuDotDu();
const DoFValue & dofValuesDuDotDuNeighbor();
const DoFValue & dofValuesDuDotDotDu();
const DoFValue & dofValuesDuDotDotDuNeighbor();

/**
* Return the AD dof values
Expand Down
5 changes: 2 additions & 3 deletions framework/include/variables/MooseVariableInterface.h
Expand Up @@ -105,7 +105,7 @@ class MooseVariableInterface
*
* @return The reference to be stored off and used later.
*/
virtual const VariableValue & dotDu();
virtual const typename OutputTools<T>::VariableValue & dotDu();

/**
* The derivative of the second time derivative of the variable this object is operating on
Expand All @@ -115,7 +115,7 @@ class MooseVariableInterface
*
* @return The reference to be stored off and used later.
*/
virtual const VariableValue & dotDotDu();
virtual const typename OutputTools<T>::VariableValue & dotDotDu();

/**
* The gradient of the variable this object is operating on.
Expand Down Expand Up @@ -202,4 +202,3 @@ class MooseVariableInterface
protected:
Assembly * _mvi_assembly;
};

8 changes: 4 additions & 4 deletions framework/src/variables/MooseVariableData.C
Expand Up @@ -903,10 +903,10 @@ MooseVariableData<RealEigenVector>::computeValues()
_u_dotdot_old[i].setZero(_count);

if (_need_du_dot_du)
_du_dot_du[i] = 0;
_du_dot_du[i].setZero(_count);

if (_need_du_dotdot_du)
_du_dotdot_du[i] = 0;
_du_dotdot_du[i].setZero(_count);

if (_need_grad_dot)
_grad_u_dot[i].setZero(_count, LIBMESH_DIM);
Expand Down Expand Up @@ -1789,15 +1789,15 @@ MooseVariableData<OutputType>::dofValuesDotDotOld() const
}

template <typename OutputType>
const MooseArray<Number> &
const typename MooseVariableData<OutputType>::DoFValue &
MooseVariableData<OutputType>::dofValuesDuDotDu() const
{
_need_dof_du_dot_du = true;
return _dof_du_dot_du;
}

template <typename OutputType>
const MooseArray<Number> &
const typename MooseVariableData<OutputType>::DoFValue &
MooseVariableData<OutputType>::dofValuesDuDotDotDu() const
{
_need_dof_du_dotdot_du = true;
Expand Down
8 changes: 4 additions & 4 deletions framework/src/variables/MooseVariableFE.C
Expand Up @@ -346,28 +346,28 @@ MooseVariableFE<OutputType>::dofValuesDotDotOldNeighbor()
}

template <typename OutputType>
const MooseArray<Number> &
const typename MooseVariableFE<OutputType>::DoFValue &
MooseVariableFE<OutputType>::dofValuesDuDotDu()
{
return _element_data->dofValuesDuDotDu();
}

template <typename OutputType>
const MooseArray<Number> &
const typename MooseVariableFE<OutputType>::DoFValue &
MooseVariableFE<OutputType>::dofValuesDuDotDotDu()
{
return _element_data->dofValuesDuDotDotDu();
}

template <typename OutputType>
const MooseArray<Number> &
const typename MooseVariableFE<OutputType>::DoFValue &
MooseVariableFE<OutputType>::dofValuesDuDotDuNeighbor()
{
return _neighbor_data->dofValuesDuDotDu();
}

template <typename OutputType>
const MooseArray<Number> &
const typename MooseVariableFE<OutputType>::DoFValue &
MooseVariableFE<OutputType>::dofValuesDuDotDotDuNeighbor()
{
return _neighbor_data->dofValuesDuDotDotDu();
Expand Down
24 changes: 22 additions & 2 deletions framework/src/variables/MooseVariableInterface.C
Expand Up @@ -213,7 +213,7 @@ MooseVariableInterface<RealVectorValue>::dotDotOld()
}

template <typename T>
const VariableValue &
const typename OutputTools<T>::VariableValue &
MooseVariableInterface<T>::dotDu()
{
if (_nodal)
Expand All @@ -223,7 +223,7 @@ MooseVariableInterface<T>::dotDu()
}

template <typename T>
const VariableValue &
const typename OutputTools<T>::VariableValue &
MooseVariableInterface<T>::dotDotDu()
{
if (_nodal)
Expand All @@ -232,6 +232,26 @@ MooseVariableInterface<T>::dotDotDu()
return _variable->duDotDotDu();
}

template <>
const VectorVariableValue &
MooseVariableInterface<RealVectorValue>::dotDu()
{
if (_nodal)
mooseError("Dofs are scalars while vector variables have vector values. Mismatch");
else
return _variable->duDotDu();
}

template <>
const VectorVariableValue &
MooseVariableInterface<RealVectorValue>::dotDotDu()
{
if (_nodal)
mooseError("Dofs are scalars while vector variables have vector values. Mismatch");
else
return _variable->duDotDotDu();
}

template <typename T>
const typename OutputTools<T>::VariableGradient &
MooseVariableInterface<T>::gradient()
Expand Down

0 comments on commit b0022f3

Please sign in to comment.