https://mooseframework.inl.gov
ArrayNodalKernel.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #pragma once
11 
12 #include "NodalKernelBase.h"
13 #include "MooseVariableInterface.h"
14 
18 class ArrayNodalKernel : public NodalKernelBase, public MooseVariableInterface<RealEigenVector>
19 {
20 public:
26 
28 
35  virtual void computeResidual() override;
36 
43  virtual void computeJacobian() override;
44 
52  virtual void computeOffDiagJacobian(unsigned int jvar) override;
53 
58  const MooseVariableFE<RealEigenVector> & variable() const override { return _var; }
59 
60 protected:
65  virtual void computeQpResidual(RealEigenVector & residual) = 0;
66 
72  virtual void computeQpJacobian() {}
73 
80  virtual void computeQpOffDiagJacobian(unsigned int /*jvar*/) {}
81 
88  void setJacobian(unsigned int i, unsigned int j, Real value);
89 
92 
95 
97  const unsigned int _count;
98 
99 private:
102 
104  const std::vector<dof_id_type> * _ivar_indices;
105  const std::vector<dof_id_type> * _jvar_indices;
106 
108  const std::vector<Real> & _scaling;
109 };
const std::vector< dof_id_type > * _jvar_indices
const std::vector< Real > & _scaling
scaling factors
RealEigenVector _work_vector
Work vector for residual.
virtual void computeResidual() override
Compute and assemble the residual at the current node.
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseBase.h:131
virtual void computeJacobian() override
Compute and assemble the Jacobian at one node.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
const ArrayVariableValue & _u
Value of the unknown variable this is acting on.
void setJacobian(unsigned int i, unsigned int j, Real value)
Add a Jacobian entry for the current nodal kernel contribution.
virtual void computeQpJacobian()
The user can override this function to compute the intra-variable off-diagonal Jacobian contribution ...
MooseVariableFE< RealEigenVector > & _var
variable this works on
static InputParameters validParams()
Class constructor.
virtual void computeQpOffDiagJacobian(unsigned int)
The user can override this function to compute the inter-variable off-diagonal Jacobian contribution ...
ArrayNodalKernel(const InputParameters &parameters)
virtual const OutputTools< RealEigenVector >::VariableValue & value()
The value of the variable this object is operating on.
const std::vector< dof_id_type > * _ivar_indices
DOF indices.
virtual void computeQpResidual(RealEigenVector &residual)=0
The user must override this function to compute the residual at a node.
forward declarations
Base class for creating new types of nodal kernels.
const unsigned int _count
Number of components of the array variable.
Interface for objects that need to get values of MooseVariables.
Eigen::Matrix< Real, Eigen::Dynamic, 1 > RealEigenVector
Definition: MooseTypes.h:147
const MooseVariableFE< RealEigenVector > & variable() const override
Gets the variable this is active on.
Base class for creating nodal kernels with hand-coded Jacobians.
virtual void computeOffDiagJacobian(unsigned int jvar) override
Compute the off-diagonal Jacobian at one node.