Chombo + EB + MF  3.2
CoDimCopyManager.H
Go to the documentation of this file.
1 #ifdef CH_LANG_CC
2 /*
3  * _______ __
4  * / ___/ / ___ __ _ / / ___
5  * / /__/ _ \/ _ \/ V \/ _ \/ _ \
6  * \___/_//_/\___/_/_/_/_.__/\___/
7  * Please refer to Copyright.txt, in Chombo's root directory.
8  */
9 #endif
10 
11 #ifndef _CODIMCOPYMANAGER_H_
12 #define _CODIMCOPYMANAGER_H_
13 
14 #include "DisjointBoxLayout.H"
15 #include "Pool.H"
16 #include "Vector.H"
17 #include "ProblemDomain.H"
18 #include "Copier.H"
19 #include "NamespaceHeader.H"
20 
21 
22 /// Helper class to manage CoDim exchange operations
23 /**
24  CoDimCopiers are designed to be exercised in order, starting with CoDim=2
25  and increasing to SpaceDim. The CoDimCopyManager class manages these operations.
26 */
27 template <class T> class CoDimCopyManager
28 {
29 public:
30  /// null constructor
32  {
33  }
34 
35  /// defining constructor -- calls matching define function
36  /** by default, does all coDim copies from CoDim=2->SpaceDim. If you know you only need coDim ghost cells up to a Co-dimension less than SpaceDim,
37  that can be specified, which will make things cheaper.
38  */
39  CoDimCopyManager(const DisjointBoxLayout& a_grids, const BoxLayout& a_dest, const IntVect& a_ghostVect, bool a_exchange=false, int a_maxCoDim=SpaceDim);
40 
41  /// destructor
43 
44  /// define
45  void define(const DisjointBoxLayout& a_grids, const BoxLayout& a_dest, const IntVect& a_ghostVect, bool a_exchange=false, int a_maxCoDim=SpaceDim);
46 
47  /// orchestrates CoDim exchanges
48  void manageExchanges(LevelData<T>& a_data) const;
49 
50  /// orchestrates CoDim copies
51  void manageCopies(const LevelData<T>& a_data, BoxLayoutData<T>& a_dest) const;
52 
53  /// returns ghostVect used to define this object (to check for compatibility)
54  IntVect ghostVect() const {return m_ghostVect;}
55 
56  /// returns reference to src layout used to define this object
57  const DisjointBoxLayout& srcGrids() const {return m_srcGrids;}
58 
59  /// returns reference to dest layout used to define this object
60  const BoxLayout& destGrids() const {return m_destGrids;}
61 
62 protected:
63  /// Vector of CoDimCopiers
65 
66  /// keep ghostVect around just in case
68 
69  /// keep source and dest layouts around as well
70  // src grids used to define this object
72 
73  // dest grids used to define this object
75 
76 
77 private:
78 
79 
80 };
81 
82 
83 #include "NamespaceFooter.H"
84 #include "CoDimCopyManagerI.H"
85 
86 #endif
Helper class to manage CoDim exchange operations.
Definition: CoDimCopyManager.H:27
void define(const DisjointBoxLayout &a_grids, const BoxLayout &a_dest, const IntVect &a_ghostVect, bool a_exchange=false, int a_maxCoDim=SpaceDim)
define
Definition: CoDimCopyManagerI.H:46
A not-necessarily-disjoint collective of boxes.
Definition: BoxLayout.H:145
one dimensional dynamic array
Definition: Vector.H:53
DisjointBoxLayout m_srcGrids
keep source and dest layouts around as well
Definition: CoDimCopyManager.H:71
Vector< Copier * > m_copierVect
Vector of CoDimCopiers.
Definition: CoDimCopyManager.H:64
void manageCopies(const LevelData< T > &a_data, BoxLayoutData< T > &a_dest) const
orchestrates CoDim copies
Definition: CoDimCopyManagerI.H:80
const int SpaceDim
Definition: SPACE.H:38
BoxLayout m_destGrids
Definition: CoDimCopyManager.H:74
const DisjointBoxLayout & srcGrids() const
returns reference to src layout used to define this object
Definition: CoDimCopyManager.H:57
new code
Definition: BoxLayoutData.H:170
Data on a BoxLayout.
Definition: BoxLayoutData.H:97
A BoxLayout that has a concept of disjointedness.
Definition: DisjointBoxLayout.H:30
void manageExchanges(LevelData< T > &a_data) const
orchestrates CoDim exchanges
Definition: CoDimCopyManagerI.H:68
CoDimCopyManager()
null constructor
Definition: CoDimCopyManager.H:31
IntVect m_ghostVect
keep ghostVect around just in case
Definition: CoDimCopyManager.H:67
An integer Vector in SpaceDim-dimensional space.
Definition: CHArray.H:42
IntVect ghostVect() const
returns ghostVect used to define this object (to check for compatibility)
Definition: CoDimCopyManager.H:54
~CoDimCopyManager()
destructor
Definition: CoDimCopyManagerI.H:29
const BoxLayout & destGrids() const
returns reference to dest layout used to define this object
Definition: CoDimCopyManager.H:60