chombo-discharge
Loading...
Searching...
No Matches
CD_AmrMesh.H
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2021-2026 SINTEF Energy Research
3 *
4 * SPDX-License-Identifier: GPL-3.0-or-later
5 */
6
14
15#ifndef CD_AMRMESH_H
16#define CD_AMRMESH_H
17
18// Chombo includes
19#include <DisjointBoxLayout.H>
20#include <ProblemDomain.H>
21
22// Our includes
23#include <CD_EBAMRData.H>
24#include <CD_EBCoarAve.H>
27#include <CD_LoadBalancing.H>
28#include <CD_MFLevelGrid.H>
29#include <CD_EBReflux.H>
30#include <CD_DomainFluxIFFAB.H>
33#include <CD_Realm.H>
36#include <CD_CopyStrategy.H>
37#include <CD_LoadBalancing.H>
38#include <CD_NamespaceHeader.H>
39
46{
47public:
51 AmrMesh();
52
57 AmrMesh(const AmrMesh& a_other) = delete;
58
63 AmrMesh(const AmrMesh&& a_other) = delete;
64
68 virtual ~AmrMesh();
69
74 AmrMesh&
75 operator=(const AmrMesh& a_other) = delete;
76
81 AmrMesh&
82 operator=(const AmrMesh&& a_other) = delete;
83
94 template <typename T>
95 void
97 const EBAMRData<T>& a_src,
98 const CopyStrategy& a_toRegion = CopyStrategy::Valid,
99 const CopyStrategy& a_fromRegion = CopyStrategy::Valid) const noexcept;
100
112 template <typename T>
113 void
114 copyData(EBAMRData<T>& a_dst,
115 const EBAMRData<T>& a_src,
116 const Interval& a_dstComps,
117 const Interval& a_srcComps,
118 const CopyStrategy& a_toRegion = CopyStrategy::Valid,
119 const CopyStrategy& a_fromRegion = CopyStrategy::Valid) const noexcept;
120
134 template <typename T>
135 void
136 copyData(LevelData<T>& a_dst,
137 const LevelData<T>& a_src,
138 const int a_level,
139 const std::string a_toRealm,
140 const std::string a_fromRealm,
141 const CopyStrategy& a_toRegion = CopyStrategy::Valid,
142 const CopyStrategy& a_fromRegion = CopyStrategy::Valid) const noexcept;
143
159 template <typename T>
160 void
161 copyData(LevelData<T>& a_dst,
162 const LevelData<T>& a_src,
163 const int a_level,
164 const std::string a_toRealm,
165 const std::string a_fromRealm,
166 const Interval& a_dstComps,
167 const Interval& a_srcComps,
168 const CopyStrategy& a_toRegion = CopyStrategy::Valid,
169 const CopyStrategy& a_fromRegion = CopyStrategy::Valid) const noexcept;
170
175 template <typename T>
176 void
177 deallocate(Vector<T*>& a_data) const;
178
183 template <typename T>
184 void
185 deallocate(Vector<RefCountedPtr<T>>& a_data) const;
186
191 template <typename T>
192 void
193 deallocate(EBAMRData<T>& a_data) const;
194
201 template <typename T>
202 void
203 alias(Vector<T*>& a_alias, const Vector<RefCountedPtr<T>>& a_data) const;
204
211 template <typename T, typename S>
212 void
213 alias(Vector<T*>& a_alias, const EBAMRData<S>& a_data) const;
214
222 template <typename P, typename Traits>
223 void
224 allocate(ParticleContainer<P, Traits>& a_container, const std::string& a_realm) const;
225
231 template <typename T>
232 void
233 allocatePointer(Vector<RefCountedPtr<T>>& a_data) const;
234
241 template <typename T>
242 void
243 allocatePointer(Vector<RefCountedPtr<T>>& a_data, const int a_finestLevel) const;
244
251 template <typename T>
252 void
253 allocatePointer(EBAMRData<T>& a_data, const std::string& a_realm) const;
254
262 template <typename T>
263 void
264 allocatePointer(EBAMRData<T>& a_data, const std::string& a_realm, const int a_finestLevel) const;
265
273 EBAMRCellData
274 slice(EBAMRCellData& a_original, const Interval a_variables) const noexcept;
275
283 EBAMRCellData
284 slice(const EBAMRCellData& a_original, const Interval a_variables) const noexcept;
285
289 void
290 parseOptions();
291
296 void
298
306 void
307 registerOperator(const std::string& a_operator, const std::string& a_realm, const phase::which_phase a_phase);
308
317 void
318 registerMultigrid(const std::string& a_realm, const int a_minCellsBottom);
319
328 void
329 registerMask(const std::string& a_mask, const int a_buffer, const std::string& a_realm);
330
334 void
335 buildDomains();
336
343 void
344 setFinestLevel(const int a_finestLevel);
345
350 void
351 setCoarsestGrid(const IntVect& a_nCells);
352
358 bool
359 queryRealm(const std::string& a_realm) const;
360
366 bool
367 getEbCf() const;
368
374 void
375 registerRealm(const std::string& a_realm);
376
384 void
385 alias(EBAMRCellData& a_data,
386 const phase::which_phase a_phase,
387 const MFAMRCellData& a_mfdata,
388 const int a_finestLevel) const;
389
397 void
398 alias(EBAMRFluxData& a_data,
399 const phase::which_phase a_phase,
400 const MFAMRFluxData& a_mfdata,
401 const int a_finestLevel) const;
402
409 void
410 alias(EBAMRCellData& a_data, const phase::which_phase a_phase, const MFAMRCellData& a_mfdata) const;
411
418 void
419 alias(EBAMRFluxData& a_data, const phase::which_phase a_phase, const MFAMRFluxData& a_mfdata) const;
420
427 void
428 alias(EBAMRIVData& a_data, const phase::which_phase a_phase, const MFAMRIVData& a_mfdata) const;
429
436 EBAMRCellData
437 alias(const phase::which_phase a_phase, const MFAMRCellData& a_mfdata) const;
438
445 EBAMRFluxData
446 alias(const phase::which_phase a_phase, const MFAMRFluxData& a_mfdata) const;
447
454 EBAMRIVData
455 alias(const phase::which_phase a_phase, const MFAMRIVData& a_mfdata) const;
456
466 void
467 computeGradient(EBAMRCellData& a_gradient,
468 const EBAMRCellData& a_phi,
469 const std::string& a_realm,
470 const phase::which_phase a_phase) const;
471
481 void
482 computeGradient(EBAMRFluxData& a_gradient,
483 const EBAMRCellData& a_phi,
484 const std::string& a_realm,
485 const phase::which_phase a_phase) const;
486
495 void
496 computeGradient(MFAMRCellData& a_gradient, const MFAMRCellData& a_phi, const std::string& a_realm) const;
497
506 void
507 computeGradient(MFAMRFluxData& a_gradient, const MFAMRCellData& a_phi, const std::string& a_realm) const;
508
518 void
519 allocate(EBAMRCellData& a_data,
520 const std::string& a_realm,
521 const phase::which_phase a_phase,
522 const int a_nComp,
523 const int a_ghost = -1) const;
524
535 void
536 allocate(LevelData<EBCellFAB>& a_data,
537 const std::string& a_realm,
538 const phase::which_phase a_phase,
539 const int a_level,
540 const int a_nComp,
541 const int a_ghost = -1) const;
542
552 void
553 allocate(EBAMRFluxData& a_data,
554 const std::string& a_realm,
555 const phase::which_phase a_phase,
556 const int a_nComp,
557 const int a_ghost = -1) const;
558
568 void
569 allocate(EBAMRIVData& a_data,
570 const std::string& a_realm,
571 const phase::which_phase a_phase,
572 const int a_nComp,
573 const int a_ghost = -1) const;
574
584 void
585 allocate(EBAMRIFData& a_data,
586 const std::string& a_realm,
587 const phase::which_phase a_phase,
588 const int a_nComp,
589 const int a_ghost = -1) const;
590
599 void
600 allocate(EBAMRBool& a_data, const std::string& a_realm, const int a_nComp, const int a_ghost = -1) const;
601
612 void
613 allocate(EBAMRFAB& a_data, const std::string& a_realm, const int a_nComp, const int a_ghost = -1) const;
614
623 void
624 allocate(MFAMRCellData& a_data, const std::string& a_realm, const int a_nComp, const int a_ghost = -1) const;
625
634 void
635 allocate(MFAMRFluxData& a_data, const std::string& a_realm, const int a_nComp, const int a_ghost = -1) const;
636
645 void
646 allocate(MFAMRIVData& a_data, const std::string& a_realm, const int a_nComp, const int a_ghost = 0) const;
647
655 void
656 reallocate(EBAMRCellData& a_data, const phase::which_phase a_phase, const int a_lmin) const;
657
665 void
666 reallocate(EBAMRFluxData& a_data, const phase::which_phase a_phase, const int a_lmin) const;
667
675 void
676 reallocate(EBAMRIVData& a_data, const phase::which_phase a_phase, const int a_lmin) const;
677
685 void
686 reallocate(EBAMRIFData& a_data, const phase::which_phase a_phase, const int a_lmin) const;
687
694 void
695 reallocate(EBAMRBool& a_data, const int a_lmin) const;
696
703 void
704 reallocate(MFAMRCellData& a_data, const int a_lmin) const;
705
712 void
713 reallocate(MFAMRFluxData& a_data, const int a_lmin) const;
714
721 void
722 reallocate(MFAMRIVData& a_data, const int a_lmin) const;
723
730 void
731 average(MFAMRCellData& a_data, const std::string& a_realm, const Average& a_average) const;
732
738 void
739 arithmeticAverage(MFAMRCellData& a_data, const std::string& a_realm) const;
740
746 void
747 harmonicAverage(MFAMRCellData& a_data, const std::string& a_realm) const;
748
754 void
755 conservativeAverage(MFAMRCellData& a_data, const std::string& a_realm) const;
756
763 void
764 average(MFAMRFluxData& a_data, const std::string& a_realm, const Average& a_average) const;
765
773 void
774 arithmeticAverage(MFAMRFluxData& a_data, const std::string& a_realm) const;
775
783 void
784 harmonicAverage(MFAMRFluxData& a_data, const std::string& a_realm) const;
785
791 void
792 conservativeAverage(MFAMRFluxData& a_data, const std::string& a_realm) const;
793
801 void
802 average(EBAMRCellData& a_data,
803 const std::string& a_realm,
804 const phase::which_phase a_phase,
805 const Average& a_average) const;
806
815 void
816 average(EBAMRCellData& a_data,
817 const std::string& a_realm,
818 const phase::which_phase a_phase,
819 const Average& a_average,
820 const Interval& a_variables) const;
821
828 void
829 arithmeticAverage(EBAMRCellData& a_data, const std::string& a_realm, const phase::which_phase a_phase) const;
830
838 void
839 arithmeticAverage(EBAMRCellData& a_data,
840 const std::string& a_realm,
841 const phase::which_phase a_phase,
842 const Interval& a_variables) const;
843
850 void
851 harmonicAverage(EBAMRCellData& a_data, const std::string& a_realm, const phase::which_phase a_phase) const;
852
860 void
861 harmonicAverage(EBAMRCellData& a_data,
862 const std::string& a_realm,
863 const phase::which_phase a_phase,
864 const Interval& a_variables) const;
865
872 void
873 conservativeAverage(EBAMRCellData& a_data, const std::string& a_realm, const phase::which_phase a_phase) const;
874
882 void
883 conservativeAverage(EBAMRCellData& a_data,
884 const std::string& a_realm,
885 const phase::which_phase a_phase,
886 const Interval& a_variables) const;
887
895 void
896 average(EBAMRFluxData& a_data,
897 const std::string& a_realm,
898 const phase::which_phase a_phase,
899 const Average& a_average) const;
900
909 void
910 arithmeticAverage(EBAMRFluxData& a_data, const std::string& a_realm, const phase::which_phase a_phase) const;
911
920 void
921 harmonicAverage(EBAMRFluxData& a_data, const std::string& a_realm, const phase::which_phase a_phase) const;
922
929 void
930 conservativeAverage(EBAMRFluxData& a_data, const std::string& a_realm, const phase::which_phase a_phase) const;
931
939 void
940 average(EBAMRIVData& a_data,
941 const std::string& a_realm,
942 const phase::which_phase a_phase,
943 const Average& a_average) const;
944
951 void
952 arithmeticAverage(EBAMRIVData& a_data, const std::string& a_realm, const phase::which_phase a_phase) const;
953
960 void
961 harmonicAverage(EBAMRIVData& a_data, const std::string& a_realm, const phase::which_phase a_phase) const;
962
969 void
970 conservativeAverage(EBAMRIVData& a_data, const std::string& a_realm, const phase::which_phase a_phase) const;
971
982 template <typename P, typename Traits>
983 void
984 depositParticles(EBAMRIVData& a_meshData,
985 const std::string& a_realm,
986 const phase::which_phase& a_phase,
987 const ParticleContainer<P, Traits>& a_particles) const noexcept;
988
1001 template <typename P, typename Traits>
1002 void
1003 depositWeight(EBAMRCellData& a_meshData,
1004 const std::string& a_realm,
1005 const phase::which_phase& a_phase,
1006 const ParticleContainer<P, Traits>& a_particles,
1007 const DepositionType a_depositionType,
1008 const CoarseFineDeposition a_coarseFineDeposition,
1009 const IrregularDeposition a_irregularDeposition);
1010
1027 template <typename P, typename Traits, typename CellGather>
1028 void
1029 depositGathered(EBAMRCellData& a_meshData,
1030 const std::string& a_realm,
1031 const phase::which_phase& a_phase,
1032 const ParticleContainer<P, Traits>& a_particles,
1033 const DepositionType a_depositionType,
1034 const CoarseFineDeposition a_coarseFineDeposition,
1035 const IrregularDeposition a_irregularDeposition,
1036 CellGather a_cellGather);
1037
1053 template <auto... Members, typename P, typename Traits>
1054 void
1055 depositParticles(EBAMRCellData& a_meshData,
1056 const std::string& a_realm,
1057 const phase::which_phase& a_phase,
1058 const ParticleContainer<P, Traits>& a_particles,
1059 const DepositionType a_depositionType,
1060 const CoarseFineDeposition a_coarseFineDeposition,
1061 const IrregularDeposition a_irregularDeposition);
1062
1074 template <typename P, typename Traits>
1075 void
1077 const std::string& a_realm,
1078 const phase::which_phase& a_phase,
1079 const EBAMRCellData& a_meshScalarField,
1080 const DepositionType a_interpType,
1081 const bool a_forceIrregNGP) const;
1082
1097 template <auto... Members, typename P, typename Traits>
1098 void
1100 const std::string& a_realm,
1101 const phase::which_phase& a_phase,
1102 const EBAMRCellData& a_meshField,
1103 const DepositionType a_interpType,
1104 const bool a_forceIrregNGP) const;
1105
1114 template <typename P, typename Traits>
1115 void
1117 const phase::which_phase& a_phase,
1118 const Real a_tolerance) const;
1119
1129 template <typename P, typename Traits>
1130 void
1132 const phase::which_phase& a_phase,
1133 const Real a_tolerance) const;
1134
1142 template <typename P, typename Traits>
1143 void
1145
1158 template <typename P, typename Traits>
1159 void
1161 ParticleContainer<P, Traits>& a_particlesTo,
1162 const phase::which_phase& a_phase,
1163 const Real a_tolerance) const;
1164
1176 template <typename P, typename Traits>
1177 void
1179 ParticleContainer<P, Traits>& a_particlesTo,
1180 const phase::which_phase& a_phase,
1181 const Real a_tolerance) const;
1182
1191 template <typename P, typename Traits>
1192 void
1194 ParticleContainer<P, Traits>& a_particlesTo,
1195 const phase::which_phase& a_phase) const;
1196
1207 template <typename P, typename Traits>
1208 void
1210 ParticleContainer<P, Traits>& a_srcParticles,
1211 const phase::which_phase a_phase) const noexcept;
1212
1235 template <auto... OldPosition, typename P, typename Traits>
1236 void
1238 ParticleContainer<P, Traits>& a_activeParticles,
1239 ParticleContainer<P, Traits>& a_ebParticles,
1240 ParticleContainer<P, Traits>& a_domainParticles,
1241 const phase::which_phase a_phase,
1242 const Real a_tolerance,
1243 const bool a_deleteParticles,
1244 const std::function<void(ParticleSoA<P, Traits>&, std::size_t)>& a_nonDeletionModifier) const noexcept;
1245
1263 template <auto... OldPosition, typename P, typename Traits>
1264 void
1266 ParticleContainer<P, Traits>& a_activeParticles,
1267 ParticleContainer<P, Traits>& a_ebParticles,
1268 ParticleContainer<P, Traits>& a_domainParticles,
1269 const phase::which_phase a_phase,
1270 const Real a_bisectionStep,
1271 const bool a_deleteParticles,
1272 const std::function<void(ParticleSoA<P, Traits>&, std::size_t)>& a_nonDeletionModifier) const noexcept;
1273
1280 void
1281 interpGhost(EBAMRCellData& a_data, const std::string& a_realm, const phase::which_phase a_phase) const;
1282
1291 void
1292 interpGhost(LevelData<EBCellFAB>& a_fineData,
1293 const LevelData<EBCellFAB>& a_coarData,
1294 const int a_fineLevel,
1295 const std::string& a_realm,
1296 const phase::which_phase a_phase) const;
1297
1303 void
1304 interpGhost(MFAMRCellData& a_data, const std::string& a_realm) const;
1305
1311 void
1312 interpGhostPwl(MFAMRCellData& a_data, const std::string& a_realm) const;
1313
1320 void
1321 interpGhostPwl(EBAMRCellData& a_data, const std::string& a_realm, const phase::which_phase a_phase) const;
1322
1330 void
1331 interpGhostMG(MFAMRCellData& a_data, const std::string& a_realm) const;
1332
1341 void
1342 interpGhostMG(EBAMRCellData& a_data, const std::string& a_realm, const phase::which_phase a_phase) const;
1343
1355 void
1356 interpToNewGrids(MFAMRCellData& a_newData,
1357 const MFAMRCellData& a_oldData,
1358 const int a_lmin,
1359 const int a_oldFinestLevel,
1360 const int a_newFinestLevel,
1361 const EBCoarseToFineInterp::Type a_type);
1362
1375 void
1376 interpToNewGrids(EBAMRCellData& a_newData,
1377 const EBAMRCellData& a_oldData,
1378 const phase::which_phase a_phase,
1379 const int a_lmin,
1380 const int a_oldFinestLevel,
1381 const int a_newFinestLevel,
1382 const EBCoarseToFineInterp::Type a_type);
1383
1396 void
1397 interpToNewGrids(EBAMRIVData& a_newData,
1398 const EBAMRIVData& a_oldData,
1399 const phase::which_phase a_phase,
1400 const int a_lmin,
1401 const int a_oldFinestLevel,
1402 const int a_newFinestLevel,
1403 const EBCoarseToFineInterp::Type a_type);
1404
1414 template <typename P, typename Traits>
1415 void
1417 const int a_lmin,
1418 const int a_newFinestLevel) const noexcept;
1419
1428 void
1429 interpToCentroids(EBAMRCellData& a_data, const std::string& a_realm, const phase::which_phase a_phase) const noexcept;
1430
1438 void
1439 interpToCentroids(LevelData<EBCellFAB>& a_data,
1440 const std::string& a_realm,
1441 const phase::which_phase a_phase,
1442 const int a_level) const noexcept;
1443
1453 void
1454 interpToCentroids(EBCellFAB& a_centroidData,
1455 const EBCellFAB& a_cellData,
1456 const std::string& a_realm,
1457 const phase::which_phase a_phase,
1458 const int a_level,
1459 const DataIndex& a_din) const noexcept;
1460
1470 void
1471 interpToCentroids(EBAMRIVData& a_centroidData,
1472 const EBAMRCellData& a_cellData,
1473 const std::string& a_realm,
1474 const phase::which_phase a_phase) const noexcept;
1475
1484 void
1485 interpToCentroids(LevelData<BaseIVFAB<Real>>& a_centroidData,
1486 const LevelData<EBCellFAB>& a_cellData,
1487 const std::string& a_realm,
1488 const phase::which_phase a_phase,
1489 const int a_level) const noexcept;
1490
1498 void
1499 interpToEB(EBAMRIVData& a_centroidData,
1500 const EBAMRCellData& a_cellData,
1501 const std::string& a_realm,
1502 const phase::which_phase a_phase) const noexcept;
1503
1512 void
1513 interpToEB(LevelData<BaseIVFAB<Real>>& a_centroidData,
1514 const LevelData<EBCellFAB>& a_cellData,
1515 const std::string& a_realm,
1516 const phase::which_phase a_phase,
1517 const int a_level) const noexcept;
1518
1528 void
1529 interpToEB(BaseIVFAB<Real>& a_centroidData,
1530 const EBCellFAB& a_cellData,
1531 const std::string& a_realm,
1532 const phase::which_phase a_phase,
1533 const int a_level,
1534 const DataIndex& a_din) const noexcept;
1535
1545 void
1546 nonConservativeDivergence(EBAMRIVData& a_nonConsDivF,
1547 const EBAMRCellData& a_kappaDivF,
1548 const std::string& a_realm,
1549 const phase::which_phase& a_phase) const noexcept;
1550
1561 void
1562 nonConservativeDivergence(LevelData<BaseIVFAB<Real>>& a_nonConsDivF,
1563 const LevelData<EBCellFAB>& a_kappaDivF,
1564 const int& a_level,
1565 const std::string& a_realm,
1566 const phase::which_phase& a_phase) const noexcept;
1567
1572 void
1573 setMultifluidIndexSpace(const RefCountedPtr<MultiFluidIndexSpace>& a_multiFluidIndexSpace);
1574
1580 void
1581 setBaseImplicitFunction(const phase::which_phase a_phase, const RefCountedPtr<BaseIF>& a_baseIF);
1582
1586 void
1587 preRegrid();
1588
1595 void
1596 regridAmr(const Vector<IntVectSet>& a_tags, const int a_lmin, const int a_hardcap = -1);
1597
1607 void
1608 regridAmr(const Vector<Vector<Box>>& a_boxes, const int a_lmin);
1609
1617 void
1618 regridRealm(const std::string& a_realm,
1619 const Vector<Vector<int>>& a_procs,
1620 const Vector<Vector<Box>>& a_boxes,
1621 const int a_lmin);
1622
1626 void
1627 postRegrid();
1628
1635 void
1636 setGrids(const Vector<Vector<Box>>& a_boxes, const std::map<std::string, Vector<Vector<long int>>>& a_realmsAndLoads);
1637
1642 void
1643 regridOperators(const int a_lmin);
1644
1650 void
1651 regridOperators(const std::string& a_realm, const int a_lmin);
1652
1656 void
1657 sanityCheck() const;
1658
1663 int
1664 getFinestLevel() const;
1665
1670 int
1671 getMaxAmrDepth() const;
1672
1677 int
1678 getMaxSimulationDepth() const;
1679
1684 int
1685 getMinBlockSize() const;
1686
1692 int
1694 {
1695 return this->getMinBlockSize();
1696 }
1697
1702 int
1703 getMaxBlockSize() const;
1704
1710 int
1712 {
1713 return this->getMaxBlockSize();
1714 }
1715
1720 int
1721 getBrBuffer() const;
1722
1727 int
1728 getMaxEbisBoxSize() const;
1729
1736 int
1737 getEbMinBlockSize() const;
1738
1744 int
1745 getEbMaxBlockSize() const;
1746
1751 int
1752 getNumberOfGhostCells() const;
1753
1758 int
1760
1765 Real
1766 getFinestDx() const;
1767
1772 RealVect
1773 getProbLo() const;
1774
1779 RealVect
1780 getProbHi() const;
1781
1786 ProblemDomain
1787 getFinestDomain() const;
1788
1793 const Vector<Real>&
1794 getDx() const;
1795
1800 const Vector<int>&
1801 getRefinementRatios() const;
1802
1810 int
1811 getRefinementRatio(const int a_level1, const int a_level2) const;
1812
1818 const RefCountedPtr<BaseIF>&
1819 getBaseImplicitFunction(const phase::which_phase a_phase) const;
1820
1826 const Vector<DisjointBoxLayout>&
1827 getProxyGrids() const;
1828
1834 const Vector<DisjointBoxLayout>&
1835 getGrids(const std::string& a_realm) const;
1836
1841 const Vector<ProblemDomain>&
1842 getDomains() const;
1843
1851 const AMRMask&
1852 getMask(const std::string& a_mask, const int a_buffer, const std::string& a_realm) const;
1853
1859 const AMRMask&
1860 getValidCells(const std::string& a_realm) const;
1861
1867 const Vector<RefCountedPtr<LevelTiles>>&
1868 getLevelTiles(const std::string& a_realm) const;
1869
1875 void
1876 registerParticleGhostMask(const std::string& a_realm, const int a_width);
1877
1885 getParticleGhostMask(const std::string& a_realm, const int a_width) const;
1886
1896 getParticleGhostMaskFineToCoar(const std::string& a_realm, const int a_width) const;
1897
1907 getParticleGhostMaskCoarToFine(const std::string& a_realm, const int a_width) const;
1908
1916
1927 const AMRMask&
1928 getParticleGhostExposure(const std::string& a_realm, const int a_width) const;
1929
1936 const Vector<RefCountedPtr<EBLevelGrid>>&
1937 getEBLevelGrid(const std::string& a_realm, const phase::which_phase a_phase) const;
1938
1945 const Vector<RefCountedPtr<EBLevelGrid>>&
1946 getEBLevelGridCoFi(const std::string& a_realm, const phase::which_phase a_phase) const;
1947
1954 const Vector<EBISLayout>&
1955 getEBISLayout(const std::string& a_realm, const phase::which_phase a_phase) const;
1956
1962 const Vector<RefCountedPtr<MFLevelGrid>>&
1963 getMFLevelGrid(const std::string& a_realm) const;
1964
1971 const Vector<RefCountedPtr<MFLevelGrid>>&
1972 getMFLevelGridCoFi(const std::string& a_realm) const;
1973
1981 const Vector<Vector<RefCountedPtr<EBLevelGrid>>>&
1982 getMultigridLevelGrids(const std::string& a_realm, const phase::which_phase a_phase) const;
1983
1991 const Vector<Vector<RefCountedPtr<EBLevelGrid>>>&
1992 getMultigridLevelGridsCoFi(const std::string& a_realm, const phase::which_phase a_phase) const;
1993
2001 const Vector<Vector<RefCountedPtr<EBCoarAve>>>&
2002 getMultigridCoarseAverage(const std::string& a_realm, const phase::which_phase a_phase) const;
2003
2010 const Vector<Vector<RefCountedPtr<MFLevelGrid>>>&
2011 getMultigridMFLevelGrids(const std::string& a_realm) const;
2012
2019 const Vector<Vector<RefCountedPtr<MFLevelGrid>>>&
2020 getMultigridMFLevelGridsCoFi(const std::string& a_realm) const;
2021
2030 Vector<RefCountedPtr<LayoutData<VoFIterator>>>&
2031 getVofIterator(const std::string& a_realm, const phase::which_phase a_phase) const;
2032
2042 Vector<RefCountedPtr<LayoutData<VoFIterator>>>&
2043 getMultiCutVofIterator(const std::string& a_realm, const phase::which_phase a_phase) const;
2044
2053 Vector<RefCountedPtr<LayoutData<std::array<FaceIterator, SpaceDim>>>>&
2054 getFaceIterator(const std::string& a_realm, const phase::which_phase a_phase) const;
2055
2064 Vector<RefCountedPtr<LayoutData<std::array<FaceIterator, SpaceDim>>>>&
2065 getFaceIteratorNoBoundary(const std::string& a_realm, const phase::which_phase a_phase) const;
2066
2078 Vector<RefCountedPtr<LayoutData<std::array<FaceIterator, SpaceDim>>>>&
2079 getFaceIteratorWithTangentialGhosts(const std::string& a_realm, const phase::which_phase a_phase) const;
2080
2091 Vector<RefCountedPtr<LayoutData<std::array<FaceIterator, SpaceDim>>>>&
2092 getMultiCutFaceIterator(const std::string& a_realm, const phase::which_phase a_phase) const;
2093
2100 const EBAMRFAB&
2101 getLevelset(const std::string& a_realm, const phase::which_phase a_phase) const;
2102
2109 const EBAMRCellData&
2110 getRegularCells(const std::string& a_realm, const phase::which_phase a_phase) const;
2111
2118 const EBAMRCellData&
2119 getCoveredCells(const std::string& a_realm, const phase::which_phase a_phase) const;
2120
2127 const EBAMRCellData&
2128 getNotCoveredCells(const std::string& a_realm, const phase::which_phase a_phase) const;
2129
2136 const EBAMRCellData&
2137 getIrregularCells(const std::string& a_realm, const phase::which_phase a_phase) const;
2138
2147 const EBAMRCellData&
2148 getMirrorSurfaceData(const std::string& a_realm, const phase::which_phase a_phase) const;
2149
2158 const Vector<int>&
2159 getMirrorHasCutCells(const std::string& a_realm, const phase::which_phase a_phase) const;
2160
2165 Real
2166 getMirrorMaxJacobian() const;
2167
2172 Real
2174
2182 getParticleMesh(const std::string& a_realm, const phase::which_phase a_phase) const;
2183
2191 getSurfaceDeposition(const std::string& a_realm, const phase::which_phase a_phase) const;
2192
2199 Vector<RefCountedPtr<EBCoarAve>>&
2200 getCoarseAverage(const std::string& a_realm, const phase::which_phase a_phase) const;
2201
2208 Vector<RefCountedPtr<EBMultigridInterpolator>>&
2209 getMultigridInterpolator(const std::string& a_realm, const phase::which_phase a_phase) const;
2210
2217 Vector<RefCountedPtr<EBCoarseToFineInterp>>&
2218 getFineInterp(const std::string& a_realm, const phase::which_phase a_phase) const;
2219
2226 Vector<RefCountedPtr<EBReflux>>&
2227 getFluxRegister(const std::string& a_realm, const phase::which_phase a_phase) const;
2228
2235 Vector<RefCountedPtr<EBMassRedistribution>>&
2236 getMassRedistributionOp(const std::string& a_realm, const phase::which_phase a_phase) const;
2237
2244 const RefCountedPtr<EBStateRedistribution>&
2245 getStateRedistribution(const std::string& a_realm, const phase::which_phase a_phase) const;
2246
2258 void
2259 redistributeMass(EBAMRCellData& a_phi,
2260 const EBAMRIVData& a_deltaM,
2261 const std::string& a_realm,
2262 const phase::which_phase a_phase) const noexcept;
2263
2264#ifdef CH_USE_PETSC
2270 const RefCountedPtr<PetscGrid>&
2271 getPetscGrid(const std::string& a_realm) const noexcept;
2272#endif
2273
2278 std::vector<std::string>
2279 getRealms() const;
2280
2286 getBoxSorting() const;
2287
2293 RefCountedPtr<EBIndexSpace>&
2295 {
2296 return m_multifluidIndexSpace->getEBIndexSpace(a_phase);
2297 }
2298
2299protected:
2304 {
2305 BergerRigoutsous,
2306 Tiled,
2307 };
2308
2312 mutable std::map<std::string, RefCountedPtr<Realm>> m_realms;
2313
2317 std::map<phase::which_phase, RefCountedPtr<BaseIF>> m_baseif;
2318
2322 std::map<std::string, Vector<DisjointBoxLayout>> m_oldGrids;
2323
2328 std::map<std::string, Vector<Copier>> m_oldToNewCellCopiers;
2329
2334 std::map<std::string, Vector<Copier>> m_oldToNewEBCopiers;
2335
2340 std::map<std::pair<std::string, std::string>, Vector<Copier>> m_validToValidRealmCopiers;
2341
2346 std::map<std::pair<std::string, std::string>, Vector<Copier>> m_validToValidGhostRealmCopiers;
2347
2352 std::map<std::pair<std::string, std::string>, Vector<Copier>> m_validGhostToValidRealmCopiers;
2353
2358 std::map<std::pair<std::string, std::string>, Vector<Copier>> m_validGhostToValidGhostRealmCopiers;
2359
2364
2369
2373 RefCountedPtr<MultiFluidIndexSpace> m_multifluidIndexSpace;
2374
2379
2384
2388 IntVect m_numCells;
2389
2394
2398 RealVect m_probLo;
2399
2403 RealVect m_probHi;
2404
2409
2414
2419
2424
2429
2434
2439
2444
2449
2454
2459
2464
2469
2474
2479
2484
2489
2494
2499
2504
2511
2518
2525
2533
2540
2545
2550
2554 Vector<DisjointBoxLayout> m_grids;
2555
2559 Vector<ProblemDomain> m_domains;
2560
2565
2569 Vector<Real> m_dx;
2570
2574 void
2575 defineRealms();
2576
2585 void
2586 buildGrids(const Vector<IntVectSet>& a_tags, const int a_lmin, const int a_hardcap = -1);
2587
2595 void
2596 buildGrids(const Vector<Vector<Box>>& a_boxes, const int a_lmin);
2597
2603 void
2604 defineGrids(Vector<Vector<Box>>& a_boxes, const int a_lmin);
2605
2609 void
2610 buildCopiers();
2611
2615 void
2617
2621 void
2623
2627 void
2629
2633 void
2635
2639 void
2641
2645 void
2647
2651 void
2653
2657 void
2659
2663 void
2665
2669 void
2671
2676 void
2678
2682 void
2684
2688 void
2690
2695 void
2697
2701 void
2703
2707 void
2709
2713 void
2715
2719 void
2721
2725 void
2727
2731 void
2733
2744 void
2745 computeGradient(LevelData<EBCellFAB>& a_gradient,
2746 const LevelData<EBCellFAB>& a_phi,
2747 const std::string& a_realm,
2748 const phase::which_phase a_phase,
2749 const int a_lvl) const;
2750};
2751
2752#include <CD_NamespaceFooter.H>
2753
2754#include <CD_AmrMeshImplem.H>
2755
2756#endif
Implementation of CD_AmrMesh.H.
Average
Various averaging methods.
Definition CD_Average.H:25
BoxSorting
Enum for sorting boxes.
Definition CD_BoxSorting.H:22
CoarseFineDeposition
Coarse-fine deposition types (see CD_EBAMRParticleMesh for how these are handled).
Definition CD_CoarseFineDeposition.H:28
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:24
DepositionType
Deposition types.
Definition CD_DepositionType.H:24
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.
Declaration of cut-cell deposition strategies.
IrregularDeposition
How a deposition scheme treats the cut cells.
Definition CD_IrregularDeposition.H:36
Declaration of a static class for various load balancing operations.
Declaration of a wrapper for wrapping multifluid EBLevelGrids.
Multi-fluid index space.
Declaration of an AMR-hierarchy container that owns per-patch ParticleSoA leaves.
Declaration of ParticleGhostMask, a per-box CSR lookup of particle ghost scatter targets.
Vector< RefCountedPtr< LayoutData< ParticleGhostMask > > > AMRParticleGhostMask
AMR-wide particle ghost-target lookup: one per-box CSR table per level, indexed by SOURCE level.
Definition CD_ParticleGhostMask.H:210
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:33
AmrMesh & operator=(const AmrMesh &a_other)=delete
Disallowed copy assignment.
const AMRParticleGhostMask & getTrivialParticleGhostMask() const
Get a trivial (empty) particle ghost mask that scatters no particles.
Definition CD_AmrMesh.cpp:3643
void redistributeMass(EBAMRCellData &a_phi, const EBAMRIVData &a_deltaM, const std::string &a_realm, const phase::which_phase a_phase) const noexcept
Add the mass of each cut cell to its neighbouring cells.
Definition CD_AmrMesh.cpp:4088
int m_refRatio
Refinement ratio.
Definition CD_AmrMesh.H:2408
Vector< RefCountedPtr< LayoutData< std::array< FaceIterator, SpaceDim > > > > & getFaceIterator(const std::string &a_realm, const phase::which_phase a_phase) const
Get face iterators over cut-cell faces in each valid grid box (FaceStop::SurroundingWithBoundary).
Definition CD_AmrMesh.cpp:3460
void depositGathered(EBAMRCellData &a_meshData, const std::string &a_realm, const phase::which_phase &a_phase, const ParticleContainer< P, Traits > &a_particles, const DepositionType a_depositionType, const CoarseFineDeposition a_coarseFineDeposition, const IrregularDeposition a_irregularDeposition, CellGather a_cellGather)
Deposit a custom per-particle scalar (a_cellGather) of an SoA container on the mesh.
Definition CD_AmrMeshImplem.H:392
void parseRuntimeOptions()
Parse runtime options.
Definition CD_AmrMesh.cpp:988
std::map< std::string, Vector< Copier > > m_oldToNewCellCopiers
Storage for copiers from the old grids to the new ones.
Definition CD_AmrMesh.H:2328
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:4225
void allocatePointer(Vector< RefCountedPtr< T > > &a_data) const
Allocate pointer but not any memory blocks.
Definition CD_AmrMeshImplem.H:269
EBAMRSurfaceDeposition & getSurfaceDeposition(const std::string &a_realm, const phase::which_phase a_phase) const
Get EBAMRSurfaceDeposition surface deposition operator.
Definition CD_AmrMesh.cpp:3969
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:3529
std::vector< std::string > getRealms() const
Get the name of all Realms.
Definition CD_AmrMesh.cpp:4371
RealVect getProbHi() const
Get upper-right corner of computational domain.
Definition CD_AmrMesh.cpp:3164
void parseBrBufferSize()
Parse buffer size for Berger-Rigoutsous grid algorithm.
Definition CD_AmrMesh.cpp:2745
Real getFinestDx() const
Get resolution on the finest grid level.
Definition CD_AmrMesh.cpp:3326
int getMaxBlockSize() const
Get maximum permitted block size.
Definition CD_AmrMesh.cpp:3263
void registerRealm(const std::string &a_realm)
Register a new realm.
Definition CD_AmrMesh.cpp:4212
const RefCountedPtr< BaseIF > & getBaseImplicitFunction(const phase::which_phase a_phase) const
Get implicit function for a specific phase.
Definition CD_AmrMesh.cpp:3359
AmrMesh(const AmrMesh &&a_other)=delete
Disallowed move constructor.
void transferCoveredParticlesIF(ParticleContainer< P, Traits > &a_particlesFrom, ParticleContainer< P, Traits > &a_particlesTo, const phase::which_phase &a_phase, const Real a_tolerance) const
Transfer SoA particles inside the EB (implicit-function test) from one container to another: f(x) > a...
Definition CD_AmrMeshImplem.H:674
Real m_fillRatioBR
Fill ratio.
Definition CD_AmrMesh.H:2393
void allocate(ParticleContainer< P, Traits > &a_container, const std::string &a_realm) const
Allocate a struct-of-arrays particle container on the given realm.
Definition CD_AmrMeshImplem.H:242
ProblemDomain getFinestDomain() const
Get finest domain.
Definition CD_AmrMesh.cpp:3315
void parseCellCentroidInterpolation()
Parse centroid interpolation stencils.
Definition CD_AmrMesh.cpp:2971
Vector< RefCountedPtr< EBCoarAve > > & getCoarseAverage(const std::string &a_realm, const phase::which_phase a_phase) const
Get the coarsening utility.
Definition CD_AmrMesh.cpp:3986
const Vector< RefCountedPtr< LevelTiles > > & getLevelTiles(const std::string &a_realm) const
Get the tiled space representation.
Definition CD_AmrMesh.cpp:3561
void depositWeight(EBAMRCellData &a_meshData, const std::string &a_realm, const phase::which_phase &a_phase, const ParticleContainer< P, Traits > &a_particles, const DepositionType a_depositionType, const CoarseFineDeposition a_coarseFineDeposition, const IrregularDeposition a_irregularDeposition)
Deposit the SoA container's weight column on the mesh (all coarse-fine strategies).
Definition CD_AmrMeshImplem.H:372
int m_oldFinestLevel
Finest level before a regrid.
Definition CD_AmrMesh.H:2423
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:23
const Vector< DisjointBoxLayout > & getProxyGrids() const
Get the "proxy" grids in AmrMesh.
Definition CD_AmrMesh.cpp:3382
void interpGhostMG(MFAMRCellData &a_data, const std::string &a_realm) const
Interpolate ghost cells over a realm and phase.
Definition CD_AmrMesh.cpp:2121
IntVect m_numCells
Coarsest box where we compute.
Definition CD_AmrMesh.H:2388
void postRegrid()
Run post-regrid operations.
Definition CD_AmrMesh.cpp:1081
void parseMaxAmrDepth()
Parse the maximum permitted AMR depth.
Definition CD_AmrMesh.cpp:2575
RealVect m_probHi
Domain simulation corner.
Definition CD_AmrMesh.H:2403
void registerParticleGhostMask(const std::string &a_realm, const int a_width)
Register a particle ghost-mask width on a realm so it is (re)built at every regrid.
Definition CD_AmrMesh.cpp:3577
const RefCountedPtr< PetscGrid > & getPetscGrid(const std::string &a_realm) const noexcept
Get a PETSc grid object.
Definition CD_AmrMesh.cpp:4128
const RefCountedPtr< EBStateRedistribution > & getStateRedistribution(const std::string &a_realm, const phase::which_phase a_phase) const
Get the state redistribution.
Definition CD_AmrMesh.cpp:4054
const AMRMask & getValidCells(const std::string &a_realm) const
Get a map of all valid cells on a specified realm.
Definition CD_AmrMesh.cpp:3545
Vector< DisjointBoxLayout > m_grids
Grids.
Definition CD_AmrMesh.H:2554
RefCountedPtr< MultiFluidIndexSpace > m_multifluidIndexSpace
MultiFluidIndexSpace.
Definition CD_AmrMesh.H:2373
void interpolateWeight(ParticleContainer< P, Traits > &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) const
Interpolate a mesh scalar field onto the SoA container's weight column.
Definition CD_AmrMeshImplem.H:442
RealVect m_probLo
Domain simulation corner.
Definition CD_AmrMesh.H:2398
int m_mirrorBandRadius
Mirror deposition: half-width, in cells, of the band around the embedded boundary that reflects.
Definition CD_AmrMesh.H:2510
void nonConservativeDivergence(EBAMRIVData &a_nonConsDivF, const EBAMRCellData &a_kappaDivF, const std::string &a_realm, const phase::which_phase &a_phase) const noexcept
Compute a non-conservative divergence.
Definition CD_AmrMesh.cpp:4145
int m_bufferSizeBR
Set buffer size.
Definition CD_AmrMesh.H:2448
void intersectParticlesBisectIF(ParticleContainer< P, Traits > &a_activeParticles, ParticleContainer< P, Traits > &a_ebParticles, ParticleContainer< P, Traits > &a_domainParticles, const phase::which_phase a_phase, const Real a_bisectionStep, const bool a_deleteParticles, const std::function< void(ParticleSoA< P, Traits > &, std::size_t)> &a_nonDeletionModifier) const noexcept
SoA bisection-based particle intersection algorithm.
Definition CD_AmrMeshImplem.H:1060
void setCoarsestGrid(const IntVect &a_nCells)
Set the coarsest grid cells.
Definition CD_AmrMesh.cpp:2534
void parseMaxSimulationDepth()
Set maximum simulation depth.
Definition CD_AmrMesh.cpp:2594
int getMaxSimulationDepth() const
Get maximum permitted simulation depth.
Definition CD_AmrMesh.cpp:3197
int m_maxSimulationDepth
Maximum allowed depth for simulation.
Definition CD_AmrMesh.H:2433
void setFinestLevel(const int a_finestLevel)
Set the finest level.
Definition CD_AmrMesh.cpp:2651
virtual ~AmrMesh()
Destructor.
const Vector< DisjointBoxLayout > & getGrids(const std::string &a_realm) const
Get the grids.
Definition CD_AmrMesh.cpp:3393
const Vector< Vector< RefCountedPtr< EBLevelGrid > > > & getMultigridLevelGridsCoFi(const std::string &a_realm, const phase::which_phase a_phase) const
Get the coarsened grids between consecutive multigrid levels for a Realm and phase.
Definition CD_AmrMesh.cpp:3756
const Vector< Vector< RefCountedPtr< EBLevelGrid > > > & getMultigridLevelGrids(const std::string &a_realm, const phase::which_phase a_phase) const
Get the multigrid levels for a Realm and phase.
Definition CD_AmrMesh.cpp:3739
int m_multigridInterpRadius
Multigrid interpolation radius.
Definition CD_AmrMesh.H:2488
void buildDomains()
Build domains.
Definition CD_AmrMesh.cpp:1024
Real m_mirrorCreaseTolerance
Mirror deposition: largest permitted dimensionless residual of the shape-operator fit.
Definition CD_AmrMesh.H:2524
int m_srdOrder
State redistribution: order of the reconstruction (0 or 2).
Definition CD_AmrMesh.H:2498
const AMRParticleGhostMask & getParticleGhostMask(const std::string &a_realm, const int a_width) const
Get the same-level particle ghost mask on a realm for a registered width.
Definition CD_AmrMesh.cpp:3593
GridGenerationMethod m_gridGenerationMethod
Grid generation method.
Definition CD_AmrMesh.H:2363
int getMinBlockSize() const
Get the minimum block size (i.e. the smallest possible box / tile size).
Definition CD_AmrMesh.cpp:3252
const EBAMRCellData & getMirrorSurfaceData(const std::string &a_realm, const phase::which_phase a_phase) const
Get the per-band-cell surface data used by mirrored deposition, for a Realm and phase.
Definition CD_AmrMesh.cpp:3906
void parseRefinementRatios()
Parse refinement ratios.
Definition CD_AmrMesh.cpp:2613
Vector< int > m_refinementRatios
AMR resolutions.
Definition CD_AmrMesh.H:2564
Vector< RefCountedPtr< LayoutData< std::array< FaceIterator, SpaceDim > > > > & getFaceIteratorNoBoundary(const std::string &a_realm, const phase::which_phase a_phase) const
Get face iterators over cut-cell faces in each valid grid box (FaceStop::SurroundingNoBoundary).
Definition CD_AmrMesh.cpp:3477
const EBAMRCellData & getNotCoveredCells(const std::string &a_realm, const phase::which_phase a_phase) const
Get the non-covered-cell mask (1 in regular/irregular cells, 0 in covered cells) for a Realm and phas...
Definition CD_AmrMesh.cpp:3872
int m_verbosity
Verbosity.
Definition CD_AmrMesh.H:2413
Real getMirrorMaxJacobian() const
Get the largest Jacobian magnitude the mirror pass will trust.
Definition CD_AmrMesh.cpp:3940
Vector< RefCountedPtr< LayoutData< VoFIterator > > > & getMultiCutVofIterator(const std::string &a_realm, const phase::which_phase a_phase) const
Get vof iterators restricted to multiply-cut cells for a Realm and phase.
Definition CD_AmrMesh.cpp:3443
void interpToCentroids(EBAMRCellData &a_data, const std::string &a_realm, const phase::which_phase a_phase) const noexcept
Interpolate data to centroids on realm and phase.
Definition CD_AmrMesh.cpp:2356
const EBAMRCellData & getIrregularCells(const std::string &a_realm, const phase::which_phase a_phase) const
Get the irregular-cell mask (value 1 in irregular cells, 0 elsewhere) for a Realm and phase.
Definition CD_AmrMesh.cpp:3889
bool m_hasRegridCopiers
Has regrid copiers or not.
Definition CD_AmrMesh.H:2549
int m_minBlockSize
Blocking factor.
Definition CD_AmrMesh.H:2453
int m_multigridInterpOrder
Multigrid interpolation order.
Definition CD_AmrMesh.H:2483
const AMRParticleGhostMask & getParticleGhostMaskFineToCoar(const std::string &a_realm, const int a_width) const
Get the fine-to-coarse particle ghost mask on a realm for a registered width.
Definition CD_AmrMesh.cpp:3609
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:2340
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:2352
void parseNumGhostCells()
Parse the number of ghost cells.
Definition CD_AmrMesh.cpp:2873
const AMRParticleGhostMask & getParticleGhostMaskCoarToFine(const std::string &a_realm, const int a_width) const
Get the coarse-to-fine particle ghost mask on a realm for a registered width.
Definition CD_AmrMesh.cpp:3626
void sanityCheck() const
Do a sanity check to make sure everything is set up correctly.
Definition CD_AmrMesh.cpp:3057
const Vector< int > & getMirrorHasCutCells(const std::string &a_realm, const phase::which_phase a_phase) const
Get, per level, whether that level has any cut cell anywhere in the domain.
Definition CD_AmrMesh.cpp:3923
int m_numGhostCells
Number of ghost cells.
Definition CD_AmrMesh.H:2473
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:1189
void parseVerbosity()
Parse the verbosity for AmrMesh.
Definition CD_AmrMesh.cpp:2545
int m_maxBlockSize
Max box size.
Definition CD_AmrMesh.H:2438
GridGenerationMethod
Enum for having understandable notation for grid generation.
Definition CD_AmrMesh.H:2304
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:2358
void transferCoveredParticlesDiscrete(ParticleContainer< P, Traits > &a_particlesFrom, ParticleContainer< P, Traits > &a_particlesTo, const phase::which_phase &a_phase, const Real a_tolerance) const
Transfer SoA particles inside the EB using discrete (EBISBox) information from one container to anoth...
Definition CD_AmrMeshImplem.H:739
void harmonicAverage(MFAMRCellData &a_data, const std::string &a_realm) const
Harmonic coarsening of multifluid data.
Definition CD_AmrMesh.cpp:1636
void removeCoveredParticlesVoxels(ParticleContainer< P, Traits > &a_particles, const phase::which_phase &a_phase) const
Remove SoA particles that live in covered cells (voxel test).
Definition CD_AmrMeshImplem.H:619
bool getEbCf() const
Check if mesh has an EBCF.
Definition CD_AmrMesh.cpp:4201
const AMRMask & getParticleGhostExposure(const std::string &a_realm, const int a_width) const
Get the particle boundary-exposure mask on a realm for a registered width.
Definition CD_AmrMesh.cpp:3656
void parseMinBlockSize()
Parse the B-R blocking factor. For tiled mesh refinement this parses the tile size.
Definition CD_AmrMesh.cpp:2806
Vector< Real > m_dx
Level resolutions.
Definition CD_AmrMesh.H:2569
Real m_mirrorConditionTolerance
Mirror deposition: smallest permitted eigenvalue ratio of U^T U in the shape-operator fit.
Definition CD_AmrMesh.H:2517
int m_numEbGhostsCells
Number of ghost cells to use for eb stuff.
Definition CD_AmrMesh.H:2468
void transferIrregularParticles(ParticleContainer< P, Traits > &a_dstParticles, ParticleContainer< P, Traits > &a_srcParticles, const phase::which_phase a_phase) const noexcept
Transfer SoA particles that are on the covered side of the EB to a different container.
Definition CD_AmrMeshImplem.H:1232
void parseOptions()
Parse options. Called during the constructor.
Definition CD_AmrMesh.cpp:952
void buildCopiers()
Build copiers for copying between realms.
Definition CD_AmrMesh.cpp:1380
RealVect getProbLo() const
Get lower-left corner of computational domain.
Definition CD_AmrMesh.cpp:3153
BoxSorting m_boxSort
Box sorting.
Definition CD_AmrMesh.H:2368
void setMultifluidIndexSpace(const RefCountedPtr< MultiFluidIndexSpace > &a_multiFluidIndexSpace)
Sets multifluid index space.
Definition CD_AmrMesh.cpp:928
int m_maxAmrDepth
Maximum amr depth.
Definition CD_AmrMesh.H:2428
void defineRealms()
Define Realms.
Definition CD_AmrMesh.cpp:4274
int m_finestLevel
Finest level.
Definition CD_AmrMesh.H:2418
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:3689
void removeCoveredParticlesIF(ParticleContainer< P, Traits > &a_particles, const phase::which_phase &a_phase, const Real a_tolerance) const
Remove SoA particles that fall inside the EB (implicit-function test): f(x) > a_tolerance*dx.
Definition CD_AmrMeshImplem.H:480
void reallocate(EBAMRCellData &a_data, const phase::which_phase a_phase, const int a_lmin) const
Reallocate data.
Definition CD_AmrMesh.cpp:614
const Vector< Vector< RefCountedPtr< MFLevelGrid > > > & getMultigridMFLevelGridsCoFi(const std::string &a_realm) const
Get the multifluid coarsened grids between consecutive multigrid levels for a Realm.
Definition CD_AmrMesh.cpp:3806
const Vector< Vector< RefCountedPtr< EBCoarAve > > > & getMultigridCoarseAverage(const std::string &a_realm, const phase::which_phase a_phase) const
Get the coarse averaging between consecutive multigrid levels for a Realm and phase.
Definition CD_AmrMesh.cpp:3773
Real m_mirrorMaxJacobian
Mirror deposition: largest Jacobian magnitude that will be trusted.
Definition CD_AmrMesh.H:2532
std::map< std::string, Vector< Copier > > m_oldToNewEBCopiers
Storage for copiers from the old grids to the new ones.
Definition CD_AmrMesh.H:2334
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:3672
std::map< phase::which_phase, RefCountedPtr< BaseIF > > m_baseif
Implicit functions.
Definition CD_AmrMesh.H:2317
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:4309
int getNumberOfGhostCells() const
Get the default number of ghost cells.
Definition CD_AmrMesh.cpp:3230
bool queryRealm(const std::string &a_realm) const
Query if a realm exists.
Definition CD_AmrMesh.cpp:4184
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:3822
const Vector< Vector< RefCountedPtr< MFLevelGrid > > > & getMultigridMFLevelGrids(const std::string &a_realm) const
Get the multifluid multigrid levels for a Realm.
Definition CD_AmrMesh.cpp:3790
int m_ebMaxBlockSize
Largest box the geometry grids are tiled with.
Definition CD_AmrMesh.H:2463
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:1119
AmrMesh & operator=(const AmrMesh &&a_other)=delete
Disallowed move assignment.
void parseCoarsestLevelNumCells()
Parse the coarsest domain grid.
Definition CD_AmrMesh.cpp:2558
RefCountedPtr< EBIndexSpace > & getEBIndexSpace(const phase::which_phase a_phase)
Get EBIndexSpace corresponding to a particular phase.
Definition CD_AmrMesh.H:2294
void arithmeticAverage(MFAMRCellData &a_data, const std::string &a_realm) const
Arithmetic coarsening of multifluid data.
Definition CD_AmrMesh.cpp:1625
void intersectParticlesRaycastIF(ParticleContainer< P, Traits > &a_activeParticles, ParticleContainer< P, Traits > &a_ebParticles, ParticleContainer< P, Traits > &a_domainParticles, const phase::which_phase a_phase, const Real a_tolerance, const bool a_deleteParticles, const std::function< void(ParticleSoA< P, Traits > &, std::size_t)> &a_nonDeletionModifier) const noexcept
SoA ray-casting particle intersection algorithm.
Definition CD_AmrMeshImplem.H:886
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:2664
Vector< RefCountedPtr< LayoutData< std::array< FaceIterator, SpaceDim > > > > & getFaceIteratorWithTangentialGhosts(const std::string &a_realm, const phase::which_phase a_phase) const
Get per-direction face iterators covering cut-cell faces that reach into the tangential ghost layer.
Definition CD_AmrMesh.cpp:3494
int getEbMinBlockSize() const
Get the smallest box the geometry grids are tiled with.
Definition CD_AmrMesh.cpp:3208
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:2346
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:1445
const Vector< Real > & getDx() const
Get spatial resolutions.
Definition CD_AmrMesh.cpp:3337
int getBrBuffer() const
Return buffer for B-R mesh refinement algorithm.
Definition CD_AmrMesh.cpp:3274
Real getMirrorMinDenominator() const
Get the smallest Jacobian denominator the mirror pass will trust.
Definition CD_AmrMesh.cpp:3946
Vector< RefCountedPtr< LayoutData< std::array< FaceIterator, SpaceDim > > > > & getMultiCutFaceIterator(const std::string &a_realm, const phase::which_phase a_phase) const
Get face iterators restricted to multiply-cut faces in each valid grid box.
Definition CD_AmrMesh.cpp:3512
EBAMRParticleMesh & getParticleMesh(const std::string &a_realm, const phase::which_phase a_phase) const
Get EBAMRParticleMesh operator.
Definition CD_AmrMesh.cpp:3952
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:3409
void defineGrids(Vector< Vector< Box > > &a_boxes, const int a_lmin)
Load balance new boxes and define m_grids from them, for levels a_lmin through m_finestLevel.
Definition CD_AmrMesh.cpp:1321
int getMaxBoxSize() const
Deprecated alias for getMaxBlockSize().
Definition CD_AmrMesh.H:1711
std::map< std::string, RefCountedPtr< Realm > > m_realms
These are all the Realms.
Definition CD_AmrMesh.H:2312
int getMaxEbisBoxSize() const
Get maximum box size for EBIS generation.
Definition CD_AmrMesh.cpp:3285
AmrMesh()
Default constructor.
Definition CD_AmrMesh.cpp:32
int getEbMaxBlockSize() const
Get the largest box the geometry grids are tiled with.
Definition CD_AmrMesh.cpp:3219
void registerMultigrid(const std::string &a_realm, const int a_minCellsBottom)
Register the multigrid levels over a realm.
Definition CD_AmrMesh.cpp:4242
void parseEbGhostCells()
Parse number of ghost cells for eb stuff.
Definition CD_AmrMesh.cpp:2829
void parseMultigridInterpolator()
Parse settings for the multigrid interpolator.
Definition CD_AmrMesh.cpp:2895
void interpolateParticles(ParticleContainer< P, Traits > &a_particles, const std::string &a_realm, const phase::which_phase &a_phase, const EBAMRCellData &a_meshField, const DepositionType a_interpType, const bool a_forceIrregNGP) const
Interpolate a mesh field onto one or more SoA payload columns.
Definition CD_AmrMeshImplem.H:461
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:46
void parseStateRedistribution()
Parse the parameters of the state redistribution.
Definition CD_AmrMesh.cpp:2920
int getRefinementRatio(const int a_level1, const int a_level2) const
Get refinement factor between two levels.
Definition CD_AmrMesh.cpp:3296
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:4258
const EBAMRCellData & getRegularCells(const std::string &a_realm, const phase::which_phase a_phase) const
Get the regular-cell mask (value 1 in regular cells, 0 elsewhere) for a Realm and phase.
Definition CD_AmrMesh.cpp:3838
void depositParticles(EBAMRIVData &a_meshData, const std::string &a_realm, const phase::which_phase &a_phase, const ParticleContainer< P, Traits > &a_particles) const noexcept
Deposit the weight column of an SoA particle container onto the surface (EB).
Definition CD_AmrMeshImplem.H:352
Vector< RefCountedPtr< EBMultigridInterpolator > > & getMultigridInterpolator(const std::string &a_realm, const phase::which_phase a_phase) const
Get multigrid interpolation utility.
Definition CD_AmrMesh.cpp:4003
Vector< RefCountedPtr< EBMassRedistribution > > & getMassRedistributionOp(const std::string &a_realm, const phase::which_phase a_phase) const
Get the redistribution operators.
Definition CD_AmrMesh.cpp:4071
void interpToEB(EBAMRIVData &a_centroidData, const EBAMRCellData &a_cellData, const std::string &a_realm, const phase::which_phase a_phase) const noexcept
Interpolate data to EB centroids on realm and phase.
Definition CD_AmrMesh.cpp:2465
void remapToNewGrids(ParticleContainer< P, Traits > &a_particles, const int a_lmin, const int a_newFinestLevel) const noexcept
Regrid a struct-of-arrays particle container to new grids.
Definition CD_AmrMeshImplem.H:328
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:2060
int getBlockingFactor() const
Deprecated alias for getMinBlockSize().
Definition CD_AmrMesh.H:1693
void parseMaxBlockSize()
Parse the maximum permitted box size.
Definition CD_AmrMesh.cpp:2703
CellCentroidInterpolation::Type m_cellCentroidInterpolationType
Interpolation type for cell to cell centroid interpolation.
Definition CD_AmrMesh.H:2378
void parseEBCentroidInterpolation()
Parse EB interpolation (or extrapolation) stencils.
Definition CD_AmrMesh.cpp:3014
const Vector< RefCountedPtr< MFLevelGrid > > & getMFLevelGrid(const std::string &a_realm) const
Get EBISLayouts for a Realm.
Definition CD_AmrMesh.cpp:3706
int m_multigridInterpWeight
Multigrid interpolation weights.
Definition CD_AmrMesh.H:2493
std::map< std::string, Vector< DisjointBoxLayout > > m_oldGrids
Old grids.
Definition CD_AmrMesh.H:2322
Real m_srdTargetVolFrac
State redistribution: target volume fraction.
Definition CD_AmrMesh.H:2503
EBCentroidInterpolation::Type m_ebCentroidInterpolationType
Interpolation type for cell to EB centroid interpolation.
Definition CD_AmrMesh.H:2383
Vector< RefCountedPtr< LayoutData< VoFIterator > > > & getVofIterator(const std::string &a_realm, const phase::which_phase a_phase) const
Get VoF iterators covering all cut-cells (singly- and multiply-cut) for a Realm and phase.
Definition CD_AmrMesh.cpp:3426
const EBAMRCellData & getCoveredCells(const std::string &a_realm, const phase::which_phase a_phase) const
Get the covered-cell mask (value 1 in covered cells, 0 elsewhere) for a Realm and phase.
Definition CD_AmrMesh.cpp:3855
void preRegrid()
Run pre-regrid operations.
Definition CD_AmrMesh.cpp:1049
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:1585
Vector< RefCountedPtr< EBReflux > > & getFluxRegister(const std::string &a_realm, const phase::which_phase a_phase) const
Get flux register.
Definition CD_AmrMesh.cpp:4037
const Vector< RefCountedPtr< MFLevelGrid > > & getMFLevelGridCoFi(const std::string &a_realm) const
Get the multifluid coarsened grids between AMR levels for a Realm.
Definition CD_AmrMesh.cpp:3723
AmrMesh(const AmrMesh &a_other)=delete
Disallowed copy constructor.
void parseBrFillRatio()
Parse the Berger-Rigoutsos fill ratio.
Definition CD_AmrMesh.cpp:2635
Vector< ProblemDomain > m_domains
Problem domains.
Definition CD_AmrMesh.H:2559
void parseProbLoHiCorners()
Parse the low/high corners of the computational domain.
Definition CD_AmrMesh.cpp:1006
void parseGridGeneration()
Parse the grid generation algorithm.
Definition CD_AmrMesh.cpp:2764
Vector< RefCountedPtr< EBCoarseToFineInterp > > & getFineInterp(const std::string &a_realm, const phase::which_phase a_phase) const
Get interpolator.
Definition CD_AmrMesh.cpp:4020
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:2179
void parseMaxEbisBoxSize()
Parse the maximum permitted box size.
Definition CD_AmrMesh.cpp:2726
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:214
Real m_mirrorMinDenominator
Mirror deposition: smallest Jacobian denominator that will be trusted.
Definition CD_AmrMesh.H:2539
bool m_hasGrids
Has grids or not.
Definition CD_AmrMesh.H:2544
void deallocate(Vector< T * > &a_data) const
Deallocate data.
Definition CD_AmrMeshImplem.H:166
int getMaxAmrDepth() const
Get maximum permitted amr depth.
Definition CD_AmrMesh.cpp:3186
void transferCoveredParticlesVoxels(ParticleContainer< P, Traits > &a_particlesFrom, ParticleContainer< P, Traits > &a_particlesTo, const phase::which_phase &a_phase) const
Transfer SoA particles that live in covered cells (voxel test) from one container to another.
Definition CD_AmrMeshImplem.H:826
void conservativeAverage(MFAMRCellData &a_data, const std::string &a_realm) const
Conservative coarsening of multifluid data.
Definition CD_AmrMesh.cpp:1647
int m_ebMinBlockSize
Smallest box the geometry grids are tiled with.
Definition CD_AmrMesh.H:2458
const Vector< int > & getRefinementRatios() const
Get refinement ratios.
Definition CD_AmrMesh.cpp:3348
void regridOperators(const int a_lmin)
Regrid AMR operators. This is done for all realms.
Definition CD_AmrMesh.cpp:1158
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:1976
BoxSorting getBoxSorting() const
Get box sorting method.
Definition CD_AmrMesh.cpp:4389
void removeCoveredParticlesDiscrete(ParticleContainer< P, Traits > &a_particles, const phase::which_phase &a_phase, const Real a_tolerance) const
Remove SoA particles inside the EB using discrete (EBISBox) information: covered cells,...
Definition CD_AmrMeshImplem.H:539
void parseEbBlockSizes()
Parse the tile and super-tile the geometry grids are built with.
Definition CD_AmrMesh.cpp:2846
void parseMirrorDeposition()
Parse the mirror-deposition band radius and fit/guard tolerances.
Definition CD_AmrMesh.cpp:2941
int m_maxEbisBoxSize
Maximum box size for EBIS generation.
Definition CD_AmrMesh.H:2443
int getNumberOfEbGhostCells() const
Get number of ghost cells used for EB grid generation.
Definition CD_AmrMesh.cpp:3241
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:941
int getFinestLevel() const
Get finest grid level.
Definition CD_AmrMesh.cpp:3175
const Vector< ProblemDomain > & getDomains() const
Get domains.
Definition CD_AmrMesh.cpp:3371
int m_numLsfGhostCells
Number of ghost cells to use when writing level-set to grid.
Definition CD_AmrMesh.H:2478
Type
Supported interpolation types.
Definition CD_CellCentroidInterpolation.H:44
Default class for holding LevelData<T> data across an EBAMR realm.
Definition CD_EBAMRData.H:41
AMR driver that deposits/interpolates ParticleContainer particles across the hierarchy.
Definition CD_EBAMRParticleMesh.H:95
class for handling surface deposition of particles with EB and AMR.
Definition CD_EBAMRSurfaceDeposition.H:30
Type
Supported interpolation types.
Definition CD_EBCentroidInterpolation.H:44
Type
Type of interpolation methods supported. PWC = Piecewise constant, ignoring the embedded boundary....
Definition CD_EBCoarseToFineInterp.H:43
AMR-hierarchy container of computational particles, stored per patch in Struct-of-Arrays form.
Definition CD_ParticleContainer.H:123
Arena-backed Struct-of-Arrays particle container for a single grid patch.
Definition CD_ParticleSoA.H:655
which_phase
Enumeration of supported phases.
Definition CD_MultiFluidIndexSpace.H:38