ThunderEgg  1.0.0
Solver.h
Go to the documentation of this file.
1 /***************************************************************************
2  * ThunderEgg, a library for solvers on adaptively refined block-structured
3  * Cartesian grids.
4  *
5  * Copyright (c) 2021 Scott Aiton
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <https://www.gnu.org/licenses/>.
19  ***************************************************************************/
20 
21 #ifndef THUNDEREGG_ITERATIVE_SOLVER_H
22 #define THUNDEREGG_ITERATIVE_SOLVER_H
23 
29 #include <ThunderEgg/Operator.h>
30 #include <iostream>
31 
32 namespace ThunderEgg::Iterative {
38 template<int D>
39 class Solver
40 {
41 public:
47  virtual Solver<D>* clone() const = 0;
51  virtual ~Solver() {}
64  virtual int solve(const Operator<D>& A,
65  Vector<D>& x,
66  const Vector<D>& b,
67  const Operator<D>* Mr = nullptr,
68  bool output = false,
69  std::ostream& os = std::cout) const = 0;
70 };
71 } // namespace ThunderEgg::Iterative
72 #endif
Operator.h
Operator class.
ThunderEgg::Iterative
Iterative Solvers.
Definition: BiCGStab.h:34
ThunderEgg::Iterative::Solver::~Solver
virtual ~Solver()
Destroy the Solver object.
Definition: Solver.h:51
ThunderEgg::Iterative::Solver::clone
virtual Solver< D > * clone() const =0
Clone this solver.
ThunderEgg::Iterative::Solver::solve
virtual int solve(const Operator< D > &A, Vector< D > &x, const Vector< D > &b, const Operator< D > *Mr=nullptr, bool output=false, std::ostream &os=std::cout) const =0
Perform an iterative solve.
ThunderEgg::Operator
Base class for operators.
Definition: Operator.h:37
ThunderEgg::Iterative::Solver
Abstract interface for Iterative solvers.
Definition: Solver.h:39
ThunderEgg::Vector
Vector class for use in thunderegg.
Definition: Vector.h:42