Chombo + EB + MF  3.2
CoDimCopier.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 _CODIMCOPIER_H_
12 #define _CODIMCOPIER_H_
13 
14 #include "DisjointBoxLayout.H"
15 #include "Pool.H"
16 #include "Vector.H"
17 #include "ProblemDomain.H"
18 #include "Copier.H"
19 #include "LevelData.H"
20 #include "NamespaceHeader.H"
21 
22 
23 /// An even strangerer (than CornerCopier) thing to copy from ghost cells to corner ghost cells.
24 /**
25  This is a specialized Copier to fill corner ghost cells of Codim n from codim (n-1) ghost
26  cells of adjacent boxes. Calling exchange with this copier will
27  fill _only_ the corner ghost cells. All other exchange operations
28  should be performed by calling a separate exchange with a normal
29  Copier.
30  For this to work properly, one needs to call it DIM-1 times, starting with a coDim of 1,
31  and ending with coDim DIM-1. To automate this, we provide a CoDimCopierManager class, which
32  defines the appropriate CoDimCopiers and also managed the series of CoDim exchanges.
33 */
34 
35 class CoDimCopier: public Copier
36 {
37 public:
38 
39  ///null constructor, copy constructor and operator= can be compiler defined.
41  {
43  m_coDim = -1;
44  }
45 
46  /// Basic defining constructor
47  /** Note that this constructor doesn't take a ghost cell argument,
48  so it creates a useless CoDimCopier (no intersections are computed).
49  Provided for compatibility with Copier base class.
50  */
51  CoDimCopier(const DisjointBoxLayout& a_level, const BoxLayout& a_dest,
52  bool a_exchange = false);
53 
54  /// this constructor contains support for periodic BC's
55  /** Note that this constructor doesn't take a ghost cell argument,
56  so it creates a useless CoDimCopier (no intersections are computed).
57  Provided for compatibility with Copier base class.
58  */
59  CoDimCopier(const DisjointBoxLayout& a_level, const BoxLayout& a_dest,
60  const ProblemDomain& a_domain,
61  bool a_exchange = false);
62 
63  /// Copier to copy into coDim corner ghost cells of a_dest from coDim-1 ghost cells of a_level
64  /** Assumption is that a_dest and a_level have the same number of
65  ghost cells. coDim is the co-dimensionality of the copier intersections.
66  */
67  CoDimCopier(const DisjointBoxLayout& a_level,
68  const BoxLayout& a_dest,
69  const IntVect& a_ghost,
70  int a_coDim,
71  bool a_exchange = false);
72 
73  /// Copier to copy data into the coDim corner ghost cells of a_dest from the coDim-1 ghost cells of a_level with support for periodic BCs
74  /** Assumption is that a_dest and a_level have the same number of
75  ghost cells. coDim is the co-dimensionality of the copier intersections
76  */
77  CoDimCopier(const DisjointBoxLayout& a_level,
78  const BoxLayout& a_dest,
79  const ProblemDomain& a_domain,
80  const IntVect& a_ghost,
81  int a_coDim,
82  bool a_exchange = false);
83 
84  ///
85  virtual ~CoDimCopier();
86 
87  /// define to match constructor (also doesn't do anything)
88  virtual void define(const DisjointBoxLayout& a_level,
89  const BoxLayout& a_dest,
90  bool a_exchange = false);
91 
92  /// define to match constructor (also doesn't do anything)
93  virtual void define(const DisjointBoxLayout& a_level,
94  const BoxLayout& a_dest,
95  const ProblemDomain& a_domain,
96  bool a_exchange = false);
97 
98  ///
99  virtual void define(const DisjointBoxLayout& a_level,
100  const BoxLayout& a_dest,
101  const IntVect& a_ghost,
102  int a_coDim,
103  bool a_exchange = false);
104 
105  /// contains support for periodic BCs
106  virtual void define(const BoxLayout& a_level,
107  const BoxLayout& a_dest,
108  const ProblemDomain& a_domain,
109  const IntVect& a_ghost,
110  int a_coDim,
111  bool a_exchange = false);
112 
113  ///
114  virtual void clear();
115 
116  const IntVect& ghost()
117  {
118  return m_ghost;
119  }
120 
121  const int coDim() const
122  {
123  return m_coDim;
124  }
125 
126 protected:
127 
128 private:
129 
131  int m_coDim;
132 };
133 
134 std::ostream& operator<<(std::ostream& os, const CoDimCopier& copier);
135 
136 
137 #include "NamespaceFooter.H"
138 #endif
An even strangerer (than CornerCopier) thing to copy from ghost cells to corner ghost cells...
Definition: CoDimCopier.H:35
A class to facilitate interaction with physical boundary conditions.
Definition: ProblemDomain.H:141
const IntVect & ghost()
Definition: CoDimCopier.H:116
int m_coDim
Definition: CoDimCopier.H:131
A not-necessarily-disjoint collective of boxes.
Definition: BoxLayout.H:145
A strange but true thing to make copying from one boxlayoutdata to another fast.
Definition: Copier.H:152
const int coDim() const
Definition: CoDimCopier.H:121
std::ostream & operator<<(std::ostream &os, const CoDimCopier &copier)
virtual void define(const DisjointBoxLayout &a_level, const BoxLayout &a_dest, bool a_exchange=false)
define to match constructor (also doesn't do anything)
virtual void clear()
static const IntVect Unit
Definition: IntVect.H:663
A BoxLayout that has a concept of disjointedness.
Definition: DisjointBoxLayout.H:30
IntVect m_ghost
Definition: CoDimCopier.H:130
virtual ~CoDimCopier()
An integer Vector in SpaceDim-dimensional space.
Definition: CHArray.H:42
CoDimCopier()
null constructor, copy constructor and operator= can be compiler defined.
Definition: CoDimCopier.H:40