48 template <
typename Derived>
114 template <
typename Derived>
122 template <
typename Derived>
125 _u(kokkosSystems(), _var),
126 _default_offdiag(&Derived::computeQpOffDiagJacobian == &
NodalBC::computeQpOffDiagJacobian)
131 template <
typename Derived>
135 ::Kokkos::RangePolicy<ResidualLoop, ExecSpace, ::Kokkos::IndexType<ThreadID>> policy(
136 0, numKokkosBoundaryNodes());
137 ::Kokkos::parallel_for(policy, *static_cast<Derived *>(
this));
141 template <
typename Derived>
145 ::Kokkos::RangePolicy<JacobianLoop, ExecSpace, ::Kokkos::IndexType<ThreadID>> policy(
146 0, numKokkosBoundaryNodes());
147 ::Kokkos::parallel_for(policy, *static_cast<Derived *>(
this));
150 if (!_default_offdiag)
152 auto & sys = kokkosSystem(_kokkos_var.sys());
154 _thread.resize({sys.getCoupling(_kokkos_var.var()).size(), numKokkosBoundaryNodes()});
156 ::Kokkos::RangePolicy<OffDiagJacobianLoop, ExecSpace, ::Kokkos::IndexType<ThreadID>> policy(
158 ::Kokkos::parallel_for(policy, *static_cast<Derived *>(
this));
163 template <
typename Derived>
167 auto bc =
static_cast<const Derived *
>(
this);
168 auto node = kokkosBoundaryNodeID(tid);
169 auto & sys = kokkosSystem(_kokkos_var.sys());
171 if (!sys.isNodalDefined(node, _kokkos_var.var()))
174 Real local_re = bc->computeQpResidual(node);
176 accumulateTaggedNodalResidual(
false, local_re, node);
179 template <
typename Derived>
183 auto bc =
static_cast<const Derived *
>(
this);
184 auto node = kokkosBoundaryNodeID(tid);
185 auto & sys = kokkosSystem(_kokkos_var.sys());
187 if (!sys.isNodalDefined(node, _kokkos_var.var()))
190 Real local_ke = bc->computeQpJacobian(node);
193 accumulateTaggedNodalMatrix(
false, local_ke, node, _kokkos_var.var());
196 template <
typename Derived>
200 auto bc =
static_cast<const Derived *
>(
this);
201 auto node = kokkosBoundaryNodeID(_thread(tid, 1));
202 auto & sys = kokkosSystem(_kokkos_var.sys());
203 auto jvar = sys.getCoupling(_kokkos_var.var())[_thread(tid, 0)];
205 if (!sys.isNodalDefined(node, _kokkos_var.var()))
208 Real local_ke = bc->computeQpOffDiagJacobian(jvar, node);
210 accumulateTaggedNodalMatrix(
true, local_ke, node, jvar);
216 #define usingKokkosNodalBCMembers(T) \ 217 usingKokkosNodalBCBaseMembers; \ 220 using Moose::Kokkos::NodalBC<T>::_u; \ 223 using Moose::Kokkos::NodalBC<T>::operator() virtual void computeResidual() override
Dispatch residual calculation.
KOKKOS_FUNCTION void operator()(ResidualLoop, const ThreadID tid) const
The parallel computation entry functions called by Kokkos.
const InputParameters & parameters() const
Get the parameters of the object.
virtual void computeResidual() override
Compute this object's contribution to the residual.
NodalBC(const InputParameters ¶meters)
Constructor.
static InputParameters validParams()
dof_id_type ContiguousNodeID
The base class for Kokkos nodal boundary conditions.
void addMooseVariableDependency(MooseVariableFieldBase *var)
Call this function to add the passed in MooseVariableFieldBase as a variable that this object depends...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
KOKKOS_FUNCTION Real computeQpJacobian(const ContiguousNodeID) const
Default methods to prevent compile errors even when these methods were not defined in the derived cla...
KOKKOS_FUNCTION Real computeQpOffDiagJacobian(const unsigned int, const ContiguousNodeID) const
Compute off-diagonal Jacobian contribution on a node.
static InputParameters validParams()
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...
virtual void computeJacobian() override
Dispatch diagonal and off-diagonal Jacobian calculation.
virtual void computeJacobian() override
Compute this object's contribution to the diagonal Jacobian entries.
const VariableNodalValue _u
Current solution at nodes.
The base class for a user to derive their own Kokkos nodal boundary conditions.
const bool _default_offdiag
Flag whether computeQpOffDiagJacobian() was not defined in the derived class.