91 template <AccumulationMode mode = AccumulationMode::Atomic>
93 template <AccumulationMode mode = AccumulationMode::Atomic>
121template <LinearSystemContributionObject::AccumulationMode mode>
122KOKKOS_FUNCTION
inline void
124 const dof_id_type row)
const
130 auto & sys = kokkosSystem(
_var.
sys());
132 for (MOOSE_KOKKOS_INDEX_TYPE index = 0; index < tags_size; ++index)
135 if (sys.isResidualTagActive(tag))
138 ::Kokkos::atomic_add(&sys.getVectorDofValue(row, tag), value);
140 sys.getVectorDofValue(row, tag) += value;
145template <LinearSystemContributionObject::AccumulationMode mode>
146KOKKOS_FUNCTION
inline void
148 const dof_id_type row,
149 const dof_id_type col)
const
155 auto & sys = kokkosSystem(
_var.
sys());
157 for (MOOSE_KOKKOS_INDEX_TYPE index = 0; index < tags_size; ++index)
160 if (sys.isMatrixTagActive(tag))
163 ::Kokkos::atomic_add(&sys.getMatrixValue(row, col, tag), value);
165 sys.getMatrixValue(row, col, tag) += value;
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
Interface for objects that need to use functions.
Interface for notifications that the mesh has changed.
const InputParameters & parameters() const
Get the parameters of the object.
Every object that can be built by the factory should be derived from this class.
KOKKOS_FUNCTION index_type size() const
Get the total array size.
Base class for Kokkos objects that contribute to a linear system, i.e.
KOKKOS_FUNCTION void accumulateTaggedMatrix(Real value, dof_id_type row, dof_id_type col) const
FEProblemBase & _fe_problem
Reference to the finite element problem.
AccumulationMode
Whether tagged vector/matrix accumulation must use atomics.
Array< TagID > _matrix_tags
Matrix tags this object contributes to.
Variable _var
Kokkos variable.
LinearSystemContributionObject(const InputParameters ¶meters)
LinearSystemContributionObject(const LinearSystemContributionObject &object)
Variable variable() const
Get the Kokkos variable this object contributes to.
KOKKOS_FUNCTION void accumulateTaggedVector(Real value, dof_id_type row) const
virtual void computeRightHandSide()=0
Compute the right-hand side contributions of this object.
static InputParameters validParams()
Scalar< Real > _t
TODO: Move to TransientInterface.
std::unique_ptr< DispatcherBase > _matrix_dispatcher
Dispatcher for the matrix computation loop.
Array< TagID > _vector_tags
Vector (residual) tags this object contributes to.
std::unique_ptr< DispatcherBase > _rhs_dispatcher
Dispatcher for the right-hand side computation loop.
virtual void computeMatrix()=0
Compute the matrix contributions of this object.
The Kokkos interface that holds the host reference of the Kokkos mesh and copies it to device during ...
The Kokkos wrapper class that can hold the reference of an arithmetic scalar variable.
The Kokkos variable object that carries the coupled variable and tag information.
KOKKOS_FUNCTION unsigned int components() const
Get the number of components.
KOKKOS_FUNCTION unsigned int sys(unsigned int comp=0) const
Get the system number of a component.
Interface class for classes which interact with Postprocessors.
A class for creating restricted objects.
Interface for objects that needs transient capabilities.
Interface for objects that need to use UserObjects.
Tag dispatch type for the matrix computation loop.
Tag dispatch type for the right-hand side computation loop.