60 template <
typename Derived>
64 template <
typename Derived>
68 template <
typename Derived>
72 template <
typename Derived>
81 template <
typename Derived>
83 template <
typename Derived>
85 template <
typename Derived>
87 const FVDatum & datum,
const int bc_index,
const MOOSE_KOKKOS_INDEX_TYPE bc_face_index)
const;
88 template <
typename Derived>
90 template <
typename Derived>
92 const FVDatum & datum,
const int bc_index,
const MOOSE_KOKKOS_INDEX_TYPE bc_face_index)
const;
101 template <
typename Derived>
104 return &LinearFVFluxKernel::computeInternalMatrixContribution<Derived>;
107 template <
typename Derived>
110 return &LinearFVFluxKernel::computeInternalNeighborMatrixContribution<Derived>;
113 template <
typename Derived>
116 return &LinearFVFluxKernel::computeBoundaryMatrixContribution<Derived>;
155 const MOOSE_KOKKOS_INDEX_TYPE bc_face_index)
const;
158 const MOOSE_KOKKOS_INDEX_TYPE bc_face_index)
const;
161 const int bc_index,
const MOOSE_KOKKOS_INDEX_TYPE bc_face_index)
const;
164 const int bc_index,
const MOOSE_KOKKOS_INDEX_TYPE bc_face_index)
const;
182KOKKOS_FUNCTION
inline bool
188 const auto & sys = kokkosSystem(
_var.
sys());
192KOKKOS_FUNCTION
inline bool
195 return bc_index >= 0 &&
_bc_index.isAlloc() &&
200KOKKOS_FUNCTION
inline Real
202 const MOOSE_KOKKOS_INDEX_TYPE bc_face_index)
const
204 KOKKOS_ASSERT(bc_index >= 0);
205 return _bc_data[bc_index].value.coefficient[bc_face_index];
208KOKKOS_FUNCTION
inline Real
210 const MOOSE_KOKKOS_INDEX_TYPE bc_face_index)
const
212 KOKKOS_ASSERT(bc_index >= 0);
213 return _bc_data[bc_index].value.source[bc_face_index];
216KOKKOS_FUNCTION
inline Real
218 const int bc_index,
const MOOSE_KOKKOS_INDEX_TYPE bc_face_index)
const
220 KOKKOS_ASSERT(bc_index >= 0);
221 return _bc_data[bc_index].normal_gradient.coefficient[bc_face_index];
224KOKKOS_FUNCTION
inline Real
226 const MOOSE_KOKKOS_INDEX_TYPE bc_face_index)
const
228 KOKKOS_ASSERT(bc_index >= 0);
229 return _bc_data[bc_index].normal_gradient.source[bc_face_index];
232template <
typename Derived>
236 ::Kokkos::abort(
"Default computeInternalMatrixContribution() should never be called. Make sure "
237 "you properly redefined this method in your class without typos.");
242template <
typename Derived>
246 ::Kokkos::abort(
"Default computeInternalNeighborMatrixContribution() should never be called. "
247 "Make sure you properly redefined this method in your class without typos.");
252template <
typename Derived>
256 const MOOSE_KOKKOS_INDEX_TYPE)
const
258 ::Kokkos::abort(
"Default computeBoundaryMatrixContribution() should never be called. Make sure "
259 "you properly redefined this method in your class without typos.");
264template <
typename Derived>
268 ::Kokkos::abort(
"Default computeInternalRightHandSideContribution() should never be called. Make "
269 "sure you properly redefined this method in your class without typos.");
274template <
typename Derived>
278 const MOOSE_KOKKOS_INDEX_TYPE)
const
280 ::Kokkos::abort(
"Default computeBoundaryRightHandSideContribution() should never be called. Make "
281 "sure you properly redefined this method in your class without typos.");
286template <
typename Derived>
290 const Derived & kernel)
const
297 const auto & sys = kokkosSystem(
_var.
sys());
298 kernel.accumulateTaggedVector(
299 kernel.template computeInternalRightHandSideContribution<Derived>(datum),
300 sys.getElemLocalDofIndex(elem, 0,
_var.
var()));
303template <
typename Derived>
307 const Derived & kernel)
const
314 const auto & sys = kokkosSystem(
_var.
sys());
315 kernel.accumulateTaggedVector(kernel.template computeBoundaryRightHandSideContribution<Derived>(
316 datum, bc_index, bc_face_index),
317 sys.getElemLocalDofIndex(elem, 0,
_var.
var()));
320template <
typename Derived>
329 const auto var_num =
_var.
var();
330 const auto & sys = kokkosSystem(
_var.
sys());
331 const auto row = sys.getElemLocalDofIndex(elem, 0, var_num);
332 kernel.accumulateTaggedMatrix(kernel.template computeInternalMatrixContribution<Derived>(datum),
334 sys.getElemGlobalDofIndex(elem, 0, var_num));
335 kernel.accumulateTaggedMatrix(
336 kernel.template computeInternalNeighborMatrixContribution<Derived>(datum),
338 sys.getElemGlobalDofIndex(datum.
neighborID(), 0, var_num));
341template <
typename Derived>
350 const auto var_num =
_var.
var();
351 const auto & sys = kokkosSystem(
_var.
sys());
352 const auto row = sys.getElemLocalDofIndex(elem, 0, var_num);
353 kernel.accumulateTaggedMatrix(
354 kernel.template computeBoundaryMatrixContribution<Derived>(datum, bc_index, bc_face_index),
356 sys.getElemGlobalDofIndex(elem, 0, var_num));
dof_id_type ContiguousElementID
const InputParameters & parameters() const
Get the parameters of the object.
Device-side geometric context for finite volume kernels and boundary conditions.
Base class for Kokkos linear finite volume kernels that contribute on faces (flux terms).
std::unique_ptr< DispatcherBase > _boundary_matrix_dispatcher
KOKKOS_FUNCTION Real computeInternalMatrixContribution(const FVDatum &datum) const
Default methods to prevent compile errors when matrix/RHS contributions are not defined in the derive...
KOKKOS_FUNCTION void operator()(InternalRightHandSideLoop, const ThreadID tid, const Derived &kernel) const
KOKKOS_FUNCTION bool hasFaceNeighbor(const FVDatum &datum) const
Whether this face has a mesh neighbor on a subdomain where this kernel's variable is active.
KOKKOS_FUNCTION Real computeBoundaryRightHandSideContribution(const FVDatum &datum, const int bc_index, const MOOSE_KOKKOS_INDEX_TYPE bc_face_index) const
KOKKOS_FUNCTION Real computeInternalRightHandSideContribution(const FVDatum &datum) const
static auto defaultInternalNeighborMatrixContribution()
static auto defaultInternalMatrixContribution()
Functions used to check if users have overriden the matrix hook methods, whose calculations can be sk...
std::unique_ptr< DispatcherBase > _internal_rhs_dispatcher
KOKKOS_FUNCTION Real computeInternalNeighborMatrixContribution(const FVDatum &datum) const
static InputParameters validParams()
Array2D< int > _bc_index
Setup/debug map from (side, element) to compact boundary condition index.
static auto defaultBoundaryMatrixContribution()
virtual bool needsBoundaryNormalGradientData() const
Whether this kernel needs boundary normal gradient data from its boundary conditions.
KOKKOS_FUNCTION Real boundaryNormalGradientCoefficient(const int bc_index, const MOOSE_KOKKOS_INDEX_TYPE bc_face_index) const
Boundary normal gradient coefficient for this boundary face.
KOKKOS_FUNCTION Real boundaryValueSource(const int bc_index, const MOOSE_KOKKOS_INDEX_TYPE bc_face_index) const
Boundary value source for this boundary face.
virtual void computeRightHandSide() override
Compute the right-hand side contributions of this object.
KOKKOS_FUNCTION Real computeBoundaryMatrixContribution(const FVDatum &datum, const int bc_index, const MOOSE_KOKKOS_INDEX_TYPE bc_face_index) const
virtual bool hasInternalRightHandSideContribution() const
Whether this kernel has nonzero internal-face RHS contributions.
LinearFVFluxKernel(const InputParameters ¶meters)
std::unique_ptr< DispatcherBase > _internal_matrix_dispatcher
std::unique_ptr< DispatcherBase > _boundary_rhs_dispatcher
KOKKOS_FUNCTION Real boundaryValueCoefficient(const int bc_index, const MOOSE_KOKKOS_INDEX_TYPE bc_face_index) const
Boundary value coefficient for this boundary face.
Array< FaceID > _internal_face_ids
Directed internal element sides with an active variable on the neighbor element.
virtual void initialSetup() override
Gets called at the beginning of the simulation before this object is asked to do its job.
LinearFVFluxKernel(const LinearFVFluxKernel &object)
KOKKOS_FUNCTION Real boundaryNormalGradientSource(const int bc_index, const MOOSE_KOKKOS_INDEX_TYPE bc_face_index) const
Boundary normal gradient source for this boundary face.
Array< LinearFVBoundaryCondition::BoundaryData > _bc_data
Boundary condition data handles indexed by compact boundary condition index.
Array< BoundaryFaceID > _boundary_face_ids
Directed boundary element sides with active Kokkos boundary data.
KOKKOS_FUNCTION bool hasBoundaryData(const FVDatum &datum, const int bc_index) const
Whether this boundary face has a boundary condition data provider.
virtual void computeMatrix() override
Compute the matrix contributions of this object.
virtual bool needsBoundaryValueData() const
Whether this kernel needs boundary value data from its boundary conditions.
Base class for Kokkos linear finite volume kernels that contribute to the linear system.
Variable _var
Kokkos variable.
KOKKOS_FUNCTION ContiguousElementID neighborID() const
Get the contiguous neighbor element ID.
KOKKOS_FUNCTION ContiguousSubdomainID neighborSubdomain() const
Get the contiguous neighbor subdomain ID.
KOKKOS_FUNCTION unsigned int side() const
Get the side index.
KOKKOS_FUNCTION ContiguousElementID elemID() const
Get the contiguous element ID.
KOKKOS_FUNCTION bool hasNeighbor() const
Get whether the current side has a neighbor.
KOKKOS_FUNCTION const Mesh & kokkosMesh() const
Get the const reference of the Kokkos mesh.
KOKKOS_FUNCTION unsigned int components() const
Get the number of components.
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.
MOOSE_KOKKOS_INDEX_TYPE ThreadID
Directed boundary side and its compact boundary condition and BC-local face indices.
MOOSE_KOKKOS_INDEX_TYPE bc_face_index
bool operator<(const BoundaryFaceID &other) const
Tag dispatch type for boundary-face matrix computation.
Tag dispatch type for boundary-face right-hand side computation.
Tag dispatch type for internal-face matrix computation.
Tag dispatch type for internal-face right-hand side computation.