|
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_amrMesh, const RefCountedPtr< CellTagger > &a_cellTagger=RefCountedPtr< CellTagger >(nullptr)) | |
| Full constructor. | |
| virtual | ~Driver () |
| Destructor (does nothing) | |
| void | setupAndRun () |
| Setup and run simulations. | |
Protected Member Functions | |
| 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. | |
| void | setup (const std::string &a_inputFile, const int a_initialRegrids, const bool a_restart, const std::string &a_restartFile) |
| Setup function. | |
| void | setAmr (const RefCountedPtr< AmrMesh > &a_amrMesh) |
| Set amr. | |
| void | sanityCheck () |
| Sanity check. | |
| void | parseOptions () |
| Parse options. | |
| void | parseRuntimeOptions () |
| Parse runtime options. | |
| void | parseGeometryRefinement () |
| Parse geometrical refinement. | |
| void | parsePlotVariables () |
| Parse plot variables. | |
| void | parseGeometryGeneration () |
| Parse option for geometry generation. | |
| void | parseIrregTagGrowth () |
| Parse irregular tag growth. | |
| void | createOutputDirectories () |
| Create output directories. | |
| void | allocateInternals () |
| Allocate internal storage for Driver. | |
| void | cacheTags (const EBAMRTags &a_tags) |
| Cache tags for use after regrid. | |
| void | writeEBIS () |
| Write the geometry to file. | |
| void | getGeometryTags () |
| Get geometric tags. | |
| 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 statistics about a DisjointBoxLaout. This will compute the number of grid cells and patches both locally and globally. | |
| void | gridReport () |
| Print regrid report. | |
| void | regrid (const int a_lmin, const int a_lmax, const bool a_useInitialData) |
| Do a regrid step. | |
| void | regridInternals (const int a_oldFinestLevel, const int a_newFinestLevel) |
| Regrid internal storage for this class. | |
| void | setComputationalGeometry (const RefCountedPtr< ComputationalGeometry > &a_computationalGeometry) |
| Set the computational geometry. | |
| void | setTimeStepper (const RefCountedPtr< TimeStepper > &a_timeStepper) |
| Set the time stepper. | |
| void | setCellTagger (const RefCountedPtr< CellTagger > &a_cellTagger) |
| Set the cell tagger. | |
| void | setupFresh (const int a_initialRegrids) |
| Setup function for fresh (non-restart) simulations. | |
| void | setupGeometryOnly () |
| Set for restart. | |
| void | checkRestartFile (const std::string &a_restartFile) const |
| Check if restart file exists and abort if not found. | |
| void | stepReport (const Real a_startTime, const Real a_endTime, const int a_maxSteps) |
| Write a time step report to stdout. | |
| void | writePlotFile (const std::string &a_filename) |
| Write a plot file to the specified path. | |
| void | writePlotFile () |
| Write a plot file. This writes to plt/. | |
| void | writePreRegridFile () |
| Write a regrid file. | |
| void | writePostRegridFile () |
| Write a regrid file. | |
| void | writeRestartFile () |
| Write a restart file. | |
| void | writeCrashFile () |
| Write a crash file. | |
| void | writeMemoryUsage () |
| Write the memory usage to file. | |
| void | writeComputationalLoads () |
| Write computational loads. | |
| void | writeCheckpointFile () |
| Write a checkpoint file. | |
| void | writeGeometry () |
| Write the geometry to file. | |
| bool | tagCells (Vector< IntVectSet > &a_allTags, EBAMRTags &a_cellTags) |
| Tag cells for refinement. Computes cell tags and global tags (union of cell tags with geometric tags). | |
| int | getNumberOfPlotVariables () const |
| Get number of plot variables. | |
| 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. | |
| virtual void | writeTags (LevelData< EBCellFAB > &a_output, int &a_comp, const int a_level) const noexcept |
| Write cell tags to file. | |
| virtual void | writeRanks (LevelData< EBCellFAB > &a_output, int &a_comp, const int a_level) const noexcept |
| Write MPI ranks to output. | |
| virtual void | writeLevelset (LevelData< EBCellFAB > &a_output, int &a_comp, const int a_level) const noexcept |
| Write level sets. | |
| virtual void | writeLoads (LevelData< EBCellFAB > &a_output, int &a_comp, const int a_level) const noexcept |
| Write computational loads to output. | |
| int | getFinestTagLevel (const EBAMRTags &a_cellTags) const |
| Return the finest AMR level that contains any cell tags. | |
| 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. | |
| 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. | |
| 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 |
| Capacitance of the geometry (used for electrical energy calculations). | |
| 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. | |
| 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_amrMesh, | ||
| const RefCountedPtr< CellTagger > & | a_cellTagger = RefCountedPtr<CellTagger>(nullptr) |
||
| ) |
Full constructor.
| [in] | a_computationalGeometry | Computational geometry. |
| [in] | a_timeStepper | The time stepper |
| [in] | a_amrMesh | AmrMesh core class. |
| [in] | a_cellTagger | Cell tagger which flags cell for refinement. |
Cache tags for use after regrid.
| [in] | a_tags | Tags to cache. |
|
protected |
Check if restart file exists and abort if not found.
| [in] | a_restartFile | Path to the restart file. |
|
protected |
Get statistics 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_numLocalBoxes | 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_numTotalBoxes | 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 |
Return the finest AMR level that contains any cell tags.
| [in] | a_cellTags | Cell tags on all AMR levels. |
|
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 |
Get the string identifiers for the internal plot variables from Driver.
|
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.
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. |
Regrid internal storage for this class.
| [in] | a_oldFinestLevel | Finest level before the regrid |
| [in] | a_newFinestLevel | Finest level before the regrid |
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 time stepper.
| [in] | a_timeStepper | Time stepper |
|
protected |
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) |
Setup function for fresh (non-restart) simulations.
| [in] | a_initialRegrids | Number of initial regrids to perform during setup. |
|
protected |
Set for restart.
Set up for geometry only
|
protected |
Write a time step report to stdout.
| [in] | a_startTime | Simulation start time. |
| [in] | a_endTime | Simulation end time. |
| [in] | a_maxSteps | Maximum number of time steps. |
|
protected |
Tag cells for refinement. Computes cell tags and global tags (union of cell tags with geometric tags).
| [out] | a_allTags | Global tags (cell + geometric). |
| [out] | a_cellTags | Tags from cell tagger only. |
|
protected |
Write a crash file.
This writes a regular plot file to /crash
|
protectedvirtualnoexcept |
Write level sets.
| [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 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 to the specified path.
| [in] | a_filename | File name including path. E.g. /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.