20template<
typename SolutionFieldType>
23 BackwardEuler<SolutionFieldType>>
28 using ValueType =
typename SolutionFieldType::FieldValueType;
33 :
Base(schemeDict, solutionDict)
36 static std::string
name() {
return "backwardEuler"; }
38 static std::string
doc() {
return "first order time integration method"; }
40 static std::string
schema() {
return "none"; }
44 SolutionFieldType& solutionField,
50 SolutionFieldType& oldSolutionField =
56 using ValueType =
typename SolutionFieldType::ElementType;
63 NeoFOAM::la::ginkgo::BiCGStab<ValueType> solver(solutionField.exec(), this->solutionDict_);
64 solver.solve(ginkgoLs, solutionField.internalField());
67 if (std::holds_alternative<NeoFOAM::GPUExecutor>(eqn.
exec()))
71 oldSolutionField.internalField() = solutionField.internalField();
74 std::unique_ptr<TimeIntegratorBase<SolutionFieldType>>
clone()
const override
76 return std::make_unique<BackwardEuler>(*
this);
A class representing a dictionary that stores key-value pairs.
const Executor & exec() const
la::LinearSystem< ValueType, localIdx > implicitOperation()
Field< ValueType > explicitOperation(size_t nCells)
std::span< ValueType > values()
Get a span to the values array.
CSRMatrix< ValueType, IndexType > & matrix()
void solve(dsl::Expression< ValueType > &eqn, SolutionFieldType &solutionField, scalar t, scalar dt) override
TimeIntegratorBase< SolutionFieldType >::template Register< BackwardEuler< SolutionFieldType > > Base
BackwardEuler(const Dictionary &schemeDict, const Dictionary &solutionDict)
std::unique_ptr< TimeIntegratorBase< SolutionFieldType > > clone() const override
static std::string schema()
static std::string name()
typename SolutionFieldType::FieldValueType ValueType
A template class for registering derived classes with a base class.
NeoFOAM::la::LinearSystem< typename FieldType::ElementType, int > ginkgoMatrix(NeoFOAM::la::LinearSystem< typename FieldType::ElementType, localIdx > &ls, FieldType &solution)
FieldType & oldTime(FieldType &field)
Retrieves the old time field of a given field.