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>
34#include <CD_CopyStrategy.H>
35#include <CD_LoadBalancing.H>
36#include <CD_NamespaceHeader.H>
37
43{
44public:
48 AmrMesh();
49
54 AmrMesh(const AmrMesh& a_other) = delete;
55
60 AmrMesh(const AmrMesh&& a_other) = delete;
61
65 virtual ~AmrMesh();
66
71 AmrMesh&
72 operator=(const AmrMesh& a_other) = delete;
73
78 AmrMesh&
79 operator=(const AmrMesh&& a_other) = delete;
80
91 template <typename T>
92 void
94 const EBAMRData<T>& a_src,
95 const CopyStrategy& a_toRegion = CopyStrategy::Valid,
96 const CopyStrategy& a_fromRegion = CopyStrategy::Valid) const noexcept;
97
109 template <typename T>
110 void
112 const EBAMRData<T>& a_src,
113 const Interval& a_dstComps,
114 const Interval& a_srcComps,
115 const CopyStrategy& a_toRegion = CopyStrategy::Valid,
116 const CopyStrategy& a_fromRegion = CopyStrategy::Valid) const noexcept;
117
131 template <typename T>
132 void
134 const LevelData<T>& a_src,
135 const int a_level,
138 const CopyStrategy& a_toRegion = CopyStrategy::Valid,
139 const CopyStrategy& a_fromRegion = CopyStrategy::Valid) const noexcept;
140
156 template <typename T>
157 void
159 const LevelData<T>& a_src,
160 const int a_level,
163 const Interval& a_dstComps,
164 const Interval& a_srcComps,
165 const CopyStrategy& a_toRegion = CopyStrategy::Valid,
166 const CopyStrategy& a_fromRegion = CopyStrategy::Valid) const noexcept;
167
172 template <typename T>
173 void
175
180 template <typename T>
181 void
183
188 template <typename T>
189 void
191
198 template <typename T>
199 void
201
208 template <typename T, typename S>
209 void
211
217 template <typename T>
218 void
220
226 template <typename T>
227 void
229
235 template <typename T>
236 void
238
245 template <typename T>
246 void
248
255 template <typename T>
256 void
258
266 template <typename T>
267 void
269
277 slice(EBAMRCellData& a_original, const Interval a_variables) const noexcept;
278
286 slice(const EBAMRCellData& a_original, const Interval a_variables) const noexcept;
287
291 void
292 parseOptions();
293
298 void
300
308 void
310
319 void
320 registerMask(const std::string& a_mask, const int a_buffer, const std::string& a_realm);
321
325 void
326 buildDomains();
327
333 void
334 setFinestLevel(const int a_finestLevel);
335
340 void
342
348 bool
349 queryRealm(const std::string& a_realm) const;
350
356 bool
357 getEbCf() const;
358
364 void
366
374 void
377 const MFAMRCellData& a_mfdata,
378 const int a_finestLevel) const;
379
387 void
390 const MFAMRFluxData& a_mfdata,
391 const int a_finestLevel) const;
392
399 void
401
408 void
410
417 void
419
428
437
446
456 void
458 const EBAMRCellData& a_phi,
459 const std::string& a_realm,
460 const phase::which_phase a_phase) const;
461
471 void
473 const EBAMRCellData& a_phi,
474 const std::string& a_realm,
475 const phase::which_phase a_phase) const;
476
485 void
487
496 void
498
508 void
510 const std::string& a_realm,
512 const int a_nComp,
513 const int a_ghost = -1) const;
514
525 void
527 const std::string& a_realm,
529 const int a_level,
530 const int a_nComp,
531 const int a_ghost = -1) const;
532
542 void
544 const std::string& a_realm,
546 const int a_nComp,
547 const int a_ghost = -1) const;
548
558 void
560 const std::string& a_realm,
562 const int a_nComp,
563 const int a_ghost = -1) const;
564
574 void
576 const std::string& a_realm,
578 const int a_nComp,
579 const int a_ghost = -1) const;
580
589 void
590 allocate(EBAMRBool& a_data, const std::string& a_realm, const int a_nComp, const int a_ghost = -1) const;
591
600 void
601 allocate(MFAMRCellData& a_data, const std::string& a_realm, const int a_nComp, const int a_ghost = -1) const;
602
611 void
612 allocate(MFAMRFluxData& a_data, const std::string& a_realm, const int a_nComp, const int a_ghost = -1) const;
613
622 void
623 allocate(MFAMRIVData& a_data, const std::string& a_realm, const int a_nComp, const int a_ghost = 0) const;
624
632 void
634
642 void
644
652 void
654
662 void
664
671 void
672 reallocate(EBAMRBool& a_data, const int a_lmin) const;
673
680 void
681 reallocate(MFAMRCellData& a_data, const int a_lmin) const;
682
689 void
690 reallocate(MFAMRFluxData& a_data, const int a_lmin) const;
691
698 void
699 reallocate(MFAMRIVData& a_data, const int a_lmin) const;
700
707 void
709
715 void
717
723 void
725
731 void
733
740 void
742
749 void
751
758 void
760
766 void
768
776 void
778 const std::string& a_realm,
780 const Average& a_average) const;
781
790 void
792 const std::string& a_realm,
794 const Average& a_average,
795 const Interval& a_variables) const;
796
803 void
805
813 void
815 const std::string& a_realm,
817 const Interval& a_variables) const;
818
825 void
827
835 void
837 const std::string& a_realm,
839 const Interval& a_variables) const;
840
847 void
849
857 void
859 const std::string& a_realm,
861 const Interval& a_variables) const;
862
870 void
872 const std::string& a_realm,
874 const Average& a_average) const;
875
883 void
885
893 void
895
902 void
904
912 void
914 const std::string& a_realm,
916 const Average& a_average) const;
917
924 void
926
933 void
935
942 void
944
957 template <class P, typename Ret, Ret (P::*MemberFunc)() const>
958 void
960 const std::string& a_realm,
965 const bool a_forceIrregNGP = false);
966
976 template <class P, typename Ret, Ret (P::*MemberFunc)() const>
977 void
979 const std::string& a_realm,
981 const ParticleContainer<P>& a_particles) const noexcept;
982
994 template <class P, class Ret, Ret (P::*MemberFunc)()>
995 void
997 const std::string& a_realm,
1001 const bool a_forceIrregNGP = false) const;
1002
1013 template <class P>
1014 void
1017 const Real a_tolerance = 0.0) const;
1018
1029 template <class P>
1030 void
1033 const Real a_tolerance = 0.0) const;
1034
1043 template <class P>
1044 void
1046
1058 template <class P>
1059 void
1063 const Real a_tolerance = 0.0) const;
1064
1076 template <class P>
1077 void
1081 const Real a_tolerance = 0.0) const;
1082
1092 template <class P>
1093 void
1096 const phase::which_phase& a_phase) const;
1097
1105 template <class P>
1106 void
1111 const std::function<void(P&)>& a_transferModifier = [](P&) -> void {
1112 return;
1113 }) const noexcept;
1114
1134 template <class P>
1135 void
1141 const Real a_tolerance,
1142 const bool a_deleteParticles,
1143 const std::function<void(P&)>& a_nonDeletionModifier = [](P&) -> void {
1144 return;
1145 }) const noexcept;
1146
1162 template <class P>
1163 void
1169 const Real a_bisectionStep,
1170 const bool a_deleteParticles,
1171 const std::function<void(P&)>& a_nonDeletionModifier = [](P&) -> void {
1172 return;
1173 }) const noexcept;
1174
1181 void
1183
1192 void
1195 const int a_fineLevel,
1196 const std::string& a_realm,
1197 const phase::which_phase a_phase) const;
1198
1204 void
1206
1212 void
1214
1221 void
1223
1231 void
1233
1242 void
1244
1256 void
1258 const MFAMRCellData& a_oldData,
1259 const int a_lmin,
1260 const int a_oldFinestLevel,
1261 const int a_newFinestLevel,
1263
1276 void
1278 const EBAMRCellData& a_oldData,
1280 const int a_lmin,
1281 const int a_oldFinestLevel,
1282 const int a_newFinestLevel,
1284
1297 void
1299 const EBAMRIVData& a_oldData,
1301 const int a_lmin,
1302 const int a_oldFinestLevel,
1303 const int a_newFinestLevel,
1305
1313 template <class P>
1314 void
1315 remapToNewGrids(ParticleContainer<P>& a_particles, const int a_lmin, const int a_newFinestLevel) const noexcept;
1316
1324 void
1326
1334 void
1336 const std::string& a_realm,
1338 const int a_level) const noexcept;
1339
1349 void
1351 const EBCellFAB& a_cellData,
1352 const std::string& a_realm,
1354 const int a_level,
1355 const DataIndex& a_din) const noexcept;
1356
1365 void
1368 const std::string& a_realm,
1369 const phase::which_phase a_phase) const noexcept;
1370
1379 void
1382 const std::string& a_realm,
1384 const int a_level) const noexcept;
1385
1393 void
1396 const std::string& a_realm,
1397 const phase::which_phase a_phase) const noexcept;
1398
1407 void
1410 const std::string& a_realm,
1412 const int a_level) const noexcept;
1413
1423 void
1425 const EBCellFAB& a_cellData,
1426 const std::string& a_realm,
1428 const int a_level,
1429 const DataIndex& a_din) const noexcept;
1430
1440 void
1443 const std::string& a_realm,
1444 const phase::which_phase& a_phase) const noexcept;
1445
1456 void
1459 const int& a_level,
1460 const std::string& a_realm,
1461 const phase::which_phase& a_phase) const noexcept;
1462
1467 void
1469
1475 void
1477
1481 void
1482 preRegrid();
1483
1490 void
1491 regridAmr(const Vector<IntVectSet>& a_tags, const int a_lmin, const int a_hardcap = -1);
1492
1500 void
1502 const Vector<Vector<int>>& a_procs,
1503 const Vector<Vector<Box>>& a_boxes,
1504 const int a_lmin);
1505
1509 void
1510 postRegrid();
1511
1518 void
1520
1525 void
1526 regridOperators(const int a_lmin);
1527
1533 void
1534 regridOperators(const std::string& a_realm, const int a_lmin);
1535
1539 void
1540 sanityCheck() const;
1541
1546 int
1547 getFinestLevel() const;
1548
1553 int
1554 getMaxAmrDepth() const;
1555
1560 int
1561 getMaxSimulationDepth() const;
1562
1567 int
1568 getBlockingFactor() const;
1569
1574 int
1575 getMaxBoxSize() const;
1576
1581 int
1582 getBrBuffer() const;
1583
1588 int
1589 getMaxEbisBoxSize() const;
1590
1595 int
1596 getNumberOfGhostCells() const;
1597
1602 int
1604
1609 int
1611
1616 Real
1617 getFinestDx() const;
1618
1623 RealVect
1624 getProbLo() const;
1625
1630 RealVect
1631 getProbHi() const;
1632
1638 getFinestDomain() const;
1639
1644 const Vector<Real>&
1645 getDx() const;
1646
1651 const Vector<int>&
1652 getRefinementRatios() const;
1653
1661 int
1662 getRefinementRatio(const int a_level1, const int a_level2) const;
1663
1671
1678 getProxyGrids() const;
1679
1686 getGrids(const std::string& a_realm) const;
1687
1693 getDomains() const;
1694
1702 const AMRMask&
1703 getMask(const std::string& a_mask, const int a_buffer, const std::string& a_realm) const;
1704
1710 const AMRMask&
1711 getValidCells(const std::string& a_realm) const;
1712
1719 getLevelTiles(const std::string& a_realm) const;
1720
1729
1738
1745 const Vector<EBISLayout>&
1747
1754 getMFLevelGrid(const std::string& a_realm) const;
1755
1766
1778
1789
1800
1814
1827
1834 const EBAMRFAB&
1836
1843 const EBAMRCellData&
1845
1852 const EBAMRCellData&
1854
1861 const EBAMRCellData&
1863
1870 const EBAMRCellData&
1872
1881
1890
1899
1908
1917
1926
1935
1936#ifdef CH_USE_PETSC
1942 getPetscGrid(const std::string& a_realm) const noexcept;
1943#endif
1944
1950 getRealms() const;
1951
1957 getBoxSorting() const;
1958
1966 {
1967 return m_multifluidIndexSpace->getEBIndexSpace(a_phase);
1968 }
1969
1970protected:
1975 {
1976 BergerRigoutsous,
1977 Tiled,
1978 };
1979
1984
1989
1994
2000
2006
2012
2018
2024
2030
2035
2040
2045
2050
2055
2060
2065
2070
2075
2080
2085
2090
2095
2100
2105
2110
2115
2120
2125
2130
2135
2140
2145
2150
2155
2160
2165
2170
2175
2180
2185
2190
2194 void
2195 defineRealms();
2196
2204 void
2205 buildGrids(const Vector<IntVectSet>& a_tags, const int a_lmin, const int a_hardcap = -1);
2206
2210 void
2211 buildCopiers();
2212
2216 void
2218
2222 void
2224
2228 void
2230
2234 void
2236
2240 void
2242
2246 void
2248
2252 void
2254
2258 void
2260
2264 void
2266
2270 void
2272
2277 void
2279
2283 void
2285
2290 void
2292
2296 void
2298
2302 void
2304
2308 void
2310
2314 void
2316
2320 void
2322
2333 void
2336 const std::string& a_realm,
2338 const int a_lvl) const;
2339};
2340
2341#include <CD_NamespaceFooter.H>
2342
2343#include <CD_AmrMeshImplem.H>
2344
2345#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:27
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 a class for holding particles on an AMR hierarchy.
Declaration of the Realm class.
Class for handling spatial operations.
Definition CD_AmrMesh.H:43
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:606
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:739
int m_refRatio
Refinement ratio.
Definition CD_AmrMesh.H:2079
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:3252
void parseRuntimeOptions()
Parse runtime options.
Definition CD_AmrMesh.cpp:956
std::map< std::string, Vector< Copier > > m_oldToNewCellCopiers
Storage for copiers from the old grids to the new ones.
Definition CD_AmrMesh.H:1999
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:3721
void allocatePointer(Vector< RefCountedPtr< T > > &a_data) const
Allocate pointer but not any memory blocks.
Definition CD_AmrMeshImplem.H:304
EBAMRSurfaceDeposition & getSurfaceDeposition(const std::string &a_realm, const phase::which_phase a_phase) const
Get EBAMRSurfaceDeposition surface deposition operator.
Definition CD_AmrMesh.cpp:3521
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:3321
std::vector< std::string > getRealms() const
Get the name of all Realms.
Definition CD_AmrMesh.cpp:3841
RealVect getProbHi() const
Get upper-right corner of computational domain.
Definition CD_AmrMesh.cpp:2967
void parseBrBufferSize()
Parse buffer size for Berger-Rigoutsous grid algorithm.
Definition CD_AmrMesh.cpp:2653
Real getFinestDx() const
Get resolution on the finest grid level.
Definition CD_AmrMesh.cpp:3118
void registerRealm(const std::string &a_realm)
Register a new realm.
Definition CD_AmrMesh.cpp:3708
const RefCountedPtr< BaseIF > & getBaseImplicitFunction(const phase::which_phase a_phase) const
Get implicit function for a specific phase.
Definition CD_AmrMesh.cpp:3151
AmrMesh(const AmrMesh &&a_other)=delete
Disallowed move constructor.
Real m_fillRatioBR
Fill ratio.
Definition CD_AmrMesh.H:2064
ProblemDomain getFinestDomain() const
Get finest domain.
Definition CD_AmrMesh.cpp:3107
void parseCellCentroidInterpolation()
Parse centroid interpolation stencils.
Definition CD_AmrMesh.cpp:2811
Vector< RefCountedPtr< EBCoarAve > > & getCoarseAverage(const std::string &a_realm, const phase::which_phase a_phase) const
Get the coarsening utility.
Definition CD_AmrMesh.cpp:3538
const Vector< RefCountedPtr< LevelTiles > > & getLevelTiles(const std::string &a_realm) const
Get the tiled space representation.
Definition CD_AmrMesh.cpp:3353
int m_oldFinestLevel
Finest level before a regrid.
Definition CD_AmrMesh.H:2094
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:3174
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:665
void interpGhostMG(MFAMRCellData &a_data, const std::string &a_realm) const
Interpolate ghost cells over a realm and phase.
Definition CD_AmrMesh.cpp:2029
IntVect m_numCells
Coarsest box where we compute.
Definition CD_AmrMesh.H:2059
void postRegrid()
Run post-regrid operations.
Definition CD_AmrMesh.cpp:1049
void parseMaxAmrDepth()
Parse the maximum permitted AMR depth.
Definition CD_AmrMesh.cpp:2489
RealVect m_probHi
Domain simulation corner.
Definition CD_AmrMesh.H:2074
int m_maxBoxSize
Max box size.
Definition CD_AmrMesh.H:2109
const AMRMask & getValidCells(const std::string &a_realm) const
Get a map of all valid cells on a specified realm.
Definition CD_AmrMesh.cpp:3337
Vector< DisjointBoxLayout > m_grids
Grids.
Definition CD_AmrMesh.H:2174
RefCountedPtr< MultiFluidIndexSpace > m_multifluidIndexSpace
MultiFluidIndexSpace.
Definition CD_AmrMesh.H:2044
RealVect m_probLo
Domain simulation corner.
Definition CD_AmrMesh.H:2069
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:3641
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:363
int m_bufferSizeBR
Set buffer size.
Definition CD_AmrMesh.H:2119
void setCoarsestGrid(const IntVect &a_nCells)
Set the coarsest grid cells.
Definition CD_AmrMesh.cpp:2448
void parseMaxSimulationDepth()
Set maximum simulation depth.
Definition CD_AmrMesh.cpp:2508
int getMaxSimulationDepth() const
Get maximum permitted simulation depth.
Definition CD_AmrMesh.cpp:3000
int m_maxSimulationDepth
Maximum allowed depth for simulation.
Definition CD_AmrMesh.H:2104
void setFinestLevel(const int a_finestLevel)
Set the finest level.
Definition CD_AmrMesh.cpp:2565
virtual ~AmrMesh()
Destructor.
const Vector< DisjointBoxLayout > & getGrids(const std::string &a_realm) const
Get the grids.
Definition CD_AmrMesh.cpp:3185
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:450
int m_multigridInterpRadius
Multigrid interpolation radius.
Definition CD_AmrMesh.H:2149
void buildDomains()
Build domains.
Definition CD_AmrMesh.cpp:992
GridGenerationMethod m_gridGenerationMethod
Grid generation method.
Definition CD_AmrMesh.H:2034
void parseRefinementRatios()
Parse refinement ratios.
Definition CD_AmrMesh.cpp:2527
Vector< int > m_refinementRatios
AMR resolutions.
Definition CD_AmrMesh.H:2184
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:3269
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:3470
int m_verbosity
Verbosity.
Definition CD_AmrMesh.H:2084
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:3235
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:2270
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:3487
bool m_hasRegridCopiers
Has regrid copiers or not.
Definition CD_AmrMesh.H:2169
void parseMaxBoxSize()
Parse the maximum permitted box size.
Definition CD_AmrMesh.cpp:2615
int m_multigridInterpOrder
Multigrid interpolation order.
Definition CD_AmrMesh.H:2144
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:2011
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:2023
void parseNumGhostCells()
Parse the number of ghost cells.
Definition CD_AmrMesh.cpp:2747
void sanityCheck() const
Do a sanity check to make sure everything is set up correctly.
Definition CD_AmrMesh.cpp:2897
int m_numGhostCells
Number of ghost cells.
Definition CD_AmrMesh.H:2134
Vector< RefCountedPtr< EBFluxRedistribution > > & getRedistributionOp(const std::string &a_realm, const phase::which_phase a_phase) const
Get the redistribution operators.
Definition CD_AmrMesh.cpp:3606
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:1139
void parseVerbosity()
Parse the verbosity for AmrMesh.
Definition CD_AmrMesh.cpp:2459
GridGenerationMethod
Enum for having understandable notation for grid generation.
Definition CD_AmrMesh.H:1975
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:2029
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:516
void harmonicAverage(MFAMRCellData &a_data, const std::string &a_realm) const
Harmonic coarsening of multifluid data.
Definition CD_AmrMesh.cpp:1534
bool getEbCf() const
Check if mesh has an EBCF.
Definition CD_AmrMesh.cpp:3697
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:1154
Vector< Real > m_dx
Level resolutions.
Definition CD_AmrMesh.H:2189
int m_numEbGhostsCells
Number of ghost cells to use for eb stuff.
Definition CD_AmrMesh.H:2129
void parseOptions()
Parse options. Called during the constructor.
Definition CD_AmrMesh.cpp:922
void buildCopiers()
Build copiers for copying between realms.
Definition CD_AmrMesh.cpp:1280
RealVect getProbLo() const
Get lower-left corner of computational domain.
Definition CD_AmrMesh.cpp:2956
BoxSorting m_boxSort
Box sorting.
Definition CD_AmrMesh.H:2039
void setMultifluidIndexSpace(const RefCountedPtr< MultiFluidIndexSpace > &a_multiFluidIndexSpace)
Sets multifluid index space.
Definition CD_AmrMesh.cpp:898
int m_maxAmrDepth
Maximum amr depth.
Definition CD_AmrMesh.H:2099
void defineRealms()
Define Realms.
Definition CD_AmrMesh.cpp:3754
int m_finestLevel
Finest level.
Definition CD_AmrMesh.H:2089
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:3386
void reallocate(EBAMRCellData &a_data, const phase::which_phase a_phase, const int a_lmin) const
Reallocate data.
Definition CD_AmrMesh.cpp:586
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:982
std::map< std::string, Vector< Copier > > m_oldToNewEBCopiers
Storage for copiers from the old grids to the new ones.
Definition CD_AmrMesh.H:2005
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:384
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:3369
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:898
std::map< phase::which_phase, RefCountedPtr< BaseIF > > m_baseif
Implicit functions.
Definition CD_AmrMesh.H:1988
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:3784
int getNumberOfGhostCells() const
Get the default number of ghost cells.
Definition CD_AmrMesh.cpp:3011
bool queryRealm(const std::string &a_realm) const
Query if a realm exists.
Definition CD_AmrMesh.cpp:3680
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:3420
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:1087
AmrMesh & operator=(const AmrMesh &&a_other)=delete
Disallowed move assignment.
void parseCoarsestLevelNumCells()
Parse the coarsest domain grid.
Definition CD_AmrMesh.cpp:2472
RefCountedPtr< EBIndexSpace > & getEBIndexSpace(const phase::which_phase a_phase)
Get EBIndexSpace corresponding to a particular phase.
Definition CD_AmrMesh.H:1965
void arithmeticAverage(MFAMRCellData &a_data, const std::string &a_realm) const
Arithmetic coarsening of multifluid data.
Definition CD_AmrMesh.cpp:1523
void parseRedistributionRadius()
Parse the default redistribution radius.
Definition CD_AmrMesh.cpp:2794
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:2578
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:3286
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:2017
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:1345
const Vector< Real > & getDx() const
Get spatial resolutions.
Definition CD_AmrMesh.cpp:3129
int getBrBuffer() const
Return buffer for B-R mesh refinement algorithm.
Definition CD_AmrMesh.cpp:3066
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:3304
EBAMRParticleMesh & getParticleMesh(const std::string &a_realm, const phase::which_phase a_phase) const
Get EBAMRParticleMesh operator.
Definition CD_AmrMesh.cpp:3504
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:3201
int getMaxBoxSize() const
Get maximum permitted box size.
Definition CD_AmrMesh.cpp:3055
std::map< std::string, RefCountedPtr< Realm > > m_realms
These are all the Realms.
Definition CD_AmrMesh.H:1983
int getMaxEbisBoxSize() const
Get maximum box size for EBIS generation.
Definition CD_AmrMesh.cpp:3077
AmrMesh()
Default constructor.
Definition CD_AmrMesh.cpp:32
void parseEbGhostCells()
Parse number of ghost cells for eb stuff.
Definition CD_AmrMesh.cpp:2730
void parseMultigridInterpolator()
Parse settings for the multigrid interpolator.
Definition CD_AmrMesh.cpp:2769
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 m_blockingFactor
Blocking factor.
Definition CD_AmrMesh.H:2124
int getRefinementRatio(const int a_level1, const int a_level2) const
Get refinement factor between two levels.
Definition CD_AmrMesh.cpp:3088
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:3738
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:3436
Vector< RefCountedPtr< EBMultigridInterpolator > > & getMultigridInterpolator(const std::string &a_realm, const phase::which_phase a_phase) const
Get multigrid interpolation utility.
Definition CD_AmrMesh.cpp:3555
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:428
void parseBlockingFactor()
Parse the B-R blocking factor. For tiled mesh refinement this parses the tile size.
Definition CD_AmrMesh.cpp:2714
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:2379
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:1964
int getBlockingFactor() const
Get blocking factor (i.e. the smallest possible box).
Definition CD_AmrMesh.cpp:3044
CellCentroidInterpolation::Type m_cellCentroidInterpolationType
Interpolation type for cell to cell centroid interpolation.
Definition CD_AmrMesh.H:2049
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:238
void parseEBCentroidInterpolation()
Parse EB interpolation (or extrapolation) stencils.
Definition CD_AmrMesh.cpp:2854
const Vector< RefCountedPtr< MFLevelGrid > > & getMFLevelGrid(const std::string &a_realm) const
Get EBISLayouts for a Realm.
Definition CD_AmrMesh.cpp:3403
int m_multigridInterpWeight
Multigrid interpolation weights.
Definition CD_AmrMesh.H:2154
std::map< std::string, Vector< DisjointBoxLayout > > m_oldGrids
Old grids.
Definition CD_AmrMesh.H:1993
EBCentroidInterpolation::Type m_ebCentroidInterpolationType
Interpolation type for cell to EB centroid interpolation
Definition CD_AmrMesh.H:2054
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:3218
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:3453
void preRegrid()
Run pre-regrid operations.
Definition CD_AmrMesh.cpp:1017
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:1483
Vector< RefCountedPtr< EBReflux > > & getFluxRegister(const std::string &a_realm, const phase::which_phase a_phase) const
Get flux register.
Definition CD_AmrMesh.cpp:3589
AmrMesh(const AmrMesh &a_other)=delete
Disallowed copy constructor.
void parseBrFillRatio()
Parse the Berger-Rigoutsos fill ratio.
Definition CD_AmrMesh.cpp:2549
Vector< ProblemDomain > m_domains
Problem domains.
Definition CD_AmrMesh.H:2179
void parseProbLoHiCorners()
Parse the low/high corners of the computational domain.
Definition CD_AmrMesh.cpp:974
void parseGridGeneration()
Parse the grid generation algorithm.
Definition CD_AmrMesh.cpp:2672
Vector< RefCountedPtr< EBCoarseToFineInterp > > & getFineInterp(const std::string &a_realm, const phase::which_phase a_phase) const
Get interpolator.
Definition CD_AmrMesh.cpp:3572
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:2093
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:833
void parseMaxEbisBoxSize()
Parse the maximum permitted box size.
Definition CD_AmrMesh.cpp:2634
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:2164
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:2989
void conservativeAverage(MFAMRCellData &a_data, const std::string &a_realm) const
Conservative coarsening of multifluid data.
Definition CD_AmrMesh.cpp:1545
const Vector< int > & getRefinementRatios() const
Get refinement ratios.
Definition CD_AmrMesh.cpp:3140
void regridOperators(const int a_lmin)
Regrid AMR operators. This is done for all realms.
Definition CD_AmrMesh.cpp:1108
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:1874
int getRedistributionRadius() const
Get default redistribution radius.
Definition CD_AmrMesh.cpp:3033
BoxSorting getBoxSorting() const
Get box sorting method.
Definition CD_AmrMesh.cpp:3859
int m_maxEbisBoxSize
Maximum box size for EBIS generation.
Definition CD_AmrMesh.H:2114
int getNumberOfEbGhostCells() const
Get number of ghost cells used for EB grid generation.
Definition CD_AmrMesh.cpp:3022
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:911
int getFinestLevel() const
Get finest grid level.
Definition CD_AmrMesh.cpp:2978
int m_redistributionRadius
Redistribution radius.
Definition CD_AmrMesh.H:2159
const Vector< ProblemDomain > & getDomains() const
Get domains.
Definition CD_AmrMesh.cpp:3163
int m_numLsfGhostCells
Number of ghost cells to use when writing level-set to grid.
Definition CD_AmrMesh.H:2139
Type
Supported interpolation types.
Definition CD_CellCentroidInterpolation.H:44
Class for handling particle-mesh operations with AMR.
Definition CD_EBAMRParticleMesh.H:53
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
Base class for a tracer particle solver. This solver can advance particles in a pre-defined velocity ...
Definition CD_TracerParticleSolver.H:38
TracerParticleSolver()
Default constructor.
Definition CD_TracerParticleSolverImplem.H:26
which_phase
Enumeration of supported phases.
Definition CD_MultiFluidIndexSpace.H:38