https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ADArrayNodalKernel.C
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#include "ADArrayNodalKernel.h"
11#include "SubProblem.h"
12#include "SystemBase.h"
13#include "MooseVariableFE.h"
14#include "Assembly.h"
15
21
23 : NodalKernelBase(parameters),
24 MooseVariableInterface<RealEigenVector>(this,
25 true,
26 "variable",
27 Moose::VarKindType::VAR_SOLVER,
28 Moose::VarFieldType::VAR_FIELD_ARRAY),
29 _var(*mooseVariable()),
30 _u(_var.adDofValues()),
31 _count(_var.count()),
32 _work_vector(_count)
33{
35}
36
37void
49
50void
59
60void
unsigned int count
Definition MortarUtils.C:53
virtual void computeResidual() override
Compute the residual at the current node.
virtual void computeQpResidual(ADRealEigenVector &residual)=0
The user can override this function to compute the residual at a node.
static InputParameters validParams()
Class constructor.
const Node * _my_node
Cache variable to make sure we don't do duplicate AD computations.
ADArrayNodalKernel(const InputParameters &parameters)
virtual void computeOffDiagJacobian(unsigned int jvar) override
Compute the off-diagonal Jacobian at one node.
MooseVariableFE< RealEigenVector > & _var
variable this works on
ADRealEigenVector _work_vector
Work vector for residual.
virtual void computeJacobian() override
Compute the Jacobian at one node.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
const std::vector< Real > & arrayScalingFactor() const
void addMooseVariableDependency(MooseVariableFieldBase *var)
Call this function to add the passed in MooseVariableFieldBase as a variable that this object depends...
const std::vector< dof_id_type > & dofIndices() const final
Get local DoF indices.
virtual bool isNodalDefined() const override
Is this variable defined at nodes.
Interface for objects that need to get values of MooseVariables.
MooseVariableFE< RealEigenVector > * mooseVariable() const
Return the MooseVariableFE object that this interface acts on.
Base class for creating new types of nodal kernels.
unsigned int _qp
Quadrature point index.
const Node *const & _current_node
current node being processed
static InputParameters validParams()
Class constructor.
Assembly & _assembly
Reference to this Kernel's assembly object.
void addJacobian(Assembly &assembly, const Residuals &residuals, const Indices &dof_indices, Real scaling_factor)
Add the provided residual derivatives into the Jacobian for the provided dof indices.
void addResiduals(Assembly &assembly, const Residuals &residuals, const Indices &dof_indices, Real scaling_factor)
Add the provided incoming residuals corresponding to the provided dof indices.
auto raw_value(const Eigen::Map< T > &in)
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...