00001 #ifdef CH_LANG_CC
00002
00003
00004
00005
00006
00007
00008
00009 #endif
00010
00011
00012
00013 #ifndef _EBISBOX_H_
00014 #define _EBISBOX_H_
00015
00016 #include "REAL.H"
00017 #include "IntVect.H"
00018 #include "IntVectSet.H"
00019 #include "VolIndex.H"
00020 #include "Interval.H"
00021 #include "FaceIndex.H"
00022 #include "Tuple.H"
00023 #include "IntVectSet.H"
00024 #include "RealVect.H"
00025 #include "BaseFab.H"
00026 #include "RefCountedPtr.H"
00027 #include "SPMD.H"
00028 #include "EBGraph.H"
00029 #include "EBData.H"
00030 #include "NamespaceHeader.H"
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046 class EBISBox
00047 {
00048 public:
00049
00050
00051
00052
00053
00054 EBISBox();
00055
00056
00057 ~EBISBox();
00058
00059
00060
00061
00062
00063
00064 IntVectSet getMultiCells(const Box& a_subbox) const;
00065
00066
00067
00068
00069
00070
00071 IntVectSet getIrregIVS(const Box& a_subbox) const;
00072
00073
00074
00075
00076
00077 IntVectSet boundaryIVS(const Box& a_subbox) const;
00078
00079
00080
00081
00082
00083 int numVoFs(const IntVect& a_iv) const;
00084
00085
00086
00087
00088
00089 Vector<VolIndex> getVoFs(const IntVect& a_iv) const;
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103 Vector<VolIndex> getVoFs(const VolIndex& a_vof,
00104 const int& a_dir,
00105 const Side::LoHiSide& a_sd,
00106 const int& a_steps) const;
00107
00108
00109
00110
00111
00112 bool isAllRegular() const;
00113
00114
00115
00116
00117
00118 bool isAllCovered() const;
00119
00120
00121
00122
00123
00124 bool isRegular(const IntVect& a_iv) const;
00125
00126
00127
00128
00129
00130 bool isIrregular(const IntVect& a_iv) const;
00131
00132
00133
00134
00135
00136 bool isCovered(const IntVect& a_iv) const;
00137
00138
00139
00140
00141
00142
00143 bool isCovered(const Box& a_box) const;
00144
00145
00146
00147
00148
00149
00150 bool isRegular(const Box& a_box) const;
00151
00152
00153
00154
00155
00156
00157 Vector<FaceIndex> getFaces(const VolIndex& a_vof,
00158 const int& a_idir,
00159 const Side::LoHiSide& a_sd) const;
00160
00161
00162 Vector<FaceIndex> getAllFaces(const IntVect& a_iv,
00163 const int& a_idir,
00164 const Side::LoHiSide& a_sd) const;
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176 RealVect centroid(const FaceIndex& facein) const;
00177
00178
00179
00180
00181
00182
00183 int numFaces(const VolIndex& a_vof,
00184 const int& a_idir,
00185 const Side::LoHiSide& a_sd) const;
00186
00187
00188
00189
00190
00191 Real volFrac(const VolIndex& a_vof) const;
00192
00193
00194
00195
00196
00197
00198 Real areaFracScaling(const VolIndex& a_vof) const;
00199
00200
00201
00202
00203
00204 bool isConnected(const VolIndex& a_vof1,
00205 const VolIndex& a_vof2) const;
00206
00207
00208
00209
00210
00211
00212
00213 Real areaFrac(const FaceIndex& a_face1) const;
00214
00215
00216
00217
00218
00219
00220 Real sumArea(const VolIndex& a_vof,
00221 const int& a_idir,
00222 const Side::LoHiSide& a_sd) const;
00223
00224
00225
00226
00227
00228
00229
00230
00231 RealVect centroid(const VolIndex& a_vof) const;
00232
00233
00234
00235
00236
00237
00238
00239 Vector<VolIndex> refine(const VolIndex& a_coarVoF) const;
00240
00241
00242
00243
00244
00245
00246
00247 VolIndex coarsen(const VolIndex& a_fineVoF) const;
00248
00249
00250
00251
00252 RealVect bndryCentroid(const VolIndex& a_vof) const;
00253 RealVect bndryCentroid(const VolIndex& a_vof, int face) const;
00254
00255
00256
00257
00258 Real bndryArea(const VolIndex& a_vof) const;
00259 Real bndryArea(const VolIndex& a_vof, int face) const;
00260
00261
00262 int numFacePhase(const VolIndex& a_vof) const ;
00263
00264
00265 int facePhase(const VolIndex& a_vof, int face) const ;
00266
00267
00268 const VolIndex& faceIndex(const VolIndex& a_vof, int face) const ;
00269
00270
00271
00272
00273
00274
00275 RealVect normal(const VolIndex& a_vof) const;
00276 RealVect normal(const VolIndex& a_vof, int face) const;
00277
00278
00279 const Box& getRegion() const;
00280
00281
00282 const ProblemDomain& getDomain() const;
00283
00284
00285 void setDomain(const ProblemDomain& a_domain);
00286
00287
00288
00289
00290
00291
00292
00293 Vector<FaceIndex> refine(const FaceIndex& a_coarFace,const EBISBox& a_fineEBISBox) const;
00294
00295
00296
00297
00298
00299
00300
00301
00302 FaceIndex coarsen(const FaceIndex& a_fineFace) const;
00303
00304
00305
00306
00307
00308 void setToAllRegular();
00309
00310
00311
00312
00313
00314 void setToAllCovered();
00315
00316
00317 void
00318 define(const BaseFab<int>& a_regIrregCovered,
00319 const Vector<IrregNode>& a_irregGraph,
00320 const Box& a_validRegion,
00321 const ProblemDomain& a_domain);
00322
00323
00324
00325
00326 const EBGraph& getEBGraph() const;
00327
00328
00329
00330
00331 const EBData& getEBData() const;
00332
00333
00334 void
00335 define(const EBGraph& a_graph,
00336 const EBData& a_data);
00337
00338
00339 EBISBox& operator=(const EBISBox& ebiin);
00340
00341
00342 EBISBox(const EBISBox& ebiin);
00343
00344
00345 bool operator==(const EBISBox& ebiin);
00346
00347 private:
00348
00349
00350 EBGraph m_graph;
00351
00352
00353 EBData m_data;
00354
00355 };
00356
00357
00358
00359
00360 inline bool
00361 EBISBox::isRegular(const IntVect& a_iv) const
00362 {
00363 return m_graph.isRegular(a_iv);
00364 }
00365
00366 inline bool
00367 EBISBox::isIrregular(const IntVect& a_iv) const
00368 {
00369 return m_graph.isIrregular(a_iv);
00370 }
00371
00372 inline bool
00373 EBISBox::isAllCovered() const
00374 {
00375 return m_graph.isAllCovered();
00376 }
00377
00378 inline bool
00379 EBISBox::isAllRegular() const
00380 {
00381 return m_graph.isAllRegular();
00382 }
00383
00384 inline bool
00385 EBISBox::isCovered(const IntVect& a_iv) const
00386 {
00387 return m_graph.isCovered(a_iv);
00388 }
00389
00390 inline bool
00391 EBISBox::isCovered(const Box& a_box) const
00392 {
00393 return m_graph.isCovered(a_box);
00394 }
00395
00396 inline bool
00397 EBISBox::isRegular(const Box& a_box) const
00398 {
00399 return m_graph.isRegular(a_box);
00400 }
00401
00402 inline Vector<VolIndex>
00403 EBISBox::getVoFs(const IntVect& a_iv) const
00404 {
00405 return m_graph.getVoFs(a_iv);
00406 }
00407
00408
00409 inline Vector<FaceIndex>
00410 EBISBox::getAllFaces(const IntVect& a_iv,
00411 const int& a_idir,
00412 const Side::LoHiSide& a_sd) const
00413 {
00414 return m_graph.getAllFaces(a_iv, a_idir, a_sd);
00415 }
00416
00417 inline Vector<FaceIndex>
00418 EBISBox::getFaces(const VolIndex& a_vof,
00419 const int& a_idir,
00420 const Side::LoHiSide& a_sd) const
00421 {
00422 return m_graph.getFaces(a_vof, a_idir, a_sd);
00423 }
00424
00425 inline int
00426 EBISBox::numVoFs(const IntVect& a_iv) const
00427 {
00428 return m_graph.numVoFs(a_iv);
00429 }
00430 #include "NamespaceFooter.H"
00431 #endif