chombo-discharge
CD_AmrMesh.H
Go to the documentation of this file.
1 /* chombo-discharge
2  * Copyright © 2021 SINTEF Energy Research.
3  * Please refer to Copyright.txt and LICENSE in the chombo-discharge root directory.
4  */
5 
14 #ifndef CD_AmrMesh_H
15 #define CD_AmrMesh_H
16 
17 // Chombo includes
18 #include <DisjointBoxLayout.H>
19 #include <ProblemDomain.H>
20 
21 // Our includes
22 #include <CD_EBAMRData.H>
23 #include <CD_EBCoarAve.H>
26 #include <CD_IrregAmrStencil.H>
27 #include <CD_LoadBalancing.H>
28 #include <CD_MFLevelGrid.H>
29 #include <CD_EBReflux.H>
30 #include <CD_DomainFluxIFFAB.H>
32 #include <CD_ParticleContainer.H>
34 #include <CD_Realm.H>
35 #include <CD_CopyStrategy.H>
36 #include <CD_LoadBalancing.H>
37 #include <CD_NamespaceHeader.H>
38 
43 class AmrMesh
44 {
45 public:
49  AmrMesh();
50 
55  AmrMesh(const AmrMesh& a_other) = delete;
56 
61  AmrMesh(const AmrMesh&& a_other) = delete;
62 
66  virtual ~AmrMesh();
67 
72  AmrMesh&
73  operator=(const AmrMesh& a_other) = delete;
74 
79  AmrMesh&
80  operator=(const AmrMesh&& a_other) = delete;
81 
92  template <typename T>
93  void
94  copyData(EBAMRData<T>& a_dst,
95  const EBAMRData<T>& a_src,
96  const CopyStrategy& a_toRegion = CopyStrategy::Valid,
97  const CopyStrategy& a_fromRegion = CopyStrategy::Valid) const noexcept;
98 
110  template <typename T>
111  void
112  copyData(EBAMRData<T>& a_dst,
113  const EBAMRData<T>& a_src,
114  const Interval& a_dstComps,
115  const Interval& a_srcComps,
116  const CopyStrategy& a_toRegion = CopyStrategy::Valid,
117  const CopyStrategy& a_fromRegion = CopyStrategy::Valid) const noexcept;
118 
132  template <typename T>
133  void
134  copyData(LevelData<T>& a_dst,
135  const LevelData<T>& a_src,
136  const int a_level,
137  const std::string a_toRealm,
138  const std::string a_fromRealm,
139  const CopyStrategy& a_toRegion = CopyStrategy::Valid,
140  const CopyStrategy& a_fromRegion = CopyStrategy::Valid) const noexcept;
141 
157  template <typename T>
158  void
159  copyData(LevelData<T>& a_dst,
160  const LevelData<T>& a_src,
161  const int a_level,
162  const std::string a_toRealm,
163  const std::string a_fromRealm,
164  const Interval& a_dstComps,
165  const Interval& a_srcComps,
166  const CopyStrategy& a_toRegion = CopyStrategy::Valid,
167  const CopyStrategy& a_fromRegion = CopyStrategy::Valid) const noexcept;
168 
173  template <typename T>
174  void
175  deallocate(Vector<T*>& a_data) const;
176 
181  template <typename T>
182  void
183  deallocate(Vector<RefCountedPtr<T>>& a_data) const;
184 
189  template <typename T>
190  void
191  deallocate(EBAMRData<T>& a_data) const;
192 
199  template <typename T>
200  void
201  alias(Vector<T*>& a_alias, const Vector<RefCountedPtr<T>>& a_data) const;
202 
209  template <typename T, typename S>
210  void
211  alias(Vector<T*>& a_alias, const EBAMRData<S>& a_data) const;
212 
218  template <typename T>
219  void
220  allocate(Vector<RefCountedPtr<ParticleData<T>>>& a_particles, const std::string a_realm) const;
221 
227  template <typename T>
228  void
229  allocate(ParticleContainer<T>& a_container, const std::string a_realm) const;
230 
236  template <typename T>
237  void
238  allocatePointer(Vector<RefCountedPtr<T>>& a_data) const;
239 
246  template <typename T>
247  void
248  allocatePointer(Vector<RefCountedPtr<T>>& a_data, const int a_finestLevel) const;
249 
256  template <typename T>
257  void
258  allocatePointer(EBAMRData<T>& a_data, const std::string a_realm) const;
259 
267  template <typename T>
268  void
269  allocatePointer(EBAMRData<T>& a_data, const std::string a_realm, const int a_finestLevel) const;
270 
278  slice(EBAMRCellData& a_original, const Interval a_variables) const noexcept;
279 
286  const EBAMRCellData
287  slice(const EBAMRCellData& a_original, const Interval a_variables) const noexcept;
288 
292  void
293  parseOptions();
294 
299  void
301 
309  void
310  registerOperator(const std::string a_operator, const std::string a_realm, const phase::which_phase a_phase);
311 
320  void
321  registerMask(const std::string a_mask, const int a_buffer, const std::string a_realm);
322 
326  void
327  buildDomains();
328 
334  void
335  setFinestLevel(const int a_finestLevel);
336 
340  void
341  setCoarsestGrid(const IntVect& a_nCells);
342 
348  bool
349  queryRealm(const std::string a_realm) const;
350 
355  bool
356  getEbCf() const;
357 
363  void
364  registerRealm(const std::string a_realm);
365 
373  void
374  alias(EBAMRCellData& a_data,
375  const phase::which_phase a_phase,
376  const MFAMRCellData& a_mfdata,
377  const int a_finestLevel) const;
378 
386  void
387  alias(EBAMRFluxData& a_data,
388  const phase::which_phase a_phase,
389  const MFAMRFluxData& a_mfdata,
390  const int a_finestLevel) const;
391 
398  void
399  alias(EBAMRCellData& a_data, const phase::which_phase a_phase, const MFAMRCellData& a_mfdata) const;
400 
407  void
408  alias(EBAMRFluxData& a_data, const phase::which_phase a_phase, const MFAMRFluxData& a_mfdata) const;
409 
416  void
417  alias(EBAMRIVData& a_data, const phase::which_phase a_phase, const MFAMRIVData& a_mfdata) const;
418 
426  alias(const phase::which_phase a_phase, const MFAMRCellData& a_mfdata) const;
427 
435  alias(const phase::which_phase a_phase, const MFAMRFluxData& a_mfdata) const;
436 
444  alias(const phase::which_phase a_phase, const MFAMRIVData& a_mfdata) const;
445 
455  void
456  computeGradient(EBAMRCellData& a_gradient,
457  const EBAMRCellData& a_phi,
458  const std::string a_realm,
459  const phase::which_phase a_phase) const;
460 
470  void
471  computeGradient(EBAMRFluxData& a_gradient,
472  const EBAMRCellData& a_phi,
473  const std::string a_realm,
474  const phase::which_phase a_phase) const;
475 
484  void
485  computeGradient(MFAMRCellData& a_gradient, const MFAMRCellData& a_phi, const std::string a_realm) const;
486 
495  void
496  computeGradient(MFAMRFluxData& a_gradient, const MFAMRCellData& a_phi, const std::string a_realm) const;
497 
507  void
508  allocate(EBAMRCellData& a_data,
509  const std::string a_realm,
510  const phase::which_phase a_phase,
511  const int a_nComp,
512  const int a_nGhost = -1) const;
513 
524  void
525  allocate(LevelData<EBCellFAB>& a_data,
526  const std::string a_realm,
527  const phase::which_phase a_phase,
528  const int a_level,
529  const int a_nComp,
530  const int a_nGhost = -1) const;
531 
541  void
542  allocate(EBAMRFluxData& a_data,
543  const std::string a_realm,
544  const phase::which_phase a_phase,
545  const int a_nComp,
546  const int a_nGhost = -1) const;
547 
557  void
558  allocate(EBAMRIVData& a_data,
559  const std::string a_realm,
560  const phase::which_phase a_phase,
561  const int a_nComp,
562  const int a_nGhost = -1) const;
563 
572  void
573  allocate(EBAMRIFData& a_data,
574  const std::string a_realm,
575  const phase::which_phase a_phase,
576  const int a_nComp,
577  const int a_nGhost = -1) const;
578 
587  void
588  allocate(EBAMRBool& a_data, const std::string a_realm, const int a_nComp, const int a_nGhost = -1) const;
589 
598  void
599  allocate(MFAMRCellData& a_data, const std::string a_realm, const int a_nComp, const int a_nGhost = -1) const;
600 
609  void
610  allocate(MFAMRFluxData& a_data, const std::string a_realm, const int a_nComp, const int a_ghost = -1) const;
611 
620  void
621  allocate(MFAMRIVData& a_data, const std::string a_realm, const int a_nComp, const int a_ghost = 0) const;
622 
630  void
631  reallocate(EBAMRCellData& a_data, const phase::which_phase a_phase, const int a_lmin) const;
632 
640  void
641  reallocate(EBAMRFluxData& a_data, const phase::which_phase a_phase, const int a_lmin) const;
642 
650  void
651  reallocate(EBAMRIVData& a_data, const phase::which_phase a_phase, const int a_lmin) const;
652 
660  void
661  reallocate(EBAMRIFData& a_data, const phase::which_phase a_phase, const int a_lmin) const;
662 
669  void
670  reallocate(EBAMRBool& a_data, const int a_lmin) const;
671 
678  void
679  reallocate(MFAMRCellData& a_data, const int a_lmin) const;
680 
687  void
688  reallocate(MFAMRFluxData& a_data, const int a_lmin) const;
689 
696  void
697  reallocate(MFAMRIVData& a_data, const int a_lmin) const;
698 
705  void
706  average(MFAMRCellData& a_data, const std::string a_realm, const Average& a_average) const;
707 
713  void
714  arithmeticAverage(MFAMRCellData& a_data, const std::string a_realm) const;
715 
721  void
722  harmonicAverage(MFAMRCellData& a_data, const std::string a_realm) const;
723 
729  void
730  conservativeAverage(MFAMRCellData& a_data, const std::string a_realm) const;
731 
738  void
739  average(MFAMRFluxData& a_data, const std::string a_realm, const Average& a_average) const;
740 
747  void
748  arithmeticAverage(MFAMRFluxData& a_data, const std::string a_realm) const;
749 
756  void
757  harmonicAverage(MFAMRFluxData& a_data, const std::string a_realm) const;
758 
764  void
765  conservativeAverage(MFAMRFluxData& a_data, const std::string a_realm) const;
766 
774  void
775  average(EBAMRCellData& a_data,
776  const std::string a_realm,
777  const phase::which_phase a_phase,
778  const Average& a_average) const;
779 
788  void
789  average(EBAMRCellData& a_data,
790  const std::string a_realm,
791  const phase::which_phase a_phase,
792  const Average& a_average,
793  const Interval& a_variables) const;
794 
801  void
802  arithmeticAverage(EBAMRCellData& a_data, const std::string a_realm, const phase::which_phase a_phase) const;
803 
811  void
813  const std::string a_realm,
814  const phase::which_phase a_phase,
815  const Interval& a_variables) const;
816 
823  void
824  harmonicAverage(EBAMRCellData& a_data, const std::string a_realm, const phase::which_phase a_phase) const;
825 
833  void
835  const std::string a_realm,
836  const phase::which_phase a_phase,
837  const Interval& a_variables) const;
838 
845  void
846  conservativeAverage(EBAMRCellData& a_data, const std::string a_realm, const phase::which_phase a_phase) const;
847 
855  void
857  const std::string a_realm,
858  const phase::which_phase a_phase,
859  const Interval& a_variables) const;
860 
868  void
869  average(EBAMRFluxData& a_data,
870  const std::string a_realm,
871  const phase::which_phase a_phase,
872  const Average& a_average) const;
873 
881  void
882  arithmeticAverage(EBAMRFluxData& a_data, const std::string a_realm, const phase::which_phase a_phase) const;
883 
891  void
892  harmonicAverage(EBAMRFluxData& a_data, const std::string a_realm, const phase::which_phase a_phase) const;
893 
900  void
901  conservativeAverage(EBAMRFluxData& a_data, const std::string a_realm, const phase::which_phase a_phase) const;
902 
910  void
911  average(EBAMRIVData& a_data,
912  const std::string a_realm,
913  const phase::which_phase a_phase,
914  const Average& a_average) const;
915 
922  void
923  arithmeticAverage(EBAMRIVData& a_data, const std::string a_realm, const phase::which_phase a_phase) const;
924 
931  void
932  harmonicAverage(EBAMRIVData& a_data, const std::string a_realm, const phase::which_phase a_phase) const;
933 
940  void
941  conservativeAverage(EBAMRIVData& a_data, const std::string a_realm, const phase::which_phase a_phase) const;
942 
964  template <class P, const Real& (P::*particleScalarField)() const>
965  void
966  depositParticles(EBAMRCellData& a_meshData,
967  const std::string& a_realm,
968  const phase::which_phase& a_phase,
969  const ParticleContainer<P>& a_particles,
970  const DepositionType a_depositionType,
971  const CoarseFineDeposition a_coarseFineDeposition,
972  const bool a_forceIrregNGP = false);
973 
985  template <class P, Real (P::*particleScalarField)() const>
986  void
988  const std::string& a_realm,
989  const phase::which_phase& a_phase,
990  const ParticleContainer<P>& a_particles,
991  const DepositionType a_depositionType,
992  const CoarseFineDeposition a_coarseFineDeposition,
993  const bool a_forceIrregNGP = false);
994 
1016  template <class P, const RealVect& (P::*particleVectorField)() const>
1017  void
1019  const std::string& a_realm,
1020  const phase::which_phase& a_phase,
1021  const ParticleContainer<P>& a_particles,
1022  const DepositionType a_depositionType,
1023  const CoarseFineDeposition a_coarseFineDeposition,
1024  const bool a_forceIrregNGP = false);
1025 
1037  template <class P, RealVect (P::*particleVectorField)() const>
1038  void
1040  const std::string& a_realm,
1041  const phase::which_phase& a_phase,
1042  const ParticleContainer<P>& a_particles,
1043  const DepositionType a_depositionType,
1044  const CoarseFineDeposition a_coarseFineDeposition,
1045  const bool a_forceIrregNGP = false);
1046 
1058  template <class P, const Real& (P::*particleScalarField)() const>
1059  void
1060  depositParticles(EBAMRIVData& a_meshData,
1061  const std::string& a_realm,
1062  const phase::which_phase& a_phase,
1063  const ParticleContainer<P>& a_particles) const noexcept;
1064 
1076  template <class P, Real (P::*particleScalarField)() const>
1077  void
1079  const std::string& a_realm,
1080  const phase::which_phase& a_phase,
1081  const ParticleContainer<P>& a_particles) const noexcept;
1082 
1101  template <class P, Real& (P::*particleScalarField)()>
1102  void
1104  const std::string& a_realm,
1105  const phase::which_phase& a_phase,
1106  const EBAMRCellData& a_meshScalarField,
1107  const DepositionType a_interpType,
1108  const bool a_forceIrregNGP = false) const;
1109 
1128  template <class P, RealVect& (P::*particleVectorField)()>
1129  void
1131  const std::string& a_realm,
1132  const phase::which_phase& a_phase,
1133  const EBAMRCellData& a_meshVectorField,
1134  const DepositionType a_interpType,
1135  const bool a_forceIrregNGP = false) const;
1136 
1147  template <class P>
1148  void
1150  const phase::which_phase& a_phase,
1151  const Real a_tolerance = 0.0) const;
1152 
1163  template <class P>
1164  void
1166  const phase::which_phase& a_phase,
1167  const Real a_tolerance = 0.0) const;
1168 
1177  template <class P>
1178  void
1179  removeCoveredParticlesVoxels(ParticleContainer<P>& a_particles, const phase::which_phase& a_phase) const;
1180 
1192  template <class P>
1193  void
1195  ParticleContainer<P>& a_particlesTo,
1196  const phase::which_phase& a_phase,
1197  const Real a_tolerance = 0.0) const;
1198 
1210  template <class P>
1211  void
1213  ParticleContainer<P>& a_particlesTo,
1214  const phase::which_phase& a_phase,
1215  const Real a_tolerance = 0.0) const;
1216 
1227  template <class P>
1228  void
1230  ParticleContainer<P>& a_particlesTo,
1231  const phase::which_phase& a_phase) const;
1232 
1240  template <class P>
1241  void
1243  ParticleContainer<P>& a_dstParticles,
1244  ParticleContainer<P>& a_srcParticles,
1245  const phase::which_phase a_phase,
1246  const std::function<void(P&)> a_transferModifier = [](P&) -> void {
1247  return;
1248  }) const noexcept;
1249 
1269  template <class P>
1270  void
1272  ParticleContainer<P>& a_activeParticles,
1273  ParticleContainer<P>& a_ebParticles,
1274  ParticleContainer<P>& a_domainParticles,
1275  const phase::which_phase a_phase,
1276  const Real a_tolerance,
1277  const bool a_deleteParticles,
1278  const std::function<void(P&)> a_nonDeletionModifier = [](P&) -> void {
1279  return;
1280  }) const noexcept;
1281 
1297  template <class P>
1298  void
1300  ParticleContainer<P>& a_activeParticles,
1301  ParticleContainer<P>& a_ebParticles,
1302  ParticleContainer<P>& a_domainParticles,
1303  const phase::which_phase a_phase,
1304  const Real a_bisectionStep,
1305  const bool a_deleteParticles,
1306  const std::function<void(P&)> a_nonDeletionModifier = [](P&) -> void {
1307  return;
1308  }) const noexcept;
1309 
1316  void
1317  interpGhost(EBAMRCellData& a_data, const std::string a_realm, const phase::which_phase a_phase) const;
1318 
1327  void
1328  interpGhost(LevelData<EBCellFAB>& a_fineData,
1329  const LevelData<EBCellFAB>& a_coarData,
1330  const int a_level,
1331  const std::string a_realm,
1332  const phase::which_phase a_phase) const;
1333 
1339  void
1340  interpGhost(MFAMRCellData& a_data, const std::string a_realm) const;
1341 
1348  void
1349  interpGhostPwl(MFAMRCellData& a_data, const std::string a_realm) const;
1350 
1357  void
1358  interpGhostPwl(EBAMRCellData& a_data, const std::string a_realm, const phase::which_phase a_phase) const;
1359 
1368  void
1369  interpGhostMG(MFAMRCellData& a_data, const std::string a_realm) const;
1370 
1379  void
1380  interpGhostMG(EBAMRCellData& a_data, const std::string a_realm, const phase::which_phase a_phase) const;
1381 
1393  void
1394  interpToNewGrids(MFAMRCellData& a_newData,
1395  const MFAMRCellData& a_oldData,
1396  const int a_lmin,
1397  const int a_oldFinestLevel,
1398  const int a_newFinestLevel,
1399  const EBCoarseToFineInterp::Type a_type);
1400 
1413  void
1414  interpToNewGrids(EBAMRCellData& a_newData,
1415  const EBAMRCellData& a_oldData,
1416  const phase::which_phase a_phase,
1417  const int a_lmin,
1418  const int a_oldFinestLevel,
1419  const int a_newFinestLevel,
1420  const EBCoarseToFineInterp::Type a_type);
1421 
1434  void
1435  interpToNewGrids(EBAMRIVData& a_newData,
1436  const EBAMRIVData& a_oldData,
1437  const phase::which_phase a_phase,
1438  const int a_lmin,
1439  const int a_oldFinestLevel,
1440  const int a_newFinestLevel,
1441  const EBCoarseToFineInterp::Type a_type);
1442 
1449  template <class P>
1450  void
1451  remapToNewGrids(ParticleContainer<P>& a_particles, const int a_lmin, const int a_newFinestLevel) const noexcept;
1452 
1460  void
1461  interpToCentroids(EBAMRCellData& a_data, const std::string a_realm, const phase::which_phase a_phase) const;
1462 
1470  void
1471  interpToCentroids(LevelData<EBCellFAB>& a_data,
1472  const std::string a_realm,
1473  const phase::which_phase a_phase,
1474  const int a_level) const;
1475 
1480  void
1481  setMultifluidIndexSpace(const RefCountedPtr<MultiFluidIndexSpace>& a_multiFluidIndexSpace);
1482 
1488  void
1489  setBaseImplicitFunction(const phase::which_phase a_phase, const RefCountedPtr<BaseIF>& a_baseIF);
1490 
1494  void
1495  preRegrid();
1496 
1503  void
1504  regridAmr(const Vector<IntVectSet>& a_tags, const int a_lmin, const int a_hardcap = -1);
1505 
1513  void
1514  regridRealm(const std::string a_realm,
1515  const Vector<Vector<int>>& a_procs,
1516  const Vector<Vector<Box>>& a_boxes,
1517  const int a_lmin);
1518 
1522  void
1523  postRegrid();
1524 
1531  void
1532  setGrids(const Vector<Vector<Box>>& a_boxes, const std::map<std::string, Vector<Vector<long int>>>& a_realmsAndLoads);
1533 
1538  void
1539  regridOperators(const int a_lmin);
1540 
1546  void
1547  regridOperators(const std::string a_realm, const int a_lmin);
1548 
1552  void
1553  sanityCheck() const;
1554 
1558  int
1559  getFinestLevel() const;
1560 
1564  int
1565  getMaxAmrDepth() const;
1566 
1570  int
1571  getMaxSimulationDepth() const;
1572 
1576  int
1577  getBlockingFactor() const;
1578 
1582  int
1583  getMaxBoxSize() const;
1584 
1588  int
1589  getBrBuffer() const;
1590 
1594  int
1595  getMaxEbisBoxSize() const;
1596 
1600  int
1601  getNumberOfGhostCells() const;
1602 
1606  int
1607  getNumberOfEbGhostCells() const;
1608 
1612  int
1613  getRedistributionRadius() const;
1614 
1618  Real
1619  getFinestDx() const;
1620 
1624  RealVect
1625  getProbLo() const;
1626 
1630  RealVect
1631  getProbHi() const;
1632 
1636  ProblemDomain
1637  getFinestDomain() const;
1638 
1642  const Vector<Real>&
1643  getDx() const;
1644 
1648  const Vector<int>&
1649  getRefinementRatios() const;
1650 
1657  int
1658  getRefinementRatio(const int a_level1, const int a_level2) const;
1659 
1664  const RefCountedPtr<BaseIF>&
1665  getBaseImplicitFunction(const phase::which_phase a_phase) const;
1666 
1671  const Vector<DisjointBoxLayout>&
1672  getProxyGrids() const;
1673 
1677  const Vector<DisjointBoxLayout>&
1678  getGrids(const std::string a_realm) const;
1679 
1683  const Vector<ProblemDomain>&
1684  getDomains() const;
1685 
1692  const AMRMask&
1693  getMask(const std::string a_mask, const int a_buffer, const std::string a_realm) const;
1694 
1699  const AMRMask&
1700  getValidCells(const std::string a_realm) const;
1701 
1706  const Vector<RefCountedPtr<LevelTiles>>&
1707  getLevelTiles(const std::string a_realm) const;
1708 
1714  const Vector<RefCountedPtr<EBLevelGrid>>&
1715  getEBLevelGrid(const std::string a_realm, const phase::which_phase a_phase) const;
1716 
1722  const Vector<RefCountedPtr<EBLevelGrid>>&
1723  getEBLevelGridCoFi(const std::string a_realm, const phase::which_phase a_phase) const;
1724 
1730  const Vector<EBISLayout>&
1731  getEBISLayout(const std::string a_realm, const phase::which_phase a_phase) const;
1732 
1737  const Vector<RefCountedPtr<MFLevelGrid>>&
1738  getMFLevelGrid(const std::string a_realm) const;
1739 
1744  Vector<RefCountedPtr<LayoutData<VoFIterator>>>&
1745  getVofIterator(const std::string a_realm, const phase::which_phase a_phase) const;
1746 
1752  const EBAMRFAB&
1753  getLevelset(const std::string a_realm, const phase::which_phase a_phase) const;
1754 
1761  getParticleMesh(const std::string a_realm, const phase::which_phase a_phase) const;
1762 
1769  getSurfaceDeposition(const std::string a_realm, const phase::which_phase a_phase) const;
1770 
1774  Vector<RefCountedPtr<EBCoarAve>>&
1775  getCoarseAverage(const std::string a_realm, const phase::which_phase a_phase) const;
1776 
1782  Vector<RefCountedPtr<EBMultigridInterpolator>>&
1783  getMultigridInterpolator(const std::string a_realm, const phase::which_phase a_phase) const;
1784 
1790  Vector<RefCountedPtr<EBCoarseToFineInterp>>&
1791  getFineInterp(const std::string a_realm, const phase::which_phase a_phase) const;
1792 
1798  Vector<RefCountedPtr<EBReflux>>&
1799  getFluxRegister(const std::string a_realm, const phase::which_phase a_phase) const;
1800 
1806  Vector<RefCountedPtr<EBFluxRedistribution>>&
1807  getRedistributionOp(const std::string a_realm, const phase::which_phase a_phase) const;
1808 
1815  getCentroidInterpolationStencils(const std::string a_realm, const phase::which_phase a_phase) const;
1816 
1823  getEbCentroidInterpolationStencils(const std::string a_realm, const phase::which_phase a_phase) const;
1824 
1831  getNonConservativeDivergenceStencils(const std::string a_realm, const phase::which_phase a_phase) const;
1832 
1837  std::vector<std::string>
1838  getRealms() const;
1839 
1844  BoxSorting
1845  getBoxSorting() const;
1846 
1851  RefCountedPtr<EBIndexSpace>&
1852  getEBIndexSpace(const phase::which_phase a_phase)
1853  {
1854  return m_multifluidIndexSpace->getEBIndexSpace(a_phase);
1855  }
1856 
1857 protected:
1862  {
1863  BergerRigoutsous,
1864  Tiled,
1865  };
1866 
1870  mutable std::map<std::string, RefCountedPtr<Realm>> m_realms;
1871 
1875  std::map<phase::which_phase, RefCountedPtr<BaseIF>> m_baseif;
1876 
1880  std::map<std::string, Vector<DisjointBoxLayout>> m_oldGrids;
1881 
1886  std::map<std::string, Vector<Copier>> m_oldToNewCellCopiers;
1887 
1892  std::map<std::string, Vector<Copier>> m_oldToNewEBCopiers;
1893 
1898  std::map<std::pair<std::string, std::string>, Vector<Copier>> m_validToValidRealmCopiers;
1899 
1904  std::map<std::pair<std::string, std::string>, Vector<Copier>> m_validToValidGhostRealmCopiers;
1905 
1910  std::map<std::pair<std::string, std::string>, Vector<Copier>> m_validGhostToValidRealmCopiers;
1911 
1916  std::map<std::pair<std::string, std::string>, Vector<Copier>> m_validGhostToValidGhostRealmCopiers;
1917 
1922 
1927 
1931  RefCountedPtr<MultiFluidIndexSpace> m_multifluidIndexSpace;
1932 
1937 
1942 
1947 
1951  IntVect m_numCells;
1952 
1957 
1961  RealVect m_probLo;
1962 
1966  RealVect m_probHi;
1967 
1972 
1977 
1982 
1987 
1992 
1997 
2002 
2007 
2012 
2017 
2022 
2027 
2032 
2037 
2042 
2047 
2052 
2057 
2062 
2067 
2072 
2077 
2082 
2087 
2092 
2096  Vector<DisjointBoxLayout> m_grids;
2097 
2101  Vector<ProblemDomain> m_domains;
2102 
2106  Vector<int> m_refinementRatios;
2107 
2111  Vector<Real> m_dx;
2112 
2116  void
2117  defineRealms();
2118 
2126  void
2127  buildGrids(const Vector<IntVectSet>& a_tags, const int a_lmin, const int a_hardcap = -1);
2128 
2132  void
2133  buildCopiers();
2134 
2138  void
2140 
2144  void
2146 
2150  void
2151  parseVerbosity();
2152 
2156  void
2158 
2162  void
2163  parseMaxAmrDepth();
2164 
2168  void
2170 
2174  void
2176 
2180  void
2182 
2186  void
2187  parseBrFillRatio();
2188 
2192  void
2193  parseMaxBoxSize();
2194 
2199  void
2201 
2205  void
2207 
2212  void
2214 
2218  void
2220 
2224  void
2226 
2230  void
2232 
2236  void
2238 
2242  void
2244 
2255  void
2256  computeGradient(LevelData<EBCellFAB>& a_gradient,
2257  const LevelData<EBCellFAB>& a_phi,
2258  const std::string a_realm,
2259  const phase::which_phase a_phase,
2260  const int a_lvl) const;
2261 };
2262 
2263 #include <CD_NamespaceFooter.H>
2264 
2265 #include <CD_AmrMeshImplem.H>
2266 
2267 #endif
Implementation of CD_AmrMesh.H.
Average
Various averaging methods.
Definition: CD_Average.H:24
BoxSorting
Enum for sorting boxes.
Definition: CD_BoxSorting.H:21
CoarseFineDeposition
Coarse-fine deposition types (see CD_EBAMRParticleMesh for how these are handled).
Definition: CD_CoarseFineDeposition.H:26
Declaration of base class for defining geometries.
Simple enum for distinguishing copying strategies.
CopyStrategy
Enum for distinguishing how we copy data Valid => valid region ValidGhost => valid+ghost region.
Definition: CD_CopyStrategy.H:23
DepositionType
Deposition types.
Definition: CD_DepositionType.H:23
Declaration of factory class for DomainFluxIFFAB.
Declaration of a BaseIFFAB wrapper that holds domain fluxes.
Class for holding data across EBAMR hierarchies.
Declaration of conservative coarsening utility.
Declaration of a class which can reflux over the coarse-fine interface.
Class for holding stencils on irregular over an entire AMR hierarchy.
Declaration of a static class for various load balancing operations.
Declaration of a wrapper for wrapping multifluid EBLevelGrids.
Multi-fluid index space.
Implementation of IrregStencil that can perform the nonconservative divergence averaging.
Declaration of a class for holding particles on an AMR hierarchy.
Declaration of the Realm class.
Vector< RefCountedPtr< LevelData< BaseFab< bool > >> > AMRMask
Alias for cutting down on the typic of booleans defined over AMR grids.
Definition: CD_Realm.H:36
Class for handling spatial operations.
Definition: CD_AmrMesh.H:44
void removeCoveredParticlesVoxels(ParticleContainer< P > &a_particles, const phase::which_phase &a_phase) const
Function which removes particles from the domain if they fall inside the EB.
Definition: CD_AmrMeshImplem.H:695
void computeGradient(EBAMRCellData &a_gradient, const EBAMRCellData &a_phi, const std::string a_realm, const phase::which_phase a_phase) const
Compute cell-centered gradient over an AMR hierarchy.
Definition: CD_AmrMesh.cpp:1337
void transferCoveredParticlesDiscrete(ParticleContainer< P > &a_particlesFrom, ParticleContainer< P > &a_particlesTo, const phase::which_phase &a_phase, const Real a_tolerance=0.0) const
Function which transferse particles from one particle container to another if they fall inside the EB...
Definition: CD_AmrMeshImplem.H:828
int m_refRatio
Refinement ratio.
Definition: CD_AmrMesh.H:1971
void parseRuntimeOptions()
Parse runtime options.
Definition: CD_AmrMesh.cpp:949
std::map< std::string, Vector< Copier > > m_oldToNewCellCopiers
Storage for copiers from the old grids to the new ones.
Definition: CD_AmrMesh.H:1886
std::vector< std::string > getRealms() const
Get the name of all Realms.
Definition: CD_AmrMesh.cpp:3467
RealVect getProbHi() const
Get upper-left corner of computational domain.
Definition: CD_AmrMesh.cpp:2751
void parseBrBufferSize()
Parse buffer size for Berger-Rigoutsous grid algorithm.
Definition: CD_AmrMesh.cpp:2495
Real getFinestDx() const
Get resolution on the finest grid level.
Definition: CD_AmrMesh.cpp:2902
const AMRMask & getValidCells(const std::string a_realm) const
Get a map of all valid cells on a specified realm.
Definition: CD_AmrMesh.cpp:3034
const RefCountedPtr< BaseIF > & getBaseImplicitFunction(const phase::which_phase a_phase) const
Get implicit function for a specific phase.
Definition: CD_AmrMesh.cpp:2935
AmrMesh(const AmrMesh &&a_other)=delete
Disallowed move constructor.
void harmonicAverage(MFAMRCellData &a_data, const std::string a_realm) const
Harmonic coarsening of multifluid data.
Definition: CD_AmrMesh.cpp:1523
Real m_fillRatioBR
Fill ratio.
Definition: CD_AmrMesh.H:1956
ProblemDomain getFinestDomain() const
Get finest domain.
Definition: CD_AmrMesh.cpp:2891
int m_oldFinestLevel
Finest level before a regrid.
Definition: CD_AmrMesh.H:1986
void copyData(EBAMRData< T > &a_dst, const EBAMRData< T > &a_src, const CopyStrategy &a_toRegion=CopyStrategy::Valid, const CopyStrategy &a_fromRegion=CopyStrategy::Valid) const noexcept
Method for copying from a source container to a destination container. User supplies information abou...
Definition: CD_AmrMeshImplem.H:22
const Vector< DisjointBoxLayout > & getProxyGrids() const
Get the "proxy" grids in AmrMesh.
Definition: CD_AmrMesh.cpp:2957
void transferCoveredParticlesIF(ParticleContainer< P > &a_particlesFrom, ParticleContainer< P > &a_particlesTo, const phase::which_phase &a_phase, const Real a_tolerance=0.0) const
Function which transferse particles from one particle container to another if they fall inside the EB...
Definition: CD_AmrMeshImplem.H:754
IntVect m_numCells
Coarsest box where we compute.
Definition: CD_AmrMesh.H:1951
void postRegrid()
Run post-regrid operations.
Definition: CD_AmrMesh.cpp:1042
void parseMaxAmrDepth()
Parse the maximum permitted AMR depth.
Definition: CD_AmrMesh.cpp:2331
Vector< RefCountedPtr< EBMultigridInterpolator > > & getMultigridInterpolator(const std::string a_realm, const phase::which_phase a_phase) const
Get multigrid interpolation utility.
Definition: CD_AmrMesh.cpp:3184
RealVect m_probHi
Domain simulation corner.
Definition: CD_AmrMesh.H:1966
int m_maxBoxSize
Max box size.
Definition: CD_AmrMesh.H:2001
void registerOperator(const std::string a_operator, const std::string a_realm, const phase::which_phase a_phase)
Register an operator over a realm and a phase.
Definition: CD_AmrMesh.cpp:3347
int m_centroidStencilOrder
Order for interpolation stencils to centroids.
Definition: CD_AmrMesh.H:2056
Vector< DisjointBoxLayout > m_grids
Grids.
Definition: CD_AmrMesh.H:2096
RefCountedPtr< MultiFluidIndexSpace > m_multifluidIndexSpace
MultiFluidIndexSpace.
Definition: CD_AmrMesh.H:1931
void regridRealm(const std::string a_realm, const Vector< Vector< int >> &a_procs, const Vector< Vector< Box >> &a_boxes, const int a_lmin)
Regrid a realm. This generates the grids for the realm, but does not do the operators on the realm.
Definition: CD_AmrMesh.cpp:3410
RealVect m_probLo
Domain simulation corner.
Definition: CD_AmrMesh.H:1961
void remapToNewGrids(ParticleContainer< P > &a_particles, const int a_lmin, const int a_newFinestLevel) const noexcept
Regrid particle to new grids.
Definition: CD_AmrMeshImplem.H:362
int m_bufferSizeBR
Set buffer size.
Definition: CD_AmrMesh.H:2011
void setCoarsestGrid(const IntVect &a_nCells)
Set the coarsest grid cells.
Definition: CD_AmrMesh.cpp:2290
void parseMaxSimulationDepth()
Set maximum simulation depth.
Definition: CD_AmrMesh.cpp:2350
int getMaxSimulationDepth() const
Get maximum permitted simulation depth.
Definition: CD_AmrMesh.cpp:2784
void interpGhostPwl(MFAMRCellData &a_data, const std::string a_realm) const
Interpolate ghost cells over a realm and phase. This uses piecewise linear interpolation (with limite...
Definition: CD_AmrMesh.cpp:1953
int m_maxSimulationDepth
Maximum allowed depth for simulation.
Definition: CD_AmrMesh.H:1996
void setFinestLevel(const int a_finestLevel)
Set the finest level.
Definition: CD_AmrMesh.cpp:2407
RefCountedPtr< EBIndexSpace > & getEBIndexSpace(const phase::which_phase a_phase)
Get EBIndexSpace corresponding to a particular phase.
Definition: CD_AmrMesh.H:1852
void transferIrregularParticles(ParticleContainer< P > &a_dstParticles, ParticleContainer< P > &a_srcParticles, const phase::which_phase a_phase, const std::function< void(P &)> a_transferModifier=[](P &) -> void { return;}) const noexcept
Transfer particles that are on the wrong side of the EB to a different container.
Definition: CD_AmrMeshImplem.H:987
bool queryRealm(const std::string a_realm) const
Query if a realm exists.
Definition: CD_AmrMesh.cpp:3306
virtual ~AmrMesh()
Destructor.
Definition: CD_AmrMesh.cpp:46
void parseEbCentroidStencils()
Parse EB interpolation (or extrapolation) stencils.
Definition: CD_AmrMesh.cpp:2678
void removeCoveredParticlesIF(ParticleContainer< P > &a_particles, const phase::which_phase &a_phase, const Real a_tolerance=0.0) const
Function which removes particles from the domain if they fall inside the EB.
Definition: CD_AmrMeshImplem.H:539
int m_multigridInterpRadius
Multigrid interpolation radius.
Definition: CD_AmrMesh.H:2041
void arithmeticAverage(MFAMRCellData &a_data, const std::string a_realm) const
Arithmetic coarsening of multifluid data.
Definition: CD_AmrMesh.cpp:1512
void buildDomains()
Build domains.
Definition: CD_AmrMesh.cpp:985
int m_ebCentroidStencilRadius
Radius for EB interpolation stencil.
Definition: CD_AmrMesh.H:2071
GridGenerationMethod m_gridGenerationMethod
Grid generation method.
Definition: CD_AmrMesh.H:1921
void interpGhostMG(MFAMRCellData &a_data, const std::string a_realm) const
Interpolate ghost cells over a realm and phase.
Definition: CD_AmrMesh.cpp:2016
void setGrids(const Vector< Vector< Box >> &a_boxes, const std::map< std::string, Vector< Vector< long int >>> &a_realmsAndLoads)
Set grids from boxes and computational loads.
Definition: CD_AmrMesh.cpp:2420
void parseRefinementRatios()
Parse refinement ratios.
Definition: CD_AmrMesh.cpp:2369
Vector< int > m_refinementRatios
AMR resolutions.
Definition: CD_AmrMesh.H:2106
void depositParticles(EBAMRCellData &a_meshData, const std::string &a_realm, const phase::which_phase &a_phase, const ParticleContainer< P > &a_particles, const DepositionType a_depositionType, const CoarseFineDeposition a_coarseFineDeposition, const bool a_forceIrregNGP=false)
Deposit scalar particle quantities on the mesh.
Definition: CD_AmrMeshImplem.H:383
int m_verbosity
Verbosity.
Definition: CD_AmrMesh.H:1976
void conservativeAverage(MFAMRCellData &a_data, const std::string a_realm) const
Conservative coarsening of multifluid data.
Definition: CD_AmrMesh.cpp:1534
bool m_hasRegridCopiers
Has regrid copiers or not.
Definition: CD_AmrMesh.H:2091
Vector< RefCountedPtr< EBCoarseToFineInterp > > & getFineInterp(const std::string a_realm, const phase::which_phase a_phase) const
Get interpolator.
Definition: CD_AmrMesh.cpp:3201
void parseMaxBoxSize()
Parse the maximum permitted box size.
Definition: CD_AmrMesh.cpp:2457
void interpToCentroids(EBAMRCellData &a_data, const std::string a_realm, const phase::which_phase a_phase) const
Interpolate data to centroids on realm and phase.
Definition: CD_AmrMesh.cpp:2251
int m_multigridInterpOrder
Multigrid interpolation order.
Definition: CD_AmrMesh.H:2036
int m_centroidStencilRadius
Radius for centroid interpolation stencil.
Definition: CD_AmrMesh.H:2061
std::map< std::pair< std::string, std::string >, Vector< Copier > > m_validToValidRealmCopiers
Map for copying between various Realms. First index is the "from" realm and second index is the "to" ...
Definition: CD_AmrMesh.H:1898
std::map< std::pair< std::string, std::string >, Vector< Copier > > m_validGhostToValidRealmCopiers
Map for copying between various Realms. First index is the "from" realm and second index is the "to" ...
Definition: CD_AmrMesh.H:1910
void intersectParticlesRaycastIF(ParticleContainer< P > &a_activeParticles, ParticleContainer< P > &a_ebParticles, ParticleContainer< P > &a_domainParticles, const phase::which_phase a_phase, const Real a_tolerance, const bool a_deleteParticles, const std::function< void(P &)> a_nonDeletionModifier=[](P &) -> void { return;}) const noexcept
Particle intersection algorithm based on ray-casting.
Definition: CD_AmrMeshImplem.H:1071
void parseNumGhostCells()
Parse the number of ghost cells.
Definition: CD_AmrMesh.cpp:2585
AmrMesh & operator=(const AmrMesh &&a_other)=delete
Disallowed move assignment.
void sanityCheck() const
Do a sanity check to make sure everything is set up correctly.
Definition: CD_AmrMesh.cpp:2713
int m_numGhostCells
Number of ghost cells.
Definition: CD_AmrMesh.H:2026
void buildGrids(const Vector< IntVectSet > &a_tags, const int a_lmin, const int a_hardcap=-1)
Build new internal AMR grids.
Definition: CD_AmrMesh.cpp:1131
void parseVerbosity()
Parse the verbosity for AmrMesh.
Definition: CD_AmrMesh.cpp:2301
const Vector< RefCountedPtr< EBLevelGrid > > & getEBLevelGrid(const std::string a_realm, const phase::which_phase a_phase) const
Get the EBLevelGrid for a Realm and phase.
Definition: CD_AmrMesh.cpp:3066
GridGenerationMethod
Enum for having understandable notation for grid generation.
Definition: CD_AmrMesh.H:1862
std::map< std::pair< std::string, std::string >, Vector< Copier > > m_validGhostToValidGhostRealmCopiers
Map for copying between various Realms. First index is the "from" realm and second index is the "to" ...
Definition: CD_AmrMesh.H:1916
void registerRealm(const std::string a_realm)
Register a new realm.
Definition: CD_AmrMesh.cpp:3334
void removeCoveredParticlesDiscrete(ParticleContainer< P > &a_particles, const phase::which_phase &a_phase, const Real a_tolerance=0.0) const
Function which removes particles from the domain if they fall inside the EB.
Definition: CD_AmrMeshImplem.H:605
bool getEbCf() const
Check if mesh has an EBCF.
Definition: CD_AmrMesh.cpp:3323
Vector< Real > m_dx
Level resolutions.
Definition: CD_AmrMesh.H:2111
const Vector< DisjointBoxLayout > & getGrids(const std::string a_realm) const
Get the grids.
Definition: CD_AmrMesh.cpp:2968
void intersectParticlesBisectIF(ParticleContainer< P > &a_activeParticles, ParticleContainer< P > &a_ebParticles, ParticleContainer< P > &a_domainParticles, const phase::which_phase a_phase, const Real a_bisectionStep, const bool a_deleteParticles, const std::function< void(P &)> a_nonDeletionModifier=[](P &) -> void { return;}) const noexcept
Particle intersection algorithm based on bisection.
Definition: CD_AmrMeshImplem.H:1243
int m_numEbGhostsCells
Number of ghost cells to use for eb stuff.
Definition: CD_AmrMesh.H:2021
void parseOptions()
Parse options. Called during the constructor.
Definition: CD_AmrMesh.cpp:915
void buildCopiers()
Build copiers for copying between realms.
Definition: CD_AmrMesh.cpp:1272
IrregStencil::StencilType m_stencilType
Stencil type.
Definition: CD_AmrMesh.H:1936
RealVect getProbLo() const
Get lower-left corner of computational domain.
Definition: CD_AmrMesh.cpp:2740
BoxSorting m_boxSort
Box sorting.
Definition: CD_AmrMesh.H:1926
void setMultifluidIndexSpace(const RefCountedPtr< MultiFluidIndexSpace > &a_multiFluidIndexSpace)
Sets multifluid index space.
Definition: CD_AmrMesh.cpp:891
int m_maxAmrDepth
Maximum amr depth.
Definition: CD_AmrMesh.H:1991
void defineRealms()
Define Realms.
Definition: CD_AmrMesh.cpp:3380
int m_finestLevel
Finest level.
Definition: CD_AmrMesh.H:1981
void reallocate(EBAMRCellData &a_data, const phase::which_phase a_phase, const int a_lmin) const
Reallocate data.
Definition: CD_AmrMesh.cpp:582
std::map< std::string, Vector< Copier > > m_oldToNewEBCopiers
Storage for copiers from the old grids to the new ones.
Definition: CD_AmrMesh.H:1892
AmrMesh & operator=(const AmrMesh &a_other)=delete
Disallowed copy assignment.
const Vector< EBISLayout > & getEBISLayout(const std::string a_realm, const phase::which_phase a_phase) const
Get EBISLayouts for a Realm and phase.
Definition: CD_AmrMesh.cpp:2984
Vector< RefCountedPtr< EBReflux > > & getFluxRegister(const std::string a_realm, const phase::which_phase a_phase) const
Get flux register.
Definition: CD_AmrMesh.cpp:3218
Vector< RefCountedPtr< EBFluxRedistribution > > & getRedistributionOp(const std::string a_realm, const phase::which_phase a_phase) const
Get the redistribution operators.
Definition: CD_AmrMesh.cpp:3235
std::map< phase::which_phase, RefCountedPtr< BaseIF > > m_baseif
Implicit functions.
Definition: CD_AmrMesh.H:1875
int getNumberOfGhostCells() const
Get the default number of ghost cells.
Definition: CD_AmrMesh.cpp:2795
void interpGhost(EBAMRCellData &a_data, const std::string a_realm, const phase::which_phase a_phase) const
Interpolate ghost vectors over a realm, using the default ghost cell interpolation method.
Definition: CD_AmrMesh.cpp:1863
const Vector< RefCountedPtr< MFLevelGrid > > & getMFLevelGrid(const std::string a_realm) const
Get EBISLayouts for a Realm.
Definition: CD_AmrMesh.cpp:3100
void regridAmr(const Vector< IntVectSet > &a_tags, const int a_lmin, const int a_hardcap=-1)
Regrid AMR. This versions generates the grids and Realms, but not the operator.
Definition: CD_AmrMesh.cpp:1079
void parseCoarsestLevelNumCells()
Parse the coarsest domain grid.
Definition: CD_AmrMesh.cpp:2314
const IrregAmrStencil< EbCentroidInterpolationStencil > & getEbCentroidInterpolationStencils(const std::string a_realm, const phase::which_phase a_phase) const
Get interpolation stencils for going from cell center to cell boundary centroid.
Definition: CD_AmrMesh.cpp:3270
void parseRedistributionRadius()
Parse the default redistribution radius.
Definition: CD_AmrMesh.cpp:2627
void interpolateParticles(ParticleContainer< P > &a_particles, const std::string &a_realm, const phase::which_phase &a_phase, const EBAMRCellData &a_meshScalarField, const DepositionType a_interpType, const bool a_forceIrregNGP=false) const
Interpolate a scalar field onto the particle position.
Definition: CD_AmrMeshImplem.H:495
int m_ebCentroidStencilOrder
Order for interpolation stencilst to EB.
Definition: CD_AmrMesh.H:2066
const IrregAmrStencil< NonConservativeDivergenceStencil > & getNonConservativeDivergenceStencils(const std::string a_realm, const phase::which_phase a_phase) const
Get the nonconservative divergence stencils.
Definition: CD_AmrMesh.cpp:3288
std::map< std::pair< std::string, std::string >, Vector< Copier > > m_validToValidGhostRealmCopiers
Map for copying between various Realms. First index is the "from" realm and second index is the "to" ...
Definition: CD_AmrMesh.H:1904
const Vector< Real > & getDx() const
Get spatial resolutions.
Definition: CD_AmrMesh.cpp:2913
int getBrBuffer() const
Return buffer for B-R mesh refinement algorithm.
Definition: CD_AmrMesh.cpp:2850
int getMaxBoxSize() const
Get maximum permitted box size.
Definition: CD_AmrMesh.cpp:2839
std::map< std::string, RefCountedPtr< Realm > > m_realms
These are all the Realms.
Definition: CD_AmrMesh.H:1870
int getMaxEbisBoxSize() const
Get maximum box size for EBIS generation.
Definition: CD_AmrMesh.cpp:2861
AmrMesh()
Default constructor.
Definition: CD_AmrMesh.cpp:31
void parseEbGhostCells()
Parse number of ghost cells for eb stuff.
Definition: CD_AmrMesh.cpp:2569
void parseMultigridInterpolator()
Parse settings for the multigrid interpolator.
Definition: CD_AmrMesh.cpp:2605
Vector< RefCountedPtr< EBCoarAve > > & getCoarseAverage(const std::string a_realm, const phase::which_phase a_phase) const
Get the coarsening utility.
Definition: CD_AmrMesh.cpp:3167
EBAMRCellData slice(EBAMRCellData &a_original, const Interval a_variables) const noexcept
Slice cell-centered data in order to fetch a subset of components.
Definition: CD_AmrMesh.cpp:50
int m_blockingFactor
Blocking factor.
Definition: CD_AmrMesh.H:2016
int getRefinementRatio(const int a_level1, const int a_level2) const
Get refinement factor between two levels.
Definition: CD_AmrMesh.cpp:2872
const IrregAmrStencil< CentroidInterpolationStencil > & getCentroidInterpolationStencils(const std::string a_realm, const phase::which_phase a_phase) const
Get interpolation stencils for going from cell center to cell centroid.
Definition: CD_AmrMesh.cpp:3252
void parseBlockingFactor()
Parse the B-R blocking factor. For tiled mesh refinement this parses the tile size.
Definition: CD_AmrMesh.cpp:2553
void interpolateParticles(ParticleContainer< P > &a_particles, const std::string &a_realm, const phase::which_phase &a_phase, const EBAMRCellData &a_meshVectorField, const DepositionType a_interpType, const bool a_forceIrregNGP=false) const
Interpolate a vector field onto the particle position.
int m_irregStenOrder
Stencil order for irregular stencils.
Definition: CD_AmrMesh.H:2076
int m_irregStenRadius
radius for irregular stencils
Definition: CD_AmrMesh.H:2081
int getBlockingFactor() const
Get blocking factor (i.e. the smallest possible box).
Definition: CD_AmrMesh.cpp:2828
void allocatePointer(Vector< RefCountedPtr< T >> &a_data) const
Allocate pointer but not any memory blocks.
Definition: CD_AmrMeshImplem.H:303
int m_multigridInterpWeight
Multigrid interpolation weights.
Definition: CD_AmrMesh.H:2046
std::map< std::string, Vector< DisjointBoxLayout > > m_oldGrids
Old grids.
Definition: CD_AmrMesh.H:1880
const AMRMask & getMask(const std::string a_mask, const int a_buffer, const std::string a_realm) const
Get a registered mask.
Definition: CD_AmrMesh.cpp:3018
void depositParticles(EBAMRIVData &a_meshData, const std::string &a_realm, const phase::which_phase &a_phase, const ParticleContainer< P > &a_particles) const noexcept
Deposit scalar particle quantities on the mesh.
void average(MFAMRCellData &a_data, const std::string a_realm, const Average &a_average) const
Average multifluid data over a specified realm.
Definition: CD_AmrMesh.cpp:1472
EBAMRSurfaceDeposition & getSurfaceDeposition(const std::string a_realm, const phase::which_phase a_phase) const
Get EBAMRSurfaceDeposition surface deposition operator.
Definition: CD_AmrMesh.cpp:3150
void preRegrid()
Run pre-regrid operations.
Definition: CD_AmrMesh.cpp:1010
void registerMask(const std::string a_mask, const int a_buffer, const std::string a_realm)
Register a boolean mask over a realm.
Definition: CD_AmrMesh.cpp:3364
AmrMesh(const AmrMesh &a_other)=delete
Disallowed copy constructor.
void parseBrFillRatio()
Parse the Berger-Rigoutsos fill ratio.
Definition: CD_AmrMesh.cpp:2391
Vector< ProblemDomain > m_domains
Problem domains.
Definition: CD_AmrMesh.H:2101
void parseProbLoHiCorners()
Parse the low/high corners of the computational domain.
Definition: CD_AmrMesh.cpp:967
void parseGridGeneration()
Parse the grid generation algorithm.
Definition: CD_AmrMesh.cpp:2514
void allocate(Vector< RefCountedPtr< ParticleData< T >>> &a_particles, const std::string a_realm) const
Template class for generic allocation of particle data.
Definition: CD_AmrMeshImplem.H:237
void interpToNewGrids(MFAMRCellData &a_newData, const MFAMRCellData &a_oldData, const int a_lmin, const int a_oldFinestLevel, const int a_newFinestLevel, const EBCoarseToFineInterp::Type a_type)
Interpolate data to new grids.
Definition: CD_AmrMesh.cpp:2080
void transferCoveredParticlesVoxels(ParticleContainer< P > &a_particlesFrom, ParticleContainer< P > &a_particlesTo, const phase::which_phase &a_phase) const
Function which transferse particles from one particle container to another if they fall inside the EB...
Definition: CD_AmrMeshImplem.H:922
void parseMaxEbisBoxSize()
Parse the maximum permitted box size.
Definition: CD_AmrMesh.cpp:2476
EBAMRParticleMesh & getParticleMesh(const std::string a_realm, const phase::which_phase a_phase) const
Get EBAMRParticleMesh operator.
Definition: CD_AmrMesh.cpp:3133
void alias(Vector< T * > &a_alias, const Vector< RefCountedPtr< T >> &a_data) const
Turn smart-pointer data structure into regular-pointer data structure.
Definition: CD_AmrMeshImplem.H:209
bool m_hasGrids
Has grids or not.
Definition: CD_AmrMesh.H:2086
Vector< RefCountedPtr< LayoutData< VoFIterator > > > & getVofIterator(const std::string a_realm, const phase::which_phase a_phase) const
Get vof iterators for a Realm and phase. This has the capability of iterating through cut-cells.
Definition: CD_AmrMesh.cpp:3001
IrregStencil::StencilType m_ebCentroidStencilType
Stencil type for EB interpolation.
Definition: CD_AmrMesh.H:1946
void deallocate(Vector< T * > &a_data) const
Deallocate data.
Definition: CD_AmrMeshImplem.H:161
int getMaxAmrDepth() const
Get maximum permitted amr depth.
Definition: CD_AmrMesh.cpp:2773
const Vector< int > & getRefinementRatios() const
Get refinement ratios.
Definition: CD_AmrMesh.cpp:2924
void regridOperators(const int a_lmin)
Regrid AMR operators. This is done for all realms.
Definition: CD_AmrMesh.cpp:1100
int getRedistributionRadius() const
Get default redistribution radius.
Definition: CD_AmrMesh.cpp:2817
const Vector< RefCountedPtr< LevelTiles > > & getLevelTiles(const std::string a_realm) const
Get the tiled space representation.
Definition: CD_AmrMesh.cpp:3050
BoxSorting getBoxSorting() const
Get box sorting method.
Definition: CD_AmrMesh.cpp:3484
void parseCentroidStencils()
Parse centroid interpolation stencils.
Definition: CD_AmrMesh.cpp:2643
int m_maxEbisBoxSize
Maximum box size for EBIS generation.
Definition: CD_AmrMesh.H:2006
int getNumberOfEbGhostCells() const
Get number of ghost cells used for EB grid generation.
Definition: CD_AmrMesh.cpp:2806
const EBAMRFAB & getLevelset(const std::string a_realm, const phase::which_phase a_phase) const
Get levelset function, allocated over a grid for a Realm and phase.
Definition: CD_AmrMesh.cpp:3117
IrregStencil::StencilType m_centroidStencilType
Stencil type for centroid interpolation.
Definition: CD_AmrMesh.H:1941
void setBaseImplicitFunction(const phase::which_phase a_phase, const RefCountedPtr< BaseIF > &a_baseIF)
Set implicit function for a specific phase. Need e.g. for level-sets.
Definition: CD_AmrMesh.cpp:904
int getFinestLevel() const
Get finest grid level.
Definition: CD_AmrMesh.cpp:2762
const Vector< RefCountedPtr< EBLevelGrid > > & getEBLevelGridCoFi(const std::string a_realm, const phase::which_phase a_phase) const
Get the coarsened fine EBLevelGrid for a Realm and phase.
Definition: CD_AmrMesh.cpp:3083
int m_redistributionRadius
Redistribution radius.
Definition: CD_AmrMesh.H:2051
const Vector< ProblemDomain > & getDomains() const
Get domains.
Definition: CD_AmrMesh.cpp:2946
int m_numLsfGhostCells
Number of ghost cells to use when writing level-set to grid.
Definition: CD_AmrMesh.H:2031
Default class for holding LevelData<T> data across an EBAMR realm.
Definition: CD_EBAMRData.H:40
Class for handling particle-mesh operations with AMR.
Definition: CD_EBAMRParticleMesh.H:47
class for handling surface deposition of particles with EB and AMR.
Definition: CD_EBAMRSurfaceDeposition.H:29
Type
Type of interpolation methods supported. PWC = Piecewise constant, ignoring the embedded boundary....
Definition: CD_EBCoarseToFineInterp.H:42
Class for holding VoFStencils on irregular cells over an entire AMR hierarchy. The template parameter...
Definition: CD_IrregAmrStencil.H:29
StencilType
Enum for identifying stencil – only meant for enhancing code visibility.
Definition: CD_IrregStencil.H:44
Templated class for holding particles on an AMR hierarchy with particle remapping.
Definition: CD_ParticleContainer.H:50