OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
MLPoissonSolver.h
Go to the documentation of this file.
1 //
2 // Class MLPoissonSolver
3 // Interface to the C++ based AMR Poisson multigrid solver of AMReX.
4 //
5 // Copyright (c) 2016 - 2020, Matthias Frey, Paul Scherrer Institute, 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 ML_POISSON_SOLVER_H_
22 #define ML_POISSON_SOLVER_H_
23 
25 #include "Amr/AmrBoxLib.h"
26 
27 class MLPoissonSolver : public AmrPoissonSolver< AmrBoxLib > {
28 
29 private:
31  typedef amrex::Vector<AmrBoxLib::AmrField_t*> AmrFieldContainer_pt;
32  typedef amrex::Vector<const AmrBoxLib::AmrField_t*> const_AmrFieldContainer_pt;
40 
41 public:
42 
50  MLPoissonSolver(AmrBoxLib* itsAmrObject_p);
51 
66  unsigned short baseLevel,
67  unsigned short finestLevel,
68  bool prevAsGuess = true);
69 
70  double getXRangeMin(unsigned short level = 0);
71  double getXRangeMax(unsigned short level = 0);
72  double getYRangeMin(unsigned short level = 0);
73  double getYRangeMax(unsigned short level = 0);
74  double getZRangeMin(unsigned short level = 0);
75  double getZRangeMax(unsigned short level = 0);
76 
77 
82  Inform &print(Inform &os) const;
83 
84 
85 private:
86 
98  int baseLevel,
99  int finestLevel);
100 
101 private:
102  double reltol_m;
103  double abstol_m;
104 };
105 
106 
107 inline Inform &operator<<(Inform &os, const MLPoissonSolver &fs) {
108  return fs.print(os);
109 }
110 
111 #endif
Inform & operator<<(Inform &os, const MLPoissonSolver &fs)
FRONT * fs
Definition: hypervolume.cpp:59
amr::AmrGeometry_t AmrGeometry_t
Definition: AmrBoxLib.h:52
amr::AmrProcMap_t AmrProcMap_t
Definition: AmrBoxLib.h:51
amr::AmrVectorFieldContainer_t AmrVectorFieldContainer_t
Definition: AmrBoxLib.h:43
amr::AmrProcMapContainer_t AmrProcMapContainer_t
Definition: AmrBoxLib.h:46
amr::AmrGrid_t AmrGrid_t
Definition: AmrBoxLib.h:50
amr::AmrScalarFieldContainer_t AmrScalarFieldContainer_t
Definition: AmrBoxLib.h:42
amr::AmrGeomContainer_t AmrGeomContainer_t
Definition: AmrBoxLib.h:44
amr::AmrGridContainer_t AmrGridContainer_t
Definition: AmrBoxLib.h:45
double getYRangeMin(unsigned short level=0)
AmrBoxLib::AmrScalarFieldContainer_t AmrScalarFieldContainer_t
double getXRangeMax(unsigned short level=0)
double getZRangeMin(unsigned short level=0)
amrex::Vector< AmrBoxLib::AmrField_t * > AmrFieldContainer_pt
double abstol_m
Absolute tolerance for solver.
AmrBoxLib::AmrGridContainer_t AmrGridContainer_t
AmrBoxLib::AmrGeomContainer_t GeomContainer_t
MLPoissonSolver(AmrBoxLib *itsAmrObject_p)
Inform & print(Inform &os) const
void solve(AmrScalarFieldContainer_t &rho, AmrScalarFieldContainer_t &phi, AmrVectorFieldContainer_t &efield, unsigned short baseLevel, unsigned short finestLevel, bool prevAsGuess=true)
amrex::Vector< const AmrBoxLib::AmrField_t * > const_AmrFieldContainer_pt
void mlmg_m(AmrScalarFieldContainer_t &rho, AmrScalarFieldContainer_t &phi, AmrVectorFieldContainer_t &efield, int baseLevel, int finestLevel)
AmrBoxLib::AmrProcMapContainer_t AmrProcMapContainer_t
AmrBoxLib::AmrVectorFieldContainer_t AmrVectorFieldContainer_t
double getZRangeMax(unsigned short level=0)
double getXRangeMin(unsigned short level=0)
AmrBoxLib::AmrGrid_t AmrGrid_t
double getYRangeMax(unsigned short level=0)
AmrBoxLib::AmrProcMap_t AmrProcMap_t
double reltol_m
Relative tolearance for solver.
AmrBoxLib::AmrGeometry_t AmrGeometry_t
Definition: Inform.h:42