Skip to content

Commit

Permalink
Merge pull request idaholab#345 from idaholab/residual-object
Browse files Browse the repository at this point in the history
Update to uniform ResidualObject APIs
  • Loading branch information
aeslaughter authored Nov 11, 2020
2 parents 6f022ca + b102f2b commit 3194280
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 14 deletions.
3 changes: 1 addition & 2 deletions include/kernels/StressDivergenceDamper.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ class StressDivergenceDamper : public Kernel
StressDivergenceDamper(const InputParameters & parameters);
virtual void computeResidual() override;
virtual void computeJacobian() override;
virtual void computeOffDiagJacobian(MooseVariableFEBase & jvar) override;
using Kernel::computeOffDiagJacobian;
virtual void computeOffDiagJacobian(unsigned int jvar) override;

protected:
virtual Real computeQpResidual() override { return 0.0; }
Expand Down
3 changes: 1 addition & 2 deletions include/kernels/StressDivergenceIsolator.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ class StressDivergenceIsolator : public Kernel
StressDivergenceIsolator(const InputParameters & parameters);
virtual void computeResidual() override;
virtual void computeJacobian() override;
virtual void computeOffDiagJacobian(MooseVariableFEBase & jvar) override;
using Kernel::computeOffDiagJacobian;
virtual void computeOffDiagJacobian(unsigned int jvar) override;

protected:
virtual Real computeQpResidual() override { return 0.0; }
Expand Down
4 changes: 1 addition & 3 deletions include/kernels/StressDivergenceSpring.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,14 @@ template <typename>
class RankTwoTensorTempl;
typedef RankTwoTensorTempl<Real> RankTwoTensor;


class StressDivergenceSpring : public Kernel
{
public:
static InputParameters validParams();
StressDivergenceSpring(const InputParameters & parameters);
virtual void computeResidual() override;
virtual void computeJacobian() override;
virtual void computeOffDiagJacobian(MooseVariableFEBase & jvar) override;
using Kernel::computeOffDiagJacobian;
virtual void computeOffDiagJacobian(unsigned int jvar) override;

protected:
virtual Real computeQpResidual() override { return 0.0; }
Expand Down
2 changes: 1 addition & 1 deletion moose
Submodule moose updated 191 files
3 changes: 1 addition & 2 deletions src/kernels/StressDivergenceDamper.C
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,9 @@ StressDivergenceDamper::computeJacobian()
}

void
StressDivergenceDamper::computeOffDiagJacobian(MooseVariableFEBase & jvar)
StressDivergenceDamper::computeOffDiagJacobian(const unsigned int jvar_num)
// coupling one variable to another (disp x to disp y, etc)
{
size_t jvar_num = jvar.number();
if (jvar_num == _var.number())
// jacobian calculation if jvar is the same as the current variable i.e.,
// diagonal elements
Expand Down
3 changes: 1 addition & 2 deletions src/kernels/StressDivergenceIsolator.C
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,9 @@ StressDivergenceIsolator::computeJacobian()
}

void
StressDivergenceIsolator::computeOffDiagJacobian(MooseVariableFEBase & jvar)
StressDivergenceIsolator::computeOffDiagJacobian(const unsigned int jvar_num)
// coupling one variable to another (disp x to disp y, etc)
{
size_t jvar_num = jvar.number();
if (jvar_num == _var.number())
// jacobian calculation if jvar is the same as the current variable i.e.,
// diagonal elements
Expand Down
3 changes: 1 addition & 2 deletions src/kernels/StressDivergenceSpring.C
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,9 @@ StressDivergenceSpring::computeJacobian()
}

void
StressDivergenceSpring::computeOffDiagJacobian(MooseVariableFEBase & jvar)
StressDivergenceSpring::computeOffDiagJacobian(const unsigned int jvar_num)
// coupling one variable to another (disp x to disp y, etc)
{
size_t jvar_num = jvar.number();
if (jvar_num == _var.number())
// jacobian calculation if jvar is the same as the current variable i.e.,
// diagonal elements
Expand Down

0 comments on commit 3194280

Please sign in to comment.