OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
CellParticleCachingPolicy.h
Go to the documentation of this file.
1 //
2 // Class CellParticleCachingPolicy
3 //
4 // The Cell caching layout ensures that each node has all ghost particles
5 // for each external particle that is inside a neighboring cell.
6 //
7 // Please note: for the time being this class is *not* used! But since it
8 // might be used in future projects, we keep this file.
9 //
10 // Copyright (c) 2003 - 2020, Paul Scherrer Institut, Villigen PSI, Switzerland
11 // All rights reserved
12 //
13 // This file is part of OPAL.
14 //
15 // OPAL is free software: you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation, either version 3 of the License, or
18 // (at your option) any later version.
19 //
20 // You should have received a copy of the GNU General Public License
21 // along with OPAL. If not, see <https://www.gnu.org/licenses/>.
22 //
23 
24 #ifndef CELL_PARTICLE_CACHING_POLICY
25 #define CELL_PARTICLE_CACHING_POLICY
26 
28 
29 template<class T, unsigned Dim, class Mesh>
31 public:
33  {
34  std::fill(cells, cells+Dim, 0);
35  }
36 
37  void setCacheCellRange(int d, int length)
38  {
39  cells[d] = length;
40  }
41 
42  void setAllCacheCellRanges(int length)
43  {
44  std::fill(cells, cells+Dim, length);
45  }
46 
47  template<class C>
50  )
51  {
52  for(unsigned int d = 0;d<Dim;++d)
53  BoxParticleCachingPolicy<T,Dim,Mesh>::setCacheDimension(d, cells[d]*PLayout.getLayout().getMesh().get_meshSpacing(d));
54 
56  }
57 
58  template<class C>
62  )
63  {
64  for(unsigned int d = 0;d<Dim;++d)
65  BoxParticleCachingPolicy<T,Dim,Mesh>::setCacheDimension(d, cells[d]*PLayout.getLayout().getMesh().get_meshSpacing(d));
66 
68  }
69 protected:
71 private:
72  int cells[Dim];
73 };
74 
75 #endif
const unsigned Dim
void updateCacheInformation(ParticleSpatialLayout< T, Dim, Mesh, C > &PLayout)
void updateGhostParticles(IpplParticleBase< ParticleSpatialLayout< T, Dim, Mesh, C > > &PData, ParticleSpatialLayout< T, Dim, Mesh, C > &)
void updateCacheInformation(ParticleSpatialLayout< T, Dim, Mesh, C > &PLayout)
void updateGhostParticles(IpplParticleBase< ParticleSpatialLayout< T, Dim, Mesh, C > > &PData, ParticleSpatialLayout< T, Dim, Mesh, C > &PLayout)
void setCacheCellRange(int d, int length)