cache_data.hpp
Go to the documentation of this file.
1 
6 #ifndef CACHE_DATA_HPP
7 #define CACHE_DATA_HPP 1
8 
9 #include "../../misc/cached_lazy_list.hpp"
10 #include "../../tessellation/tessellation.hpp"
11 #include "physical_geometry.hpp"
12 
14 class CacheData
15 {
16 private:
17  class CMCalculator : public LazyList<Vector2D>
18  {
19  public:
20 
21  CMCalculator(const Tessellation& tess,
22  const PhysicalGeometry& pg);
23 
24  size_t size(void) const;
25 
26  Vector2D operator[](const size_t i) const;
27 
28  private:
29  const Tessellation& tess_;
30  const PhysicalGeometry& pg_;
31  };
32 
33  class VolumeCalculator: public LazyList<double>
34  {
35  public:
36 
37  VolumeCalculator(const Tessellation& tess,
38  const PhysicalGeometry& pg);
39 
40  size_t size(void) const;
41 
42  double operator[](const size_t i) const;
43 
44  private:
45  const Tessellation& tess_;
46  const PhysicalGeometry& pg_;
47  };
48 
49  class AreaCalculator: public LazyList<double>
50  {
51  public:
52 
53  AreaCalculator(const Tessellation& tess,
54  const PhysicalGeometry& pg);
55 
56  size_t size(void) const;
57 
58  double operator[](const size_t i) const;
59 
60  private:
61  const Tessellation& tess_;
62  const PhysicalGeometry& pg_;
63  };
64 
65  const VolumeCalculator volume_func_;
66  const AreaCalculator area_func_;
67  const CMCalculator cm_func_;
68 public:
69 
74  CacheData(const Tessellation& tess,
75  const PhysicalGeometry& pg);
76 
78  void reset(void) const;
79 
82 
85 
88 };
89 
90 #endif // CACHE_DATA_HPP
CacheData(const Tessellation &tess, const PhysicalGeometry &pg)
Class constructor.
Definition: cache_data.cpp:60
void reset(void) const
Marks all items for recalculation.
Definition: cache_data.cpp:65
Abstract class for tessellation.
const CachedLazyList< Vector2D > CMs
List of center of masses of the cells.
Definition: cache_data.hpp:87
const CachedLazyList< double > areas
List of areas of interfaces.
Definition: cache_data.hpp:84
Ordered list whose terms are evaluated lazily.
Definition: lazy_list.hpp:17
const CachedLazyList< double > volumes
List of cell volumes.
Definition: cache_data.hpp:81
Container for cache data.
Definition: cache_data.hpp:14
Physical geometry of the grid.
2D Mathematical vector
Definition: geometry.hpp:15
Base class for physical geometry.