OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
ParticleAmrLayout.h
Go to the documentation of this file.
1 //
2 // Class ParticleAmrLayout
3 // Particle layout for AMR particles.
4 //
5 // Copyright (c) 2016 - 2020, Matthias Frey, Uldis Locans, 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 PARTICLE_AMR_LAYOUT_H
22 #define PARTICLE_AMR_LAYOUT_H
23 
25 
26 template<class T, unsigned Dim>
27 class ParticleAmrLayout : public ParticleLayout<T, Dim> {
28 
29 public:
30  // pair iterator definition ... this layout does not allow for pairlists
31  typedef int pair_t;
36 
37  // type of attributes this layout should use for position and ID
40 
41 public:
42 
44 
48  void setFinestLevel(int finestLevel);
49 
53  void setMaxLevel(int maxLevel);
54 
60  virtual void setBoundingBox(double dh) = 0;
61 
62 protected:
64  int maxLevel_m;
65 };
66 
67 
68 // ============================================================================
69 
70 
71 template <class T, unsigned Dim>
73  : finestLevel_m(0),
74  maxLevel_m(0)
75 { }
76 
77 
78 template <class T, unsigned Dim>
80  finestLevel_m = finestLevel;
81 }
82 
83 
84 template <class T, unsigned Dim>
86  maxLevel_m = maxLevel;
87 }
88 
89 #endif
virtual void setBoundingBox(double dh)=0
ParticleLayout< T, Dim >::Index_t Index_t
ParticleAttrib< SingleParticlePos_t > ParticlePos_t
int finestLevel_m
Current finest level of simluation.
ParticleLayout< T, Dim >::SingleParticlePos_t SingleParticlePos_t
int maxLevel_m
Maximum level allowed.
void setMaxLevel(int maxLevel)
void setFinestLevel(int finestLevel)
ParticleAttrib< Index_t > ParticleIndex_t
unsigned Index_t