14 template <
typename Derived>
43 template <
typename Derived>
49 "v",
"The coupled variable we require to be greater than the lower bound");
50 params.
addParam<std::vector<BoundaryName>>(
53 "Boundaries on which not to execute the nodal kernel. This can be useful for avoiding " 54 "singuarility in the matrix in case a constraint is active in the same place that a " 55 "Dirichlet BC is set");
59 template <
typename Derived>
62 _v_var(this->coupled(
"v")),
63 _v(this->kokkosCoupledNodalValue(
"v"))
66 this->
paramError(
"v",
"Coupled variable needs to be different from 'variable'");
68 std::set<ContiguousBoundaryID> bnd_ids;
70 const auto & bnd_names = this->
template getParam<std::vector<BoundaryName>>(
"exclude_boundaries");
72 bnd_ids.insert(this->kokkosMesh().getContiguousBoundaryID(bnd_id));
77 template <
typename Derived>
82 if (this->kokkosMesh().isBoundaryNode(node, _bnd_ids[b]))
88 template <
typename Derived>
92 if (skipOnBoundary(node))
95 return static_cast<const Derived *
>(
this)->getResidual(node);
98 template <
typename Derived>
102 if (skipOnBoundary(node))
105 return static_cast<const Derived *
>(
this)->getJacobian(node);
108 template <
typename Derived>
113 if (skipOnBoundary(node))
116 return static_cast<const Derived *
>(
this)->getOffDiagJacobian(jvar, node);
MooseMesh & _mesh
Reference to this Kernel's mesh object.
static InputParameters validParams()
void paramError(const std::string ¶m, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
KOKKOS_FUNCTION Real computeQpOffDiagJacobian(const unsigned int jvar, const ContiguousNodeID node) const
unsigned int number() const
Get variable number coming from libMesh.
usingKokkosNodalKernelMembers(Derived)
const InputParameters & parameters() const
Get the parameters of the object.
Moose::Kokkos::Array< ContiguousBoundaryID > _bnd_ids
Boundaries on which we should not execute this object.
The base class for a user to derive their own Kokkos nodal kernels.
MooseVariableFieldBase & _var
Reference of the MOOSE variable.
KOKKOS_FUNCTION Real computeQpJacobian(const ContiguousNodeID node) const
static InputParameters validParams()
dof_id_type ContiguousNodeID
KOKKOS_FUNCTION bool skipOnBoundary(const ContiguousNodeID node) const
KOKKOS_FUNCTION Real computeQpResidual(const ContiguousNodeID node) const
const unsigned int _v_var
The number of the coupled variable.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
KokkosBoundNodalKernel(const InputParameters ¶meters)
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...
std::vector< BoundaryID > getBoundaryIDs(const Elem *const elem, const unsigned short int side) const
Returns a vector of boundary IDs for the requested element on the requested side. ...
const Moose::Kokkos::VariableNodalValue _v
The value of the coupled variable.
Base class for creating nodal kernels with hand-coded Jacobians.