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
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 registerMask(const std::string& a_mask, const int a_buffer, const std::string& a_realm);
319
323 void
324 buildDomains();
325
332 void
333 setFinestLevel(const int a_finestLevel);
334
339 void
340 setCoarsestGrid(const IntVect& a_nCells);
341
347 bool
348 queryRealm(const std::string& a_realm) const;
349
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
425 EBAMRCellData
426 alias(const phase::which_phase a_phase, const MFAMRCellData& a_mfdata) const;
427
434 EBAMRFluxData
435 alias(const phase::which_phase a_phase, const MFAMRFluxData& a_mfdata) const;
436
443 EBAMRIVData
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_ghost = -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_ghost = -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_ghost = -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_ghost = -1) const;
563
573 void
574 allocate(EBAMRIFData& a_data,
575 const std::string& a_realm,
576 const phase::which_phase a_phase,
577 const int a_nComp,
578 const int a_ghost = -1) const;
579
588 void
589 allocate(EBAMRBool& a_data, const std::string& a_realm, const int a_nComp, const int a_ghost = -1) const;
590
601 void
602 allocate(EBAMRFAB& a_data, const std::string& a_realm, const int a_nComp, const int a_ghost = -1) const;
603
612 void
613 allocate(MFAMRCellData& a_data, const std::string& a_realm, const int a_nComp, const int a_ghost = -1) const;
614
623 void
624 allocate(MFAMRFluxData& a_data, const std::string& a_realm, const int a_nComp, const int a_ghost = -1) const;
625
634 void
635 allocate(MFAMRIVData& a_data, const std::string& a_realm, const int a_nComp, const int a_ghost = 0) const;
636
644 void
645 reallocate(EBAMRCellData& a_data, const phase::which_phase a_phase, const int a_lmin) const;
646
654 void
655 reallocate(EBAMRFluxData& a_data, const phase::which_phase a_phase, const int a_lmin) const;
656
664 void
665 reallocate(EBAMRIVData& a_data, const phase::which_phase a_phase, const int a_lmin) const;
666
674 void
675 reallocate(EBAMRIFData& a_data, const phase::which_phase a_phase, const int a_lmin) const;
676
683 void
684 reallocate(EBAMRBool& a_data, const int a_lmin) const;
685
692 void
693 reallocate(MFAMRCellData& a_data, const int a_lmin) const;
694
701 void
702 reallocate(MFAMRFluxData& a_data, const int a_lmin) const;
703
710 void
711 reallocate(MFAMRIVData& a_data, const int a_lmin) const;
712
719 void
720 average(MFAMRCellData& a_data, const std::string& a_realm, const Average& a_average) const;
721
727 void
728 arithmeticAverage(MFAMRCellData& a_data, const std::string& a_realm) const;
729
735 void
736 harmonicAverage(MFAMRCellData& a_data, const std::string& a_realm) const;
737
743 void
744 conservativeAverage(MFAMRCellData& a_data, const std::string& a_realm) const;
745
752 void
753 average(MFAMRFluxData& a_data, const std::string& a_realm, const Average& a_average) const;
754
762 void
763 arithmeticAverage(MFAMRFluxData& a_data, const std::string& a_realm) const;
764
772 void
773 harmonicAverage(MFAMRFluxData& a_data, const std::string& a_realm) const;
774
780 void
781 conservativeAverage(MFAMRFluxData& a_data, const std::string& a_realm) const;
782
790 void
791 average(EBAMRCellData& a_data,
792 const std::string& a_realm,
793 const phase::which_phase a_phase,
794 const Average& a_average) const;
795
804 void
805 average(EBAMRCellData& a_data,
806 const std::string& a_realm,
807 const phase::which_phase a_phase,
808 const Average& a_average,
809 const Interval& a_variables) const;
810
817 void
818 arithmeticAverage(EBAMRCellData& a_data, const std::string& a_realm, const phase::which_phase a_phase) const;
819
827 void
828 arithmeticAverage(EBAMRCellData& a_data,
829 const std::string& a_realm,
830 const phase::which_phase a_phase,
831 const Interval& a_variables) const;
832
839 void
840 harmonicAverage(EBAMRCellData& a_data, const std::string& a_realm, const phase::which_phase a_phase) const;
841
849 void
850 harmonicAverage(EBAMRCellData& a_data,
851 const std::string& a_realm,
852 const phase::which_phase a_phase,
853 const Interval& a_variables) const;
854
861 void
862 conservativeAverage(EBAMRCellData& a_data, const std::string& a_realm, const phase::which_phase a_phase) const;
863
871 void
872 conservativeAverage(EBAMRCellData& a_data,
873 const std::string& a_realm,
874 const phase::which_phase a_phase,
875 const Interval& a_variables) const;
876
884 void
885 average(EBAMRFluxData& a_data,
886 const std::string& a_realm,
887 const phase::which_phase a_phase,
888 const Average& a_average) const;
889
898 void
899 arithmeticAverage(EBAMRFluxData& a_data, const std::string& a_realm, const phase::which_phase a_phase) const;
900
909 void
910 harmonicAverage(EBAMRFluxData& a_data, const std::string& a_realm, const phase::which_phase a_phase) const;
911
918 void
919 conservativeAverage(EBAMRFluxData& a_data, const std::string& a_realm, const phase::which_phase a_phase) const;
920
928 void
929 average(EBAMRIVData& a_data,
930 const std::string& a_realm,
931 const phase::which_phase a_phase,
932 const Average& a_average) const;
933
940 void
941 arithmeticAverage(EBAMRIVData& a_data, const std::string& a_realm, const phase::which_phase a_phase) const;
942
949 void
950 harmonicAverage(EBAMRIVData& a_data, const std::string& a_realm, const phase::which_phase a_phase) const;
951
958 void
959 conservativeAverage(EBAMRIVData& a_data, const std::string& a_realm, const phase::which_phase a_phase) const;
960
971 template <typename P, typename Traits>
972 void
973 depositParticles(EBAMRIVData& a_meshData,
974 const std::string& a_realm,
975 const phase::which_phase& a_phase,
976 const ParticleContainer<P, Traits>& a_particles) const noexcept;
977
990 template <typename P, typename Traits>
991 void
992 depositWeight(EBAMRCellData& a_meshData,
993 const std::string& a_realm,
994 const phase::which_phase& a_phase,
995 const ParticleContainer<P, Traits>& a_particles,
996 const DepositionType a_depositionType,
997 const CoarseFineDeposition a_coarseFineDeposition,
998 const IrregularDeposition a_irregularDeposition);
999
1016 template <typename P, typename Traits, typename CellGather>
1017 void
1018 depositGathered(EBAMRCellData& a_meshData,
1019 const std::string& a_realm,
1020 const phase::which_phase& a_phase,
1021 const ParticleContainer<P, Traits>& a_particles,
1022 const DepositionType a_depositionType,
1023 const CoarseFineDeposition a_coarseFineDeposition,
1024 const IrregularDeposition a_irregularDeposition,
1025 CellGather a_cellGather);
1026
1042 template <auto... Members, typename P, typename Traits>
1043 void
1044 depositParticles(EBAMRCellData& a_meshData,
1045 const std::string& a_realm,
1046 const phase::which_phase& a_phase,
1047 const ParticleContainer<P, Traits>& a_particles,
1048 const DepositionType a_depositionType,
1049 const CoarseFineDeposition a_coarseFineDeposition,
1050 const IrregularDeposition a_irregularDeposition);
1051
1063 template <typename P, typename Traits>
1064 void
1066 const std::string& a_realm,
1067 const phase::which_phase& a_phase,
1068 const EBAMRCellData& a_meshScalarField,
1069 const DepositionType a_interpType,
1070 const bool a_forceIrregNGP) const;
1071
1086 template <auto... Members, typename P, typename Traits>
1087 void
1089 const std::string& a_realm,
1090 const phase::which_phase& a_phase,
1091 const EBAMRCellData& a_meshField,
1092 const DepositionType a_interpType,
1093 const bool a_forceIrregNGP) const;
1094
1103 template <typename P, typename Traits>
1104 void
1106 const phase::which_phase& a_phase,
1107 const Real a_tolerance) const;
1108
1118 template <typename P, typename Traits>
1119 void
1121 const phase::which_phase& a_phase,
1122 const Real a_tolerance) const;
1123
1131 template <typename P, typename Traits>
1132 void
1134
1147 template <typename P, typename Traits>
1148 void
1150 ParticleContainer<P, Traits>& a_particlesTo,
1151 const phase::which_phase& a_phase,
1152 const Real a_tolerance) const;
1153
1165 template <typename P, typename Traits>
1166 void
1168 ParticleContainer<P, Traits>& a_particlesTo,
1169 const phase::which_phase& a_phase,
1170 const Real a_tolerance) const;
1171
1180 template <typename P, typename Traits>
1181 void
1183 ParticleContainer<P, Traits>& a_particlesTo,
1184 const phase::which_phase& a_phase) const;
1185
1196 template <typename P, typename Traits>
1197 void
1199 ParticleContainer<P, Traits>& a_srcParticles,
1200 const phase::which_phase a_phase) const noexcept;
1201
1224 template <auto... OldPosition, typename P, typename Traits>
1225 void
1227 ParticleContainer<P, Traits>& a_activeParticles,
1228 ParticleContainer<P, Traits>& a_ebParticles,
1229 ParticleContainer<P, Traits>& a_domainParticles,
1230 const phase::which_phase a_phase,
1231 const Real a_tolerance,
1232 const bool a_deleteParticles,
1233 const std::function<void(ParticleSoA<P, Traits>&, std::size_t)>& a_nonDeletionModifier) const noexcept;
1234
1252 template <auto... OldPosition, typename P, typename Traits>
1253 void
1255 ParticleContainer<P, Traits>& a_activeParticles,
1256 ParticleContainer<P, Traits>& a_ebParticles,
1257 ParticleContainer<P, Traits>& a_domainParticles,
1258 const phase::which_phase a_phase,
1259 const Real a_bisectionStep,
1260 const bool a_deleteParticles,
1261 const std::function<void(ParticleSoA<P, Traits>&, std::size_t)>& a_nonDeletionModifier) const noexcept;
1262
1269 void
1270 interpGhost(EBAMRCellData& a_data, const std::string& a_realm, const phase::which_phase a_phase) const;
1271
1280 void
1281 interpGhost(LevelData<EBCellFAB>& a_fineData,
1282 const LevelData<EBCellFAB>& a_coarData,
1283 const int a_fineLevel,
1284 const std::string& a_realm,
1285 const phase::which_phase a_phase) const;
1286
1292 void
1293 interpGhost(MFAMRCellData& a_data, const std::string& a_realm) const;
1294
1300 void
1301 interpGhostPwl(MFAMRCellData& a_data, const std::string& a_realm) const;
1302
1309 void
1310 interpGhostPwl(EBAMRCellData& a_data, const std::string& a_realm, const phase::which_phase a_phase) const;
1311
1319 void
1320 interpGhostMG(MFAMRCellData& a_data, const std::string& a_realm) const;
1321
1330 void
1331 interpGhostMG(EBAMRCellData& a_data, const std::string& a_realm, const phase::which_phase a_phase) const;
1332
1344 void
1345 interpToNewGrids(MFAMRCellData& a_newData,
1346 const MFAMRCellData& a_oldData,
1347 const int a_lmin,
1348 const int a_oldFinestLevel,
1349 const int a_newFinestLevel,
1350 const EBCoarseToFineInterp::Type a_type);
1351
1364 void
1365 interpToNewGrids(EBAMRCellData& a_newData,
1366 const EBAMRCellData& a_oldData,
1367 const phase::which_phase a_phase,
1368 const int a_lmin,
1369 const int a_oldFinestLevel,
1370 const int a_newFinestLevel,
1371 const EBCoarseToFineInterp::Type a_type);
1372
1385 void
1386 interpToNewGrids(EBAMRIVData& a_newData,
1387 const EBAMRIVData& a_oldData,
1388 const phase::which_phase a_phase,
1389 const int a_lmin,
1390 const int a_oldFinestLevel,
1391 const int a_newFinestLevel,
1392 const EBCoarseToFineInterp::Type a_type);
1393
1403 template <typename P, typename Traits>
1404 void
1406 const int a_lmin,
1407 const int a_newFinestLevel) const noexcept;
1408
1417 void
1418 interpToCentroids(EBAMRCellData& a_data, const std::string& a_realm, const phase::which_phase a_phase) const noexcept;
1419
1427 void
1428 interpToCentroids(LevelData<EBCellFAB>& a_data,
1429 const std::string& a_realm,
1430 const phase::which_phase a_phase,
1431 const int a_level) const noexcept;
1432
1442 void
1443 interpToCentroids(EBCellFAB& a_centroidData,
1444 const EBCellFAB& a_cellData,
1445 const std::string& a_realm,
1446 const phase::which_phase a_phase,
1447 const int a_level,
1448 const DataIndex& a_din) const noexcept;
1449
1459 void
1460 interpToCentroids(EBAMRIVData& a_centroidData,
1461 const EBAMRCellData& a_cellData,
1462 const std::string& a_realm,
1463 const phase::which_phase a_phase) const noexcept;
1464
1473 void
1474 interpToCentroids(LevelData<BaseIVFAB<Real>>& a_centroidData,
1475 const LevelData<EBCellFAB>& a_cellData,
1476 const std::string& a_realm,
1477 const phase::which_phase a_phase,
1478 const int a_level) const noexcept;
1479
1487 void
1488 interpToEB(EBAMRIVData& a_centroidData,
1489 const EBAMRCellData& a_cellData,
1490 const std::string& a_realm,
1491 const phase::which_phase a_phase) const noexcept;
1492
1501 void
1502 interpToEB(LevelData<BaseIVFAB<Real>>& a_centroidData,
1503 const LevelData<EBCellFAB>& a_cellData,
1504 const std::string& a_realm,
1505 const phase::which_phase a_phase,
1506 const int a_level) const noexcept;
1507
1517 void
1518 interpToEB(BaseIVFAB<Real>& a_centroidData,
1519 const EBCellFAB& a_cellData,
1520 const std::string& a_realm,
1521 const phase::which_phase a_phase,
1522 const int a_level,
1523 const DataIndex& a_din) const noexcept;
1524
1534 void
1535 nonConservativeDivergence(EBAMRIVData& a_nonConsDivF,
1536 const EBAMRCellData& a_kappaDivF,
1537 const std::string& a_realm,
1538 const phase::which_phase& a_phase) const noexcept;
1539
1550 void
1551 nonConservativeDivergence(LevelData<BaseIVFAB<Real>>& a_nonConsDivF,
1552 const LevelData<EBCellFAB>& a_kappaDivF,
1553 const int& a_level,
1554 const std::string& a_realm,
1555 const phase::which_phase& a_phase) const noexcept;
1556
1561 void
1562 setMultifluidIndexSpace(const RefCountedPtr<MultiFluidIndexSpace>& a_multiFluidIndexSpace);
1563
1569 void
1570 setBaseImplicitFunction(const phase::which_phase a_phase, const RefCountedPtr<BaseIF>& a_baseIF);
1571
1575 void
1576 preRegrid();
1577
1584 void
1585 regridAmr(const Vector<IntVectSet>& a_tags, const int a_lmin, const int a_hardcap = -1);
1586
1596 void
1597 regridAmr(const Vector<Vector<Box>>& a_boxes, const int a_lmin);
1598
1606 void
1607 regridRealm(const std::string& a_realm,
1608 const Vector<Vector<int>>& a_procs,
1609 const Vector<Vector<Box>>& a_boxes,
1610 const int a_lmin);
1611
1615 void
1616 postRegrid();
1617
1624 void
1625 setGrids(const Vector<Vector<Box>>& a_boxes, const std::map<std::string, Vector<Vector<long int>>>& a_realmsAndLoads);
1626
1631 void
1632 regridOperators(const int a_lmin);
1633
1639 void
1640 regridOperators(const std::string& a_realm, const int a_lmin);
1641
1645 void
1646 sanityCheck() const;
1647
1652 int
1653 getFinestLevel() const;
1654
1659 int
1660 getMaxAmrDepth() const;
1661
1666 int
1667 getMaxSimulationDepth() const;
1668
1673 int
1674 getMinBlockSize() const;
1675
1681 int
1683 {
1684 return this->getMinBlockSize();
1685 }
1686
1691 int
1692 getMaxBlockSize() const;
1693
1699 int
1701 {
1702 return this->getMaxBlockSize();
1703 }
1704
1709 int
1710 getBrBuffer() const;
1711
1716 int
1717 getMaxEbisBoxSize() const;
1718
1725 int
1726 getEbMinBlockSize() const;
1727
1733 int
1734 getEbMaxBlockSize() const;
1735
1740 int
1741 getNumberOfGhostCells() const;
1742
1747 int
1749
1754 int
1756
1761 Real
1762 getFinestDx() const;
1763
1768 RealVect
1769 getProbLo() const;
1770
1775 RealVect
1776 getProbHi() const;
1777
1782 ProblemDomain
1783 getFinestDomain() const;
1784
1789 const Vector<Real>&
1790 getDx() const;
1791
1796 const Vector<int>&
1797 getRefinementRatios() const;
1798
1806 int
1807 getRefinementRatio(const int a_level1, const int a_level2) const;
1808
1814 const RefCountedPtr<BaseIF>&
1815 getBaseImplicitFunction(const phase::which_phase a_phase) const;
1816
1822 const Vector<DisjointBoxLayout>&
1823 getProxyGrids() const;
1824
1830 const Vector<DisjointBoxLayout>&
1831 getGrids(const std::string& a_realm) const;
1832
1837 const Vector<ProblemDomain>&
1838 getDomains() const;
1839
1847 const AMRMask&
1848 getMask(const std::string& a_mask, const int a_buffer, const std::string& a_realm) const;
1849
1855 const AMRMask&
1856 getValidCells(const std::string& a_realm) const;
1857
1863 const Vector<RefCountedPtr<LevelTiles>>&
1864 getLevelTiles(const std::string& a_realm) const;
1865
1871 void
1872 registerParticleGhostMask(const std::string& a_realm, const int a_width);
1873
1881 getParticleGhostMask(const std::string& a_realm, const int a_width) const;
1882
1892 getParticleGhostMaskFineToCoar(const std::string& a_realm, const int a_width) const;
1893
1903 getParticleGhostMaskCoarToFine(const std::string& a_realm, const int a_width) const;
1904
1912
1923 const AMRMask&
1924 getParticleGhostExposure(const std::string& a_realm, const int a_width) const;
1925
1932 const Vector<RefCountedPtr<EBLevelGrid>>&
1933 getEBLevelGrid(const std::string& a_realm, const phase::which_phase a_phase) const;
1934
1941 const Vector<RefCountedPtr<EBLevelGrid>>&
1942 getEBLevelGridCoFi(const std::string& a_realm, const phase::which_phase a_phase) const;
1943
1950 const Vector<EBISLayout>&
1951 getEBISLayout(const std::string& a_realm, const phase::which_phase a_phase) const;
1952
1958 const Vector<RefCountedPtr<MFLevelGrid>>&
1959 getMFLevelGrid(const std::string& a_realm) const;
1960
1969 Vector<RefCountedPtr<LayoutData<VoFIterator>>>&
1970 getVofIterator(const std::string& a_realm, const phase::which_phase a_phase) const;
1971
1981 Vector<RefCountedPtr<LayoutData<VoFIterator>>>&
1982 getMultiCutVofIterator(const std::string& a_realm, const phase::which_phase a_phase) const;
1983
1992 Vector<RefCountedPtr<LayoutData<std::array<FaceIterator, SpaceDim>>>>&
1993 getFaceIterator(const std::string& a_realm, const phase::which_phase a_phase) const;
1994
2003 Vector<RefCountedPtr<LayoutData<std::array<FaceIterator, SpaceDim>>>>&
2004 getFaceIteratorNoBoundary(const std::string& a_realm, const phase::which_phase a_phase) const;
2005
2017 Vector<RefCountedPtr<LayoutData<std::array<FaceIterator, SpaceDim>>>>&
2018 getFaceIteratorWithTangentialGhosts(const std::string& a_realm, const phase::which_phase a_phase) const;
2019
2030 Vector<RefCountedPtr<LayoutData<std::array<FaceIterator, SpaceDim>>>>&
2031 getMultiCutFaceIterator(const std::string& a_realm, const phase::which_phase a_phase) const;
2032
2039 const EBAMRFAB&
2040 getLevelset(const std::string& a_realm, const phase::which_phase a_phase) const;
2041
2048 const EBAMRCellData&
2049 getRegularCells(const std::string& a_realm, const phase::which_phase a_phase) const;
2050
2057 const EBAMRCellData&
2058 getCoveredCells(const std::string& a_realm, const phase::which_phase a_phase) const;
2059
2066 const EBAMRCellData&
2067 getNotCoveredCells(const std::string& a_realm, const phase::which_phase a_phase) const;
2068
2075 const EBAMRCellData&
2076 getIrregularCells(const std::string& a_realm, const phase::which_phase a_phase) const;
2077
2086 const EBAMRCellData&
2087 getMirrorSurfaceData(const std::string& a_realm, const phase::which_phase a_phase) const;
2088
2097 const Vector<int>&
2098 getMirrorHasCutCells(const std::string& a_realm, const phase::which_phase a_phase) const;
2099
2104 Real
2105 getMirrorMaxJacobian() const;
2106
2111 Real
2113
2121 getParticleMesh(const std::string& a_realm, const phase::which_phase a_phase) const;
2122
2130 getSurfaceDeposition(const std::string& a_realm, const phase::which_phase a_phase) const;
2131
2138 Vector<RefCountedPtr<EBCoarAve>>&
2139 getCoarseAverage(const std::string& a_realm, const phase::which_phase a_phase) const;
2140
2147 Vector<RefCountedPtr<EBMultigridInterpolator>>&
2148 getMultigridInterpolator(const std::string& a_realm, const phase::which_phase a_phase) const;
2149
2156 Vector<RefCountedPtr<EBCoarseToFineInterp>>&
2157 getFineInterp(const std::string& a_realm, const phase::which_phase a_phase) const;
2158
2165 Vector<RefCountedPtr<EBReflux>>&
2166 getFluxRegister(const std::string& a_realm, const phase::which_phase a_phase) const;
2167
2174 Vector<RefCountedPtr<EBFluxRedistribution>>&
2175 getRedistributionOp(const std::string& a_realm, const phase::which_phase a_phase) const;
2176
2177#ifdef CH_USE_PETSC
2182 const RefCountedPtr<PetscGrid>&
2183 getPetscGrid(const std::string& a_realm) const noexcept;
2184#endif
2185
2190 std::vector<std::string>
2191 getRealms() const;
2192
2198 getBoxSorting() const;
2199
2205 RefCountedPtr<EBIndexSpace>&
2207 {
2208 return m_multifluidIndexSpace->getEBIndexSpace(a_phase);
2209 }
2210
2211protected:
2216 {
2217 BergerRigoutsous,
2218 Tiled,
2219 };
2220
2224 mutable std::map<std::string, RefCountedPtr<Realm>> m_realms;
2225
2229 std::map<phase::which_phase, RefCountedPtr<BaseIF>> m_baseif;
2230
2234 std::map<std::string, Vector<DisjointBoxLayout>> m_oldGrids;
2235
2240 std::map<std::string, Vector<Copier>> m_oldToNewCellCopiers;
2241
2246 std::map<std::string, Vector<Copier>> m_oldToNewEBCopiers;
2247
2252 std::map<std::pair<std::string, std::string>, Vector<Copier>> m_validToValidRealmCopiers;
2253
2258 std::map<std::pair<std::string, std::string>, Vector<Copier>> m_validToValidGhostRealmCopiers;
2259
2264 std::map<std::pair<std::string, std::string>, Vector<Copier>> m_validGhostToValidRealmCopiers;
2265
2270 std::map<std::pair<std::string, std::string>, Vector<Copier>> m_validGhostToValidGhostRealmCopiers;
2271
2276
2281
2285 RefCountedPtr<MultiFluidIndexSpace> m_multifluidIndexSpace;
2286
2291
2296
2300 IntVect m_numCells;
2301
2306
2310 RealVect m_probLo;
2311
2315 RealVect m_probHi;
2316
2321
2326
2331
2336
2341
2346
2351
2356
2361
2366
2371
2376
2381
2386
2391
2396
2401
2406
2411
2418
2425
2432
2440
2447
2452
2457
2461 Vector<DisjointBoxLayout> m_grids;
2462
2466 Vector<ProblemDomain> m_domains;
2467
2472
2476 Vector<Real> m_dx;
2477
2481 void
2482 defineRealms();
2483
2492 void
2493 buildGrids(const Vector<IntVectSet>& a_tags, const int a_lmin, const int a_hardcap = -1);
2494
2502 void
2503 buildGrids(const Vector<Vector<Box>>& a_boxes, const int a_lmin);
2504
2510 void
2511 defineGrids(Vector<Vector<Box>>& a_boxes, const int a_lmin);
2512
2516 void
2517 buildCopiers();
2518
2522 void
2524
2528 void
2530
2534 void
2536
2540 void
2542
2546 void
2548
2552 void
2554
2558 void
2560
2564 void
2566
2570 void
2572
2576 void
2578
2583 void
2585
2589 void
2591
2595 void
2597
2602 void
2604
2608 void
2610
2614 void
2616
2620 void
2622
2626 void
2628
2632 void
2634
2638 void
2640
2651 void
2652 computeGradient(LevelData<EBCellFAB>& a_gradient,
2653 const LevelData<EBCellFAB>& a_phi,
2654 const std::string& a_realm,
2655 const phase::which_phase a_phase,
2656 const int a_lvl) const;
2657};
2658
2659#include <CD_NamespaceFooter.H>
2660
2661#include <CD_AmrMeshImplem.H>
2662
2663#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
Class for handling spatial operations.
Definition CD_AmrMesh.H:46
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:3650
int m_refRatio
Refinement ratio.
Definition CD_AmrMesh.H:2320
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:3467
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:391
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:2240
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:4077
void allocatePointer(Vector< RefCountedPtr< T > > &a_data) const
Allocate pointer but not any memory blocks.
Definition CD_AmrMeshImplem.H:268
EBAMRSurfaceDeposition & getSurfaceDeposition(const std::string &a_realm, const phase::which_phase a_phase) const
Get EBAMRSurfaceDeposition surface deposition operator.
Definition CD_AmrMesh.cpp:3877
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:3536
std::vector< std::string > getRealms() const
Get the name of all Realms.
Definition CD_AmrMesh.cpp:4203
RealVect getProbHi() const
Get upper-right corner of computational domain.
Definition CD_AmrMesh.cpp:3160
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:3333
int getMaxBlockSize() const
Get maximum permitted block size.
Definition CD_AmrMesh.cpp:3270
void registerRealm(const std::string &a_realm)
Register a new realm.
Definition CD_AmrMesh.cpp:4064
const RefCountedPtr< BaseIF > & getBaseImplicitFunction(const phase::which_phase a_phase) const
Get implicit function for a specific phase.
Definition CD_AmrMesh.cpp:3366
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:673
Real m_fillRatioBR
Fill ratio.
Definition CD_AmrMesh.H:2305
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:241
ProblemDomain getFinestDomain() const
Get finest domain.
Definition CD_AmrMesh.cpp:3322
void parseCellCentroidInterpolation()
Parse centroid interpolation stencils.
Definition CD_AmrMesh.cpp:2967
Vector< RefCountedPtr< EBCoarAve > > & getCoarseAverage(const std::string &a_realm, const phase::which_phase a_phase) const
Get the coarsening utility.
Definition CD_AmrMesh.cpp:3894
const Vector< RefCountedPtr< LevelTiles > > & getLevelTiles(const std::string &a_realm) const
Get the tiled space representation.
Definition CD_AmrMesh.cpp:3568
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:371
int m_oldFinestLevel
Finest level before a regrid.
Definition CD_AmrMesh.H:2335
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:3389
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:2300
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:2315
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:3584
const AMRMask & getValidCells(const std::string &a_realm) const
Get a map of all valid cells on a specified realm.
Definition CD_AmrMesh.cpp:3552
Vector< DisjointBoxLayout > m_grids
Grids.
Definition CD_AmrMesh.H:2461
RefCountedPtr< MultiFluidIndexSpace > m_multifluidIndexSpace
MultiFluidIndexSpace.
Definition CD_AmrMesh.H:2285
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:441
RealVect m_probLo
Domain simulation corner.
Definition CD_AmrMesh.H:2310
int m_mirrorBandRadius
Mirror deposition: half-width, in cells, of the band around the embedded boundary that reflects.
Definition CD_AmrMesh.H:2417
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:3997
int m_bufferSizeBR
Set buffer size.
Definition CD_AmrMesh.H:2360
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:1053
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:3193
int m_maxSimulationDepth
Maximum allowed depth for simulation.
Definition CD_AmrMesh.H:2345
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:3400
int m_multigridInterpRadius
Multigrid interpolation radius.
Definition CD_AmrMesh.H:2400
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:2431
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:3600
GridGenerationMethod m_gridGenerationMethod
Grid generation method.
Definition CD_AmrMesh.H:2275
int getMinBlockSize() const
Get the minimum block size (i.e. the smallest possible box / tile size).
Definition CD_AmrMesh.cpp:3259
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:3814
void parseRefinementRatios()
Parse refinement ratios.
Definition CD_AmrMesh.cpp:2613
Vector< int > m_refinementRatios
AMR resolutions.
Definition CD_AmrMesh.H:2471
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:3484
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:3780
int m_verbosity
Verbosity.
Definition CD_AmrMesh.H:2325
Real getMirrorMaxJacobian() const
Get the largest Jacobian magnitude the mirror pass will trust.
Definition CD_AmrMesh.cpp:3848
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:3450
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:3797
bool m_hasRegridCopiers
Has regrid copiers or not.
Definition CD_AmrMesh.H:2456
int m_minBlockSize
Blocking factor.
Definition CD_AmrMesh.H:2365
int m_multigridInterpOrder
Multigrid interpolation order.
Definition CD_AmrMesh.H:2395
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:3616
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:2252
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:2264
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:3633
void sanityCheck() const
Do a sanity check to make sure everything is set up correctly.
Definition CD_AmrMesh.cpp:3053
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:3831
int m_numGhostCells
Number of ghost cells.
Definition CD_AmrMesh.H:2385
Vector< RefCountedPtr< EBFluxRedistribution > > & getRedistributionOp(const std::string &a_realm, const phase::which_phase a_phase) const
Get the redistribution operators.
Definition CD_AmrMesh.cpp:3962
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:2350
GridGenerationMethod
Enum for having understandable notation for grid generation.
Definition CD_AmrMesh.H:2216
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:2270
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:738
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:618
bool getEbCf() const
Check if mesh has an EBCF.
Definition CD_AmrMesh.cpp:4053
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:3663
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:2476
Real m_mirrorConditionTolerance
Mirror deposition: smallest permitted eigenvalue ratio of U^T U in the shape-operator fit.
Definition CD_AmrMesh.H:2424
int m_numEbGhostsCells
Number of ghost cells to use for eb stuff.
Definition CD_AmrMesh.H:2380
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:1219
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:3149
BoxSorting m_boxSort
Box sorting.
Definition CD_AmrMesh.H:2280
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:2340
void defineRealms()
Define Realms.
Definition CD_AmrMesh.cpp:4110
int m_finestLevel
Finest level.
Definition CD_AmrMesh.H:2330
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:3696
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:479
void reallocate(EBAMRCellData &a_data, const phase::which_phase a_phase, const int a_lmin) const
Reallocate data.
Definition CD_AmrMesh.cpp:614
Real m_mirrorMaxJacobian
Mirror deposition: largest Jacobian magnitude that will be trusted.
Definition CD_AmrMesh.H:2439
std::map< std::string, Vector< Copier > > m_oldToNewEBCopiers
Storage for copiers from the old grids to the new ones.
Definition CD_AmrMesh.H:2246
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:3679
std::map< phase::which_phase, RefCountedPtr< BaseIF > > m_baseif
Implicit functions.
Definition CD_AmrMesh.H:2229
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:4143
int getNumberOfGhostCells() const
Get the default number of ghost cells.
Definition CD_AmrMesh.cpp:3226
bool queryRealm(const std::string &a_realm) const
Query if a realm exists.
Definition CD_AmrMesh.cpp:4036
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:3730
int m_ebMaxBlockSize
Largest box the geometry grids are tiled with.
Definition CD_AmrMesh.H:2375
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:2206
void arithmeticAverage(MFAMRCellData &a_data, const std::string &a_realm) const
Arithmetic coarsening of multifluid data.
Definition CD_AmrMesh.cpp:1625
void parseRedistributionRadius()
Parse the default redistribution radius.
Definition CD_AmrMesh.cpp:2920
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:885
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:3501
int getEbMinBlockSize() const
Get the smallest box the geometry grids are tiled with.
Definition CD_AmrMesh.cpp:3204
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:2258
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:3344
int getBrBuffer() const
Return buffer for B-R mesh refinement algorithm.
Definition CD_AmrMesh.cpp:3281
Real getMirrorMinDenominator() const
Get the smallest Jacobian denominator the mirror pass will trust.
Definition CD_AmrMesh.cpp:3854
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:3519
EBAMRParticleMesh & getParticleMesh(const std::string &a_realm, const phase::which_phase a_phase) const
Get EBAMRParticleMesh operator.
Definition CD_AmrMesh.cpp:3860
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:3416
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:1700
std::map< std::string, RefCountedPtr< Realm > > m_realms
These are all the Realms.
Definition CD_AmrMesh.H:2224
int getMaxEbisBoxSize() const
Get maximum box size for EBIS generation.
Definition CD_AmrMesh.cpp:3292
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:3215
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:460
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
int getRefinementRatio(const int a_level1, const int a_level2) const
Get refinement factor between two levels.
Definition CD_AmrMesh.cpp:3303
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:4094
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:3746
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:351
Vector< RefCountedPtr< EBMultigridInterpolator > > & getMultigridInterpolator(const std::string &a_realm, const phase::which_phase a_phase) const
Get multigrid interpolation utility.
Definition CD_AmrMesh.cpp:3911
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:327
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:1682
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:2290
void parseEBCentroidInterpolation()
Parse EB interpolation (or extrapolation) stencils.
Definition CD_AmrMesh.cpp:3010
const Vector< RefCountedPtr< MFLevelGrid > > & getMFLevelGrid(const std::string &a_realm) const
Get EBISLayouts for a Realm.
Definition CD_AmrMesh.cpp:3713
int m_multigridInterpWeight
Multigrid interpolation weights.
Definition CD_AmrMesh.H:2405
std::map< std::string, Vector< DisjointBoxLayout > > m_oldGrids
Old grids.
Definition CD_AmrMesh.H:2234
EBCentroidInterpolation::Type m_ebCentroidInterpolationType
Interpolation type for cell to EB centroid interpolation.
Definition CD_AmrMesh.H:2295
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:3433
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:3763
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:3945
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:2466
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:3928
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:213
Real m_mirrorMinDenominator
Mirror deposition: smallest Jacobian denominator that will be trusted.
Definition CD_AmrMesh.H:2446
bool m_hasGrids
Has grids or not.
Definition CD_AmrMesh.H:2451
void deallocate(Vector< T * > &a_data) const
Deallocate data.
Definition CD_AmrMeshImplem.H:165
int getMaxAmrDepth() const
Get maximum permitted amr depth.
Definition CD_AmrMesh.cpp:3182
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:825
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:2370
const Vector< int > & getRefinementRatios() const
Get refinement ratios.
Definition CD_AmrMesh.cpp:3355
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
int getRedistributionRadius() const
Get default redistribution radius.
Definition CD_AmrMesh.cpp:3248
BoxSorting getBoxSorting() const
Get box sorting method.
Definition CD_AmrMesh.cpp:4221
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:538
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:2937
int m_maxEbisBoxSize
Maximum box size for EBIS generation.
Definition CD_AmrMesh.H:2355
int getNumberOfEbGhostCells() const
Get number of ghost cells used for EB grid generation.
Definition CD_AmrMesh.cpp:3237
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:3171
int m_redistributionRadius
Redistribution radius.
Definition CD_AmrMesh.H:2410
const Vector< ProblemDomain > & getDomains() const
Get domains.
Definition CD_AmrMesh.cpp:3378
int m_numLsfGhostCells
Number of ghost cells to use when writing level-set to grid.
Definition CD_AmrMesh.H:2390
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