111 template <
typename Derived>
113 KOKKOS_FUNCTION
void operator()(ResidualLoop,
const ThreadID tid,
const Derived & kernel)
const;
114 template <
typename Derived>
115 KOKKOS_FUNCTION
void operator()(JacobianLoop,
const ThreadID tid,
const Derived & kernel)
const;
116 template <
typename Derived>
132 template <
typename Derived>
139 template <
typename Derived>
146 template <
typename Derived>
178 template <
typename Derived>
191 kernel.computeResidualInternal(kernel, datum);
194 template <
typename Derived>
207 kernel.computeJacobianInternal(kernel, datum);
210 template <
typename Derived>
219 if (!sys.isVariableActive(jvar,
kokkosMesh().getElementInfo(elem).subdomain))
225 kernel.computeOffDiagJacobianInternal(kernel, datum);
228 template <
typename Derived>
234 [&](
Real * local_re,
const unsigned int ib,
const unsigned int ie)
236 for (
unsigned int qp = 0; qp < datum.
n_qps(); ++qp)
240 for (
unsigned int i = ib; i < ie; ++i)
241 local_re[i] += datum.
JxW(qp) * kernel.computeQpResidual(i, qp, datum);
246 template <
typename Derived>
252 [&](
Real * local_ke,
const unsigned int ijb,
const unsigned int ije)
254 for (
unsigned int qp = 0; qp < datum.
n_qps(); ++qp)
258 for (
unsigned int ij = ijb; ij < ije; ++ij)
260 unsigned int i = ij % datum.
n_jdofs();
261 unsigned int j = ij / datum.
n_jdofs();
263 local_ke[ij] += datum.
JxW(qp) * kernel.computeQpJacobian(i, j, qp, datum);
269 template <
typename Derived>
275 [&](
Real * local_ke,
const unsigned int ijb,
const unsigned int ije)
277 for (
unsigned int qp = 0; qp < datum.
n_qps(); ++qp)
281 for (
unsigned int ij = ijb; ij < ije; ++ij)
283 unsigned int i = ij % datum.
n_jdofs();
284 unsigned int j = ij / datum.
n_jdofs();
287 datum.
JxW(qp) * kernel.computeQpOffDiagJacobian(i, j, datum.
jvar(), qp, datum);
KOKKOS_FUNCTION unsigned int n_jdofs() const
Get the number of local DOFs for the coupled variable.
KOKKOS_FUNCTION unsigned int sys(unsigned int comp=0) const
Get the system number of a component.
virtual void computeResidual() override
Dispatch residual calculation.
const unsigned int invalid_uint
KOKKOS_FUNCTION const Assembly & kokkosAssembly() const
Get the const reference of the Kokkos assembly.
KOKKOS_FUNCTION void computeJacobianInternal(ResidualDatum &datum, function body) const
The common loop structure template for computing elemental Jacobian.
static auto defaultJacobian()
Get the function pointer of the default computeQpJacobian()
const VariableValue _u
Current solution at quadrature points.
const InputParameters & parameters() const
Get the parameters of the object.
const VariableTestValue _test
Current test function.
Thread _thread
Kokkos thread object.
KOKKOS_FUNCTION Real computeQpJacobian(const unsigned int, const unsigned int, const unsigned int, ResidualDatum &) const
Default methods to prevent compile errors even when these methods were not defined in the derived cla...
The Kokkos wrapper classes for MOOSE-like shape function access.
static auto defaultOffDiagJacobian()
Get the function pointer of the default computeQpOffDiagJacobian()
KOKKOS_FUNCTION void computeJacobianInternal(const Derived &kernel, ResidualDatum &datum) const
Compute diagonal Jacobian.
KOKKOS_FUNCTION Real computeQpOffDiagJacobian(const unsigned int, const unsigned int, const unsigned int, const unsigned int, ResidualDatum &) const
Compute off-diagonal Jacobian contribution on a quadrature point.
KOKKOS_FUNCTION ContiguousElementID kokkosBlockElementID(ThreadID tid) const
Get the contiguous element ID this Kokkos thread is operating on.
static InputParameters validParams()
KOKKOS_FUNCTION void computeResidualInternal(const Derived &kernel, ResidualDatum &datum) const
The parallel computation bodies that can be customized in the derived class by defining them in the d...
KOKKOS_FUNCTION void operator()(ResidualLoop, const ThreadID tid, const Derived &kernel) const
The parallel computation entry functions called by Kokkos.
KOKKOS_FUNCTION unsigned int n_qps() const
Get the number of local quadrature points.
KOKKOS_FUNCTION const System & kokkosSystem(unsigned int sys) const
Get the const reference of a Kokkos system.
The base class for Kokkos kernels.
const VariableGradient _grad_u
Gradient of the current solution at quadrature points.
virtual void computeJacobian() override
Dispatch diagonal and off-diagonal Jacobian calculation.
KOKKOS_FUNCTION const Mesh & kokkosMesh() const
Get the const reference of the Kokkos mesh.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const VariableTestGradient _grad_test
Gradient of the current test function.
Kernel(const InputParameters ¶meters)
Constructor.
const VariablePhiGradient _grad_phi
Gradient of the current shape function.
KOKKOS_FUNCTION void computeResidualInternal(ResidualDatum &datum, function body) const
The common loop structure template for computing elemental residual.
KOKKOS_FUNCTION void computeOffDiagJacobianInternal(const Derived &kernel, ResidualDatum &datum) const
Compute off-diagonal Jacobian.
KOKKOS_FUNCTION Real JxW(const unsigned int qp)
Get the transformed Jacobian weight.
Variable _kokkos_var
Kokkos variable.
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...
The Kokkos wrapper classes for MOOSE-like variable value access.
KOKKOS_FUNCTION unsigned int var(unsigned int comp=0) const
Get the variable number of a component.
const VariablePhiValue _phi
Current shape function.
The base class for a user to derive their own Kokkos kernels.
KOKKOS_FUNCTION const auto & getCoupling(unsigned int var) const
Get the list of off-diagonal coupled variable numbers of a variable.
KOKKOS_FUNCTION unsigned int jvar() const
Get the coupled variable number.
The Kokkos object that holds thread-private data in the parallel operations of Kokkos residual object...
KOKKOS_FUNCTION void reinit()
Reset the reinit flag.
KOKKOS_FUNCTION const Array< System > & kokkosSystems() const
Get the const reference of the Kokkos systems.