|
chombo-discharge
|
Implementation of TimeStepper for solving electrostatic problems. The template parameter is the FieldSolver implementation type. More...
#include <CD_FieldStepper.H>


Public Member Functions | |
| FieldStepper () | |
| Constructor – parses some input options. | |
| virtual | ~FieldStepper () |
| Destructor (does nothing) | |
| void | setupSolvers () override |
| Solver setup routine. This instantiates the FieldSolver and parses input options. | |
| void | initialData () override |
| Set initial data – this sets the space and surface charges. | |
| void | postInitialize () override |
| Post-initialization routine. This solves the Poisson equation. | |
| void | allocate () override |
| Allocation method – allocates memory and internal data for solvers. | |
| MFAMRCellData & | getPotential () |
| Get the potential. | |
| void | postCheckpointSetup () override |
| Post-initialize operations to be performed – does nothing. | |
| int | getNumberOfPlotVariables () const override |
| Get number of plot variables. | |
| Vector< std::string > | getPlotVariableNames () const override |
| Get plot variable names. | |
| void | writePlotData (LevelData< EBCellFAB > &a_output, int &a_icomp, const std::string a_outputRealm, const int a_level) const override |
| Write plot data to file. | |
| Real | computeDt () override |
| Compute time step. | |
| Real | advance (const Real a_dt) override |
| Perform a single time step with step a_dt. | |
| void | synchronizeSolverTimes (const int a_step, const Real a_time, const Real a_dt) override |
| Synchronzie solver times and time steps. | |
| void | printStepReport () override |
| Print step report – this does nothing. | |
| void | registerRealms () override |
| Register simulation realms to be used for this simulation module. | |
| void | registerOperators () override |
| Register operators for this simulation module. | |
| void | preRegrid (const int a_lbase, const int a_finestLevel) override |
| Perform pre-regrid operations. | |
| bool | loadBalanceThisRealm (const std::string a_realm) const override |
| Load balancing query for a specified realm. If this returns true for a_realm, load balancing routines will be called during regrids. | |
| void | loadBalanceBoxes (Vector< Vector< int > > &a_procs, Vector< Vector< Box > > &a_boxes, const std::string a_realm, const Vector< DisjointBoxLayout > &a_grids, const int a_lmin, const int a_finestLevel) override |
| Load balance grid boxes for a specified realm. | |
| void | regrid (const int a_lmin, const int a_oldFinestLevel, const int a_newFinestLevel) override |
| Regrid method – regrids the potential distribution in FieldSolver (but does not solve the Poisson equation, that is done in postRegrid()). | |
| void | postRegrid () override |
| Perform post-regrid operations – this will resolve the Poisson equation. | |
| void | setRho (const std::function< Real(const RealVect &a_pos)> &a_rho, const phase::which_phase a_phase) noexcept |
| Set space charge. | |
| void | setSigma (const std::function< Real(const RealVect &a_pos)> &a_sigma) noexcept |
| Set surface charge. | |
Public Member Functions inherited from TimeStepper | |
| TimeStepper () | |
| Default constructor (does nothing) | |
| virtual | ~TimeStepper () |
| Default destructor (does nothing) | |
| void | setAmr (const RefCountedPtr< AmrMesh > &a_amr) |
| Set AmrMesh. | |
| void | setComputationalGeometry (const RefCountedPtr< ComputationalGeometry > &a_computationalGeometry) |
| Set the computational geometry. | |
| virtual void | parseRuntimeOptions () |
| Parse runtime options. | |
| virtual void | prePlot () |
| An option for calling special functions prior to plotting data. Called by Driver in the IMMEDIATELY before writing the plot file. | |
| virtual void | postPlot () |
| An option for calling special functions prior to plotting data. Called by Driver in the IMMEDIATELY after writing the plot file. | |
| virtual Vector< long int > | getCheckpointLoads (const std::string a_realm, const int a_level) const |
| Get computational loads to be checkpointed. | |
| virtual bool | needToRegrid () |
| Fuction which can have Driver do regrids at arbitrary points in the simulation. | |
Protected Member Functions | |
| void | solvePoisson () |
| Internal routine for solving the Poisson equation. | |
Protected Attributes | |
| bool | m_loadBalance |
| If true, the simulation will be introspectively load balanced. | |
| BoxSorting | m_boxSort |
| If using load balancing, this specifies how boxes will be sorted (in space) before load balancing. | |
| RefCountedPtr< FieldSolver > | m_fieldSolver |
| Reference to the FieldSolver. | |
| RefCountedPtr< SurfaceODESolver< 1 > > | m_sigma |
| Reference to the surface charge solver. | |
| std::string | m_realm |
| Realm where the solver lives. | |
| std::function< Real(const RealVect &a_pos)> | m_rhoGas |
| Space charge inside gas phase. | |
| std::function< Real(const RealVect &a_pos)> | m_rhoDielectric |
| Space charge inside dielectric. | |
| std::function< Real(const RealVect &a_pos)> | m_surfaceChargeDensity |
| Surface charge distribution. | |
Protected Attributes inherited from TimeStepper | |
| int | m_verbosity |
| Class verbosity. | |
| int | m_timeStep |
| Time step. | |
| Real | m_time |
| TIme. | |
| Real | m_dt |
| Previous time step size. | |
| RefCountedPtr< AmrMesh > | m_amr |
| AmrMesh. | |
| RefCountedPtr< ComputationalGeometry > | m_computationalGeometry |
| Computational geometry. | |
Implementation of TimeStepper for solving electrostatic problems. The template parameter is the FieldSolver implementation type.
This is just a one-step method – it currently does not feature adaptive mesh refinement but uses the static grid set up by Driver. If the user wants to add mesh refinement he/she can add a CellTagger which flags cells for refinement.
The voltage on electrodes/domain faces is set to one. If the user wants to set a different voltage he will need to fetch the FieldSolver from the FieldStepper and call FieldStepper::setVoltage(...).
The initial space charge is set to a Gaussian blob, specified in the input script. The initial surface charge is set to a constant value specified in the input script.
|
overridevirtual |
Perform a single time step with step a_dt.
| [in] | a_dt | Time step |
Implements TimeStepper.
|
overridevirtual |
Allocation method – allocates memory and internal data for solvers.
Implements TimeStepper.
|
inlineoverridevirtual |
|
overridevirtual |
|
overridevirtual |
Get plot variable names.
Implements TimeStepper.
|
overridevirtual |
Set initial data – this sets the space and surface charges.
Implements TimeStepper.
|
overridevirtual |
Load balance grid boxes for a specified realm.
| [out] | a_procs | MPI ranks owning the various grid boxes. |
| [out] | a_boxes | Grid boxes on every level (obtain them with a_grids[lvl].boxArray()) |
| [in] | a_realm | Realm identifier |
| [in] | a_grids | Original grids |
| [in] | a_lmin | Coarsest grid level that changed |
| [in] | a_finestLevel | New finest grid level |
This is only called by Driver if TimeStepper::loadBalanceThisRealm(a_realm) returned true. The default implementation uses volume-based loads for the grid patches. If the user wants to load balance boxes on a realm, this routine must be overwritten and he should compute loads for the various patches in a_grids and call LoadBalancing::makeBalance on each level. It is up to the user/programmer to decide if load balancing should be done independently on each level, or if loads per MPI rank are accumulated across levels.
Reimplemented from TimeStepper.
|
overridevirtual |
Load balancing query for a specified realm. If this returns true for a_realm, load balancing routines will be called during regrids.
| [in] | a_realm | Realm name |
Reimplemented from TimeStepper.
|
inlineoverridevirtual |
Post-initialize operations to be performed – does nothing.
Implements TimeStepper.
|
overridevirtual |
Post-initialization routine. This solves the Poisson equation.
Implements TimeStepper.
|
overridevirtual |
Perform post-regrid operations – this will resolve the Poisson equation.
This includes all operations to be done AFTER interpolating data to new grids.
Implements TimeStepper.
|
overridevirtual |
Perform pre-regrid operations.
| [in] | a_lmin | The coarsest level that changes |
| [in] | a_oldFinestLevel | The finest level before the regrid. |
Implements TimeStepper.
|
inlineoverridevirtual |
Print step report – this does nothing.
Implements TimeStepper.
|
overridevirtual |
Register operators for this simulation module.
Implements TimeStepper.
|
overridevirtual |
Register simulation realms to be used for this simulation module.
Implements TimeStepper.
|
overridevirtual |
Regrid method – regrids the potential distribution in FieldSolver (but does not solve the Poisson equation, that is done in postRegrid()).
| [in] | a_lmin | The coarsest level that changed. |
| [in] | a_oldFinestLevel | The finest level before the regrid. |
| [in] | a_newFinestLevel | The finest level after the regrid. |
Implements TimeStepper.
|
noexcept |
Set space charge.
| [in] | a_rho | Space charge distribution |
|
noexcept |
Set surface charge.
| [in] | a_sigma | Surface charge distribution |
|
overridevirtual |
Solver setup routine. This instantiates the FieldSolver and parses input options.
Implements TimeStepper.
|
overridevirtual |
Synchronzie solver times and time steps.
| [in] | a_step | Time step |
| [in] | a_time | Time (in seconds) |
| [in] | a_dt | Time step that was used. |
Implements TimeStepper.
|
overridevirtual |
Write plot data to file.
| [in,out] | a_output | Output data holder. |
| [in,out] | a_icomp | Starting component in a_output to begin at. |
| {in] | a_outputRealm Realm where a_output belongs | |
| [in] | a_level | Grid level |
Implements TimeStepper.