14 template <
typename Derived>
25 const unsigned int qp,
42 template <
typename Derived>
48 "v",
"The coupled variable we require to be greater than the lower bound");
49 params.
addParam<std::vector<BoundaryName>>(
52 "Boundaries on which not to execute the nodal kernel. This can be useful for avoiding " 53 "singuarility in the matrix in case a constraint is active in the same place that a " 54 "Dirichlet BC is set");
58 template <
typename Derived>
60 :
NodalKernel(parameters), _v_var(coupled(
"v")), _v(kokkosCoupledNodalValue(
"v"))
63 paramError(
"v",
"Coupled variable needs to be different from 'variable'");
65 std::set<ContiguousBoundaryID> bnd_ids;
67 const auto & bnd_names = getParam<std::vector<BoundaryName>>(
"exclude_boundaries");
69 bnd_ids.insert(
kokkosMesh().getContiguousBoundaryID(bnd_id));
74 template <
typename Derived>
79 if (kokkosMesh().isBoundaryNode(node, _bnd_ids[b]))
85 template <
typename Derived>
90 if (skipOnBoundary(datum.
node()))
93 return static_cast<const Derived *
>(
this)->getResidual(qp, datum);
96 template <
typename Derived>
101 if (skipOnBoundary(datum.
node()))
104 return static_cast<const Derived *
>(
this)->getJacobian(qp, datum);
107 template <
typename Derived>
110 const unsigned int qp,
113 if (skipOnBoundary(datum.
node()))
116 return static_cast<const Derived *
>(
this)->getOffDiagJacobian(jvar, qp, datum);
MooseMesh & _mesh
Reference to this Kernel's mesh object.
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 ...
unsigned int number() const
Get variable number coming from libMesh.
const InputParameters & parameters() const
Get the parameters of the object.
KOKKOS_FUNCTION Real computeQpResidual(const unsigned int qp, ResidualDatum &datum) const
KOKKOS_FUNCTION Real computeQpOffDiagJacobian(const unsigned int jvar, const unsigned int qp, ResidualDatum &datum) const
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.
static InputParameters validParams()
dof_id_type ContiguousNodeID
KOKKOS_FUNCTION bool skipOnBoundary(const ContiguousNodeID node) const
KOKKOS_FUNCTION Real computeQpJacobian(const unsigned int qp, ResidualDatum &datum) const
KOKKOS_FUNCTION const Mesh & kokkosMesh() const
Get the const reference of the Kokkos mesh.
KOKKOS_FUNCTION ContiguousNodeID node() const
Get the contiguous node ID.
const unsigned int _v_var
The number of the coupled variable.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Moose::Kokkos::VariableValue _v
The value of the coupled variable.
KokkosBoundNodalKernel(const InputParameters ¶meters)
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. ...
The Kokkos wrapper classes for MOOSE-like variable value access.
static InputParameters validParams()
Class constructor.
Base class for creating nodal kernels with hand-coded Jacobians.
The Kokkos object that holds thread-private data in the parallel operations of Kokkos residual object...