chombo-discharge
|
Main class for time/space advancement of streamer equations. More...
#include <CD_Driver.H>
Public Member Functions | |
Driver ()=delete | |
Weak constructor. Not allowed. | |
Driver (const RefCountedPtr< ComputationalGeometry > &a_computationalGeometry, const RefCountedPtr< TimeStepper > &a_timeStepper, const RefCountedPtr< AmrMesh > &a_amr, const RefCountedPtr< CellTagger > &a_cellTagger=RefCountedPtr< CellTagger >(nullptr), const RefCountedPtr< GeoCoarsener > &a_geoCoarsen=RefCountedPtr< GeoCoarsener >(nullptr)) | |
Full constructor. More... | |
virtual | ~Driver () |
Destructor (does nothing) | |
void | setupAndRun (const std::string a_inputFile) |
Setup and run simulations. More... | |
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. More... | |
void | setup (const std::string a_inputFile, const int a_initialRegrids, const bool a_restart, const std::string a_restartFile) |
Setup function. More... | |
Protected Member Functions | |
void | setAmr (const RefCountedPtr< AmrMesh > &a_amrMesh) |
Set amr. More... | |
void | sanityCheck () |
Sanity check. | |
void | parseOptions () |
Parse options. More... | |
void | parseRuntimeOptions () |
Parse runtime options. More... | |
void | parseGeometryRefinement () |
Parse geometrical refinement. More... | |
void | parsePlotVariables () |
Parse plot variables. | |
void | parseGeometryGeneration () |
Parse option for geometry generation. More... | |
void | parseIrregTagGrowth () |
Parse irregular tag growth. More... | |
void | createOutputDirectories () |
Create output directories. | |
void | allocateInternals () |
Allocate internal storage for Driver. | |
void | cacheTags (const EBAMRTags &a_tags) |
Cache tags. This is used. | |
void | writeEBIS () |
Write the geometry to file. | |
void | getGeometryTags () |
Get geometric tags. More... | |
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 locally and globally. More... | |
void | gridReport () |
Print regrid report. | |
void | regrid (const int a_lmin, const int a_lmax, const bool a_useInitialData) |
Do a regrid step. More... | |
void | regridInternals (const int a_oldFinestLevel, const int a_newFinestLevel) |
Regrid internal storage for this class. More... | |
void | setComputationalGeometry (const RefCountedPtr< ComputationalGeometry > &a_computationalGeometry) |
Set the computational geometry. More... | |
void | setTimeStepper (const RefCountedPtr< TimeStepper > &a_timeStepper) |
Set the time stepper. More... | |
void | setCellTagger (const RefCountedPtr< CellTagger > &a_cellTagger) |
Set the cell tagger. More... | |
void | setGeoCoarsen (const RefCountedPtr< GeoCoarsener > &a_geoCoarsen) |
Set the geo coarsener. More... | |
void | setupFresh (const int a_initialRegrids) |
Setup function. | |
void | setupGeometryOnly () |
Set for restart. More... | |
void | checkRestartFile (const std::string a_restartFile) const |
Check if restart file exists. | |
void | stepReport (const Real a_startTime, const Real a_endTime, const int a_maxSteps) |
Write a time step report. | |
void | writePlotFile (const std::string a_filename) |
Write a plot file. More... | |
void | writePlotFile () |
Write a plot file. This writes to plt/. | |
void | writePreRegridFile () |
Write a regrid file. More... | |
void | writePostRegridFile () |
Write a regrid file. More... | |
void | writeRestartFile () |
Write a restart file. More... | |
void | writeCrashFile () |
Write a crash file. More... | |
void | writeMemoryUsage () |
Write the memory usage to file. | |
void | writeComputationalLoads () |
Write computational loads. | |
void | writeCheckpointFile () |
Write a checkpoint file. | |
void | writeGeometry () |
Write checkpoint data. More... | |
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 tags);. | |
int | getNumberOfPlotVariables () const |
Get number of plot variables. More... | |
Vector< std::string > | getPlotVariableNames () const |
Get the string identifiers for the internal plot variables from Driver. | |
virtual void | writePlotData (LevelData< EBCellFAB > &a_output, int &a_comp, const int a_level) const noexcept |
Write internal plot data. More... | |
virtual void | writeTags (LevelData< EBCellFAB > &a_output, int &a_comp, const int a_level) const noexcept |
Write cell tags to file. More... | |
virtual void | writeRanks (LevelData< EBCellFAB > &a_output, int &a_comp, const int a_level) const noexcept |
Write MPI ranks to output. More... | |
virtual void | writeLevelset (LevelData< EBCellFAB > &a_output, int &a_comp, const int a_level) const noexcept |
Write level sets. More... | |
virtual void | writeLoads (LevelData< EBCellFAB > &a_output, int &a_comp, const int a_level) const noexcept |
Write computational loads to output. More... | |
int | getFinestTagLevel (const EBAMRTags &a_cellTags) const |
Return the finest tag level. | |
void | rebuildParmParse () const |
Rebuild Parmparse. | |
Protected Attributes | |
RefCountedPtr< MultiFluidIndexSpace > | m_multifluidIndexSpace |
Index space. | |
RefCountedPtr< AmrMesh > | m_amr |
AMR. | |
RefCountedPtr< ComputationalGeometry > | m_computationalGeometry |
Geometry. | |
RefCountedPtr< TimeStepper > | m_timeStepper |
Time stepper. | |
RefCountedPtr< CellTagger > | m_cellTagger |
Cell tagger. | |
RefCountedPtr< GeoCoarsener > | m_geoCoarsen |
Geometric coarsener. | |
std::string | m_inputFile |
Input file. | |
std::string | m_realm |
Name of realm where Driver allocates his data. This is always Realm::Primal. | |
std::string | m_geometryGeneration |
Geometry generation method – can choose between native Chombo or chombo-discharge. | |
std::string | m_outputDirectory |
Output directory for output files. | |
std::string | m_outputFileNames |
Prefix for all output files. | |
int | m_verbosity |
Verbosity. | |
int | m_irregTagGrowth |
Irregular tag growth. | |
int | m_geoScanLevel |
Geometry scan level. More... | |
int | m_timeStep |
Time step. | |
int | m_regridInterval |
Regrid interval. | |
int | m_checkpointInterval |
Checkpoint interval. | |
int | m_plotInterval |
Plot interval. | |
int | m_geometricTagsDepth |
Geometric tag depth. | |
int | m_conductorTagsDepth |
Geometric tag depth for conductors. | |
int | m_dielectricTagsDepth |
Geometric tag depth for dielectrics. | |
int | m_maxSteps |
Maximum number of steps. | |
int | m_maxPlotLevel |
Maximum plot depth. | |
int | m_maxCheckpointDepth |
Maximum plot depth. | |
int | m_initialRegrids |
Number of initial regrids. | |
int | m_numPlotGhost |
Number of ghost cells to plot. | |
int | m_restartStep |
Restart step. | |
int | m_growTags |
Grow tagged cells. | |
Vector< IntVectSet > | m_geomTags |
Tags. | |
EBAMRTags | m_tags |
Tags. | |
EBAMRBool | m_cachedTags |
Cached tags. This is done so that when we regrid and change box ownership we can copy the tags around. | |
Real | m_outputDt |
Time between outputs. | |
Real | m_startTime |
Simulation start time. | |
Real | m_stopTime |
Simulation stop time. | |
Real | m_dt |
Time increment. | |
Real | m_time |
Time. | |
Real | m_capacitance |
Real | m_wallClockStart |
MPI timer. | |
Real | m_wallClockOne |
MPI timer. | |
Real | m_wallClockTwo |
MPI timer. | |
Real | m_refineAngle |
Angle refinement threshold. | |
bool | m_profile |
Profile or not. | |
bool | m_doCoarsening |
Turn on/off geometry coarsening below the base level. | |
bool | m_needsNewGeometricTags |
Special option for when geometric tags are changed during a simulation. More... | |
bool | m_writeRegridFiles |
Write regrid files or not. | |
bool | m_writeRestartFiles |
Write restart files or not. | |
bool | m_allowCoarsening |
Allow grid coarsening. | |
bool | m_doInitLoadBalancing |
Do init load balancing. | |
bool | m_writeMemory |
Write memory report. | |
bool | m_writeLoads |
Write loads to file or not. | |
bool | m_restart |
Restart or not. | |
bool | m_geometryOnly |
Geometry only. | |
bool | m_ebisMemoryLoadBalance |
Use memory as load balance for EBIS. | |
bool | m_plotTags |
Plot tagged cells. | |
bool | m_plotRanks |
Plot MPI ranks. | |
bool | m_plotLoads |
Plot patch loads. | |
bool | m_plotLevelset |
Plot level sets. | |
Main class for time/space advancement of streamer equations.
This class runs a simulation and controls input/output, regrid intervals etc.
Driver::Driver | ( | const RefCountedPtr< ComputationalGeometry > & | a_computationalGeometry, |
const RefCountedPtr< TimeStepper > & | a_timeStepper, | ||
const RefCountedPtr< AmrMesh > & | a_amr, | ||
const RefCountedPtr< CellTagger > & | a_cellTagger = RefCountedPtr<CellTagger>(nullptr) , |
||
const RefCountedPtr< GeoCoarsener > & | a_geoCoarsen = RefCountedPtr<GeoCoarsener>(nullptr) |
||
) |
Full constructor.
[in] | a_computationalGeometry | Computational geometry. |
[in] | a_TimeStepper | The time stepper |
[in] | a_amr | AmrMesh core class. |
[in] | a_cellTagger | Cell tagger which flags cell for refinement. |
[in] | a_geoCoarsen | geo_coarsen class which can remove tags along the geometry. |
|
protected |
Get statics about a DisjointBoxLaout. This will compute the number of grid cells and patches both locally and globally.
[out] | a_numLocalCells | Local number of grid cells, excluding ghost cells. |
[out] | a_numLocalCellsGhosts | Local number of grid cells, including ghost cells. |
[out] | a_numLocalBox | Local number of grid patches (over all levels) |
[out] | a_numTotalCells | Total number of grid cells, excluding ghost cells. |
[out] | a_numTotalCellsGhosts | Total number of grid cells, including ghost cells. |
[out] | a_numTotalBox | Total number of grid patches |
[out] | a_numLocalLevelBoxes | Local number of grid boxes (per level) |
[out] | a_numTotalLevelBoxes | Total number of grid boxes (per level) |
[out] | a_numLocalLevelCells | Local number of grid cells (per level) |
[out] | a_numTotalLevelCells | Total number of grid cells (per level) |
[in] | a_finestLevel | Finest AMR level |
[in] | a_grids | Input grids |
|
protected |
Get geometric tags.
This fills m_geomTags with irregular cell tags, using information that was passed into Driver from the input script. This includes adding tags that refine surfaces to a certain depth, or tags where the curvature of the surface exceeds a specified value.
|
protected |
Get number of plot variables.
|
protected |
Parse option for geometry generation.
This sets the geometry-generation load balancing method to either use Chombo or chombo-discharge.
|
protected |
Parse geometrical refinement.
This parses settings for how deep to refine geometries, either based on curvature or a hard limit for electrodes/dielectrics.
|
protected |
Parse irregular tag growth.
This parses m_irregTagGrowth, which is used to grow cut-cell tags.
|
protected |
Parse options.
Called at the beginning of the simulation.
|
protected |
Parse runtime options.
Called every time step.
|
protected |
Do a regrid step.
[in] | a_lmin | Coarsest level that is allowed to change during regrid |
[in] | a_lmax | Finest level that can be generated during the regrid step. |
[in] | a_useInitialData | If true, fill solvers with initial data after making the new grids. |
|
protected |
Regrid internal storage for this class.
[in] | a_oldFinestLevel | Finest level before the regrid |
[in] | a_newFinestLevel | Finest level before the regrid |
void Driver::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.
[in] | a_startTime | Starting time of simulation |
[in] | a_endTime | Simulation end time |
[in] | a_maxSteps | Maximum number of steps. |
|
protected |
Set amr.
[in] | a_amrMesh | AmrMesh |
|
protected |
Set the cell tagger.
[in] | a_cellTagger | Cell tagger |
|
protected |
Set the computational geometry.
[in] | a_computationalGeometry | Computational geometry |
|
protected |
Set the geo coarsener.
[in] | a_geoCoarsen | Coarsener for cut-cell tags. |
|
protected |
Set the time stepper.
[in] | a_timeStepper | Time stepper |
void Driver::setup | ( | const std::string | a_inputFile, |
const int | a_initialRegrids, | ||
const bool | a_restart, | ||
const std::string | a_restartFile | ||
) |
Setup function.
[in] | a_inputFile | Input file containing all tunable simulation parameters. |
[in] | a_initialRegrids | Number of initial regrids to perform |
[in] | a_restart | Do a restart or not |
[in] | a_restartFile | Name of restart file (if restarting from a previous time step) |
void Driver::setupAndRun | ( | const std::string | a_inputFile | ) |
Setup and run simulations.
[in] | a_inputFile | Input file containing parameters for the simulation. |
|
protected |
Set for restart.
Set up for geometry only
|
protected |
Write a crash file.
This writes a regular plot file to /crash
|
protected |
|
protectedvirtualnoexcept |
Write level sets.
[in,out] | a_output | Output data holder |
[in,out] | a_comp | Starting component |
This adds data to a_output where the cell-centered data is the level-set value.
|
protectedvirtualnoexcept |
Write computational loads to output.
[in,out] | a_output | Output data holder |
[in,out] | a_comp | Starting component |
[in] | a_level | AMR level |
This adds data to a_output where the data in each grid patch is the MPI rank.
|
protectedvirtualnoexcept |
Write internal plot data.
[in,out] | a_output | Output data holder |
[in,out] | a_comp | Starting component |
[in] | a_level | AMR level |
This will copy Driver's plot data into a_output, starting on component a_comp.
|
protected |
Write a plot file.
[in] | a_file | File name |
This can write an arbitrary folder. E.g. filename = /crash/abc.hdf5
|
protected |
Write a regrid file.
This writes a regular plot file to /regrid
|
protected |
Write a regrid file.
This writes a regular plot file to /regrid
|
protectedvirtualnoexcept |
Write MPI ranks to output.
[in,out] | a_output | Output data holder |
[in,out] | a_comp | Starting component |
[in] | a_level | AMR level |
This adds data to a_output where the data in each grid patch is the MPI rank.
|
protected |
Write a restart file.
This writes a regular plot file to /restart
|
protectedvirtualnoexcept |
Write cell tags to file.
[in,out] | a_output | Output data holder |
[in,out] | a_comp | Starting component |
[in] | a_level | AMR level |
This will write cell tags data into a_output, starting on component a_comp.
|
protected |
Geometry scan level.
This is a special option for when we use chombo-discharge's geometry generation method.
|
protected |
Special option for when geometric tags are changed during a simulation.
This becomes = true in parseGeometryRefinement every time the geometric refinement criteria changed, and it always becomes false after a regrid.