File solverfactory.hxx


using RegisterSolver = RegisterInFactory<Solver, DerivedType>

Simpler name for Factory registration helper class


#include <bout/solverfactory.hxx>
namespace {
RegisterSolver<MySolver> registersolvermine("mysolver");

class SolverFactory : public Factory<Solver, std::function<Solver *(Options *)>>
#include <solverfactory.hxx>

Factory specialisation for Solvers

TODO: Inherits from Factory<> in order to keep the same interface during transition period. After next major version, replace whole class with:

using SolverFactory = Factory<Solver, SolverType,

Public Functions

Solver *createSolver(Options *options = nullptr)
Solver *createSolver(const SolverType &name)
Solver *createSolver(const SolverType &name, Options *options)

Public Static Functions

SolverType getDefaultSolverType()

Return the name of the default Solver type.

SolverFactory *getInstance()

Private Functions


Private Static Attributes

SolverFactory *instance = nullptr
template<typename DerivedType>
class RegisterInFactory<Solver, DerivedType>
#include <solverfactory.hxx>

Specialisation of Factory registration helper class.

Public Functions

RegisterInFactory(const std::string &name)