22template<
typename ValueType>
30 : exec_(exp.exec_), temporalOperators_(exp.temporalOperators_),
31 spatialOperators_(exp.spatialOperators_)
37 for (
auto& op : temporalOperators_)
41 for (
auto& op : spatialOperators_)
57 for (
auto& op : spatialOperators_)
61 op.explicitOperation(source);
69 for (
auto& op : temporalOperators_)
73 op.explicitOperation(source, t, dt);
83 for (
auto& op : spatialOperators_)
87 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);
127 return static_cast<localIdx>(temporalOperators_.size() + spatialOperators_.size());
133 return temporalOperators_;
138 return spatialOperators_;
151 std::vector<TemporalOperator<ValueType>> temporalOperators_;
153 std::vector<SpatialOperator<ValueType>> spatialOperators_;
156template<
typename ValueType>
157[[nodiscard]]
inline Expression<ValueType>
164template<
typename ValueType>
165[[nodiscard]]
inline Expression<ValueType>
172template<
typename leftOperator,
typename rightOperator>
173[[nodiscard]]
inline Expression<typename leftOperator::VectorValueType>
176 using ValueType =
typename leftOperator::VectorValueType;
183template<
typename ValueType>
199template<
typename ValueType>
200[[nodiscard]]
inline Expression<ValueType>
207template<
typename ValueType>
208[[nodiscard]]
inline Expression<ValueType>
215template<
typename leftOperator,
typename rightOperator>
216[[nodiscard]]
inline Expression<typename leftOperator::VectorValueType>
219 using ValueType =
typename leftOperator::VectorValueType;
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 NeoN dsl.
const std::vector< TemporalOperator< ValueType > > & temporalOperators() const
void implicitOperation(la::LinearSystem< ValueType, localIdx > &ls)
Vector< ValueType > explicitOperation(localIdx nCells) const
Expression(const Executor &exec)
void implicitOperation(la::LinearSystem< ValueType, localIdx > &ls, scalar t, scalar dt)
void addOperator(const TemporalOperator< ValueType > &oper)
void addExpression(const Expression &equation)
Vector< ValueType > explicitOperation(Vector< ValueType > &source, scalar t, scalar dt) const
const std::vector< SpatialOperator< ValueType > > & spatialOperators() const
std::vector< SpatialOperator< ValueType > > & spatialOperators()
void addOperator(const SpatialOperator< ValueType > &oper)
Vector< ValueType > explicitOperation(Vector< ValueType > &source) const
Expression(const Expression &exp)
void read(const Dictionary &input)
const Executor & exec() const
std::vector< TemporalOperator< ValueType > > & temporalOperators()
A class representing a linear system of equations.
Expression< ValueType > operator+(Expression< ValueType > lhs, const Expression< ValueType > &rhs)
Coeff operator*(const Coeff &lhs, const Coeff &rhs)
Expression< ValueType > operator-(Expression< ValueType > lhs, const Expression< ValueType > &rhs)
std::variant< SerialExecutor, CPUExecutor, GPUExecutor > Executor