44 template <
typename Derived>
51 ::Kokkos::abort(
"Default computeQpJacobian() should never be called. Make sure you properly " 52 "redefined this method in your class without typos.");
56 template <
typename Derived>
64 "Default computeQpOffDiagJacobian() should never be called. Make sure you properly " 65 "redefined this method in your class without typos.");
75 template <
typename Derived>
79 return &VectorIntegratedBC::computeQpJacobian<Derived>;
81 template <
typename Derived>
84 return &VectorIntegratedBC::computeQpOffDiagJacobian<Derived>;
91 template <
typename Derived>
93 KOKKOS_FUNCTION
void operator()(ResidualLoop,
const ThreadID tid,
const Derived & bc)
const;
94 template <
typename Derived>
95 KOKKOS_FUNCTION
void operator()(JacobianLoop,
const ThreadID tid,
const Derived & bc)
const;
96 template <
typename Derived>
105 template <
typename Derived>
108 template <
typename Derived>
110 template <
typename Derived>
142 template <
typename Derived>
153 bc.computeResidualInternal(bc, datum);
156 template <
typename Derived>
167 bc.computeJacobianInternal(bc, datum);
170 template <
typename Derived>
179 if (!sys.isVariableActive(jvar,
kokkosMesh().getElementInfo(elem).subdomain))
186 bc.computeOffDiagJacobianInternal(bc, datum);
189 template <
typename Derived>
195 [&](
Real * local_re,
const unsigned int ib,
const unsigned int ie)
197 for (
unsigned int qp = 0; qp < datum.
n_qps(); ++qp)
198 for (
unsigned int i = ib; i < ie; ++i)
199 local_re[i] += datum.
JxW(qp) * bc.template computeQpResidual<Derived>(i, qp, datum);
203 template <
typename Derived>
209 [&](
Real * local_ke,
const unsigned int ib,
const unsigned int ie,
const unsigned int j)
211 for (
unsigned int qp = 0; qp < datum.
n_qps(); ++qp)
212 for (
unsigned int i = ib; i < ie; ++i)
213 local_ke[i] += datum.
JxW(qp) * bc.template computeQpJacobian<Derived>(i, j, qp, datum);
217 template <
typename Derived>
223 [&](
Real * local_ke,
const unsigned int ib,
const unsigned int ie,
const unsigned int j)
225 for (
unsigned int qp = 0; qp < datum.
n_qps(); ++qp)
226 for (
unsigned int i = ib; i < ie; ++i)
227 local_ke[i] += datum.
JxW(qp) * bc.template computeQpOffDiagJacobian<Derived>(
228 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 void set_local_parallel(const unsigned int local_thread_id, const unsigned int num_local_threads)
Set local parallelization option.
KOKKOS_FUNCTION void computeOffDiagJacobianInternal(const Derived &bc, AssemblyDatum &datum) const
KOKKOS_FUNCTION const Assembly & kokkosAssembly() const
Get the const reference of the Kokkos assembly.
static auto defaultOffDiagJacobian()
KOKKOS_FUNCTION void operator()(ResidualLoop, const ThreadID tid, const Derived &bc) const
The parallel computation entry functions called by Kokkos.
static InputParameters validParams()
const InputParameters & parameters() const
Get the parameters of the object.
KOKKOS_FUNCTION Real computeQpOffDiagJacobian(const unsigned int, const unsigned int, const unsigned int, const unsigned int, AssemblyDatum &) const
KOKKOS_FUNCTION void computeJacobianInternal(const Derived &bc, AssemblyDatum &datum) const
Thread _thread
Kokkos thread object.
The base class for Kokkos integrated boundary conditions.
KOKKOS_FUNCTION unsigned int jvar() const
Get the coupled variable number.
MOOSE_KOKKOS_INDEX_TYPE ThreadID
const VectorVariablePhiValue _phi
Current vector shape function.
const VectorVariablePhiGradient _grad_phi
Gradient of the current vector shape function.
KOKKOS_FUNCTION unsigned int n_qps() const
Get the number of local quadrature points.
const VectorVariableValue _u
Current vector solution at quadrature points.
const VectorVariableTestGradient _grad_test
Gradient of the current vector test function.
KOKKOS_FUNCTION const Mesh & kokkosMesh() const
Get the const reference of the Kokkos mesh.
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 auto kokkosBoundaryElementSideID(Moose::Kokkos::ThreadID tid) const
Get the contiguous element ID - side index pair this Kokkos thread is operating on.
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...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
The base class for a user to derive their own Kokkos integrated boundary conditions on vector variabl...
virtual void computeJacobian() override
Dispatch diagonal and off-diagonal Jacobian calculation.
static auto defaultJacobian()
Functions used to check if users have overriden the hook methods, whose calculations can be skipped w...
The Kokkos object that holds thread-private data in the parallel operations of Kokkos kernels...
VectorIntegratedBC(const InputParameters ¶meters)
Constructor.
KOKKOS_FUNCTION Real JxW(const unsigned int qp)
Get the transformed Jacobian weight.
Variable _kokkos_var
Kokkos variable.
KOKKOS_FUNCTION unsigned int var(unsigned int comp=0) const
Get the variable number of a component.
KOKKOS_FUNCTION thread_id_type size() const
Get the total thread pool size.
virtual void computeResidual() override
Dispatch residual calculation.
KOKKOS_FUNCTION void computeResidualInternal(AssemblyDatum &datum, function body) const
The common loop structure template for computing elemental residual.
const VectorVariableTestValue _test
Current vector test function.
const VectorVariableGradient _grad_u
Gradient of the current vector solution at quadrature points.