21template<
typename ValueType>
29 : exec_(exp.exec_), temporalOperators_(exp.temporalOperators_),
30 spatialOperators_(exp.spatialOperators_)
35 for (
auto& op : temporalOperators_)
39 for (
auto& op : spatialOperators_)
55 for (
auto& op : spatialOperators_)
59 op.explicitOperation(source);
67 for (
auto& op : temporalOperators_)
71 op.explicitOperation(source, t, dt);
81 for (
auto& op : spatialOperators_)
85 op.implicitOperation(ls);
92 for (
auto& op : temporalOperators_)
96 op.implicitOperation(ls, t, dt);
106 temporalOperators_.push_back(oper);
111 for (
auto& oper : equation.temporalOperators_)
113 temporalOperators_.push_back(oper);
115 for (
auto& oper : equation.spatialOperators_)
117 spatialOperators_.push_back(oper);
125 return static_cast<localIdx>(temporalOperators_.size() + spatialOperators_.size());
131 return temporalOperators_;
136 return spatialOperators_;
149 std::vector<TemporalOperator<ValueType>> temporalOperators_;
151 std::vector<SpatialOperator<ValueType>> spatialOperators_;
154template<
typename ValueType>
155[[nodiscard]]
inline Expression<ValueType>
162template<
typename ValueType>
163[[nodiscard]]
inline Expression<ValueType>
170template<
typename leftOperator,
typename rightOperator>
171[[nodiscard]]
inline Expression<typename leftOperator::VectorValueType>
174 using ValueType =
typename leftOperator::VectorValueType;
181template<
typename ValueType>
197template<
typename ValueType>
198[[nodiscard]]
inline Expression<ValueType>
205template<
typename ValueType>
206[[nodiscard]]
inline Expression<ValueType>
213template<
typename leftOperator,
typename rightOperator>
214[[nodiscard]]
inline Expression<typename leftOperator::VectorValueType>
217 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
void build(const Dictionary &input)
Expression(const Expression &exp)
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