68 template <
typename Derived>
73 ::Kokkos::abort(
"Default precomputeQpJacobian() should never be called. Make sure you properly "
74 "redefined this method in your class without typos.");
88 template <
typename Derived>
95 "Default precomputeQpOffDiagJacobian() should never be called. Make sure you properly "
96 "redefined this method in your class without typos.");
108 template <
typename Derived>
111 return &KernelValue::precomputeQpJacobian<Derived>;
113 template <
typename Derived>
116 return &KernelValue::precomputeQpOffDiagJacobian<Derived>;
125 template <
typename Derived>
127 template <
typename Derived>
129 template <
typename Derived>
135template <
typename Derived>
141 [&](Real * local_re,
const unsigned int ib,
const unsigned int ie)
143 for (
unsigned int qp = 0; qp < datum.
n_qps(); ++qp)
145 Real value = datum.
JxW(qp) * kernel.template precomputeQpResidual<Derived>(qp, datum);
147 for (
unsigned int i = ib; i < ie; ++i)
148 local_re[i] += value *
_test(datum, i, qp);
153template <
typename Derived>
159 [&](Real * local_ke,
const unsigned int ib,
const unsigned int ie,
const unsigned int j)
161 for (
unsigned int qp = 0; qp < datum.
n_qps(); ++qp)
163 Real value = datum.
JxW(qp) * kernel.template precomputeQpJacobian<Derived>(j, qp, datum);
165 for (
unsigned int i = ib; i < ie; ++i)
166 local_ke[i] += value *
_test(datum, i, qp);
171template <
typename Derived>
177 [&](Real * local_ke,
const unsigned int ib,
const unsigned int ie,
const unsigned int j)
179 for (
unsigned int qp = 0; qp < datum.
n_qps(); ++qp)
181 Real value = datum.
JxW(qp) * kernel.template precomputeQpOffDiagJacobian<Derived>(
182 j, datum.
jvar(), qp, datum);
184 for (
unsigned int i = ib; i < ie; ++i)
185 local_ke[i] += value *
_test(datum, i, qp);
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 Real JxW(const unsigned int qp)
Get the transformed Jacobian weight.
KOKKOS_FUNCTION unsigned int n_qps() const
Get the number of local quadrature points.
The base class for a user to derive their own Kokkos kernels where the residual is of the form.
KernelValue(const InputParameters ¶meters)
Constructor.
static InputParameters validParams()
KOKKOS_FUNCTION Real precomputeQpOffDiagJacobian(const unsigned int, const unsigned int, const unsigned int, AssemblyDatum &) const
Compute off-diagonal Jacobian contribution on a quadrature point.
static auto defaultJacobian()
Functions used to check if users have overriden the hook methods, whose calculations can be skipped w...
static constexpr bool use_precompute_hooks
KernelValue hooks factor out the test function.
KOKKOS_FUNCTION void computeOffDiagJacobianInternal(const Derived &kernel, AssemblyDatum &datum) const
static auto defaultOffDiagJacobian()
KOKKOS_FUNCTION void computeJacobianInternal(const Derived &kernel, AssemblyDatum &datum) const
KOKKOS_FUNCTION void computeResidualInternal(const Derived &kernel, AssemblyDatum &datum) const
The parallel computation bodies that hide the base class methods to optimize for factoring out the te...
KOKKOS_FUNCTION Real precomputeQpJacobian(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...
The base class for a user to derive their own Kokkos kernels.
const VariableTestValue _test
Current test function.
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.