Proto  3.2
Proto_MBAMRMap.H
Go to the documentation of this file.
1 #pragma once
2 #ifndef _PROTO_MB_AMR_MAP_
3 #define _PROTO_MB_AMR_MAP_
4 
5 #include "Proto_MBAMRData.H"
6 
7 namespace Proto
8 {
9 
10 template<typename MAP, MemType MEM = MEMTYPE_DEFAULT>
11 class MBAMRMap
12 {
13  public:
14  /// Trivial Constructor
15  inline MBAMRMap(){}
16 
17  /// Non-Trivial Constructor
18  inline MBAMRMap(
19  const MBAMRLayout& a_grid,
20  const Array<Point, DIM+1>& a_ghost,
21  unsigned int a_focalBlock = 0);
22 
23  /// Non-Trivial Constructor
24  inline MBAMRMap(
25  const MBAMRLayout& a_grid,
26  Point a_ghost,
27  unsigned int a_focalBlock = 0);
28 
29  /// Lazy Constructor
30  inline void define(
31  const MBAMRLayout& a_grid,
32  const Array<Point, DIM+1>& a_ghost,
33  unsigned int a_focalBlock = 0);
34 
35  inline void define(
36  const MBAMRLayout& a_grid,
37  const Point a_ghost,
38  unsigned int a_focalBlock = 0);
39 
40  inline void initialize();
41  /// Get Level Map
42  inline const MBLevelMap<MAP,MEM>& getLevel(unsigned int a_level) const;
43 
44  /// Get Grid
45  inline const MBAMRLayout& grid() const {return *m_grid;}
46 
47  /// Get Cached Coordinates
48  inline const MBAMRData<double, DIM, MEM, PR_NODE>& map() const {return m_X; }
49 
50  /// Get Cached Jacobian
51  inline const MBAMRData<double, 1, MEM, PR_NODE>& jacobian() const {return m_J; }
52 
53  inline MBLevelMap<MAP,MEM>& operator[](unsigned int a_level){ return *m_maps[a_level];}
54 
55  private:
59  std::vector<std::shared_ptr<MBLevelMap<MAP,MEM>>> m_maps;
60 };
61 #include "implem/Proto_MBAMRMapImplem.H"
62 } //end Proto namespace
63 #endif
MBAMRData< double, DIM, MEM, PR_NODE > m_X
Definition: Proto_MBAMRMap.H:57
MBLevelMap< MAP, MEM > & operator[](unsigned int a_level)
Definition: Proto_MBAMRMap.H:53
std::vector< std::shared_ptr< MBLevelMap< MAP, MEM > > > m_maps
Definition: Proto_MBAMRMap.H:59
Single Level Mapped Multiblock Map.
Definition: Proto_MBLevelBoxData.H:19
const MBAMRData< double, DIM, MEM, PR_NODE > & map() const
Get Cached Coordinates.
Definition: Proto_MBAMRMap.H:48
const MBAMRData< double, 1, MEM, PR_NODE > & jacobian() const
Get Cached Jacobian.
Definition: Proto_MBAMRMap.H:51
void initialize()
Definition: Proto_MBAMRMap.H:58
const MBAMRLayout * m_grid
Definition: Proto_MBAMRMap.H:56
const MBLevelMap< MAP, MEM > & getLevel(unsigned int a_level) const
Get Level Map.
Definition: Proto_MBAMRMap.H:67
Definition: Proto_Array.H:17
A templated constant size array object similar to std::array, but with the ability to be used inside ...
Definition: Proto_Array.H:28
Integer Valued Vector.
Definition: Proto_Point.H:24
MBAMRMap()
Trivial Constructor.
Definition: Proto_MBAMRMap.H:15
Definition: Proto_MBAMRMap.H:11
void define(const MBAMRLayout &a_grid, const Array< Point, DIM+1 > &a_ghost, unsigned int a_focalBlock=0)
Lazy Constructor.
Definition: Proto_MBAMRMap.H:34
MBAMRData< double, 1, MEM, PR_CELL > m_J
Definition: Proto_MBAMRMap.H:58
const MBAMRLayout & grid() const
Get Grid.
Definition: Proto_MBAMRMap.H:45
Multiblock AMR Grid.
Definition: Proto_MBAMRLayout.H:12