16 #include <RefCountedPtr.H>
18 #if defined(_OPENMP) && defined(CH_USE_MEMORY_TRACKING)
19 #error "OpenMP and memory tracking are not compatible"
29 #include <CD_NamespaceHeader.H>
51 Driver(
const RefCountedPtr<ComputationalGeometry>& a_computationalGeometry,
52 const RefCountedPtr<TimeStepper>& a_timeStepper,
53 const RefCountedPtr<AmrMesh>& a_amr,
54 const RefCountedPtr<CellTagger>& a_cellTagger = RefCountedPtr<CellTagger>(
nullptr),
55 const RefCountedPtr<GeoCoarsener>& a_geoCoarsen = RefCountedPtr<GeoCoarsener>(
nullptr));
76 run(
const Real a_startTime,
const Real a_endTime,
const int a_maxSteps);
86 setup(
const std::string a_inputFile,
87 const int a_initialRegrids,
89 const std::string a_restartFile);
384 setAmr(
const RefCountedPtr<AmrMesh>& a_amrMesh);
482 long long& a_numLocalCellsGhosts,
483 long long& a_numLocalBoxes,
484 long long& a_numTotalCells,
485 long long& a_numTotalCellsGhosts,
486 long long& a_numTotalBoxes,
487 Vector<long long>& a_numLocalLevelBoxes,
488 Vector<long long>& a_numTotalLevelBoxes,
489 Vector<long long>& a_numLocalLevelCells,
490 Vector<long long>& a_numTotalLevelCells,
491 const int& a_finestLevel,
492 const Vector<DisjointBoxLayout>& a_grids);
507 readCheckpointFile(
const std::string& a_restartFile);
517 regrid(
const int a_lmin,
const int a_lmax,
const bool a_useInitialData);
525 regridInternals(
const int a_oldFinestLevel,
const int a_newFinestLevel);
546 setCellTagger(
const RefCountedPtr<CellTagger>& a_cellTagger);
553 setGeoCoarsen(
const RefCountedPtr<GeoCoarsener>& a_geoCoarsen);
566 setupForRestart(
const int a_initialRegrids,
const std::string a_restartFile);
585 stepReport(
const Real a_startTime,
const Real a_endTime,
const int a_maxSteps);
655 writeCheckpointLevel(HDF5Handle& a_handle,
const int a_level);
665 writeCheckpointTags(HDF5Handle& a_handle,
const int a_level);
675 writeCheckpointRealmLoads(HDF5Handle& a_handle,
const int a_level);
683 readCheckpointLevel(HDF5Handle& a_handle,
const int a_level);
691 readCheckpointRealmLoads(Vector<long int>& a_loads,
692 HDF5Handle& a_handle,
693 const std::string a_realm,
730 writePlotData(LevelData<EBCellFAB>& a_output,
int& a_comp,
const int a_level)
const noexcept;
740 writeTags(LevelData<EBCellFAB>& a_output,
int& a_comp,
const int a_level)
const noexcept;
750 writeRanks(LevelData<EBCellFAB>& a_output,
int& a_comp,
const int a_level)
const noexcept;
760 writeLevelset(LevelData<EBCellFAB>& a_output,
int& a_comp,
const int a_level)
const noexcept;
770 writeLoads(LevelData<EBCellFAB>& a_output,
int& a_comp,
const int a_level)
const noexcept;
785 #include <CD_NamespaceFooter.H>
Declaration of core class for handling AMR-related operations (with embedded boundaries)
Declaration of a base class for tagging cells across an AMR hierarchy.
Declaration of base class for defining geometries.
Declaration of a utility class for removing geometrically tagged cells.
Declaration of main (abstract) time stepper class.
Main class for time/space advancement of streamer equations.
Definition: CD_Driver.H:36
int m_restartStep
Restart step.
Definition: CD_Driver.H:226
std::string m_geometryGeneration
Geometry generation method – can choose between native Chombo or chombo-discharge.
Definition: CD_Driver.H:135
bool m_allowCoarsening
Allow grid coarsening.
Definition: CD_Driver.H:327
int getFinestTagLevel(const EBAMRTags &a_cellTags) const
Return the finest tag level.
Definition: CD_Driver.cpp:1875
void getCellsAndBoxes(long long &a_numLocalCells, long long &a_numLocalCellsGhosts, long long &a_numLocalBoxes, long long &a_numTotalCells, long long &a_numTotalCellsGhosts, long long &a_numTotalBoxes, Vector< long long > &a_numLocalLevelBoxes, Vector< long long > &a_numTotalLevelBoxes, Vector< long long > &a_numLocalLevelCells, Vector< long long > &a_numTotalLevelCells, const int &a_finestLevel, const Vector< DisjointBoxLayout > &a_grids)
Get statics about a DisjointBoxLaout. This will compute the number of grid cells and patches both loc...
Definition: CD_Driver.cpp:376
void cacheTags(const EBAMRTags &a_tags)
Cache tags. This is used.
Definition: CD_Driver.cpp:192
void parseGeometryGeneration()
Parse option for geometry generation.
Definition: CD_Driver.cpp:1215
int m_irregTagGrowth
Irregular tag growth.
Definition: CD_Driver.H:155
void setupGeometryOnly()
Set for restart.
Definition: CD_Driver.cpp:1412
int m_regridInterval
Regrid interval.
Definition: CD_Driver.H:171
bool m_plotLevelset
Plot level sets.
Definition: CD_Driver.H:377
int m_numPlotGhost
Number of ghost cells to plot.
Definition: CD_Driver.H:221
std::string m_outputDirectory
Output directory for output files.
Definition: CD_Driver.H:140
void writePreRegridFile()
Write a regrid file.
Definition: CD_Driver.cpp:2172
virtual void writeLoads(LevelData< EBCellFAB > &a_output, int &a_comp, const int a_level) const noexcept
Write computational loads to output.
Definition: CD_Driver.cpp:2500
std::string m_inputFile
Input file.
Definition: CD_Driver.H:125
int m_plotInterval
Plot interval.
Definition: CD_Driver.H:181
bool tagCells(Vector< IntVectSet > &a_allTags, EBAMRTags &a_cellTags)
Tag cells for refinement. This computes cell tags and global tags (union of cell tags with geometric ...
Definition: CD_Driver.cpp:1904
EBAMRBool m_cachedTags
Cached tags. This is done so that when we regrid and change box ownership we can copy the tags around...
Definition: CD_Driver.H:246
void setupFresh(const int a_initialRegrids)
Setup function.
Definition: CD_Driver.cpp:1499
void allocateInternals()
Allocate internal storage for Driver.
Definition: CD_Driver.cpp:159
void stepReport(const Real a_startTime, const Real a_endTime, const int a_maxSteps)
Write a time step report.
Definition: CD_Driver.cpp:1765
std::string m_outputFileNames
Prefix for all output files.
Definition: CD_Driver.H:145
void parseIrregTagGrowth()
Parse irregular tag growth.
Definition: CD_Driver.cpp:1200
RefCountedPtr< MultiFluidIndexSpace > m_multifluidIndexSpace
Index space.
Definition: CD_Driver.H:95
Real m_wallClockTwo
MPI timer.
Definition: CD_Driver.H:291
void rebuildParmParse() const
Rebuild Parmparse.
Definition: CD_Driver.cpp:1019
void writeCrashFile()
Write a crash file.
Definition: CD_Driver.cpp:2223
int m_verbosity
Verbosity.
Definition: CD_Driver.H:150
void gridReport()
Print regrid report.
Definition: CD_Driver.cpp:452
Driver()=delete
Weak constructor. Not allowed.
Real m_startTime
Simulation start time.
Definition: CD_Driver.H:256
std::string m_realm
Name of realm where Driver allocates his data. This is always Realm::Primal.
Definition: CD_Driver.H:130
void writeComputationalLoads()
Write computational loads.
Definition: CD_Driver.cpp:2011
RefCountedPtr< AmrMesh > m_amr
AMR.
Definition: CD_Driver.H:100
void writePlotFile()
Write a plot file. This writes to plt/.
Definition: CD_Driver.cpp:2152
int getNumberOfPlotVariables() const
Get number of plot variables.
Definition: CD_Driver.cpp:90
EBAMRTags m_tags
Tags.
Definition: CD_Driver.H:241
void parseGeometryRefinement()
Parse geometrical refinement.
Definition: CD_Driver.cpp:1233
void writeCheckpointFile()
Write a checkpoint file.
Definition: CD_Driver.cpp:2540
void createOutputDirectories()
Create output directories.
Definition: CD_Driver.cpp:1274
bool m_plotRanks
Plot MPI ranks.
Definition: CD_Driver.H:367
int m_maxPlotLevel
Maximum plot depth.
Definition: CD_Driver.H:206
RefCountedPtr< GeoCoarsener > m_geoCoarsen
Geometric coarsener.
Definition: CD_Driver.H:120
Real m_refineAngle
Angle refinement threshold.
Definition: CD_Driver.H:296
Real m_stopTime
Simulation stop time.
Definition: CD_Driver.H:261
RefCountedPtr< TimeStepper > m_timeStepper
Time stepper.
Definition: CD_Driver.H:110
RefCountedPtr< ComputationalGeometry > m_computationalGeometry
Geometry.
Definition: CD_Driver.H:105
void setGeoCoarsen(const RefCountedPtr< GeoCoarsener > &a_geoCoarsen)
Set the geo coarsener.
Definition: CD_Driver.cpp:1074
virtual void writeLevelset(LevelData< EBCellFAB > &a_output, int &a_comp, const int a_level) const noexcept
Write level sets.
Definition: CD_Driver.cpp:2453
void getGeometryTags()
Get geometric tags.
Definition: CD_Driver.cpp:234
bool m_writeRestartFiles
Write restart files or not.
Definition: CD_Driver.H:322
void setup(const std::string a_inputFile, const int a_initialRegrids, const bool a_restart, const std::string a_restartFile)
Setup function.
Definition: CD_Driver.cpp:1366
Real m_time
Time.
Definition: CD_Driver.H:271
Real m_wallClockOne
MPI timer.
Definition: CD_Driver.H:286
void writeGeometry()
Write checkpoint data.
Definition: CD_Driver.cpp:2098
int m_geoScanLevel
Geometry scan level.
Definition: CD_Driver.H:161
void regridInternals(const int a_oldFinestLevel, const int a_newFinestLevel)
Regrid internal storage for this class.
Definition: CD_Driver.cpp:722
bool m_geometryOnly
Geometry only.
Definition: CD_Driver.H:352
void sanityCheck()
Sanity check.
Definition: CD_Driver.cpp:1754
void setupAndRun(const std::string a_inputFile)
Setup and run simulations.
Definition: CD_Driver.cpp:997
virtual void writePlotData(LevelData< EBCellFAB > &a_output, int &a_comp, const int a_level) const noexcept
Write internal plot data.
Definition: CD_Driver.cpp:2352
Real m_wallClockStart
MPI timer.
Definition: CD_Driver.H:281
void writePostRegridFile()
Write a regrid file.
Definition: CD_Driver.cpp:2189
int m_geometricTagsDepth
Geometric tag depth.
Definition: CD_Driver.H:186
void setCellTagger(const RefCountedPtr< CellTagger > &a_cellTagger)
Set the cell tagger.
Definition: CD_Driver.cpp:1059
bool m_writeMemory
Write memory report.
Definition: CD_Driver.H:337
void run(const Real a_startTime, const Real a_endTime, const int a_maxSteps)
Run a simulation for a specific time, or until a maximum number of steps have been performed.
Definition: CD_Driver.cpp:777
void parseRuntimeOptions()
Parse runtime options.
Definition: CD_Driver.cpp:1133
bool m_profile
Profile or not.
Definition: CD_Driver.H:301
int m_dielectricTagsDepth
Geometric tag depth for dielectrics.
Definition: CD_Driver.H:196
bool m_needsNewGeometricTags
Special option for when geometric tags are changed during a simulation.
Definition: CD_Driver.H:312
bool m_writeRegridFiles
Write regrid files or not.
Definition: CD_Driver.H:317
int m_timeStep
Time step.
Definition: CD_Driver.H:166
void setComputationalGeometry(const RefCountedPtr< ComputationalGeometry > &a_computationalGeometry)
Set the computational geometry.
Definition: CD_Driver.cpp:1032
void regrid(const int a_lmin, const int a_lmax, const bool a_useInitialData)
Do a regrid step.
Definition: CD_Driver.cpp:611
int m_conductorTagsDepth
Geometric tag depth for conductors.
Definition: CD_Driver.H:191
int m_maxSteps
Maximum number of steps.
Definition: CD_Driver.H:201
bool m_plotLoads
Plot patch loads.
Definition: CD_Driver.H:372
bool m_restart
Restart or not.
Definition: CD_Driver.H:347
int m_growTags
Grow tagged cells.
Definition: CD_Driver.H:231
void writeRestartFile()
Write a restart file.
Definition: CD_Driver.cpp:2206
RefCountedPtr< CellTagger > m_cellTagger
Cell tagger.
Definition: CD_Driver.H:115
void writeMemoryUsage()
Write the memory usage to file.
Definition: CD_Driver.cpp:1971
virtual void writeTags(LevelData< EBCellFAB > &a_output, int &a_comp, const int a_level) const noexcept
Write cell tags to file.
Definition: CD_Driver.cpp:2377
void parsePlotVariables()
Parse plot variables.
Definition: CD_Driver.cpp:1163
Real m_outputDt
Time between outputs.
Definition: CD_Driver.H:251
virtual ~Driver()
Destructor (does nothing)
Definition: CD_Driver.cpp:84
Real m_dt
Time increment.
Definition: CD_Driver.H:266
int m_initialRegrids
Number of initial regrids.
Definition: CD_Driver.H:216
int m_checkpointInterval
Checkpoint interval.
Definition: CD_Driver.H:176
bool m_ebisMemoryLoadBalance
Use memory as load balance for EBIS.
Definition: CD_Driver.H:357
bool m_writeLoads
Write loads to file or not.
Definition: CD_Driver.H:342
void parseOptions()
Parse options.
Definition: CD_Driver.cpp:1085
bool m_doInitLoadBalancing
Do init load balancing.
Definition: CD_Driver.H:332
virtual void writeRanks(LevelData< EBCellFAB > &a_output, int &a_comp, const int a_level) const noexcept
Write MPI ranks to output.
Definition: CD_Driver.cpp:2425
bool m_doCoarsening
Turn on/off geometry coarsening below the base level.
Definition: CD_Driver.H:306
void checkRestartFile(const std::string a_restartFile) const
Check if restart file exists.
Definition: CD_Driver.cpp:1739
int m_maxCheckpointDepth
Maximum plot depth.
Definition: CD_Driver.H:211
Vector< std::string > getPlotVariableNames() const
Get the string identifiers for the internal plot variables from Driver.
Definition: CD_Driver.cpp:116
Vector< IntVectSet > m_geomTags
Tags.
Definition: CD_Driver.H:236
void setTimeStepper(const RefCountedPtr< TimeStepper > &a_timeStepper)
Set the time stepper.
Definition: CD_Driver.cpp:1046
void setAmr(const RefCountedPtr< AmrMesh > &a_amrMesh)
Set amr.
Definition: CD_Driver.cpp:1352
bool m_plotTags
Plot tagged cells.
Definition: CD_Driver.H:362
void writeEBIS()
Write the geometry to file.