00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef DISJOINTBOXLAYOUT_H
00029 #define DISJOINTBOXLAYOUT_H
00030
00031 #ifndef WRAPPER
00032 #include "Vector.H"
00033 #include "BoxLayout.H"
00034 #include "ProblemDomain.H"
00035 #endif
00036
00038
00046 class DisjointBoxLayout: public BoxLayout
00047 {
00048
00049 public:
00050
00051 friend class Copier;
00052
00053
00054
00055
00057 DisjointBoxLayout();
00058
00060
00065 DisjointBoxLayout(const Vector<Box>& a_boxes,
00066 const Vector<int>& a_procIDs);
00067
00069
00074 DisjointBoxLayout(const Vector<Box>& a_boxes,
00075 const Vector<int>& a_procIDs,
00076 const ProblemDomain& a_physDomain);
00077
00079 virtual
00080 ~DisjointBoxLayout(){;}
00081
00083
00088 virtual void
00089 define(const Vector<Box>& a_boxes,
00090 const Vector<int>& a_procIDs);
00092
00097 void
00098 define(BoxLayout& a_layout);
00099
00101
00106 void
00107 define(BoxLayout& a_layout, const ProblemDomain& a_physDomain);
00108
00109
00110
00111
00113
00118 virtual void
00119 define(const Vector<Box>& a_boxes,
00120 const Vector<int>& a_procIDs,
00121 const ProblemDomain& a_physDomain);
00122 virtual void
00123 define_pd(const Vector<Box>& a_boxes,
00124 const Vector<int>& a_procIDs,
00125 const ProblemDomain& a_physDomain) {define(a_boxes, a_procIDs, a_physDomain);}
00126
00127
00128
00129
00130
00131
00133
00135 virtual void
00136 close();
00137
00139
00142 virtual void
00143 deepCopy(const DisjointBoxLayout& a_source);
00144
00146
00148 virtual void
00149 deepCopy(const BoxLayout& a_source);
00150
00151
00153
00155 virtual void
00156 deepCopy(const BoxLayout& a_source, const ProblemDomain& a_physDomain);
00157
00159
00165 bool
00166 isDisjoint() const;
00167
00169
00178 bool checkPeriodic(const ProblemDomain& a_domain) const;
00179
00184 bool checkDomains(const DisjointBoxLayout& a_dbl) const;
00185
00187
00193 friend void coarsen(DisjointBoxLayout& output,
00194 const DisjointBoxLayout& input,
00195 int refinement);
00196
00198
00200 friend void refine(DisjointBoxLayout& output,
00201 const DisjointBoxLayout& input,
00202 int refinement);
00203
00204
00206
00210 friend void adjCellLo(DisjointBoxLayout& a_output,
00211 const DisjointBoxLayout& a_input,
00212 int a_dir, int a_len=1);
00213
00214
00216
00220 friend void adjCellHi(DisjointBoxLayout& a_output,
00221 const DisjointBoxLayout& a_input,
00222 int a_dir, int a_len=1);
00223
00224
00225 protected:
00226 const ProblemDomain& physDomain() const;
00227
00228
00229
00230 private:
00232 ProblemDomain m_physDomain;
00233
00234 };
00235 void adjCellLo_dbl(DisjointBoxLayout& a_output,
00236 const DisjointBoxLayout& a_input,
00237 int a_dir, int a_len);
00238 void adjCellHi_dbl(DisjointBoxLayout& a_output,
00239 const DisjointBoxLayout& a_input,
00240 int a_dir, int a_len);
00241 void coarsen_dbl(DisjointBoxLayout& output,
00242 const DisjointBoxLayout& input,
00243 int refinement);
00244 void refine_dbl(DisjointBoxLayout& output,
00245 const DisjointBoxLayout& input,
00246 int refinement);
00247
00248 #ifndef WRAPPER
00249 inline
00250 void adjCellLo_dbl(DisjointBoxLayout& a_output,
00251 const DisjointBoxLayout& a_input,
00252 int a_dir, int a_len) { adjCellLo(a_output,a_input,a_dir,a_len);}
00253 inline
00254 void adjCellHi_dbl(DisjointBoxLayout& a_output,
00255 const DisjointBoxLayout& a_input,
00256 int a_dir, int a_len){ adjCellHi(a_output,a_input,a_dir,a_len);}
00257 inline
00258 void coarsen_dbl(DisjointBoxLayout& output,
00259 const DisjointBoxLayout& input,
00260 int refinement){ coarsen(output, input, refinement);}
00261 inline
00262 void refine_dbl(DisjointBoxLayout& output,
00263 const DisjointBoxLayout& input,
00264 int refinement){ refine(output, input, refinement);}
00265 #endif
00266
00267 #endif