OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
AmrPoissonSolver.h
Go to the documentation of this file.
1 //
2 // Class AmrPoissonSolver
3 // Base class of AMR poisson solvers.
4 //
5 // Copyright (c) 2016 - 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 
22 #ifndef AMR_POISSON_SOLVER_H_
23 #define AMR_POISSON_SOLVER_H_
24 
25 #include "PoissonSolver.h"
26 
27 #include <memory>
28 
29 template<class AmrObject>
31 
32 public:
36  AmrPoissonSolver(AmrObject* itsAmrObject_p)
37  : itsAmrObject_mp(itsAmrObject_p), regrid_m(true) {}
38 
39  virtual ~AmrPoissonSolver() {}
40 
41 
42  void computePotential(Field_t &/*rho*/, Vector_t /*hr*/) {
43  throw OpalException("AmrPoissonSolver::computePotential(Field_t, Vector_t)",
44  "Not implemented.");
45  }
46 
47  void computePotential(Field_t &/*rho*/, Vector_t /*hr*/, double /*zshift*/) {
48  throw OpalException("AmrPoissonSolver::computePotential(Field_t, Vector_t, double)",
49  "Not implemented.");
50  }
51 
52  void test(PartBunchBase<double, 3> */*bunch*/) {
53  throw OpalException("AmrPoissonSolver::test(PartBunchBase<double, 3>)", "Not implemented.");
54  }
55 
56  void hasToRegrid() {
57  regrid_m = true;
58  }
59 
60 protected:
62 
64  bool regrid_m;
65 };
66 
67 
68 #endif
void computePotential(Field_t &, Vector_t)
virtual ~AmrPoissonSolver()
void test(PartBunchBase< double, 3 > *)
void computePotential(Field_t &, Vector_t, double)
bool regrid_m
is set to true by itsAmrObject_mp and reset to false by solver
AmrObject * itsAmrObject_mp
AmrPoissonSolver(AmrObject *itsAmrObject_p)
The base class for all OPAL exceptions.
Definition: OpalException.h:28