diff --git a/dune-solvers/solvers/solver.hh b/dune-solvers/solvers/solver.hh new file mode 100644 index 0000000000000000000000000000000000000000..eeda504f0d8a596ab2464ea0fea6eadc309bafa2 --- /dev/null +++ b/dune-solvers/solvers/solver.hh @@ -0,0 +1,31 @@ +#ifndef DUNE_SOLVER_HH +#define DUNE_SOLVER_HH + +#include "numproc.hh" + + /** \brief The base class for all sorts of solver algorithms */ + class Solver : public NumProc + { + public: + Solver(VerbosityMode verbosity) + : NumProc(verbosity) + {} + + /** \brief Virtual destructor */ + virtual ~Solver() {} + + /** \brief Do the necessary preprocessing */ + virtual void preprocess(); + + /** \brief Derived classes overload this with the actual + * solution algorithm */ + virtual void solve() = 0; + + }; + +void Solver::preprocess() +{ + // Default: Do nothing +} + +#endif