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>
35#include <CD_CopyStrategy.H>
36#include <CD_LoadBalancing.H>
37#include <CD_NamespaceHeader.H>
38
45{
46public:
50 AmrMesh();
51
56 AmrMesh(const AmrMesh& a_other) = delete;
57
62 AmrMesh(const AmrMesh&& a_other) = delete;
63
67 virtual ~AmrMesh();
68
73 AmrMesh&
74 operator=(const AmrMesh& a_other) = delete;
75
80 AmrMesh&
81 operator=(const AmrMesh&& a_other) = delete;
82
93 template <typename T>
94 void
96 const EBAMRData<T>& a_src,
97 const CopyStrategy& a_toRegion = CopyStrategy::Valid,
98 const CopyStrategy& a_fromRegion = CopyStrategy::Valid) const noexcept;
99
111 template <typename T>
112 void
113 copyData(EBAMRData<T>& a_dst,
114 const EBAMRData<T>& a_src,
115 const Interval& a_dstComps,
116 const Interval& a_srcComps,
117 const CopyStrategy& a_toRegion = CopyStrategy::Valid,
118 const CopyStrategy& a_fromRegion = CopyStrategy::Valid) const noexcept;
119
133 template <typename T>
134 void
135 copyData(LevelData<T>& a_dst,
136 const LevelData<T>& a_src,
137 const int a_level,
138 const std::string a_toRealm,
139 const std::string a_fromRealm,
140 const CopyStrategy& a_toRegion = CopyStrategy::Valid,
141 const CopyStrategy& a_fromRegion = CopyStrategy::Valid) const noexcept;
142
158 template <typename T>
159 void
160 copyData(LevelData<T>& a_dst,
161 const LevelData<T>& a_src,
162 const int a_level,
163 const std::string a_toRealm,
164 const std::string a_fromRealm,
165 const Interval& a_dstComps,
166 const Interval& a_srcComps,
167 const CopyStrategy& a_toRegion = CopyStrategy::Valid,
168 const CopyStrategy& a_fromRegion = CopyStrategy::Valid) const noexcept;
169
174 template <typename T>
175 void
176 deallocate(Vector<T*>& a_data) const;
177
182 template <typename T>
183 void
184 deallocate(Vector<RefCountedPtr<T>>& a_data) const;
185
190 template <typename T>
191 void
192 deallocate(EBAMRData<T>& a_data) const;
193
200 template <typename T>
201 void
202 alias(Vector<T*>& a_alias, const Vector<RefCountedPtr<T>>& a_data) const;
203
210 template <typename T, typename S>
211 void
212 alias(Vector<T*>& a_alias, const EBAMRData<S>& a_data) const;
213
221 template <typename P, typename Traits>
222 void
223 allocate(ParticleContainer<P, Traits>& a_container, const std::string& a_realm) const;
224
230 template <typename T>
231 void
232 allocatePointer(Vector<RefCountedPtr<T>>& a_data) const;
233
240 template <typename T>
241 void
242 allocatePointer(Vector<RefCountedPtr<T>>& a_data, const int a_finestLevel) const;
243
250 template <typename T>
251 void
252 allocatePointer(EBAMRData<T>& a_data, const std::string& a_realm) const;
253
261 template <typename T>
262 void
263 allocatePointer(EBAMRData<T>& a_data, const std::string& a_realm, const int a_finestLevel) const;
264
272 EBAMRCellData
273 slice(EBAMRCellData& a_original, const Interval a_variables) const noexcept;
274
282 EBAMRCellData
283 slice(const EBAMRCellData& a_original, const Interval a_variables) const noexcept;
284
288 void
289 parseOptions();
290
295 void
297
305 void
306 registerOperator(const std::string& a_operator, const std::string& a_realm, const phase::which_phase a_phase);
307
316 void
317 registerMask(const std::string& a_mask, const int a_buffer, const std::string& a_realm);
318
322 void
323 buildDomains();
324
331 void
332 setFinestLevel(const int a_finestLevel);
333
338 void
339 setCoarsestGrid(const IntVect& a_nCells);
340
346 bool
347 queryRealm(const std::string& a_realm) const;
348
354 bool
355 getEbCf() const;
356
362 void
363 registerRealm(const std::string& a_realm);
364
372 void
373 alias(EBAMRCellData& a_data,
374 const phase::which_phase a_phase,
375 const MFAMRCellData& a_mfdata,
376 const int a_finestLevel) const;
377
385 void
386 alias(EBAMRFluxData& a_data,
387 const phase::which_phase a_phase,
388 const MFAMRFluxData& a_mfdata,
389 const int a_finestLevel) const;
390
397 void
398 alias(EBAMRCellData& a_data, const phase::which_phase a_phase, const MFAMRCellData& a_mfdata) const;
399
406 void
407 alias(EBAMRFluxData& a_data, const phase::which_phase a_phase, const MFAMRFluxData& a_mfdata) const;
408
415 void
416 alias(EBAMRIVData& a_data, const phase::which_phase a_phase, const MFAMRIVData& a_mfdata) const;
417
424 EBAMRCellData
425 alias(const phase::which_phase a_phase, const MFAMRCellData& a_mfdata) const;
426
433 EBAMRFluxData
434 alias(const phase::which_phase a_phase, const MFAMRFluxData& a_mfdata) const;
435
442 EBAMRIVData
443 alias(const phase::which_phase a_phase, const MFAMRIVData& a_mfdata) const;
444
454 void
455 computeGradient(EBAMRCellData& a_gradient,
456 const EBAMRCellData& a_phi,
457 const std::string& a_realm,
458 const phase::which_phase a_phase) const;
459
469 void
470 computeGradient(EBAMRFluxData& a_gradient,
471 const EBAMRCellData& a_phi,
472 const std::string& a_realm,
473 const phase::which_phase a_phase) const;
474
483 void
484 computeGradient(MFAMRCellData& a_gradient, const MFAMRCellData& a_phi, const std::string& a_realm) const;
485
494 void
495 computeGradient(MFAMRFluxData& a_gradient, const MFAMRCellData& a_phi, const std::string& a_realm) const;
496
506 void
507 allocate(EBAMRCellData& a_data,
508 const std::string& a_realm,
509 const phase::which_phase a_phase,
510 const int a_nComp,
511 const int a_ghost = -1) const;
512
523 void
524 allocate(LevelData<EBCellFAB>& a_data,
525 const std::string& a_realm,
526 const phase::which_phase a_phase,
527 const int a_level,
528 const int a_nComp,
529 const int a_ghost = -1) const;
530
540 void
541 allocate(EBAMRFluxData& a_data,
542 const std::string& a_realm,
543 const phase::which_phase a_phase,
544 const int a_nComp,
545 const int a_ghost = -1) const;
546
556 void
557 allocate(EBAMRIVData& a_data,
558 const std::string& a_realm,
559 const phase::which_phase a_phase,
560 const int a_nComp,
561 const int a_ghost = -1) const;
562
572 void
573 allocate(EBAMRIFData& a_data,
574 const std::string& a_realm,
575 const phase::which_phase a_phase,
576 const int a_nComp,
577 const int a_ghost = -1) const;
578
587 void
588 allocate(EBAMRBool& a_data, const std::string& a_realm, const int a_nComp, const int a_ghost = -1) const;
589
600 void
601 allocate(EBAMRFAB& a_data, const std::string& a_realm, const int a_nComp, const int a_ghost = -1) const;
602
611 void
612 allocate(MFAMRCellData& a_data, const std::string& a_realm, const int a_nComp, const int a_ghost = -1) const;
613
622 void
623 allocate(MFAMRFluxData& a_data, const std::string& a_realm, const int a_nComp, const int a_ghost = -1) const;
624
633 void
634 allocate(MFAMRIVData& a_data, const std::string& a_realm, const int a_nComp, const int a_ghost = 0) const;
635
643 void
644 reallocate(EBAMRCellData& a_data, const phase::which_phase a_phase, const int a_lmin) const;
645
653 void
654 reallocate(EBAMRFluxData& a_data, const phase::which_phase a_phase, const int a_lmin) const;
655
663 void
664 reallocate(EBAMRIVData& a_data, const phase::which_phase a_phase, const int a_lmin) const;
665
673 void
674 reallocate(EBAMRIFData& a_data, const phase::which_phase a_phase, const int a_lmin) const;
675
682 void
683 reallocate(EBAMRBool& a_data, const int a_lmin) const;
684
691 void
692 reallocate(MFAMRCellData& a_data, const int a_lmin) const;
693
700 void
701 reallocate(MFAMRFluxData& a_data, const int a_lmin) const;
702
709 void
710 reallocate(MFAMRIVData& a_data, const int a_lmin) const;
711
718 void
719 average(MFAMRCellData& a_data, const std::string& a_realm, const Average& a_average) const;
720
726 void
727 arithmeticAverage(MFAMRCellData& a_data, const std::string& a_realm) const;
728
734 void
735 harmonicAverage(MFAMRCellData& a_data, const std::string& a_realm) const;
736
742 void
743 conservativeAverage(MFAMRCellData& a_data, const std::string& a_realm) const;
744
751 void
752 average(MFAMRFluxData& a_data, const std::string& a_realm, const Average& a_average) const;
753
761 void
762 arithmeticAverage(MFAMRFluxData& a_data, const std::string& a_realm) const;
763
771 void
772 harmonicAverage(MFAMRFluxData& a_data, const std::string& a_realm) const;
773
779 void
780 conservativeAverage(MFAMRFluxData& a_data, const std::string& a_realm) const;
781
789 void
790 average(EBAMRCellData& a_data,
791 const std::string& a_realm,
792 const phase::which_phase a_phase,
793 const Average& a_average) const;
794
803 void
804 average(EBAMRCellData& a_data,
805 const std::string& a_realm,
806 const phase::which_phase a_phase,
807 const Average& a_average,
808 const Interval& a_variables) const;
809
816 void
817 arithmeticAverage(EBAMRCellData& a_data, const std::string& a_realm, const phase::which_phase a_phase) const;
818
826 void
827 arithmeticAverage(EBAMRCellData& a_data,
828 const std::string& a_realm,
829 const phase::which_phase a_phase,
830 const Interval& a_variables) const;
831
838 void
839 harmonicAverage(EBAMRCellData& a_data, const std::string& a_realm, const phase::which_phase a_phase) const;
840
848 void
849 harmonicAverage(EBAMRCellData& a_data,
850 const std::string& a_realm,
851 const phase::which_phase a_phase,
852 const Interval& a_variables) const;
853
860 void
861 conservativeAverage(EBAMRCellData& a_data, const std::string& a_realm, const phase::which_phase a_phase) const;
862
870 void
871 conservativeAverage(EBAMRCellData& a_data,
872 const std::string& a_realm,
873 const phase::which_phase a_phase,
874 const Interval& a_variables) const;
875
883 void
884 average(EBAMRFluxData& a_data,
885 const std::string& a_realm,
886 const phase::which_phase a_phase,
887 const Average& a_average) const;
888
897 void
898 arithmeticAverage(EBAMRFluxData& a_data, const std::string& a_realm, const phase::which_phase a_phase) const;
899
908 void
909 harmonicAverage(EBAMRFluxData& a_data, const std::string& a_realm, const phase::which_phase a_phase) const;
910
917 void
918 conservativeAverage(EBAMRFluxData& a_data, const std::string& a_realm, const phase::which_phase a_phase) const;
919
927 void
928 average(EBAMRIVData& a_data,
929 const std::string& a_realm,
930 const phase::which_phase a_phase,
931 const Average& a_average) const;
932
939 void
940 arithmeticAverage(EBAMRIVData& a_data, const std::string& a_realm, const phase::which_phase a_phase) const;
941
948 void
949 harmonicAverage(EBAMRIVData& a_data, const std::string& a_realm, const phase::which_phase a_phase) const;
950
957 void
958 conservativeAverage(EBAMRIVData& a_data, const std::string& a_realm, const phase::which_phase a_phase) const;
959
970 template <typename P, typename Traits>
971 void
972 depositParticles(EBAMRIVData& a_meshData,
973 const std::string& a_realm,
974 const phase::which_phase& a_phase,
975 const ParticleContainer<P, Traits>& a_particles) const noexcept;
976
989 template <typename P, typename Traits>
990 void
991 depositWeight(EBAMRCellData& a_meshData,
992 const std::string& a_realm,
993 const phase::which_phase& a_phase,
994 const ParticleContainer<P, Traits>& a_particles,
995 const DepositionType a_depositionType,
996 const CoarseFineDeposition a_coarseFineDeposition,
997 const bool a_forceIrregNGP);
998
1015 template <typename P, typename Traits, typename CellGather>
1016 void
1017 depositGathered(EBAMRCellData& a_meshData,
1018 const std::string& a_realm,
1019 const phase::which_phase& a_phase,
1020 const ParticleContainer<P, Traits>& a_particles,
1021 const DepositionType a_depositionType,
1022 const CoarseFineDeposition a_coarseFineDeposition,
1023 const bool a_forceIrregNGP,
1024 CellGather a_cellGather);
1025
1041 template <auto... Members, typename P, typename Traits>
1042 void
1043 depositParticles(EBAMRCellData& a_meshData,
1044 const std::string& a_realm,
1045 const phase::which_phase& a_phase,
1046 const ParticleContainer<P, Traits>& a_particles,
1047 const DepositionType a_depositionType,
1048 const CoarseFineDeposition a_coarseFineDeposition,
1049 const bool a_forceIrregNGP);
1050
1062 template <typename P, typename Traits>
1063 void
1065 const std::string& a_realm,
1066 const phase::which_phase& a_phase,
1067 const EBAMRCellData& a_meshScalarField,
1068 const DepositionType a_interpType,
1069 const bool a_forceIrregNGP) const;
1070
1085 template <auto... Members, typename P, typename Traits>
1086 void
1088 const std::string& a_realm,
1089 const phase::which_phase& a_phase,
1090 const EBAMRCellData& a_meshField,
1091 const DepositionType a_interpType,
1092 const bool a_forceIrregNGP) const;
1093
1102 template <typename P, typename Traits>
1103 void
1105 const phase::which_phase& a_phase,
1106 const Real a_tolerance) const;
1107
1117 template <typename P, typename Traits>
1118 void
1120 const phase::which_phase& a_phase,
1121 const Real a_tolerance) const;
1122
1130 template <typename P, typename Traits>
1131 void
1133
1146 template <typename P, typename Traits>
1147 void
1149 ParticleContainer<P, Traits>& a_particlesTo,
1150 const phase::which_phase& a_phase,
1151 const Real a_tolerance) const;
1152
1164 template <typename P, typename Traits>
1165 void
1167 ParticleContainer<P, Traits>& a_particlesTo,
1168 const phase::which_phase& a_phase,
1169 const Real a_tolerance) const;
1170
1179 template <typename P, typename Traits>
1180 void
1182 ParticleContainer<P, Traits>& a_particlesTo,
1183 const phase::which_phase& a_phase) const;
1184
1195 template <typename P, typename Traits>
1196 void
1198 ParticleContainer<P, Traits>& a_srcParticles,
1199 const phase::which_phase a_phase) const noexcept;
1200
1220 template <auto... OldPosition, typename P, typename Traits>
1221 void
1223 ParticleContainer<P, Traits>& a_activeParticles,
1224 ParticleContainer<P, Traits>& a_ebParticles,
1225 ParticleContainer<P, Traits>& a_domainParticles,
1226 const phase::which_phase a_phase,
1227 const Real a_tolerance,
1228 const bool a_deleteParticles,
1229 const std::function<void(ParticleSoA<P, Traits>&, std::size_t)>& a_nonDeletionModifier) const noexcept;
1230
1248 template <auto... OldPosition, typename P, typename Traits>
1249 void
1251 ParticleContainer<P, Traits>& a_activeParticles,
1252 ParticleContainer<P, Traits>& a_ebParticles,
1253 ParticleContainer<P, Traits>& a_domainParticles,
1254 const phase::which_phase a_phase,
1255 const Real a_bisectionStep,
1256 const bool a_deleteParticles,
1257 const std::function<void(ParticleSoA<P, Traits>&, std::size_t)>& a_nonDeletionModifier) const noexcept;
1258
1265 void
1266 interpGhost(EBAMRCellData& a_data, const std::string& a_realm, const phase::which_phase a_phase) const;
1267
1276 void
1277 interpGhost(LevelData<EBCellFAB>& a_fineData,
1278 const LevelData<EBCellFAB>& a_coarData,
1279 const int a_fineLevel,
1280 const std::string& a_realm,
1281 const phase::which_phase a_phase) const;
1282
1288 void
1289 interpGhost(MFAMRCellData& a_data, const std::string& a_realm) const;
1290
1296 void
1297 interpGhostPwl(MFAMRCellData& a_data, const std::string& a_realm) const;
1298
1305 void
1306 interpGhostPwl(EBAMRCellData& a_data, const std::string& a_realm, const phase::which_phase a_phase) const;
1307
1315 void
1316 interpGhostMG(MFAMRCellData& a_data, const std::string& a_realm) const;
1317
1326 void
1327 interpGhostMG(EBAMRCellData& a_data, const std::string& a_realm, const phase::which_phase a_phase) const;
1328
1340 void
1341 interpToNewGrids(MFAMRCellData& a_newData,
1342 const MFAMRCellData& a_oldData,
1343 const int a_lmin,
1344 const int a_oldFinestLevel,
1345 const int a_newFinestLevel,
1346 const EBCoarseToFineInterp::Type a_type);
1347
1360 void
1361 interpToNewGrids(EBAMRCellData& a_newData,
1362 const EBAMRCellData& a_oldData,
1363 const phase::which_phase a_phase,
1364 const int a_lmin,
1365 const int a_oldFinestLevel,
1366 const int a_newFinestLevel,
1367 const EBCoarseToFineInterp::Type a_type);
1368
1381 void
1382 interpToNewGrids(EBAMRIVData& a_newData,
1383 const EBAMRIVData& a_oldData,
1384 const phase::which_phase a_phase,
1385 const int a_lmin,
1386 const int a_oldFinestLevel,
1387 const int a_newFinestLevel,
1388 const EBCoarseToFineInterp::Type a_type);
1389
1399 template <typename P, typename Traits>
1400 void
1402 const int a_lmin,
1403 const int a_newFinestLevel) const noexcept;
1404
1413 void
1414 interpToCentroids(EBAMRCellData& a_data, const std::string& a_realm, const phase::which_phase a_phase) const noexcept;
1415
1423 void
1424 interpToCentroids(LevelData<EBCellFAB>& a_data,
1425 const std::string& a_realm,
1426 const phase::which_phase a_phase,
1427 const int a_level) const noexcept;
1428
1438 void
1439 interpToCentroids(EBCellFAB& a_centroidData,
1440 const EBCellFAB& a_cellData,
1441 const std::string& a_realm,
1442 const phase::which_phase a_phase,
1443 const int a_level,
1444 const DataIndex& a_din) const noexcept;
1445
1455 void
1456 interpToCentroids(EBAMRIVData& a_centroidData,
1457 const EBAMRCellData& a_cellData,
1458 const std::string& a_realm,
1459 const phase::which_phase a_phase) const noexcept;
1460
1469 void
1470 interpToCentroids(LevelData<BaseIVFAB<Real>>& a_centroidData,
1471 const LevelData<EBCellFAB>& a_cellData,
1472 const std::string& a_realm,
1473 const phase::which_phase a_phase,
1474 const int a_level) const noexcept;
1475
1483 void
1484 interpToEB(EBAMRIVData& a_centroidData,
1485 const EBAMRCellData& a_cellData,
1486 const std::string& a_realm,
1487 const phase::which_phase a_phase) const noexcept;
1488
1497 void
1498 interpToEB(LevelData<BaseIVFAB<Real>>& a_centroidData,
1499 const LevelData<EBCellFAB>& a_cellData,
1500 const std::string& a_realm,
1501 const phase::which_phase a_phase,
1502 const int a_level) const noexcept;
1503
1513 void
1514 interpToEB(BaseIVFAB<Real>& a_centroidData,
1515 const EBCellFAB& a_cellData,
1516 const std::string& a_realm,
1517 const phase::which_phase a_phase,
1518 const int a_level,
1519 const DataIndex& a_din) const noexcept;
1520
1530 void
1531 nonConservativeDivergence(EBAMRIVData& a_nonConsDivF,
1532 const EBAMRCellData& a_kappaDivF,
1533 const std::string& a_realm,
1534 const phase::which_phase& a_phase) const noexcept;
1535
1546 void
1547 nonConservativeDivergence(LevelData<BaseIVFAB<Real>>& a_nonConsDivF,
1548 const LevelData<EBCellFAB>& a_kappaDivF,
1549 const int& a_level,
1550 const std::string& a_realm,
1551 const phase::which_phase& a_phase) const noexcept;
1552
1557 void
1558 setMultifluidIndexSpace(const RefCountedPtr<MultiFluidIndexSpace>& a_multiFluidIndexSpace);
1559
1565 void
1566 setBaseImplicitFunction(const phase::which_phase a_phase, const RefCountedPtr<BaseIF>& a_baseIF);
1567
1571 void
1572 preRegrid();
1573
1580 void
1581 regridAmr(const Vector<IntVectSet>& a_tags, const int a_lmin, const int a_hardcap = -1);
1582
1590 void
1591 regridRealm(const std::string& a_realm,
1592 const Vector<Vector<int>>& a_procs,
1593 const Vector<Vector<Box>>& a_boxes,
1594 const int a_lmin);
1595
1599 void
1600 postRegrid();
1601
1608 void
1609 setGrids(const Vector<Vector<Box>>& a_boxes, const std::map<std::string, Vector<Vector<long int>>>& a_realmsAndLoads);
1610
1615 void
1616 regridOperators(const int a_lmin);
1617
1623 void
1624 regridOperators(const std::string& a_realm, const int a_lmin);
1625
1629 void
1630 sanityCheck() const;
1631
1636 int
1637 getFinestLevel() const;
1638
1643 int
1644 getMaxAmrDepth() const;
1645
1650 int
1651 getMaxSimulationDepth() const;
1652
1657 int
1658 getMinBlockSize() const;
1659
1665 int
1667 {
1668 return this->getMinBlockSize();
1669 }
1670
1675 int
1676 getMaxBlockSize() const;
1677
1683 int
1685 {
1686 return this->getMaxBlockSize();
1687 }
1688
1693 int
1694 getBrBuffer() const;
1695
1700 int
1701 getMaxEbisBoxSize() const;
1702
1707 int
1708 getNumberOfGhostCells() const;
1709
1714 int
1716
1721 int
1723
1728 Real
1729 getFinestDx() const;
1730
1735 RealVect
1736 getProbLo() const;
1737
1742 RealVect
1743 getProbHi() const;
1744
1749 ProblemDomain
1750 getFinestDomain() const;
1751
1756 const Vector<Real>&
1757 getDx() const;
1758
1763 const Vector<int>&
1764 getRefinementRatios() const;
1765
1773 int
1774 getRefinementRatio(const int a_level1, const int a_level2) const;
1775
1781 const RefCountedPtr<BaseIF>&
1782 getBaseImplicitFunction(const phase::which_phase a_phase) const;
1783
1789 const Vector<DisjointBoxLayout>&
1790 getProxyGrids() const;
1791
1797 const Vector<DisjointBoxLayout>&
1798 getGrids(const std::string& a_realm) const;
1799
1804 const Vector<ProblemDomain>&
1805 getDomains() const;
1806
1814 const AMRMask&
1815 getMask(const std::string& a_mask, const int a_buffer, const std::string& a_realm) const;
1816
1822 const AMRMask&
1823 getValidCells(const std::string& a_realm) const;
1824
1830 const Vector<RefCountedPtr<LevelTiles>>&
1831 getLevelTiles(const std::string& a_realm) const;
1832
1838 void
1839 registerParticleGhostMask(const std::string& a_realm, const int a_width);
1840
1848 getParticleGhostMask(const std::string& a_realm, const int a_width) const;
1849
1859 getParticleGhostMaskFineToCoar(const std::string& a_realm, const int a_width) const;
1860
1870 getParticleGhostMaskCoarToFine(const std::string& a_realm, const int a_width) const;
1871
1879
1890 const AMRMask&
1891 getParticleGhostExposure(const std::string& a_realm, const int a_width) const;
1892
1899 const Vector<RefCountedPtr<EBLevelGrid>>&
1900 getEBLevelGrid(const std::string& a_realm, const phase::which_phase a_phase) const;
1901
1908 const Vector<RefCountedPtr<EBLevelGrid>>&
1909 getEBLevelGridCoFi(const std::string& a_realm, const phase::which_phase a_phase) const;
1910
1917 const Vector<EBISLayout>&
1918 getEBISLayout(const std::string& a_realm, const phase::which_phase a_phase) const;
1919
1925 const Vector<RefCountedPtr<MFLevelGrid>>&
1926 getMFLevelGrid(const std::string& a_realm) const;
1927
1936 Vector<RefCountedPtr<LayoutData<VoFIterator>>>&
1937 getVofIterator(const std::string& a_realm, const phase::which_phase a_phase) const;
1938
1948 Vector<RefCountedPtr<LayoutData<VoFIterator>>>&
1949 getMultiCutVofIterator(const std::string& a_realm, const phase::which_phase a_phase) const;
1950
1959 Vector<RefCountedPtr<LayoutData<std::array<FaceIterator, SpaceDim>>>>&
1960 getFaceIterator(const std::string& a_realm, const phase::which_phase a_phase) const;
1961
1970 Vector<RefCountedPtr<LayoutData<std::array<FaceIterator, SpaceDim>>>>&
1971 getFaceIteratorNoBoundary(const std::string& a_realm, const phase::which_phase a_phase) const;
1972
1984 Vector<RefCountedPtr<LayoutData<std::array<FaceIterator, SpaceDim>>>>&
1985 getFaceIteratorWithTangentialGhosts(const std::string& a_realm, const phase::which_phase a_phase) const;
1986
1997 Vector<RefCountedPtr<LayoutData<std::array<FaceIterator, SpaceDim>>>>&
1998 getMultiCutFaceIterator(const std::string& a_realm, const phase::which_phase a_phase) const;
1999
2006 const EBAMRFAB&
2007 getLevelset(const std::string& a_realm, const phase::which_phase a_phase) const;
2008
2015 const EBAMRCellData&
2016 getRegularCells(const std::string& a_realm, const phase::which_phase a_phase) const;
2017
2024 const EBAMRCellData&
2025 getCoveredCells(const std::string& a_realm, const phase::which_phase a_phase) const;
2026
2033 const EBAMRCellData&
2034 getNotCoveredCells(const std::string& a_realm, const phase::which_phase a_phase) const;
2035
2042 const EBAMRCellData&
2043 getIrregularCells(const std::string& a_realm, const phase::which_phase a_phase) const;
2044
2052 getParticleMesh(const std::string& a_realm, const phase::which_phase a_phase) const;
2053
2061 getSurfaceDeposition(const std::string& a_realm, const phase::which_phase a_phase) const;
2062
2069 Vector<RefCountedPtr<EBCoarAve>>&
2070 getCoarseAverage(const std::string& a_realm, const phase::which_phase a_phase) const;
2071
2078 Vector<RefCountedPtr<EBMultigridInterpolator>>&
2079 getMultigridInterpolator(const std::string& a_realm, const phase::which_phase a_phase) const;
2080
2087 Vector<RefCountedPtr<EBCoarseToFineInterp>>&
2088 getFineInterp(const std::string& a_realm, const phase::which_phase a_phase) const;
2089
2096 Vector<RefCountedPtr<EBReflux>>&
2097 getFluxRegister(const std::string& a_realm, const phase::which_phase a_phase) const;
2098
2105 Vector<RefCountedPtr<EBFluxRedistribution>>&
2106 getRedistributionOp(const std::string& a_realm, const phase::which_phase a_phase) const;
2107
2108#ifdef CH_USE_PETSC
2113 const RefCountedPtr<PetscGrid>&
2114 getPetscGrid(const std::string& a_realm) const noexcept;
2115#endif
2116
2121 std::vector<std::string>
2122 getRealms() const;
2123
2129 getBoxSorting() const;
2130
2136 RefCountedPtr<EBIndexSpace>&
2138 {
2139 return m_multifluidIndexSpace->getEBIndexSpace(a_phase);
2140 }
2141
2142protected:
2147 {
2148 BergerRigoutsous,
2149 Tiled,
2150 };
2151
2155 mutable std::map<std::string, RefCountedPtr<Realm>> m_realms;
2156
2160 std::map<phase::which_phase, RefCountedPtr<BaseIF>> m_baseif;
2161
2165 std::map<std::string, Vector<DisjointBoxLayout>> m_oldGrids;
2166
2171 std::map<std::string, Vector<Copier>> m_oldToNewCellCopiers;
2172
2177 std::map<std::string, Vector<Copier>> m_oldToNewEBCopiers;
2178
2183 std::map<std::pair<std::string, std::string>, Vector<Copier>> m_validToValidRealmCopiers;
2184
2189 std::map<std::pair<std::string, std::string>, Vector<Copier>> m_validToValidGhostRealmCopiers;
2190
2195 std::map<std::pair<std::string, std::string>, Vector<Copier>> m_validGhostToValidRealmCopiers;
2196
2201 std::map<std::pair<std::string, std::string>, Vector<Copier>> m_validGhostToValidGhostRealmCopiers;
2202
2207
2212
2216 RefCountedPtr<MultiFluidIndexSpace> m_multifluidIndexSpace;
2217
2222
2227
2231 IntVect m_numCells;
2232
2237
2241 RealVect m_probLo;
2242
2246 RealVect m_probHi;
2247
2252
2257
2262
2267
2272
2277
2282
2287
2292
2297
2302
2307
2312
2317
2322
2327
2332
2337
2342
2346 Vector<DisjointBoxLayout> m_grids;
2347
2351 Vector<ProblemDomain> m_domains;
2352
2357
2361 Vector<Real> m_dx;
2362
2366 void
2367 defineRealms();
2368
2377 void
2378 buildGrids(const Vector<IntVectSet>& a_tags, const int a_lmin, const int a_hardcap = -1);
2379
2383 void
2384 buildCopiers();
2385
2389 void
2391
2395 void
2397
2401 void
2403
2407 void
2409
2413 void
2415
2419 void
2421
2425 void
2427
2431 void
2433
2437 void
2439
2443 void
2445
2450 void
2452
2456 void
2458
2463 void
2465
2469 void
2471
2475 void
2477
2481 void
2483
2487 void
2489
2493 void
2495
2506 void
2507 computeGradient(LevelData<EBCellFAB>& a_gradient,
2508 const LevelData<EBCellFAB>& a_phi,
2509 const std::string& a_realm,
2510 const phase::which_phase a_phase,
2511 const int a_lvl) const;
2512};
2513
2514#include <CD_NamespaceFooter.H>
2515
2516#include <CD_AmrMeshImplem.H>
2517
2518#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 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:45
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:3521
int m_refRatio
Refinement ratio.
Definition CD_AmrMesh.H:2251
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:3338
void parseRuntimeOptions()
Parse runtime options.
Definition CD_AmrMesh.cpp:986
std::map< std::string, Vector< Copier > > m_oldToNewCellCopiers
Storage for copiers from the old grids to the new ones.
Definition CD_AmrMesh.H:2171
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:3902
void allocatePointer(Vector< RefCountedPtr< T > > &a_data) const
Allocate pointer but not any memory blocks.
Definition CD_AmrMeshImplem.H:265
EBAMRSurfaceDeposition & getSurfaceDeposition(const std::string &a_realm, const phase::which_phase a_phase) const
Get EBAMRSurfaceDeposition surface deposition operator.
Definition CD_AmrMesh.cpp:3702
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:3407
std::vector< std::string > getRealms() const
Get the name of all Realms.
Definition CD_AmrMesh.cpp:4022
RealVect getProbHi() const
Get upper-right corner of computational domain.
Definition CD_AmrMesh.cpp:3053
void parseBrBufferSize()
Parse buffer size for Berger-Rigoutsous grid algorithm.
Definition CD_AmrMesh.cpp:2695
Real getFinestDx() const
Get resolution on the finest grid level.
Definition CD_AmrMesh.cpp:3204
int getMaxBlockSize() const
Get maximum permitted block size.
Definition CD_AmrMesh.cpp:3141
void registerRealm(const std::string &a_realm)
Register a new realm.
Definition CD_AmrMesh.cpp:3889
const RefCountedPtr< BaseIF > & getBaseImplicitFunction(const phase::which_phase a_phase) const
Get implicit function for a specific phase.
Definition CD_AmrMesh.cpp:3237
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:666
Real m_fillRatioBR
Fill ratio.
Definition CD_AmrMesh.H:2236
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:238
ProblemDomain getFinestDomain() const
Get finest domain.
Definition CD_AmrMesh.cpp:3193
void parseCellCentroidInterpolation()
Parse centroid interpolation stencils.
Definition CD_AmrMesh.cpp:2860
Vector< RefCountedPtr< EBCoarAve > > & getCoarseAverage(const std::string &a_realm, const phase::which_phase a_phase) const
Get the coarsening utility.
Definition CD_AmrMesh.cpp:3719
const Vector< RefCountedPtr< LevelTiles > > & getLevelTiles(const std::string &a_realm) const
Get the tiled space representation.
Definition CD_AmrMesh.cpp:3439
int m_oldFinestLevel
Finest level before a regrid.
Definition CD_AmrMesh.H:2266
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:3260
void interpGhostMG(MFAMRCellData &a_data, const std::string &a_realm) const
Interpolate ghost cells over a realm and phase.
Definition CD_AmrMesh.cpp:2065
IntVect m_numCells
Coarsest box where we compute.
Definition CD_AmrMesh.H:2231
void postRegrid()
Run post-regrid operations.
Definition CD_AmrMesh.cpp:1079
void parseMaxAmrDepth()
Parse the maximum permitted AMR depth.
Definition CD_AmrMesh.cpp:2525
RealVect m_probHi
Domain simulation corner.
Definition CD_AmrMesh.H:2246
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:3455
const AMRMask & getValidCells(const std::string &a_realm) const
Get a map of all valid cells on a specified realm.
Definition CD_AmrMesh.cpp:3423
Vector< DisjointBoxLayout > m_grids
Grids.
Definition CD_AmrMesh.H:2346
RefCountedPtr< MultiFluidIndexSpace > m_multifluidIndexSpace
MultiFluidIndexSpace.
Definition CD_AmrMesh.H:2216
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:434
RealVect m_probLo
Domain simulation corner.
Definition CD_AmrMesh.H:2241
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:3822
int m_bufferSizeBR
Set buffer size.
Definition CD_AmrMesh.H:2291
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:1041
void setCoarsestGrid(const IntVect &a_nCells)
Set the coarsest grid cells.
Definition CD_AmrMesh.cpp:2484
void parseMaxSimulationDepth()
Set maximum simulation depth.
Definition CD_AmrMesh.cpp:2544
int getMaxSimulationDepth() const
Get maximum permitted simulation depth.
Definition CD_AmrMesh.cpp:3086
int m_maxSimulationDepth
Maximum allowed depth for simulation.
Definition CD_AmrMesh.H:2276
void setFinestLevel(const int a_finestLevel)
Set the finest level.
Definition CD_AmrMesh.cpp:2601
virtual ~AmrMesh()
Destructor.
const Vector< DisjointBoxLayout > & getGrids(const std::string &a_realm) const
Get the grids.
Definition CD_AmrMesh.cpp:3271
int m_multigridInterpRadius
Multigrid interpolation radius.
Definition CD_AmrMesh.H:2321
void buildDomains()
Build domains.
Definition CD_AmrMesh.cpp:1022
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:3471
GridGenerationMethod m_gridGenerationMethod
Grid generation method.
Definition CD_AmrMesh.H:2206
int getMinBlockSize() const
Get the minimum block size (i.e. the smallest possible box / tile size).
Definition CD_AmrMesh.cpp:3130
void parseRefinementRatios()
Parse refinement ratios.
Definition CD_AmrMesh.cpp:2563
Vector< int > m_refinementRatios
AMR resolutions.
Definition CD_AmrMesh.H:2356
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:3355
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:3651
int m_verbosity
Verbosity.
Definition CD_AmrMesh.H:2256
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 bool a_forceIrregNGP, CellGather a_cellGather)
Deposit a custom per-particle scalar (a_cellGather) of an SoA container on the mesh.
Definition CD_AmrMeshImplem.H:388
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:3321
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:2306
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:3668
bool m_hasRegridCopiers
Has regrid copiers or not.
Definition CD_AmrMesh.H:2341
int m_minBlockSize
Blocking factor.
Definition CD_AmrMesh.H:2296
int m_multigridInterpOrder
Multigrid interpolation order.
Definition CD_AmrMesh.H:2316
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:3487
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:2183
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:2195
void parseNumGhostCells()
Parse the number of ghost cells.
Definition CD_AmrMesh.cpp:2796
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 bool a_forceIrregNGP)
Deposit the SoA container's weight column on the mesh (all coarse-fine strategies).
Definition CD_AmrMeshImplem.H:368
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:3504
void sanityCheck() const
Do a sanity check to make sure everything is set up correctly.
Definition CD_AmrMesh.cpp:2946
int m_numGhostCells
Number of ghost cells.
Definition CD_AmrMesh.H:2306
Vector< RefCountedPtr< EBFluxRedistribution > > & getRedistributionOp(const std::string &a_realm, const phase::which_phase a_phase) const
Get the redistribution operators.
Definition CD_AmrMesh.cpp:3787
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:1169
void parseVerbosity()
Parse the verbosity for AmrMesh.
Definition CD_AmrMesh.cpp:2495
int m_maxBlockSize
Max box size.
Definition CD_AmrMesh.H:2281
GridGenerationMethod
Enum for having understandable notation for grid generation.
Definition CD_AmrMesh.H:2147
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:2201
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:731
void harmonicAverage(MFAMRCellData &a_data, const std::string &a_realm) const
Harmonic coarsening of multifluid data.
Definition CD_AmrMesh.cpp:1570
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:611
bool getEbCf() const
Check if mesh has an EBCF.
Definition CD_AmrMesh.cpp:3878
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:3534
void parseMinBlockSize()
Parse the B-R blocking factor. For tiled mesh refinement this parses the tile size.
Definition CD_AmrMesh.cpp:2756
Vector< Real > m_dx
Level resolutions.
Definition CD_AmrMesh.H:2361
int m_numEbGhostsCells
Number of ghost cells to use for eb stuff.
Definition CD_AmrMesh.H:2301
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:1207
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:1314
RealVect getProbLo() const
Get lower-left corner of computational domain.
Definition CD_AmrMesh.cpp:3042
BoxSorting m_boxSort
Box sorting.
Definition CD_AmrMesh.H:2211
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:2271
void defineRealms()
Define Realms.
Definition CD_AmrMesh.cpp:3935
int m_finestLevel
Finest level.
Definition CD_AmrMesh.H:2261
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:3567
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:472
void reallocate(EBAMRCellData &a_data, const phase::which_phase a_phase, const int a_lmin) const
Reallocate data.
Definition CD_AmrMesh.cpp:614
std::map< std::string, Vector< Copier > > m_oldToNewEBCopiers
Storage for copiers from the old grids to the new ones.
Definition CD_AmrMesh.H:2177
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:3550
std::map< phase::which_phase, RefCountedPtr< BaseIF > > m_baseif
Implicit functions.
Definition CD_AmrMesh.H:2160
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:3965
int getNumberOfGhostCells() const
Get the default number of ghost cells.
Definition CD_AmrMesh.cpp:3097
bool queryRealm(const std::string &a_realm) const
Query if a realm exists.
Definition CD_AmrMesh.cpp:3861
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:3601
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:1117
AmrMesh & operator=(const AmrMesh &&a_other)=delete
Disallowed move assignment.
void parseCoarsestLevelNumCells()
Parse the coarsest domain grid.
Definition CD_AmrMesh.cpp:2508
RefCountedPtr< EBIndexSpace > & getEBIndexSpace(const phase::which_phase a_phase)
Get EBIndexSpace corresponding to a particular phase.
Definition CD_AmrMesh.H:2137
void arithmeticAverage(MFAMRCellData &a_data, const std::string &a_realm) const
Arithmetic coarsening of multifluid data.
Definition CD_AmrMesh.cpp:1559
void parseRedistributionRadius()
Parse the default redistribution radius.
Definition CD_AmrMesh.cpp:2843
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:878
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:2614
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:3372
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:2189
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:1379
const Vector< Real > & getDx() const
Get spatial resolutions.
Definition CD_AmrMesh.cpp:3215
int getBrBuffer() const
Return buffer for B-R mesh refinement algorithm.
Definition CD_AmrMesh.cpp:3152
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:3390
EBAMRParticleMesh & getParticleMesh(const std::string &a_realm, const phase::which_phase a_phase) const
Get EBAMRParticleMesh operator.
Definition CD_AmrMesh.cpp:3685
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:3287
int getMaxBoxSize() const
Deprecated alias for getMaxBlockSize().
Definition CD_AmrMesh.H:1684
std::map< std::string, RefCountedPtr< Realm > > m_realms
These are all the Realms.
Definition CD_AmrMesh.H:2155
int getMaxEbisBoxSize() const
Get maximum box size for EBIS generation.
Definition CD_AmrMesh.cpp:3163
AmrMesh()
Default constructor.
Definition CD_AmrMesh.cpp:32
void parseEbGhostCells()
Parse number of ghost cells for eb stuff.
Definition CD_AmrMesh.cpp:2779
void parseMultigridInterpolator()
Parse settings for the multigrid interpolator.
Definition CD_AmrMesh.cpp:2818
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:453
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:3174
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:3919
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:3617
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:348
Vector< RefCountedPtr< EBMultigridInterpolator > > & getMultigridInterpolator(const std::string &a_realm, const phase::which_phase a_phase) const
Get multigrid interpolation utility.
Definition CD_AmrMesh.cpp:3736
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:2415
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:324
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:2000
int getBlockingFactor() const
Deprecated alias for getMinBlockSize().
Definition CD_AmrMesh.H:1666
void parseMaxBlockSize()
Parse the maximum permitted box size.
Definition CD_AmrMesh.cpp:2653
CellCentroidInterpolation::Type m_cellCentroidInterpolationType
Interpolation type for cell to cell centroid interpolation.
Definition CD_AmrMesh.H:2221
void parseEBCentroidInterpolation()
Parse EB interpolation (or extrapolation) stencils.
Definition CD_AmrMesh.cpp:2903
const Vector< RefCountedPtr< MFLevelGrid > > & getMFLevelGrid(const std::string &a_realm) const
Get EBISLayouts for a Realm.
Definition CD_AmrMesh.cpp:3584
int m_multigridInterpWeight
Multigrid interpolation weights.
Definition CD_AmrMesh.H:2326
std::map< std::string, Vector< DisjointBoxLayout > > m_oldGrids
Old grids.
Definition CD_AmrMesh.H:2165
EBCentroidInterpolation::Type m_ebCentroidInterpolationType
Interpolation type for cell to EB centroid interpolation.
Definition CD_AmrMesh.H:2226
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:3304
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:3634
void preRegrid()
Run pre-regrid operations.
Definition CD_AmrMesh.cpp:1047
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:1519
Vector< RefCountedPtr< EBReflux > > & getFluxRegister(const std::string &a_realm, const phase::which_phase a_phase) const
Get flux register.
Definition CD_AmrMesh.cpp:3770
AmrMesh(const AmrMesh &a_other)=delete
Disallowed copy constructor.
void parseBrFillRatio()
Parse the Berger-Rigoutsos fill ratio.
Definition CD_AmrMesh.cpp:2585
Vector< ProblemDomain > m_domains
Problem domains.
Definition CD_AmrMesh.H:2351
void parseProbLoHiCorners()
Parse the low/high corners of the computational domain.
Definition CD_AmrMesh.cpp:1004
void parseGridGeneration()
Parse the grid generation algorithm.
Definition CD_AmrMesh.cpp:2714
Vector< RefCountedPtr< EBCoarseToFineInterp > > & getFineInterp(const std::string &a_realm, const phase::which_phase a_phase) const
Get interpolator.
Definition CD_AmrMesh.cpp:3753
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:2129
void parseMaxEbisBoxSize()
Parse the maximum permitted box size.
Definition CD_AmrMesh.cpp:2676
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:210
bool m_hasGrids
Has grids or not.
Definition CD_AmrMesh.H:2336
void deallocate(Vector< T * > &a_data) const
Deallocate data.
Definition CD_AmrMeshImplem.H:162
int getMaxAmrDepth() const
Get maximum permitted amr depth.
Definition CD_AmrMesh.cpp:3075
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:818
void conservativeAverage(MFAMRCellData &a_data, const std::string &a_realm) const
Conservative coarsening of multifluid data.
Definition CD_AmrMesh.cpp:1581
const Vector< int > & getRefinementRatios() const
Get refinement ratios.
Definition CD_AmrMesh.cpp:3226
void regridOperators(const int a_lmin)
Regrid AMR operators. This is done for all realms.
Definition CD_AmrMesh.cpp:1138
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:1910
int getRedistributionRadius() const
Get default redistribution radius.
Definition CD_AmrMesh.cpp:3119
BoxSorting getBoxSorting() const
Get box sorting method.
Definition CD_AmrMesh.cpp:4040
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:531
int m_maxEbisBoxSize
Maximum box size for EBIS generation.
Definition CD_AmrMesh.H:2286
int getNumberOfEbGhostCells() const
Get number of ghost cells used for EB grid generation.
Definition CD_AmrMesh.cpp:3108
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:3064
int m_redistributionRadius
Redistribution radius.
Definition CD_AmrMesh.H:2331
const Vector< ProblemDomain > & getDomains() const
Get domains.
Definition CD_AmrMesh.cpp:3249
int m_numLsfGhostCells
Number of ghost cells to use when writing level-set to grid.
Definition CD_AmrMesh.H:2311
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:74
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