OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
BottomSolver.h
Go to the documentation of this file.
1 //
2 // Class BottomSolver
3 // Abstract base class for all base level solvers.
4 //
5 // Copyright (c) 2017 - 2020, Matthias Frey, Paul Scherrer Institut, Villigen PSI, Switzerland
6 // All rights reserved
7 //
8 // Implemented as part of the PhD thesis
9 // "Precise Simulations of Multibunches in High Intensity Cyclotrons"
10 //
11 // This file is part of OPAL.
12 //
13 // OPAL is free software: you can redistribute it and/or modify
14 // it under the terms of the GNU General Public License as published by
15 // the Free Software Foundation, either version 3 of the License, or
16 // (at your option) any later version.
17 //
18 // You should have received a copy of the GNU General Public License
19 // along with OPAL. If not, see <https://www.gnu.org/licenses/>.
20 //
21 #ifndef BOTTOM_SOLVER_H
22 #define BOTTOM_SOLVER_H
23 
24 #include "AmrMultiGridDefs.h"
25 
26 template <class Matrix, class Vector, class Level>
27 class BottomSolver {
28 
29 public:
30 
31  BottomSolver() : isInitialized_m(false) { };
32 
33  virtual ~BottomSolver() { };
34 
43  virtual void solve(const Vector& x,
44  const Vector& b) = 0;
45 
50  virtual void setOperator(const Matrix& A,
51  Level* level_p = nullptr) = 0;
52 
53 
57  virtual std::size_t getNumIters() = 0;
58 
59  bool hasOperator() const;
60 
61 
62 protected:
64 };
65 
66 
67 template <class Matrix, class Vector, class Level>
69  return isInitialized_m;
70 }
71 
72 #endif
Matrix.
Definition: Matrix.h:39
Vector.
Definition: Vector.h:37
virtual ~BottomSolver()
Definition: BottomSolver.h:33
virtual void setOperator(const Matrix &A, Level *level_p=nullptr)=0
bool isInitialized_m
Definition: BottomSolver.h:63
virtual void solve(const Vector &x, const Vector &b)=0
bool hasOperator() const
Definition: BottomSolver.h:68
virtual std::size_t getNumIters()=0