18template<
typename ValueType>
32 field.
exec(),
dsl::Coeff(1.0), field, termType
34 coefficients_(coefficients),
41 auto [sourceSpan, fieldSpan, coeff] =
46 KOKKOS_LAMBDA(
const size_t celli) {
47 sourceSpan[celli] += operatorScaling[celli] * coeff[celli] * fieldSpan[celli];
55 auto [A, b, sp] = ls.
view();
56 const auto&
exec = A.exec();
72 const auto [diagOffs, coeff] =
74 auto [values, cols, rows] = ls.
matrix().span().span();
79 KOKKOS_LAMBDA(
const size_t celli) {
80 std::size_t idx = rows[celli] + diagOffs[celli];
82 operatorScaling[celli] * coeff[celli] * vol[celli] * one<ValueType>();
93 std::string
getName()
const {
return "DivOperator"; }
98 const std::shared_ptr<SparsityPattern> sparsityPattern_;
A class to contain the data and executors for a field and define some basic operations.
std::pair< size_t, size_t > range() const
Gets the range of the field.
const Executor & exec() const
Gets the executor associated with the field.
std::span< ValueType > span() &&=delete
const scalarField & cellVolumes() const
Get the field of cell volumes in the mesh.
OperatorMixin(const Executor exec, const Coeff &coeffs, VolumeField< ValueType > &field, Operator::Type type)
virtual const Executor & exec() const final
VolumeField< ValueType > & field_
const UnstructuredMesh & mesh() const
Returns a const reference to the unstructured mesh object.
const Field< ValueType > & internalField() const
Returns a const reference to the internal field.
void implicitOperation(la::LinearSystem< ValueType, localIdx > &ls)
void explicitOperation(Field< ValueType > &source)
SourceTerm(dsl::Operator::Type termType, VolumeField< scalar > &coefficients, VolumeField< ValueType > &field)
std::string getName() const
la::LinearSystem< ValueType, localIdx > createEmptyLinearSystem() const
void build(const Input &input)
Represents a volume field in a finite volume method.
A class representing a linear system of equations.
const Executor & exec() const
LinearSystemView< ValueType, IndexType > view()
std::string sparsityPattern() const
CSRMatrix< ValueType, IndexType > & matrix()
std::variant< Dictionary, TokenList > Input
void parallelFor(const Executor &exec, std::pair< size_t, size_t > range, Kernel kernel, std::string name="parallelFor")
auto spans(Args &... fields)