chombo-discharge
Loading...
Searching...
No Matches
CD_AmrMesh.H
Go to the documentation of this file.
1/* chombo-discharge
2 * Copyright © 2021 SINTEF Energy Research.
3 * Please refer to Copyright.txt and LICENSE in the chombo-discharge root directory.
4 */
5
14#ifndef CD_AmrMesh_H
15#define CD_AmrMesh_H
16
17// Chombo includes
18#include <DisjointBoxLayout.H>
19#include <ProblemDomain.H>
20
21// Our includes
22#include <CD_EBAMRData.H>
23#include <CD_EBCoarAve.H>
26#include <CD_LoadBalancing.H>
27#include <CD_MFLevelGrid.H>
28#include <CD_EBReflux.H>
29#include <CD_DomainFluxIFFAB.H>
32#include <CD_Realm.H>
33#include <CD_CopyStrategy.H>
34#include <CD_LoadBalancing.H>
35#include <CD_NamespaceHeader.H>
36
42{
43public:
47 AmrMesh();
48
53 AmrMesh(const AmrMesh& a_other) = delete;
54
59 AmrMesh(const AmrMesh&& a_other) = delete;
60
64 virtual ~AmrMesh();
65
70 AmrMesh&
71 operator=(const AmrMesh& a_other) = delete;
72
77 AmrMesh&
78 operator=(const AmrMesh&& a_other) = delete;
79
90 template <typename T>
91 void
93 const EBAMRData<T>& a_src,
94 const CopyStrategy& a_toRegion = CopyStrategy::Valid,
95 const CopyStrategy& a_fromRegion = CopyStrategy::Valid) const noexcept;
96
108 template <typename T>
109 void
111 const EBAMRData<T>& a_src,
112 const Interval& a_dstComps,
113 const Interval& a_srcComps,
114 const CopyStrategy& a_toRegion = CopyStrategy::Valid,
115 const CopyStrategy& a_fromRegion = CopyStrategy::Valid) const noexcept;
116
130 template <typename T>
131 void
133 const LevelData<T>& a_src,
134 const int a_level,
137 const CopyStrategy& a_toRegion = CopyStrategy::Valid,
138 const CopyStrategy& a_fromRegion = CopyStrategy::Valid) const noexcept;
139
155 template <typename T>
156 void
158 const LevelData<T>& a_src,
159 const int a_level,
162 const Interval& a_dstComps,
163 const Interval& a_srcComps,
164 const CopyStrategy& a_toRegion = CopyStrategy::Valid,
165 const CopyStrategy& a_fromRegion = CopyStrategy::Valid) const noexcept;
166
171 template <typename T>
172 void
174
179 template <typename T>
180 void
182
187 template <typename T>
188 void
190
197 template <typename T>
198 void
200
207 template <typename T, typename S>
208 void
210
216 template <typename T>
217 void
219
225 template <typename T>
226 void
228
234 template <typename T>
235 void
237
244 template <typename T>
245 void
247
254 template <typename T>
255 void
257
265 template <typename T>
266 void
268
276 slice(EBAMRCellData& a_original, const Interval a_variables) const noexcept;
277
284 const EBAMRCellData
285 slice(const EBAMRCellData& a_original, const Interval a_variables) const noexcept;
286
290 void
291 parseOptions();
292
297 void
299
307 void
308 registerOperator(const std::string a_operator, const std::string a_realm, const phase::which_phase a_phase);
309
318 void
320
324 void
325 buildDomains();
326
332 void
333 setFinestLevel(const int a_finestLevel);
334
338 void
340
346 bool
347 queryRealm(const std::string a_realm) const;
348
353 bool
354 getEbCf() const;
355
361 void
363
371 void
373 const phase::which_phase a_phase,
374 const MFAMRCellData& a_mfdata,
375 const int a_finestLevel) const;
376
384 void
386 const phase::which_phase a_phase,
387 const MFAMRFluxData& a_mfdata,
388 const int a_finestLevel) const;
389
396 void
397 alias(EBAMRCellData& a_data, const phase::which_phase a_phase, const MFAMRCellData& a_mfdata) const;
398
405 void
406 alias(EBAMRFluxData& a_data, const phase::which_phase a_phase, const MFAMRFluxData& a_mfdata) const;
407
414 void
415 alias(EBAMRIVData& a_data, const phase::which_phase a_phase, const MFAMRIVData& a_mfdata) const;
416
424 alias(const phase::which_phase a_phase, const MFAMRCellData& a_mfdata) const;
425
433 alias(const phase::which_phase a_phase, const MFAMRFluxData& a_mfdata) const;
434
442 alias(const phase::which_phase a_phase, const MFAMRIVData& a_mfdata) const;
443
453 void
455 const EBAMRCellData& a_phi,
456 const std::string a_realm,
457 const phase::which_phase a_phase) const;
458
468 void
470 const EBAMRCellData& a_phi,
471 const std::string a_realm,
472 const phase::which_phase a_phase) const;
473
482 void
484
493 void
495
505 void
507 const std::string a_realm,
508 const phase::which_phase a_phase,
509 const int a_nComp,
510 const int a_nGhost = -1) const;
511
522 void
524 const std::string a_realm,
525 const phase::which_phase a_phase,
526 const int a_level,
527 const int a_nComp,
528 const int a_nGhost = -1) const;
529
539 void
541 const std::string a_realm,
542 const phase::which_phase a_phase,
543 const int a_nComp,
544 const int a_nGhost = -1) const;
545
555 void
557 const std::string a_realm,
558 const phase::which_phase a_phase,
559 const int a_nComp,
560 const int a_nGhost = -1) const;
561
570 void
572 const std::string a_realm,
573 const phase::which_phase a_phase,
574 const int a_nComp,
575 const int a_nGhost = -1) const;
576
585 void
586 allocate(EBAMRBool& a_data, const std::string a_realm, const int a_nComp, const int a_nGhost = -1) const;
587
596 void
597 allocate(MFAMRCellData& a_data, const std::string a_realm, const int a_nComp, const int a_nGhost = -1) const;
598
607 void
608 allocate(MFAMRFluxData& a_data, const std::string a_realm, const int a_nComp, const int a_ghost = -1) const;
609
618 void
619 allocate(MFAMRIVData& a_data, const std::string a_realm, const int a_nComp, const int a_ghost = 0) const;
620
628 void
629 reallocate(EBAMRCellData& a_data, const phase::which_phase a_phase, const int a_lmin) const;
630
638 void
639 reallocate(EBAMRFluxData& a_data, const phase::which_phase a_phase, const int a_lmin) const;
640
648 void
649 reallocate(EBAMRIVData& a_data, const phase::which_phase a_phase, const int a_lmin) const;
650
658 void
659 reallocate(EBAMRIFData& a_data, const phase::which_phase a_phase, const int a_lmin) const;
660
667 void
668 reallocate(EBAMRBool& a_data, const int a_lmin) const;
669
676 void
677 reallocate(MFAMRCellData& a_data, const int a_lmin) const;
678
685 void
686 reallocate(MFAMRFluxData& a_data, const int a_lmin) const;
687
694 void
695 reallocate(MFAMRIVData& a_data, const int a_lmin) const;
696
703 void
705
711 void
713
719 void
721
727 void
729
736 void
738
745 void
747
754 void
756
762 void
764
772 void
774 const std::string a_realm,
775 const phase::which_phase a_phase,
776 const Average& a_average) const;
777
786 void
788 const std::string a_realm,
789 const phase::which_phase a_phase,
790 const Average& a_average,
791 const Interval& a_variables) const;
792
799 void
800 arithmeticAverage(EBAMRCellData& a_data, const std::string a_realm, const phase::which_phase a_phase) const;
801
809 void
811 const std::string a_realm,
812 const phase::which_phase a_phase,
813 const Interval& a_variables) const;
814
821 void
822 harmonicAverage(EBAMRCellData& a_data, const std::string a_realm, const phase::which_phase a_phase) const;
823
831 void
833 const std::string a_realm,
834 const phase::which_phase a_phase,
835 const Interval& a_variables) const;
836
843 void
844 conservativeAverage(EBAMRCellData& a_data, const std::string a_realm, const phase::which_phase a_phase) const;
845
853 void
855 const std::string a_realm,
856 const phase::which_phase a_phase,
857 const Interval& a_variables) const;
858
866 void
868 const std::string a_realm,
869 const phase::which_phase a_phase,
870 const Average& a_average) const;
871
879 void
880 arithmeticAverage(EBAMRFluxData& a_data, const std::string a_realm, const phase::which_phase a_phase) const;
881
889 void
890 harmonicAverage(EBAMRFluxData& a_data, const std::string a_realm, const phase::which_phase a_phase) const;
891
898 void
899 conservativeAverage(EBAMRFluxData& a_data, const std::string a_realm, const phase::which_phase a_phase) const;
900
908 void
910 const std::string a_realm,
911 const phase::which_phase a_phase,
912 const Average& a_average) const;
913
920 void
921 arithmeticAverage(EBAMRIVData& a_data, const std::string a_realm, const phase::which_phase a_phase) const;
922
929 void
930 harmonicAverage(EBAMRIVData& a_data, const std::string a_realm, const phase::which_phase a_phase) const;
931
938 void
939 conservativeAverage(EBAMRIVData& a_data, const std::string a_realm, const phase::which_phase a_phase) const;
940
953 template <class P, typename Ret, Ret (P::*MemberFunc)() const>
954 void
956 const std::string& a_realm,
957 const phase::which_phase& a_phase,
961 const bool a_forceIrregNGP = false);
962
972 template <class P, typename Ret, Ret (P::*MemberFunc)() const>
973 void
975 const std::string& a_realm,
976 const phase::which_phase& a_phase,
977 const ParticleContainer<P>& a_particles) const noexcept;
978
990 template <class P, class Ret, Ret (P::*MemberFunc)()>
991 void
993 const std::string& a_realm,
994 const phase::which_phase& a_phase,
997 const bool a_forceIrregNGP = false) const;
998
1009 template <class P>
1010 void
1012 const phase::which_phase& a_phase,
1013 const Real a_tolerance = 0.0) const;
1014
1025 template <class P>
1026 void
1028 const phase::which_phase& a_phase,
1029 const Real a_tolerance = 0.0) const;
1030
1039 template <class P>
1040 void
1041 removeCoveredParticlesVoxels(ParticleContainer<P>& a_particles, const phase::which_phase& a_phase) const;
1042
1054 template <class P>
1055 void
1058 const phase::which_phase& a_phase,
1059 const Real a_tolerance = 0.0) const;
1060
1072 template <class P>
1073 void
1076 const phase::which_phase& a_phase,
1077 const Real a_tolerance = 0.0) const;
1078
1089 template <class P>
1090 void
1093 const phase::which_phase& a_phase) const;
1094
1102 template <class P>
1103 void
1107 const phase::which_phase a_phase,
1108 const std::function<void(P&)> a_transferModifier = [](P&) -> void {
1109 return;
1110 }) const noexcept;
1111
1131 template <class P>
1132 void
1137 const phase::which_phase a_phase,
1138 const Real a_tolerance,
1139 const bool a_deleteParticles,
1140 const std::function<void(P&)> a_nonDeletionModifier = [](P&) -> void {
1141 return;
1142 }) const noexcept;
1143
1159 template <class P>
1160 void
1165 const phase::which_phase a_phase,
1166 const Real a_bisectionStep,
1167 const bool a_deleteParticles,
1168 const std::function<void(P&)> a_nonDeletionModifier = [](P&) -> void {
1169 return;
1170 }) const noexcept;
1171
1178 void
1179 interpGhost(EBAMRCellData& a_data, const std::string a_realm, const phase::which_phase a_phase) const;
1180
1189 void
1192 const int a_level,
1193 const std::string a_realm,
1194 const phase::which_phase a_phase) const;
1195
1201 void
1203
1210 void
1212
1219 void
1220 interpGhostPwl(EBAMRCellData& a_data, const std::string a_realm, const phase::which_phase a_phase) const;
1221
1230 void
1232
1241 void
1242 interpGhostMG(EBAMRCellData& a_data, const std::string a_realm, const phase::which_phase a_phase) const;
1243
1255 void
1257 const MFAMRCellData& a_oldData,
1258 const int a_lmin,
1259 const int a_oldFinestLevel,
1260 const int a_newFinestLevel,
1262
1275 void
1277 const EBAMRCellData& a_oldData,
1278 const phase::which_phase a_phase,
1279 const int a_lmin,
1280 const int a_oldFinestLevel,
1281 const int a_newFinestLevel,
1283
1296 void
1298 const EBAMRIVData& a_oldData,
1299 const phase::which_phase a_phase,
1300 const int a_lmin,
1301 const int a_oldFinestLevel,
1302 const int a_newFinestLevel,
1304
1311 template <class P>
1312 void
1313 remapToNewGrids(ParticleContainer<P>& a_particles, const int a_lmin, const int a_newFinestLevel) const noexcept;
1314
1322 void
1323 interpToCentroids(EBAMRCellData& a_data, const std::string a_realm, const phase::which_phase a_phase) const noexcept;
1324
1332 void
1334 const std::string a_realm,
1335 const phase::which_phase a_phase,
1336 const int a_level) const noexcept;
1337
1347 void
1349 const EBCellFAB& a_cellData,
1350 const std::string a_realm,
1351 const phase::which_phase a_phase,
1352 const int a_level,
1353 const DataIndex& a_din) const noexcept;
1354
1363 void
1366 const std::string a_realm,
1367 const phase::which_phase a_phase) const noexcept;
1368
1377 void
1380 const std::string a_realm,
1381 const phase::which_phase a_phase,
1382 const int a_level) const noexcept;
1383
1391 void
1394 const std::string a_realm,
1395 const phase::which_phase a_phase) const noexcept;
1396
1405 void
1408 const std::string a_realm,
1409 const phase::which_phase a_phase,
1410 const int a_level) const noexcept;
1411
1421 void
1423 const EBCellFAB& a_cellData,
1424 const std::string a_realm,
1425 const phase::which_phase a_phase,
1426 const int a_level,
1427 const DataIndex& a_din) const noexcept;
1428
1438 void
1441 const std::string& a_realm,
1442 const phase::which_phase& a_phase) const noexcept;
1443
1454 void
1457 const int& a_level,
1458 const std::string& a_realm,
1459 const phase::which_phase& a_phase) const noexcept;
1460
1465 void
1467
1473 void
1474 setBaseImplicitFunction(const phase::which_phase a_phase, const RefCountedPtr<BaseIF>& a_baseIF);
1475
1479 void
1480 preRegrid();
1481
1488 void
1489 regridAmr(const Vector<IntVectSet>& a_tags, const int a_lmin, const int a_hardcap = -1);
1490
1498 void
1500 const Vector<Vector<int>>& a_procs,
1501 const Vector<Vector<Box>>& a_boxes,
1502 const int a_lmin);
1503
1507 void
1508 postRegrid();
1509
1516 void
1518
1523 void
1524 regridOperators(const int a_lmin);
1525
1531 void
1532 regridOperators(const std::string a_realm, const int a_lmin);
1533
1537 void
1538 sanityCheck() const;
1539
1543 int
1544 getFinestLevel() const;
1545
1549 int
1550 getMaxAmrDepth() const;
1551
1555 int
1556 getMaxSimulationDepth() const;
1557
1561 int
1562 getBlockingFactor() const;
1563
1567 int
1568 getMaxBoxSize() const;
1569
1573 int
1574 getBrBuffer() const;
1575
1579 int
1580 getMaxEbisBoxSize() const;
1581
1585 int
1586 getNumberOfGhostCells() const;
1587
1591 int
1593
1597 int
1599
1603 Real
1604 getFinestDx() const;
1605
1609 RealVect
1610 getProbLo() const;
1611
1615 RealVect
1616 getProbHi() const;
1617
1622 getFinestDomain() const;
1623
1627 const Vector<Real>&
1628 getDx() const;
1629
1633 const Vector<int>&
1634 getRefinementRatios() const;
1635
1642 int
1643 getRefinementRatio(const int a_level1, const int a_level2) const;
1644
1650 getBaseImplicitFunction(const phase::which_phase a_phase) const;
1651
1657 getProxyGrids() const;
1658
1663 getGrids(const std::string a_realm) const;
1664
1669 getDomains() const;
1670
1677 const AMRMask&
1678 getMask(const std::string a_mask, const int a_buffer, const std::string a_realm) const;
1679
1684 const AMRMask&
1685 getValidCells(const std::string a_realm) const;
1686
1692 getLevelTiles(const std::string a_realm) const;
1693
1700 getEBLevelGrid(const std::string a_realm, const phase::which_phase a_phase) const;
1701
1708 getEBLevelGridCoFi(const std::string a_realm, const phase::which_phase a_phase) const;
1709
1715 const Vector<EBISLayout>&
1716 getEBISLayout(const std::string a_realm, const phase::which_phase a_phase) const;
1717
1723 getMFLevelGrid(const std::string a_realm) const;
1724
1730 getVofIterator(const std::string a_realm, const phase::which_phase a_phase) const;
1731
1737 const EBAMRFAB&
1738 getLevelset(const std::string a_realm, const phase::which_phase a_phase) const;
1739
1746 getParticleMesh(const std::string a_realm, const phase::which_phase a_phase) const;
1747
1754 getSurfaceDeposition(const std::string a_realm, const phase::which_phase a_phase) const;
1755
1760 getCoarseAverage(const std::string a_realm, const phase::which_phase a_phase) const;
1761
1768 getMultigridInterpolator(const std::string a_realm, const phase::which_phase a_phase) const;
1769
1776 getFineInterp(const std::string a_realm, const phase::which_phase a_phase) const;
1777
1784 getFluxRegister(const std::string a_realm, const phase::which_phase a_phase) const;
1785
1792 getRedistributionOp(const std::string a_realm, const phase::which_phase a_phase) const;
1793
1794#ifdef CH_USE_PETSC
1800 getPetscGrid(const std::string a_realm) const noexcept;
1801#endif
1802
1808 getRealms() const;
1809
1815 getBoxSorting() const;
1816
1822 getEBIndexSpace(const phase::which_phase a_phase)
1823 {
1824 return m_multifluidIndexSpace->getEBIndexSpace(a_phase);
1825 }
1826
1827protected:
1832 {
1833 BergerRigoutsous,
1834 Tiled,
1835 };
1836
1841
1846
1851
1857
1863
1869
1875
1881
1887
1892
1897
1902
1907
1912
1917
1922
1927
1932
1937
1942
1947
1952
1957
1962
1967
1972
1977
1982
1987
1992
1997
2002
2007
2012
2017
2022
2027
2032
2037
2042
2047
2051 void
2052 defineRealms();
2053
2061 void
2062 buildGrids(const Vector<IntVectSet>& a_tags, const int a_lmin, const int a_hardcap = -1);
2063
2067 void
2068 buildCopiers();
2069
2073 void
2075
2079 void
2081
2085 void
2087
2091 void
2093
2097 void
2099
2103 void
2105
2109 void
2111
2115 void
2117
2121 void
2123
2127 void
2129
2134 void
2136
2140 void
2142
2147 void
2149
2153 void
2155
2159 void
2161
2165 void
2167
2171 void
2173
2177 void
2179
2190 void
2193 const std::string a_realm,
2194 const phase::which_phase a_phase,
2195 const int a_lvl) const;
2196};
2197
2198#include <CD_NamespaceFooter.H>
2199
2200#include <CD_AmrMeshImplem.H>
2201
2202#endif
Implementation of CD_AmrMesh.H.
Average
Various averaging methods.
Definition CD_Average.H:24
BoxSorting
Enum for sorting boxes.
Definition CD_BoxSorting.H:21
CoarseFineDeposition
Coarse-fine deposition types (see CD_EBAMRParticleMesh for how these are handled).
Definition CD_CoarseFineDeposition.H:26
Declaration of base class for defining geometries.
Simple enum for distinguishing copying strategies.
CopyStrategy
Enum for distinguishing how we copy data Valid => valid region ValidGhost => valid+ghost region.
Definition CD_CopyStrategy.H:23
DepositionType
Deposition types.
Definition CD_DepositionType.H:23
Declaration of factory class for DomainFluxIFFAB.
Declaration of a BaseIFFAB wrapper that holds domain fluxes.
Class for holding data across EBAMR hierarchies.
Declaration of conservative coarsening utility.
Declaration of a class which can reflux over the coarse-fine interface.
Declaration of a static class for various load balancing operations.
Declaration of a wrapper for wrapping multifluid EBLevelGrids.
Multi-fluid index space.
Declaration of a class for holding particles on an AMR hierarchy.
Declaration of the Realm class.
Class for handling spatial operations.
Definition CD_AmrMesh.H:42
AmrMesh & operator=(const AmrMesh &a_other)=delete
Disallowed copy assignment.
void removeCoveredParticlesVoxels(ParticleContainer< P > &a_particles, const phase::which_phase &a_phase) const
Function which removes particles from the domain if they fall inside the EB.
Definition CD_AmrMeshImplem.H:605
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:1334
void transferCoveredParticlesDiscrete(ParticleContainer< P > &a_particlesFrom, ParticleContainer< P > &a_particlesTo, const phase::which_phase &a_phase, const Real a_tolerance=0.0) const
Function which transferse particles from one particle container to another if they fall inside the EB...
Definition CD_AmrMeshImplem.H:738
int m_refRatio
Refinement ratio.
Definition CD_AmrMesh.H:1936
void parseRuntimeOptions()
Parse runtime options.
Definition CD_AmrMesh.cpp:946
std::map< std::string, Vector< Copier > > m_oldToNewCellCopiers
Storage for copiers from the old grids to the new ones.
Definition CD_AmrMesh.H:1856
void allocatePointer(Vector< RefCountedPtr< T > > &a_data) const
Allocate pointer but not any memory blocks.
Definition CD_AmrMeshImplem.H:303
std::vector< std::string > getRealms() const
Get the name of all Realms.
Definition CD_AmrMesh.cpp:3661
RealVect getProbHi() const
Get upper-left corner of computational domain.
Definition CD_AmrMesh.cpp:2942
void parseBrBufferSize()
Parse buffer size for Berger-Rigoutsous grid algorithm.
Definition CD_AmrMesh.cpp:2635
Real getFinestDx() const
Get resolution on the finest grid level.
Definition CD_AmrMesh.cpp:3093
const AMRMask & getValidCells(const std::string a_realm) const
Get a map of all valid cells on a specified realm.
Definition CD_AmrMesh.cpp:3225
const RefCountedPtr< BaseIF > & getBaseImplicitFunction(const phase::which_phase a_phase) const
Get implicit function for a specific phase.
Definition CD_AmrMesh.cpp:3126
AmrMesh(const AmrMesh &&a_other)=delete
Disallowed move constructor.
void harmonicAverage(MFAMRCellData &a_data, const std::string a_realm) const
Harmonic coarsening of multifluid data.
Definition CD_AmrMesh.cpp:1520
Real m_fillRatioBR
Fill ratio.
Definition CD_AmrMesh.H:1921
ProblemDomain getFinestDomain() const
Get finest domain.
Definition CD_AmrMesh.cpp:3082
void parseCellCentroidInterpolation()
Parse centroid interpolation stencils.
Definition CD_AmrMesh.cpp:2786
int m_oldFinestLevel
Finest level before a regrid.
Definition CD_AmrMesh.H:1951
void copyData(EBAMRData< T > &a_dst, const EBAMRData< T > &a_src, const CopyStrategy &a_toRegion=CopyStrategy::Valid, const CopyStrategy &a_fromRegion=CopyStrategy::Valid) const noexcept
Method for copying from a source container to a destination container. User supplies information abou...
Definition CD_AmrMeshImplem.H:22
const Vector< DisjointBoxLayout > & getProxyGrids() const
Get the "proxy" grids in AmrMesh.
Definition CD_AmrMesh.cpp:3148
void transferCoveredParticlesIF(ParticleContainer< P > &a_particlesFrom, ParticleContainer< P > &a_particlesTo, const phase::which_phase &a_phase, const Real a_tolerance=0.0) const
Function which transferse particles from one particle container to another if they fall inside the EB...
Definition CD_AmrMeshImplem.H:664
IntVect m_numCells
Coarsest box where we compute.
Definition CD_AmrMesh.H:1916
void postRegrid()
Run post-regrid operations.
Definition CD_AmrMesh.cpp:1039
void parseMaxAmrDepth()
Parse the maximum permitted AMR depth.
Definition CD_AmrMesh.cpp:2471
Vector< RefCountedPtr< EBMultigridInterpolator > > & getMultigridInterpolator(const std::string a_realm, const phase::which_phase a_phase) const
Get multigrid interpolation utility.
Definition CD_AmrMesh.cpp:3375
RealVect m_probHi
Domain simulation corner.
Definition CD_AmrMesh.H:1931
int m_maxBoxSize
Max box size.
Definition CD_AmrMesh.H:1966
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:3541
Vector< DisjointBoxLayout > m_grids
Grids.
Definition CD_AmrMesh.H:2031
RefCountedPtr< MultiFluidIndexSpace > m_multifluidIndexSpace
MultiFluidIndexSpace.
Definition CD_AmrMesh.H:1901
RealVect m_probLo
Domain simulation corner.
Definition CD_AmrMesh.H:1926
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:3461
void remapToNewGrids(ParticleContainer< P > &a_particles, const int a_lmin, const int a_newFinestLevel) const noexcept
Regrid particle to new grids.
Definition CD_AmrMeshImplem.H:362
int m_bufferSizeBR
Set buffer size.
Definition CD_AmrMesh.H:1976
void setCoarsestGrid(const IntVect &a_nCells)
Set the coarsest grid cells.
Definition CD_AmrMesh.cpp:2430
void parseMaxSimulationDepth()
Set maximum simulation depth.
Definition CD_AmrMesh.cpp:2490
int getMaxSimulationDepth() const
Get maximum permitted simulation depth.
Definition CD_AmrMesh.cpp:2975
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:1950
int m_maxSimulationDepth
Maximum allowed depth for simulation.
Definition CD_AmrMesh.H:1961
void setFinestLevel(const int a_finestLevel)
Set the finest level.
Definition CD_AmrMesh.cpp:2547
void transferIrregularParticles(ParticleContainer< P > &a_dstParticles, ParticleContainer< P > &a_srcParticles, const phase::which_phase a_phase, const std::function< void(P &)> a_transferModifier=[](P &) -> void { return;}) const noexcept
Transfer particles that are on the wrong side of the EB to a different container.
Definition CD_AmrMeshImplem.H:897
bool queryRealm(const std::string a_realm) const
Query if a realm exists.
Definition CD_AmrMesh.cpp:3500
virtual ~AmrMesh()
Destructor.
Definition CD_AmrMesh.cpp:46
void removeCoveredParticlesIF(ParticleContainer< P > &a_particles, const phase::which_phase &a_phase, const Real a_tolerance=0.0) const
Function which removes particles from the domain if they fall inside the EB.
Definition CD_AmrMeshImplem.H:449
int m_multigridInterpRadius
Multigrid interpolation radius.
Definition CD_AmrMesh.H:2006
void arithmeticAverage(MFAMRCellData &a_data, const std::string a_realm) const
Arithmetic coarsening of multifluid data.
Definition CD_AmrMesh.cpp:1509
void buildDomains()
Build domains.
Definition CD_AmrMesh.cpp:982
GridGenerationMethod m_gridGenerationMethod
Grid generation method.
Definition CD_AmrMesh.H:1891
void interpGhostMG(MFAMRCellData &a_data, const std::string a_realm) const
Interpolate ghost cells over a realm and phase.
Definition CD_AmrMesh.cpp:2013
void parseRefinementRatios()
Parse refinement ratios.
Definition CD_AmrMesh.cpp:2509
Vector< int > m_refinementRatios
AMR resolutions.
Definition CD_AmrMesh.H:2041
int m_verbosity
Verbosity.
Definition CD_AmrMesh.H:1941
void conservativeAverage(MFAMRCellData &a_data, const std::string a_realm) const
Conservative coarsening of multifluid data.
Definition CD_AmrMesh.cpp:1531
bool m_hasRegridCopiers
Has regrid copiers or not.
Definition CD_AmrMesh.H:2026
Vector< RefCountedPtr< EBCoarseToFineInterp > > & getFineInterp(const std::string a_realm, const phase::which_phase a_phase) const
Get interpolator.
Definition CD_AmrMesh.cpp:3392
void parseMaxBoxSize()
Parse the maximum permitted box size.
Definition CD_AmrMesh.cpp:2597
int m_multigridInterpOrder
Multigrid interpolation order.
Definition CD_AmrMesh.H:2001
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:1868
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:1880
void intersectParticlesRaycastIF(ParticleContainer< P > &a_activeParticles, ParticleContainer< P > &a_ebParticles, ParticleContainer< P > &a_domainParticles, const phase::which_phase a_phase, const Real a_tolerance, const bool a_deleteParticles, const std::function< void(P &)> a_nonDeletionModifier=[](P &) -> void { return;}) const noexcept
Particle intersection algorithm based on ray-casting.
Definition CD_AmrMeshImplem.H:981
void parseNumGhostCells()
Parse the number of ghost cells.
Definition CD_AmrMesh.cpp:2728
void sanityCheck() const
Do a sanity check to make sure everything is set up correctly.
Definition CD_AmrMesh.cpp:2872
int m_numGhostCells
Number of ghost cells.
Definition CD_AmrMesh.H:1991
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:1128
void parseVerbosity()
Parse the verbosity for AmrMesh.
Definition CD_AmrMesh.cpp:2441
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:3257
GridGenerationMethod
Enum for having understandable notation for grid generation.
Definition CD_AmrMesh.H:1832
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:1886
void registerRealm(const std::string a_realm)
Register a new realm.
Definition CD_AmrMesh.cpp:3528
void removeCoveredParticlesDiscrete(ParticleContainer< P > &a_particles, const phase::which_phase &a_phase, const Real a_tolerance=0.0) const
Function which removes particles from the domain if they fall inside the EB.
Definition CD_AmrMeshImplem.H:515
bool getEbCf() const
Check if mesh has an EBCF.
Definition CD_AmrMesh.cpp:3517
Vector< Real > m_dx
Level resolutions.
Definition CD_AmrMesh.H:2046
const Vector< DisjointBoxLayout > & getGrids(const std::string a_realm) const
Get the grids.
Definition CD_AmrMesh.cpp:3159
void intersectParticlesBisectIF(ParticleContainer< P > &a_activeParticles, ParticleContainer< P > &a_ebParticles, ParticleContainer< P > &a_domainParticles, const phase::which_phase a_phase, const Real a_bisectionStep, const bool a_deleteParticles, const std::function< void(P &)> a_nonDeletionModifier=[](P &) -> void { return;}) const noexcept
Particle intersection algorithm based on bisection.
Definition CD_AmrMeshImplem.H:1153
int m_numEbGhostsCells
Number of ghost cells to use for eb stuff.
Definition CD_AmrMesh.H:1986
void parseOptions()
Parse options. Called during the constructor.
Definition CD_AmrMesh.cpp:912
void buildCopiers()
Build copiers for copying between realms.
Definition CD_AmrMesh.cpp:1269
RealVect getProbLo() const
Get lower-left corner of computational domain.
Definition CD_AmrMesh.cpp:2931
BoxSorting m_boxSort
Box sorting.
Definition CD_AmrMesh.H:1896
void setMultifluidIndexSpace(const RefCountedPtr< MultiFluidIndexSpace > &a_multiFluidIndexSpace)
Sets multifluid index space.
Definition CD_AmrMesh.cpp:888
int m_maxAmrDepth
Maximum amr depth.
Definition CD_AmrMesh.H:1956
void defineRealms()
Define Realms.
Definition CD_AmrMesh.cpp:3574
int m_finestLevel
Finest level.
Definition CD_AmrMesh.H:1946
void reallocate(EBAMRCellData &a_data, const phase::which_phase a_phase, const int a_lmin) const
Reallocate data.
Definition CD_AmrMesh.cpp:582
std::map< std::string, Vector< Copier > > m_oldToNewEBCopiers
Storage for copiers from the old grids to the new ones.
Definition CD_AmrMesh.H:1862
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:3175
Vector< RefCountedPtr< EBReflux > > & getFluxRegister(const std::string a_realm, const phase::which_phase a_phase) const
Get flux register.
Definition CD_AmrMesh.cpp:3409
void depositParticles(EBAMRCellData &a_meshData, const std::string &a_realm, const phase::which_phase &a_phase, const ParticleContainer< P > &a_particles, const DepositionType a_depositionType, const CoarseFineDeposition a_coarseFineDeposition, const bool a_forceIrregNGP=false)
Deposit scalar particle quantities on the mesh.
Definition CD_AmrMeshImplem.H:383
Vector< RefCountedPtr< EBFluxRedistribution > > & getRedistributionOp(const std::string a_realm, const phase::which_phase a_phase) const
Get the redistribution operators.
Definition CD_AmrMesh.cpp:3426
std::map< phase::which_phase, RefCountedPtr< BaseIF > > m_baseif
Implicit functions.
Definition CD_AmrMesh.H:1845
int getNumberOfGhostCells() const
Get the default number of ghost cells.
Definition CD_AmrMesh.cpp:2986
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:1860
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:2252
const Vector< RefCountedPtr< MFLevelGrid > > & getMFLevelGrid(const std::string a_realm) const
Get EBISLayouts for a Realm.
Definition CD_AmrMesh.cpp:3291
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:1076
AmrMesh & operator=(const AmrMesh &&a_other)=delete
Disallowed move assignment.
void parseCoarsestLevelNumCells()
Parse the coarsest domain grid.
Definition CD_AmrMesh.cpp:2454
RefCountedPtr< EBIndexSpace > & getEBIndexSpace(const phase::which_phase a_phase)
Get EBIndexSpace corresponding to a particular phase.
Definition CD_AmrMesh.H:1822
void parseRedistributionRadius()
Parse the default redistribution radius.
Definition CD_AmrMesh.cpp:2770
void allocate(Vector< RefCountedPtr< ParticleData< T > > > &a_particles, const std::string a_realm) const
Template class for generic allocation of particle data.
Definition CD_AmrMeshImplem.H:237
void 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:2560
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:1874
const Vector< Real > & getDx() const
Get spatial resolutions.
Definition CD_AmrMesh.cpp:3104
int getBrBuffer() const
Return buffer for B-R mesh refinement algorithm.
Definition CD_AmrMesh.cpp:3041
int getMaxBoxSize() const
Get maximum permitted box size.
Definition CD_AmrMesh.cpp:3030
std::map< std::string, RefCountedPtr< Realm > > m_realms
These are all the Realms.
Definition CD_AmrMesh.H:1840
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:2361
int getMaxEbisBoxSize() const
Get maximum box size for EBIS generation.
Definition CD_AmrMesh.cpp:3052
AmrMesh()
Default constructor.
Definition CD_AmrMesh.cpp:31
void parseEbGhostCells()
Parse number of ghost cells for eb stuff.
Definition CD_AmrMesh.cpp:2712
void parseMultigridInterpolator()
Parse settings for the multigrid interpolator.
Definition CD_AmrMesh.cpp:2748
Vector< RefCountedPtr< EBCoarAve > > & getCoarseAverage(const std::string a_realm, const phase::which_phase a_phase) const
Get the coarsening utility.
Definition CD_AmrMesh.cpp:3358
EBAMRCellData slice(EBAMRCellData &a_original, const Interval a_variables) const noexcept
Slice cell-centered data in order to fetch a subset of components.
Definition CD_AmrMesh.cpp:50
int m_blockingFactor
Blocking factor.
Definition CD_AmrMesh.H:1981
int getRefinementRatio(const int a_level1, const int a_level2) const
Get refinement factor between two levels.
Definition CD_AmrMesh.cpp:3063
void interpolateParticles(ParticleContainer< P > &a_particles, const std::string &a_realm, const phase::which_phase &a_phase, const EBAMRCellData &a_meshScalarField, const DepositionType a_interpType, const bool a_forceIrregNGP=false) const
Interpolate mesh data onto a particle position.
Definition CD_AmrMeshImplem.H:427
void parseBlockingFactor()
Parse the B-R blocking factor. For tiled mesh refinement this parses the tile size.
Definition CD_AmrMesh.cpp:2696
int getBlockingFactor() const
Get blocking factor (i.e. the smallest possible box).
Definition CD_AmrMesh.cpp:3019
CellCentroidInterpolation::Type m_cellCentroidInterpolationType
Interpolation type for cell to cell centroid interpolation.
Definition CD_AmrMesh.H:1906
void parseEBCentroidInterpolation()
Parse EB interpolation (or extrapolation) stencils.
Definition CD_AmrMesh.cpp:2829
int m_multigridInterpWeight
Multigrid interpolation weights.
Definition CD_AmrMesh.H:2011
std::map< std::string, Vector< DisjointBoxLayout > > m_oldGrids
Old grids.
Definition CD_AmrMesh.H:1850
EBCentroidInterpolation::Type m_ebCentroidInterpolationType
Interpolation type for cell to EB centroid interpolation
Definition CD_AmrMesh.H:1911
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:3209
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:1469
EBAMRSurfaceDeposition & getSurfaceDeposition(const std::string a_realm, const phase::which_phase a_phase) const
Get EBAMRSurfaceDeposition surface deposition operator.
Definition CD_AmrMesh.cpp:3341
void preRegrid()
Run pre-regrid operations.
Definition CD_AmrMesh.cpp:1007
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:3558
AmrMesh(const AmrMesh &a_other)=delete
Disallowed copy constructor.
void parseBrFillRatio()
Parse the Berger-Rigoutsos fill ratio.
Definition CD_AmrMesh.cpp:2531
Vector< ProblemDomain > m_domains
Problem domains.
Definition CD_AmrMesh.H:2036
void parseProbLoHiCorners()
Parse the low/high corners of the computational domain.
Definition CD_AmrMesh.cpp:964
void parseGridGeneration()
Parse the grid generation algorithm.
Definition CD_AmrMesh.cpp:2654
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:2077
void transferCoveredParticlesVoxels(ParticleContainer< P > &a_particlesFrom, ParticleContainer< P > &a_particlesTo, const phase::which_phase &a_phase) const
Function which transferse particles from one particle container to another if they fall inside the EB...
Definition CD_AmrMeshImplem.H:832
void parseMaxEbisBoxSize()
Parse the maximum permitted box size.
Definition CD_AmrMesh.cpp:2616
void alias(Vector< T * > &a_alias, const Vector< RefCountedPtr< T > > &a_data) const
Turn smart-pointer data structure into regular-pointer data structure.
Definition CD_AmrMeshImplem.H:209
EBAMRParticleMesh & getParticleMesh(const std::string a_realm, const phase::which_phase a_phase) const
Get EBAMRParticleMesh operator.
Definition CD_AmrMesh.cpp:3324
bool m_hasGrids
Has grids or not.
Definition CD_AmrMesh.H:2021
Vector< RefCountedPtr< LayoutData< VoFIterator > > > & getVofIterator(const std::string a_realm, const phase::which_phase a_phase) const
Get vof iterators for a Realm and phase. This has the capability of iterating through cut-cells.
Definition CD_AmrMesh.cpp:3192
void deallocate(Vector< T * > &a_data) const
Deallocate data.
Definition CD_AmrMeshImplem.H:161
int getMaxAmrDepth() const
Get maximum permitted amr depth.
Definition CD_AmrMesh.cpp:2964
const Vector< int > & getRefinementRatios() const
Get refinement ratios.
Definition CD_AmrMesh.cpp:3115
void regridOperators(const int a_lmin)
Regrid AMR operators. This is done for all realms.
Definition CD_AmrMesh.cpp:1097
int getRedistributionRadius() const
Get default redistribution radius.
Definition CD_AmrMesh.cpp:3008
const Vector< RefCountedPtr< LevelTiles > > & getLevelTiles(const std::string a_realm) const
Get the tiled space representation.
Definition CD_AmrMesh.cpp:3241
BoxSorting getBoxSorting() const
Get box sorting method.
Definition CD_AmrMesh.cpp:3678
int m_maxEbisBoxSize
Maximum box size for EBIS generation.
Definition CD_AmrMesh.H:1971
int getNumberOfEbGhostCells() const
Get number of ghost cells used for EB grid generation.
Definition CD_AmrMesh.cpp:2997
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:3308
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:3604
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:901
int getFinestLevel() const
Get finest grid level.
Definition CD_AmrMesh.cpp:2953
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:3274
int m_redistributionRadius
Redistribution radius.
Definition CD_AmrMesh.H:2016
const Vector< ProblemDomain > & getDomains() const
Get domains.
Definition CD_AmrMesh.cpp:3137
int m_numLsfGhostCells
Number of ghost cells to use when writing level-set to grid.
Definition CD_AmrMesh.H:1996
Type
Supported interpolation types.
Definition CD_CellCentroidInterpolation.H:43
Class for handling particle-mesh operations with AMR.
Definition CD_EBAMRParticleMesh.H:52
class for handling surface deposition of particles with EB and AMR.
Definition CD_EBAMRSurfaceDeposition.H:29
Type
Supported interpolation types.
Definition CD_EBCentroidInterpolation.H:43
Type
Type of interpolation methods supported. PWC = Piecewise constant, ignoring the embedded boundary....
Definition CD_EBCoarseToFineInterp.H:42
Base class for a tracer particle solver. This solver can advance particles in a pre-defined velocity ...
Definition CD_TracerParticleSolver.H:37
TracerParticleSolver()
Default constructor.
Definition CD_TracerParticleSolverImplem.H:25