53 template <
typename Derived>
59 ::Kokkos::abort(
"Default computeQpJacobian() should never be called. Make sure you properly "
60 "redefined this method in your class without typos.");
74 template <
typename Derived>
82 "Default computeQpOffDiagJacobian() should never be called. Make sure you properly "
83 "redefined this method in your class without typos.");
95 template <
typename Derived>
98 return &VectorKernel::computeQpJacobian<Derived>;
100 template <
typename Derived>
103 return &VectorKernel::computeQpOffDiagJacobian<Derived>;
111 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>
177template <
typename Derived>
192 kernel.computeResidualInternal(kernel, datum);
195template <
typename Derived>
210 kernel.computeJacobianInternal(kernel, datum);
213template <
typename Derived>
222 if (!sys.isVariableActive(jvar,
kokkosMesh().getElementInfo(elem).subdomain))
230 kernel.computeOffDiagJacobianInternal(kernel, datum);
233template <
typename Derived>
239 [&](Real * local_re,
const unsigned int ib,
const unsigned int ie)
241 for (
unsigned int qp = 0; qp < datum.
n_qps(); ++qp)
242 for (
unsigned int i = ib; i < ie; ++i)
243 local_re[i] += datum.
JxW(qp) * kernel.template computeQpResidual<Derived>(i, qp, datum);
247template <
typename Derived>
253 [&](Real * local_ke,
const unsigned int ib,
const unsigned int ie,
const unsigned int j)
255 for (
unsigned int qp = 0; qp < datum.
n_qps(); ++qp)
256 for (
unsigned int i = ib; i < ie; ++i)
258 datum.
JxW(qp) * kernel.template computeQpJacobian<Derived>(i, j, qp, datum);
262template <
typename Derived>
268 [&](Real * local_ke,
const unsigned int ib,
const unsigned int ie,
const unsigned int j)
270 for (
unsigned int qp = 0; qp < datum.
n_qps(); ++qp)
271 for (
unsigned int i = ib; i < ie; ++i)
272 local_ke[i] += datum.
JxW(qp) * kernel.template computeQpOffDiagJacobian<Derived>(
273 i, j, datum.
jvar(), qp, datum);
KOKKOS_FUNCTION ContiguousElementID kokkosBlockElementID(Moose::Kokkos::ThreadID tid) const
Get the contiguous element ID this Kokkos thread is operating on.
const InputParameters & parameters() const
Get the parameters of the object.
The Kokkos object that holds thread-private data in the parallel operations of Kokkos kernels.
KOKKOS_FUNCTION unsigned int jvar() const
Get the coupled variable number.
KOKKOS_FUNCTION const Assembly & kokkosAssembly() const
Get the const reference of the Kokkos assembly.
KOKKOS_FUNCTION Real JxW(const unsigned int qp)
Get the transformed Jacobian weight.
KOKKOS_FUNCTION void set_local_parallel(const unsigned int local_thread_id, const unsigned int num_local_threads)
Set local parallelization option.
KOKKOS_FUNCTION unsigned int n_qps() const
Get the number of local quadrature points.
The base class for Kokkos kernels.
KOKKOS_FUNCTION const Mesh & kokkosMesh() const
Get the const reference of the Kokkos mesh.
Variable _kokkos_var
Kokkos variable.
Thread _thread
Kokkos thread object.
KOKKOS_FUNCTION void computeJacobianInternal(AssemblyDatum &datum, function body) const
The common loop structure template for computing elemental Jacobian.
KOKKOS_FUNCTION void computeResidualInternal(AssemblyDatum &datum, function body) const
The common loop structure template for computing elemental residual.
KOKKOS_FUNCTION thread_id_type size() const
Get the total thread pool size.
KOKKOS_FUNCTION unsigned int var(unsigned int comp=0) const
Get the variable number of a component.
KOKKOS_FUNCTION unsigned int sys(unsigned int comp=0) const
Get the system number of a component.
The base class for a user to derive their own Kokkos vector kernels on vector variables.
const VectorVariableValue _u
Current vector solution at quadrature points.
const VectorVariableTestValue _test
Current vector test function.
static InputParameters validParams()
static auto defaultOffDiagJacobian()
const VectorVariableGradient _grad_u
Gradient of the current vector solution at quadrature points.
const VectorVariablePhiGradient _grad_phi
Gradient of the current vector shape function.
KOKKOS_FUNCTION void computeJacobianInternal(const Derived &kernel, AssemblyDatum &datum) const
Compute diagonal Jacobian.
virtual void computeJacobian() override
Dispatch diagonal and off-diagonal Jacobian calculation.
VectorKernel(const InputParameters ¶meters)
Constructor.
KOKKOS_FUNCTION void computeOffDiagJacobianInternal(const Derived &kernel, AssemblyDatum &datum) const
Compute off-diagonal Jacobian.
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...
virtual void computeResidual() override
Dispatch residual calculation.
KOKKOS_FUNCTION void operator()(ResidualLoop, const ThreadID tid, const Derived &kernel) const
The parallel computation entry functions called by Kokkos.
static auto defaultJacobian()
Functions used to check if users have overriden the hook methods, whose calculations can be skipped w...
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 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...
const VectorVariableTestGradient _grad_test
Gradient of the current vector test function.
const VectorVariablePhiValue _phi
Current vector shape function.
MOOSE_KOKKOS_INDEX_TYPE ThreadID
const unsigned int invalid_uint