22template<
typename ValueType>
30 : exec_(exp.exec_), temporalOperators_(exp.temporalOperators_),
31 spatialOperators_(exp.spatialOperators_)
36 for (
auto& op : temporalOperators_)
40 for (
auto& op : spatialOperators_)
56 for (
auto& op : spatialOperators_)
60 op.explicitOperation(source);
68 for (
auto& op : temporalOperators_)
72 op.explicitOperation(source, t, dt);
81 auto ls = spatialOperators_[0].createEmptyLinearSystem();
82 for (
auto& op : spatialOperators_)
86 op.implicitOperation(ls);
94 for (
auto& op : temporalOperators_)
98 op.implicitOperation(ls, t, dt);
108 temporalOperators_.push_back(oper);
113 for (
auto& oper : equation.temporalOperators_)
115 temporalOperators_.push_back(oper);
117 for (
auto& oper : equation.spatialOperators_)
119 spatialOperators_.push_back(oper);
125 size_t size()
const {
return temporalOperators_.size() + spatialOperators_.size(); }
130 return temporalOperators_;
135 return spatialOperators_;
148 std::vector<TemporalOperator<ValueType>> temporalOperators_;
150 std::vector<SpatialOperator<ValueType>> spatialOperators_;
153template<
typename ValueType>
154[[nodiscard]]
inline Expression<ValueType>
161template<
typename ValueType>
162[[nodiscard]]
inline Expression<ValueType>
169template<
typename leftOperator,
typename rightOperator>
170[[nodiscard]]
inline Expression<typename leftOperator::FieldValueType>
173 using ValueType =
typename leftOperator::FieldValueType;
188template<
typename ValueType>
204template<
typename ValueType>
205[[nodiscard]]
inline Expression<ValueType>
212template<
typename ValueType>
213[[nodiscard]]
inline Expression<ValueType>
220template<
typename leftOperator,
typename rightOperator>
221[[nodiscard]]
inline Expression<typename leftOperator::FieldValueType>
224 using ValueType =
typename leftOperator::FieldValueType;
A class representing a dictionary that stores key-value pairs.
A class to contain the data and executors for a field and define some basic operations.
A class that represents a coefficient for the NeoFOAM dsl.
Field< ValueType > explicitOperation(Field< ValueType > &source, scalar t, scalar dt)
void addOperator(const SpatialOperator< ValueType > &oper)
const std::vector< TemporalOperator< ValueType > > & temporalOperators() const
const std::vector< SpatialOperator< ValueType > > & spatialOperators() const
const Executor & exec() const
la::LinearSystem< ValueType, localIdx > implicitOperation()
void addOperator(const TemporalOperator< ValueType > &oper)
std::vector< TemporalOperator< ValueType > > & temporalOperators()
Expression(const Executor &exec)
Field< ValueType > explicitOperation(Field< ValueType > &source)
void addExpression(const Expression &equation)
Expression(const Expression &exp)
Field< ValueType > explicitOperation(size_t nCells)
void build(const NeoFOAM::Dictionary &input)
std::vector< SpatialOperator< ValueType > > & spatialOperators()
void implicitOperation(la::LinearSystem< ValueType, localIdx > &ls, scalar t, scalar dt)
A class representing a linear system of equations.
Expression< ValueType > operator+(Expression< ValueType > lhs, const Expression< ValueType > &rhs)
Expression< ValueType > operator-(Expression< ValueType > lhs, const Expression< ValueType > &rhs)
Coeff operator*(const Coeff &lhs, const Coeff &rhs)
std::variant< SerialExecutor, CPUExecutor, GPUExecutor > Executor