22template<
typename SolutionVectorType>
25 BackwardEuler<SolutionVectorType>>
30 using ValueType =
typename SolutionVectorType::VectorValueType;
35 :
Base(schemeDict, solutionDict)
38 static std::string
name() {
return "backwardEuler"; }
40 static std::string
doc() {
return "first order time integration method"; }
42 static std::string
schema() {
return "none"; }
46 SolutionVectorType& solutionVector,
68 auto values = ls.matrix().values();
72 solver.solve(ls, solutionVector.internalVector());
75 if (std::holds_alternative<NeoN::GPUExecutor>(eqn.
exec()))
79 oldSolutionVector.internalVector() = solutionVector.internalVector();
82 std::unique_ptr<TimeIntegratorBase<SolutionVectorType>>
clone()
const override
84 return std::make_unique<BackwardEuler>(*
this);
A class representing a dictionary that stores key-value pairs.
void implicitOperation(la::LinearSystem< ValueType, localIdx > &ls)
Vector< ValueType > explicitOperation(localIdx nCells) const
const Executor & exec() const
BackwardEuler(const Dictionary &schemeDict, const Dictionary &solutionDict)
TimeIntegratorBase< SolutionVectorType >::template Register< BackwardEuler< SolutionVectorType > > Base
std::unique_ptr< TimeIntegratorBase< SolutionVectorType > > clone() const override
void solve(dsl::Expression< ValueType > &eqn, SolutionVectorType &solutionVector, scalar t, scalar dt) override
typename SolutionVectorType::VectorValueType ValueType
static std::string name()
static std::string schema()
A template class for registering derived classes with a base class.
VectorType & oldTime(VectorType &field)
Retrieves the old time field of a given field.
LinearSystem< ValueType, IndexType > createEmptyLinearSystem(const SparsityType &sparsity)