15template<
typename SolutionVectorType>
18 ForwardEuler<SolutionVectorType>>
23 using ValueType =
typename SolutionVectorType::VectorValueType;
28 :
Base(schemeDict, solutionDict)
31 static std::string
name() {
return "forwardEuler"; }
33 static std::string
doc() {
return "first order time integration method"; }
35 static std::string
schema() {
return "none"; }
39 SolutionVectorType& solutionVector,
45 SolutionVectorType& oldSolutionVector =
48 solutionVector.internalVector() = oldSolutionVector.internalVector() - source * dt;
49 solutionVector.correctBoundaryConditions();
52 if (std::holds_alternative<NeoN::GPUExecutor>(eqn.
exec()))
56 oldSolutionVector.internalVector() = solutionVector.internalVector();
59 std::unique_ptr<TimeIntegratorBase<SolutionVectorType>>
clone()
const override
61 return std::make_unique<ForwardEuler>(*
this);
A class representing a dictionary that stores key-value pairs.
Vector< ValueType > explicitOperation(localIdx nCells) const
const Executor & exec() const
ForwardEuler(const Dictionary &schemeDict, const Dictionary &solutionDict)
static std::string name()
std::unique_ptr< TimeIntegratorBase< SolutionVectorType > > clone() const override
void solve(dsl::Expression< ValueType > &eqn, SolutionVectorType &solutionVector, scalar t, scalar dt) override
TimeIntegratorBase< SolutionVectorType >::template Register< ForwardEuler< SolutionVectorType > > Base
static std::string schema()
typename SolutionVectorType::VectorValueType ValueType
A template class for registering derived classes with a base class.
VectorType & oldTime(VectorType &field)
Retrieves the old time field of a given field.