69 template <
typename Derived>
74 ::Kokkos::abort(
"Default precomputeQpJacobian() should never be called. Make sure you properly "
75 "redefined this method in your class without typos.");
89 template <
typename Derived>
96 "Default precomputeQpOffDiagJacobian() should never be called. Make sure you properly "
97 "redefined this method in your class without typos.");
109 template <
typename Derived>
112 return &KernelGrad::precomputeQpJacobian<Derived>;
114 template <
typename Derived>
117 return &KernelGrad::precomputeQpOffDiagJacobian<Derived>;
126 template <
typename Derived>
128 template <
typename Derived>
130 template <
typename Derived>
136template <
typename Derived>
142 [&](Real * local_re,
const unsigned int ib,
const unsigned int ie)
144 for (
unsigned int qp = 0; qp < datum.
n_qps(); ++qp)
146 Real3 value = datum.
J(qp).transpose() *
147 (datum.
JxW(qp) * kernel.template precomputeQpResidual<Derived>(qp, datum));
149 for (
unsigned int i = ib; i < ie; ++i)
155template <
typename Derived>
161 [&](Real * local_ke,
const unsigned int ib,
const unsigned int ie,
const unsigned int j)
163 for (
unsigned int qp = 0; qp < datum.
n_qps(); ++qp)
166 datum.
J(qp).transpose() *
167 (datum.
JxW(qp) * kernel.template precomputeQpJacobian<Derived>(j, qp, datum));
169 for (
unsigned int i = ib; i < ie; ++i)
175template <
typename Derived>
181 [&](Real * local_ke,
const unsigned int ib,
const unsigned int ie,
const unsigned int j)
183 for (
unsigned int qp = 0; qp < datum.
n_qps(); ++qp)
185 Real3 value = datum.
J(qp).transpose() *
186 (datum.
JxW(qp) * kernel.template precomputeQpOffDiagJacobian<Derived>(
187 j, datum.
jvar(), qp, datum));
189 for (
unsigned int i = ib; i < ie; ++i)
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 const Real33 & J(const unsigned int qp)
Get the inverse of Jacobian matrix | dxi/dx deta/dx dzeta/dx | | dxi/dy deta/dy dzeta/dy | | dxi/dz d...
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.
static InputParameters validParams()
KOKKOS_FUNCTION void computeJacobianInternal(const Derived &kernel, AssemblyDatum &datum) const
static auto defaultOffDiagJacobian()
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 gr...
KernelGrad(const InputParameters ¶meters)
Constructor.
static constexpr bool use_precompute_hooks
KernelGrad hooks factor out the test-function gradient.
static auto defaultJacobian()
Functions used to check if users have overriden the hook methods, whose calculations can be skipped w...
KOKKOS_FUNCTION void computeOffDiagJacobianInternal(const Derived &kernel, AssemblyDatum &datum) const
KOKKOS_FUNCTION Real3 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...
KOKKOS_FUNCTION Real3 precomputeQpOffDiagJacobian(const unsigned int, const unsigned int, const unsigned int, AssemblyDatum &) const
Compute off-diagonal Jacobian contribution on a quadrature point.
The base class for a user to derive their own Kokkos kernels.
const VariableTestGradient _grad_test
Gradient of the 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.
KOKKOS_FUNCTION const Real3 & reference(AssemblyDatum &datum, unsigned int i, unsigned int qp) const
Get the gradient of the current shape function in reference space.