110 template <
typename Derived>
113 const unsigned int i,
114 const unsigned int qp,
117 return bc.computeQpResidual(i, qp, datum);
119 template <
typename Derived>
121 const unsigned int i,
122 const unsigned int j,
123 const unsigned int qp,
126 return bc.computeQpJacobian(i, j, qp, datum);
128 template <
typename Derived>
130 const unsigned int i,
131 const unsigned int j,
132 const unsigned int jvar,
133 const unsigned int qp,
136 return bc.computeQpOffDiagJacobian(i, j, jvar, qp, datum);
143 template <
typename Derived>
145 KOKKOS_FUNCTION
void operator()(ResidualLoop,
const ThreadID tid,
const Derived & bc)
const;
146 template <
typename Derived>
147 KOKKOS_FUNCTION
void operator()(JacobianLoop,
const ThreadID tid,
const Derived & bc)
const;
148 template <
typename Derived>
164 template <
typename Derived>
171 template <
typename Derived>
178 template <
typename Derived>
210 template <
typename Derived>
219 bc.computeResidualInternal(bc, datum);
222 template <
typename Derived>
231 bc.computeJacobianInternal(bc, datum);
234 template <
typename Derived>
243 if (!sys.isVariableActive(jvar,
kokkosMesh().getElementInfo(elem).subdomain))
248 bc.computeOffDiagJacobianInternal(bc, datum);
251 template <
typename Derived>
257 [&](
Real * local_re,
const unsigned int ib,
const unsigned int ie)
259 for (
unsigned int qp = 0; qp < datum.
n_qps(); ++qp)
263 for (
unsigned int i = ib; i < ie; ++i)
264 local_re[i] += datum.
JxW(qp) * bc.computeQpResidualShim(bc, i, 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();
286 local_ke[ij] += datum.
JxW(qp) * bc.computeQpJacobianShim(bc, i, j, qp, datum);
292 template <
typename Derived>
298 [&](
Real * local_ke,
const unsigned int ijb,
const unsigned int ije)
300 for (
unsigned int qp = 0; qp < datum.
n_qps(); ++qp)
304 for (
unsigned int ij = ijb; ij < ije; ++ij)
306 unsigned int i = ij % datum.
n_jdofs();
307 unsigned int j = ij / datum.
n_jdofs();
310 datum.
JxW(qp) * bc.computeQpOffDiagJacobianShim(bc, i, j, datum.
jvar(), qp, datum);
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.
KOKKOS_FUNCTION Real computeQpJacobianShim(const Derived &bc, const unsigned int i, const unsigned int j, const unsigned int qp, AssemblyDatum &datum) const
KOKKOS_FUNCTION void computeResidualInternal(const Derived &bc, AssemblyDatum &datum) const
The parallel computation bodies that can be customized in the derived class by defining them in the d...
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()
The base class for a user to derive their own Kokkos integrated boundary conditions.
KOKKOS_FUNCTION Real computeQpResidualShim(const Derived &bc, const unsigned int i, const unsigned int qp, AssemblyDatum &datum) const
Shims for hook methods that can be leveraged to implement static polymorphism.
const InputParameters & parameters() const
Get the parameters of the object.
Thread _thread
Kokkos thread object.
The base class for Kokkos integrated boundary conditions.
KOKKOS_FUNCTION unsigned int jvar() const
Get the coupled variable number.
KOKKOS_FUNCTION unsigned int n_jdofs() const
Get the number of local DOFs for the coupled variable.
const VariableValue _u
Current solution at quadrature points.
The Kokkos wrapper classes for MOOSE-like shape function access.
const VariableGradient _grad_u
Gradient of the current solution at quadrature points.
const VariablePhiGradient _grad_phi
Gradient of the current shape function.
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 n_qps() const
Get the number of local quadrature points.
KOKKOS_FUNCTION void operator()(ResidualLoop, const ThreadID tid, const Derived &bc) const
The parallel computation entry functions called by Kokkos.
KOKKOS_FUNCTION const System & kokkosSystem(unsigned int sys) const
Get the const reference of a Kokkos system.
const VariableTestGradient _grad_test
Gradient of the current test function.
static auto defaultOffDiagJacobian()
Get the function pointer of the default computeQpOffDiagJacobian()
const VariableTestValue _test
Current test function.
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
KOKKOS_FUNCTION void computeOffDiagJacobianInternal(const Derived &bc, AssemblyDatum &datum) const
Compute off-diagonal Jacobian.
KOKKOS_FUNCTION void computeJacobianInternal(const Derived &bc, AssemblyDatum &datum) const
Compute diagonal Jacobian.
KOKKOS_FUNCTION Real computeQpOffDiagJacobianShim(const Derived &bc, const unsigned int i, const unsigned int j, const unsigned int jvar, const unsigned int qp, AssemblyDatum &datum) const
KOKKOS_FUNCTION auto kokkosBoundaryElementSideID(ThreadID tid) const
Get the contiguous element ID - side index pair this Kokkos thread is operating on.
virtual void computeJacobian() override
Dispatch diagonal and off-diagonal Jacobian calculation.
const VariablePhiValue _phi
Current shape function.
The Kokkos object that holds thread-private data in the parallel operations of Kokkos kernels...
virtual void computeResidual() override
Dispatch residual calculation.
KOKKOS_FUNCTION Real JxW(const unsigned int qp)
Get the transformed Jacobian weight.
Variable _kokkos_var
Kokkos variable.
static InputParameters validParams()
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 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 var(unsigned int comp=0) const
Get the variable number of a component.
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.
IntegratedBC(const InputParameters ¶meters)
Constructor.
KOKKOS_FUNCTION const Array< System > & kokkosSystems() const
Get the const reference of the Kokkos systems.