OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
PoissonSolver.h
Go to the documentation of this file.
1 #ifndef POISSON_SOLVER_H_
2 #define POISSON_SOLVER_H_
3 
6 
7 #ifdef ENABLE_AMR
9 #endif
10 template <class T, unsigned Dim>
12 class PartBunchBase;
13 
15 public:
16 
17  // given a charge-density field rho and a set of mesh spacings hr,
18  // compute the scalar potential in open space
19  virtual void computePotential(Field_t &rho, Vector_t hr) = 0;
20 
21 #ifdef ENABLE_AMR
22 
32  virtual void solve(AmrScalarFieldContainer_t &rho,
35  unsigned short baseLevel,
36  unsigned short finestLevel,
37  bool prevAsGuess = true)
38  {
39  throw OpalException("PoissonSolver::solve()", "Not supported for non-AMR code.");
40  };
41 
45  virtual void hasToRegrid() {
46  throw OpalException("PoissonSolver::hasToRegrid()", "Not supported for non-AMR code.");
47  }
48 #endif
49 
50  virtual void computePotential(Field_t &rho, Vector_t hr, double zshift) = 0;
51 
52  virtual double getXRangeMin(unsigned short level = 0) = 0;
53  virtual double getXRangeMax(unsigned short level = 0) = 0;
54  virtual double getYRangeMin(unsigned short level = 0) = 0;
55  virtual double getYRangeMax(unsigned short level = 0) = 0;
56  virtual double getZRangeMin(unsigned short level = 0) = 0;
57  virtual double getZRangeMax(unsigned short level = 0) = 0;
58  virtual void test(PartBunchBase<double, 3> *bunch) = 0 ;
59  virtual ~PoissonSolver(){};
60 
61 };
62 
63 inline Inform &operator<<(Inform &os, const PoissonSolver &fs) {
64  return os << "";
65 }
66 
67 #endif
std::ostream & operator<<(std::ostream &os, const Attribute &attr)
Definition: Attribute.cpp:167
virtual double getXRangeMin(unsigned short level=0)=0
virtual double getXRangeMax(unsigned short level=0)=0
virtual ~PoissonSolver()
Definition: PoissonSolver.h:59
The base class for all OPAL exceptions.
Definition: OpalException.h:28
virtual double getZRangeMax(unsigned short level=0)=0
FRONT * fs
Definition: hypervolume.cpp:59
virtual void solve(AmrScalarFieldContainer_t &rho, AmrScalarFieldContainer_t &phi, AmrVectorFieldContainer_t &efield, unsigned short baseLevel, unsigned short finestLevel, bool prevAsGuess=true)
Definition: PoissonSolver.h:32
Class: DataSink.
Definition: OpalData.h:29
virtual void computePotential(Field_t &rho, Vector_t hr)=0
virtual double getYRangeMin(unsigned short level=0)=0
virtual double getYRangeMax(unsigned short level=0)=0
virtual double getZRangeMin(unsigned short level=0)=0
amr::AmrScalarFieldContainer_t AmrScalarFieldContainer_t
Definition: PBunchDefs.h:60
virtual void hasToRegrid()
Definition: PoissonSolver.h:45
Definition: Inform.h:41
virtual void test(PartBunchBase< double, 3 > *bunch)=0
amr::AmrVectorFieldContainer_t AmrVectorFieldContainer_t
Definition: PBunchDefs.h:61