110 template <
typename Derived>
112 KOKKOS_FUNCTION
void operator()(ResidualLoop,
const ThreadID tid,
const Derived & kernel)
const;
113 template <
typename Derived>
114 KOKKOS_FUNCTION
void operator()(JacobianLoop,
const ThreadID tid,
const Derived & kernel)
const;
115 template <
typename Derived>
131 template <
typename Derived>
138 template <
typename Derived>
145 template <
typename Derived>
177 template <
typename Derived>
190 kernel.computeResidualInternal(kernel, datum);
193 template <
typename Derived>
206 kernel.computeJacobianInternal(kernel, datum);
209 template <
typename Derived>
218 if (!sys.isVariableActive(jvar,
kokkosMesh().getElementInfo(elem).subdomain))
224 kernel.computeOffDiagJacobianInternal(kernel, datum);
227 template <
typename Derived>
233 [&](
Real * local_re,
const unsigned int ib,
const unsigned int ie)
235 for (
unsigned int qp = 0; qp < datum.
n_qps(); ++qp)
239 for (
unsigned int i = ib; i < ie; ++i)
240 local_re[i] += datum.
JxW(qp) * kernel.computeQpResidual(i, qp, datum);
245 template <
typename Derived>
251 [&](
Real * local_ke,
const unsigned int ijb,
const unsigned int ije)
253 for (
unsigned int qp = 0; qp < datum.
n_qps(); ++qp)
257 for (
unsigned int ij = ijb; ij < ije; ++ij)
259 unsigned int i = ij % datum.
n_jdofs();
260 unsigned int j = ij / datum.
n_jdofs();
262 local_ke[ij] += datum.
JxW(qp) * kernel.computeQpJacobian(i, j, qp, datum);
268 template <
typename Derived>
274 [&](
Real * local_ke,
const unsigned int ijb,
const unsigned int ije)
276 for (
unsigned int qp = 0; qp < datum.
n_qps(); ++qp)
280 for (
unsigned int ij = ijb; ij < ije; ++ij)
282 unsigned int i = ij % datum.
n_jdofs();
283 unsigned int j = ij / datum.
n_jdofs();
286 datum.
JxW(qp) * kernel.computeQpOffDiagJacobian(i, j, datum.
jvar(), qp, datum);
KOKKOS_FUNCTION Real computeQpOffDiagJacobian(const unsigned int, const unsigned int, const unsigned int, const unsigned int, AssemblyDatum &) const
Compute off-diagonal Jacobian contribution on a quadrature point.
KOKKOS_FUNCTION unsigned int sys(unsigned int comp=0) const
Get the system number of a component.
KOKKOS_FUNCTION void computeJacobianInternal(AssemblyDatum &datum, function body) const
The common loop structure template for computing elemental Jacobian.
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.
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 unsigned int jvar() const
Get the coupled variable number.
KOKKOS_FUNCTION Real computeQpJacobian(const unsigned int, const unsigned int, const unsigned int, AssemblyDatum &) const
Default methods to prevent compile errors even when these methods were not defined in the derived cla...
KOKKOS_FUNCTION unsigned int n_jdofs() const
Get the number of local DOFs for the coupled variable.
The Kokkos wrapper classes for MOOSE-like shape function access.
KOKKOS_FUNCTION void computeResidualInternal(const Derived &kernel, AssemblyDatum &datum) const
The parallel computation bodies that can be customized in the derived class by defining them in the d...
static auto defaultOffDiagJacobian()
Get the function pointer of the default computeQpOffDiagJacobian()
KOKKOS_FUNCTION void computeJacobianInternal(const Derived &kernel, AssemblyDatum &datum) const
Compute diagonal Jacobian.
KOKKOS_FUNCTION ContiguousElementID kokkosBlockElementID(ThreadID tid) const
Get the contiguous element ID this Kokkos thread is operating on.
static InputParameters validParams()
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.
KOKKOS_FUNCTION void computeOffDiagJacobianInternal(const Derived &kernel, AssemblyDatum &datum) const
Compute off-diagonal Jacobian.
const VariablePhiGradient _grad_phi
Gradient of the current shape function.
The Kokkos object that holds thread-private data in the parallel operations of Kokkos kernels...
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 void computeResidualInternal(AssemblyDatum &datum, function body) const
The common loop structure template for computing elemental residual.
KOKKOS_FUNCTION void reinit()
Reset the reinit flag.
KOKKOS_FUNCTION const Array< System > & kokkosSystems() const
Get the const reference of the Kokkos systems.