00001 #ifdef CH_LANG_CC
00002
00003
00004
00005
00006
00007
00008
00009 #endif
00010
00011 #ifndef _EBFLUXREGISTER_H_
00012 #define _EBFLUXREGISTER_H_
00013
00014 #include "REAL.H"
00015 #include "Vector.H"
00016 #include "EBCellFAB.H"
00017 #include "EBFaceFAB.H"
00018 #include "EBISLayout.H"
00019 #include "EBISBox.H"
00020 #include "IntVectSet.H"
00021 #include "CFStencil.H"
00022 #include "LoHiSide.H"
00023 #include "LevelData.H"
00024 #include "LayoutData.H"
00025 #include "NamespaceHeader.H"
00026 class EBIndexSpace;
00027
00028 class EBCoarToFineRedist;
00029 class EBCoarToCoarRedist;
00030
00032
00036 class EBFluxRegister
00037 {
00038 public:
00039
00041
00044 EBFluxRegister();
00045
00047
00051 EBFluxRegister(const DisjointBoxLayout& a_dblFine,
00052 const DisjointBoxLayout& a_dblCoar,
00053 const EBISLayout& ebislFine,
00054 const EBISLayout& a_ebislCoar,
00055 const Box& a_domainCoar,
00056 const int& a_nref,
00057 const int& a_nvar,
00058 const EBIndexSpace* ebisPtr);
00059
00061 ~EBFluxRegister();
00062
00064
00067 void
00068 define(const DisjointBoxLayout& a_dblFine,
00069 const DisjointBoxLayout& a_dblCoar,
00070 const EBISLayout& a_ebislFine,
00071 const EBISLayout& a_ebislCoar,
00072 const ProblemDomain& a_domainCoar,
00073 const int& a_nref,
00074 const int& a_nvar,
00075 const EBIndexSpace* ebisPtr);
00076
00078
00081 void
00082 setToZero();
00083
00085
00093 void
00094 incrementCoarseRegular(const EBFaceFAB& a_coarseFlux,
00095 const Real& a_scale,
00096 const DataIndex& a_coarseDataIndex,
00097 const Interval& a_variables,
00098 const int& a_dir);
00099
00101 void
00102 incrementCoarseBoth(const EBFaceFAB& a_coarseFlux,
00103 const Real& a_scale,
00104 const DataIndex& a_coarseDataIndex,
00105 const Interval& a_variables,
00106 const int& a_dir);
00107
00108 void incrementCoarse(const EBFaceFAB& a_coarseFlux,
00109 const Real& a_scale,
00110 const DataIndex& a_coarseDataIndex,
00111 const Interval& a_varSrc,
00112 const Interval& a_varDst,
00113 const int& a_dir)
00114 {
00115 CH_assert(a_varSrc==a_varDst);
00116 incrementCoarseBoth(a_coarseFlux, a_scale, a_coarseDataIndex, a_varSrc, a_dir);
00117 }
00118
00120
00153 void
00154 incrementCoarseRegulRZ(const EBFaceFAB& a_coarseFlux,
00155 const Real& a_scale,
00156 const DataIndex& a_coarseDataIndex,
00157 const Interval& a_variables,
00158 const int& a_dir,
00159 const Real& a_dx);
00160
00162
00170 void
00171 incrementCoarseIrregular(const BaseIFFAB<Real>& a_coarseFlux,
00172 const Real& a_scale,
00173 const DataIndex& a_coarseDataIndex,
00174 const Interval& a_variables,
00175 const int& a_dir);
00176
00178
00181 void incrementCoarseIrregular(const EBFaceFAB& a_coarFlux,
00182 const Real& a_scale,
00183 const DataIndex& a_coarDatInd,
00184 const Interval& a_variables,
00185 const int& a_dir);
00187
00220 void
00221 incrementCoarseIrregulRZ(const BaseIFFAB<Real>& a_coarseFlux,
00222 const Real& a_scale,
00223 const DataIndex& a_coarseDataIndex,
00224 const Interval& a_variables,
00225 const int& a_dir,
00226 const Real& a_dx);
00227
00229
00235 void
00236 incrementFineRegular(const EBFaceFAB& a_fineFlux,
00237 const Real& a_scale,
00238 const DataIndex& a_fineDataIndex,
00239 const Interval& a_variables,
00240 const int& a_dir,
00241 const Side::LoHiSide& a_sd);
00242
00244 void
00245 incrementFineBoth(const EBFaceFAB& a_fineFlux,
00246 const Real& a_scale,
00247 const DataIndex& a_fineDataIndex,
00248 const Interval& a_variables,
00249 const int& a_dir,
00250 const Side::LoHiSide& a_sd);
00251
00252 void
00253 incrementFine(const EBFaceFAB& a_fineFlux,
00254 const Real& a_scale,
00255 const DataIndex& a_fineDataIndex,
00256 const Interval& a_varSrc,
00257 const Interval& a_varDst,
00258 const int& a_dir)
00259 {
00260 CH_assert(a_varSrc == a_varDst);
00261 for(SideIterator sit; sit.ok(); ++sit)
00262 {
00263 incrementFineBoth(a_fineFlux, a_scale, a_fineDataIndex, a_varSrc, a_dir, sit());
00264 }
00265 }
00266
00267
00268
00269
00271
00304 void
00305 incrementFineRegulRZ(const EBFaceFAB& a_fineFlux,
00306 const Real& a_scale,
00307 const DataIndex& a_fineDataIndex,
00308 const Interval& a_variables,
00309 const int& a_dir,
00310 const Side::LoHiSide& a_sd,
00311 const Real& a_dx);
00312
00314
00320 void
00321 incrementFineIrregular(const BaseIFFAB<Real>& a_fineFlux,
00322 const Real& a_scale,
00323 const DataIndex& a_fineDataIndex,
00324 const Interval& a_variables,
00325 const int& a_dir,
00326 const Side::LoHiSide& a_sd);
00327
00329
00332 void
00333 incrementFineIrregular(const EBFaceFAB& a_fineFlux,
00334 const Real& a_scale,
00335 const DataIndex& a_fineDataIndex,
00336 const Interval& a_variables,
00337 const int& a_dir,
00338 const Side::LoHiSide& a_sd);
00339
00341 void
00342 incrementFineBothRZ(const EBFaceFAB& a_fineFlux,
00343 const Real& a_scale,
00344 const DataIndex& a_fineDataIndex,
00345 const Interval& a_variables,
00346 const int& a_dir,
00347 const Side::LoHiSide& a_sd,
00348 const Real& a_dx);
00350 void
00351 incrementCoarseBothRZ(const EBFaceFAB& a_coarseFlux,
00352 const Real& a_scale,
00353 const DataIndex& a_coarseDataIndex,
00354 const Interval& a_variables,
00355 const int& a_dir,
00356 const Real& a_dx);
00358
00391 void
00392 incrementFineIrregulRZ(const BaseIFFAB<Real>& a_fineFlux,
00393 const Real& a_scale,
00394 const DataIndex& a_fineDataIndex,
00395 const Interval& a_variables,
00396 const int& a_dir,
00397 const Side::LoHiSide& a_sd,
00398 const Real& a_dx);
00399
00401
00406 void reflux(LevelData<EBCellFAB>& a_uCoarse,
00407 const Interval& a_variables,
00408 const Real& a_scale);
00409
00411
00417 void reflux(LevelData<EBCellFAB>& a_uCoarse,
00418 const Interval& a_variables,
00419 const Real& a_scale,
00420 const LevelData<EBCellFAB>& a_beta);
00421
00423 void reflux(LevelData<EBCellFAB>& a_uCoarse,
00424 const Interval& a_variables,
00425 const Real& a_scale,
00426 const int& a_refluxDir);
00427
00429 void reflux(LevelData<EBCellFAB>& a_uCoarse,
00430 const Interval& a_variables,
00431 const Real& a_scale,
00432 const int& a_refluxDir,
00433 const LevelData<EBCellFAB>& a_beta);
00434
00436
00440 void incrementRedistRegister(EBCoarToFineRedist& a_register,
00441 const Interval& a_variables,
00442 const Real& a_scale);
00443
00445
00449 void incrementRedistRegister(EBCoarToCoarRedist& a_register,
00450 const Interval& a_variables,
00451 const Real& a_scale);
00452
00454 void incrementRedistRegistRZ(EBCoarToCoarRedist& a_register,
00455 const Interval& a_variables,
00456 const Real& a_dx);
00457
00459
00463 void incrementDensityArray(LevelData<EBCellFAB>& a_coarMass,
00464 const Interval& a_variables,
00465 const Real& a_scale);
00466
00468 bool isDefined() const;
00469
00471 void dumpCoar(const int& a_idir,
00472 const Side::LoHiSide& a_sd);
00474 void dumpFine(const int& a_idir,
00475 const Side::LoHiSide& a_sd);
00476
00478 void dumpBIVF(const BaseIVFAB<Real>& reg,
00479 const EBISBox& a_ebisBox);
00480 protected:
00481
00482 static int index(int a_dir, Side::LoHiSide a_side);
00483
00484
00485 void setDefaultValues();
00486
00487
00488
00489
00490
00491
00492
00493
00494 DisjointBoxLayout m_gridsFine;
00495
00496 DisjointBoxLayout m_gridsCoar;
00497
00498
00499 DisjointBoxLayout m_bufGridsFine[SpaceDim*2];
00500
00501 DisjointBoxLayout m_bufGridsCoar[SpaceDim*2];
00502
00503
00504 LevelData<BaseIVFAB<Real> > m_regsCoar[SpaceDim*2];
00505
00506 LevelData<BaseIVFAB<Real> > m_regsFine[SpaceDim*2];
00507
00508
00509 LevelData<BaseIVFAB<Real> > m_scratchc[SpaceDim*2];
00510
00511
00512 LayoutData<IntVectSet> m_cfivsFine[SpaceDim*2];
00513
00514 LayoutData<IntVectSet> m_cfivsCoar[SpaceDim*2];
00515
00516
00517 EBISLayout m_ebislFine;
00518
00519 EBISLayout m_ebislCoar;
00520
00521
00522 EBISLayout m_ebislBufCoar[2*SpaceDim];
00523
00524 EBISLayout m_ebislBufFine[2*SpaceDim];
00525
00526
00527 LayoutData<Vector<DataIndex> > m_coarIndexMap[SpaceDim*2];
00528
00529 bool m_isDefined;
00530 int m_nComp;
00531 int m_refRat;
00532 ProblemDomain m_domainCoar;
00533
00534 private:
00535
00536
00537
00538
00539 void operator= (const EBFluxRegister&)
00540 {
00541 MayDay::Error("invalid operator");
00542 }
00543 EBFluxRegister(const EBFluxRegister&)
00544 {
00545 MayDay::Error("invalid operator");
00546 }
00547 };
00548 #include "NamespaceFooter.H"
00549 #endif