|
chombo-discharge
|
Derived version of GeometryShop that load balances based on the cut cells themselves. More...
#include <CD_ScanShop.H>


Public Member Functions | |
| ScanShop ()=delete | |
| Disallowed default constructor. | |
| ScanShop (const BaseIF &a_localGeom, int a_verbosity, Real a_dx, const RealVect &a_probLo, const ProblemDomain &a_finestDomain, const ProblemDomain &a_scanLevel, int a_ebGhost=4, Real a_thrshdVoF=1.0e-16) | |
| Constructor. | |
| ~ScanShop () override | |
| Destructor (does nothing) | |
| ScanShop (const ScanShop &)=delete | |
| Disallow copy construction. | |
| ScanShop & | operator= (const ScanShop &)=delete |
| Disallow copy assignment. | |
| ScanShop (ScanShop &&)=delete | |
| Disallow move construction. | |
| ScanShop & | operator= (ScanShop &&)=delete |
| Disallow move assignment. | |
| void | setProfileFileName (std::string a_fileName) |
| If doing profiling, set the output name. | |
| void | makeGrids (const ProblemDomain &a_domain, DisjointBoxLayout &a_grids, const int &a_maxGridSize, const int &a_maxIrregGridSize) override |
| This grid generation method is called by EBISLevel when using distributed data. | |
| GeometryService::InOut | InsideOutside (const Box &a_region, const ProblemDomain &a_domain, const RealVect &a_probLo, const Real &a_dx, const DataIndex &a_dit) const override |
| This method is called by EBSILevel when using distributed data. | |
| void | fillGraph (BaseFab< int > &a_regIrregCovered, Vector< IrregNode > &a_nodes, const Box &a_validRegion, const Box &a_ghostRegion, const ProblemDomain &a_domain, const RealVect &a_probLo, const Real &a_dx, const DataIndex &a_di) const override |
| Override of GeometryShop's fillGraph. | |
Protected Member Functions | |
| void | makeDomains (Real a_dx, const RealVect &a_probLo, const ProblemDomain &a_finestDomain, const ProblemDomain &a_scanLevel) |
| Create the problem domain and resolutions. | |
| void | buildFinerLevels (int a_coarserLevel, int a_maxGridSize) |
| Refine levels recursively down to the finest level. | |
| void | buildCoarseLevel (int a_level, int a_maxGridSize) |
| Build the "coarse level" where we initiate the recursion process. | |
| bool | isRegular (Box a_box, const RealVect &a_probLo, Real a_dx) const |
| Check if every point in input box is regular. | |
| bool | isCovered (Box a_box, const RealVect &a_probLo, Real a_dx) const |
| Check if every point in box is covered. | |
| std::vector< std::pair< Box, int > > | getSortedBoxesAndTypes (const Vector< Box > &a_boxes, const Vector< int > &a_types) const |
| Sort boxes lexicographically. | |
| void | defineLevel (Vector< Box > &coveredBoxes, Vector< Box > ®ularBoxes, Vector< Box > &cutCellBoxes, int a_level) |
| Define the "box map" on a specified level. | |
Protected Attributes | |
| std::string | m_fileName |
| Set output file name (if doing profiling) | |
| BoxSorting | m_boxSorting |
| For arranging boxes in space when we load balance. | |
| Timer | m_timer |
| Timer for when we use run-time profiling. | |
| bool | m_profile |
| Bool for run-time profiling of ScanShop. | |
| int | m_scanLevel |
| Scan level where we first begin to break up boxes. This is relative the EBIS level. | |
| int | m_ebGhost |
| Maximum number of ghost cells near the EB. | |
| RealVect | m_probLo |
| Lower-left corner of simulation domain. | |
| const BaseIF * | m_baseIF |
| Implicit function used to generate geometries. | |
| bool | m_hasScanLevel |
| Check if scan level has been built. | |
| Vector< Real > | m_dx |
| Level resolutions. Note that index 0 is the finest level. | |
| Vector< ProblemDomain > | m_domains |
| Level domains. Note that index 0 is the finest level. | |
| Vector< DisjointBoxLayout > | m_grids |
| Grids on each level, used for generating the EBIS information. | |
| Vector< RefCountedPtr< LayoutData< GeometryService::InOut > > > | m_boxMap |
| Box maps. | |
| std::vector< bool > | m_hasThisLevel |
| Check if level has been scanned. 0 = false, != 0 implies true. | |
Derived version of GeometryShop that load balances based on the cut cells themselves.
The internals of this class are basically the same as GeometryShop, with the exception that this class will generate an internal map of the computational domain on each level. This map is used to load balance the EB generation, most often leading to orders of magnitude speedup compared to Chombo's approach.
| ScanShop::ScanShop | ( | const BaseIF & | a_localGeom, |
| int | a_verbosity, | ||
| Real | a_dx, | ||
| const RealVect & | a_probLo, | ||
| const ProblemDomain & | a_finestDomain, | ||
| const ProblemDomain & | a_scanLevel, | ||
| int | a_ebGhost = 4, |
||
| Real | a_thrshdVoF = 1.0e-16 |
||
| ) |
Constructor.
| [in] | a_localGeom | The implicit function for the geometry |
| [in] | a_verbosity | Verbosity |
| [in] | a_dx | Resolution on the finest level |
| [in] | a_probLo | Physical coordinates of the lower-left corner of simulation domain |
| [in] | a_finestDomain | Finest grid level |
| [in] | a_scanLevel | Scan level, i.e. on which level to initiate the load balancing sequence. |
| [in] | a_ebGhost | Number of EB ghost cells |
| [in] | a_thrshdVoF | Threshold for GeometryShop |
|
protected |
Build the "coarse level" where we initiate the recursion process.
This level must be defined in order to recurse towards deeper levels. Which is why this is ALWAYS called exact ONCE before buildFinerLevels builds the finer levels.
| [in] | a_level | Level index for the coarse level |
| [in] | a_maxGridSize | Maximum patch size |
|
protected |
Refine levels recursively down to the finest level.
| [in] | a_coarserLevel | Coarser level |
| [in] | a_maxGridSize | Maximum patch size |
|
protected |
Define the "box map" on a specified level.
| [in,out] | coveredBoxes | Description |
| [in,out] | regularBoxes | Description |
| [in,out] | cutCellBoxes | Description |
| [in] | a_level | Description |
|
override |
Override of GeometryShop's fillGraph.
This just wraps a timer around the base version to spot load imbalance.
| [in,out] | a_regIrregCovered | Regular/Covered/Irregular cells |
| [in,out] | a_nodes | Nodes |
| [in] | a_validRegion | Grid region |
| [in] | a_ghostRegion | Grid region, including ghost cells |
| [in] | a_domain | Domain |
| [in] | a_probLo | Lower-left corner of computational domain |
| [in] | a_dx | Grid resolution |
| [in] | a_di | Grid index |
|
inlineprotected |
Sort boxes lexicographically.
A strange but true thing that is necessary because DisjointBoxlayout sorts the boxes under the hood
| [in,out] | a_boxes | Description |
| [in,out] | a_types | Description |
|
override |
This method is called by EBSILevel when using distributed data.
This allows EBGraph boxes to be designed covered/regular or irregular without actually calling the implicit function. Since this class uses recursion froma deeper level, we are immediately able to say that a refined box does not contain cut-cells if the coarse box didn't either.
| [in] | a_region | Region for inside/outside testing |
| [in] | a_domain | Problem domain on level |
| [in] | a_probLo | Lower-left corner of physical domain |
| [in] | a_dx | Grid resolution on level |
| [in] | a_dit | Grid index |
|
inlineprotected |
Check if every point in box is covered.
| [in] | a_box | Cell-centered box |
| [in] | a_probLo | Lower-left corner of simulation domain |
| [in] | a_dx | Grid resolution |
|
inlineprotected |
Check if every point in input box is regular.
| [in] | a_box | Cell-centered box |
| [in] | a_probLo | Lower-left corner of simulation domain |
| [in] | a_dx | Grid resolution |
Implementation of CD_ScanShop.H
|
protected |
Create the problem domain and resolutions.
| [in] | a_dx | Grid resolution |
| [in] | a_probLo | Lower-left corner of computational domain |
| [in] | a_finestDomain | Finest AMR domain |
| [in] | a_scanLevel | Domain where we initiate the load balanced recursion process. |
|
override |
This grid generation method is called by EBISLevel when using distributed data.
| [in] | a_domain | Problem domain on level |
| [out] | a_grids | Load-balanced grids. |
| [in] | a_maxGridSize | Maximum grid size. |
| [in] | a_maxIrregGridSize | Maximum irregular grid size. |
This function will create an internal "map" of the cut-cell geometry and return grids that are load-balanced with respect to the cut cells.
| void ScanShop::setProfileFileName | ( | std::string | a_fileName | ) |
If doing profiling, set the output name.
| [in] | a_fileName | File name for profiling output |
|
protected |
Box maps.
BoxType is a essentially just an integer on each patch which is =0,1,2 depending on whether or not the box is covered/regular/cut.