13#ifndef CD_BROWNIANWALKERSTEPPER_H
14#define CD_BROWNIANWALKERSTEPPER_H
20#include <CD_NamespaceHeader.H>
23namespace BrownianWalker {
123 Vector<Vector<Box>>& a_boxes,
124 const std::string& a_realm,
125 const Vector<DisjointBoxLayout>& a_grids,
127 const int a_finestLevel)
override;
136 writeCheckpointData(HDF5Handle& a_handle,
const int a_lvl)
const override;
146 readCheckpointData(HDF5Handle& a_handle,
const int a_lvl)
override;
180 const std::string& a_outputRealm,
181 const int a_level)
const override;
251 preRegrid(
const int a_lbase,
const int a_oldFinestLevel)
override;
267 advance(
const Real a_dt)
override;
276 regrid(
const int a_lmin,
const int a_oldFinestLevel,
const int a_newFinestLevel)
override;
432 Vector<Vector<Box>>& a_boxes,
433 const std::string& a_realm,
434 const Vector<DisjointBoxLayout>& a_grids,
436 const int a_finestLevel);
451 Vector<Vector<Box>>& a_boxes,
452 const std::string& a_realm,
453 const Vector<DisjointBoxLayout>& a_grids,
455 const int a_finestLevel);
460#include <CD_NamespaceFooter.H>
Declaration of a class that holds a set of ItoSolvers.
Declaration of solver class for Ito diffusion.
Declaration of main (abstract) time stepper class.
TimeStepper implementation for advancing Brownian walker particles.
Definition CD_BrownianWalkerStepper.H:40
phase::which_phase m_phase
Computational phase on which the particles live.
Definition CD_BrownianWalkerStepper.H:307
void preRegrid(const int a_lbase, const int a_oldFinestLevel) override
Pre-regrid hook. Deposits particle counts onto the mesh and puts the solver in pre-regrid mode.
Definition CD_BrownianWalkerStepper.cpp:461
bool needToRegrid() override
Always returns false; regridding is triggered externally by Driver.
Definition CD_BrownianWalkerStepper.cpp:450
Real m_diffCo
Spatially uniform diffusion coefficient for all particles.
Definition CD_BrownianWalkerStepper.H:332
std::string m_className
Input-script prefix this stepper reads its options under.
Definition CD_BrownianWalkerStepper.H:349
void setupSolvers() override
Instantiate the species and configure the solver with realm, phase, and AMR data.
Definition CD_BrownianWalkerStepper.cpp:497
LoadBalancingMethod m_whichLoadBalance
Selected load balancing strategy.
Definition CD_BrownianWalkerStepper.H:297
EBAMRCellData m_regridPPC
Temporary storage for the number of particles per cell, used during load balancing.
Definition CD_BrownianWalkerStepper.H:327
bool m_verifyConservation
If true, verify that the superparticle merge conserves the total particle weight.
Definition CD_BrownianWalkerStepper.H:372
int getNumberOfPlotVariables() const override
Return the number of output variables contributed by this stepper.
Definition CD_BrownianWalkerStepper.cpp:310
BrownianWalkerStepper()
Default constructor. Parses all options from the BrownianWalker ParmParse block.
Definition CD_BrownianWalkerStepper.cpp:29
RefCountedPtr< ItoSolver > m_solver
The Ito solver used to advance the particle system.
Definition CD_BrownianWalkerStepper.H:317
Real m_cfl
CFL-like scaling factor applied to the solver's intrinsic time step estimate.
Definition CD_BrownianWalkerStepper.H:377
Real advance(const Real a_dt) override
Advance the particle system by one Euler-Maruyama step.
Definition CD_BrownianWalkerStepper.cpp:547
std::string m_realm
Name of the realm on which the particles live.
Definition CD_BrownianWalkerStepper.H:302
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 patches for the specified realm.
Definition CD_BrownianWalkerStepper.cpp:227
bool m_loadBalance
If true, the application performs particle-based load balancing at each regrid.
Definition CD_BrownianWalkerStepper.H:312
LoadBalancingMethod
Supported load balancing strategies.
Definition CD_BrownianWalkerStepper.H:289
@ Mesh
Estimate particle counts from mesh-deposited data (fast).
Definition CD_BrownianWalkerStepper.H:290
@ Particle
Count particles directly by remapping to the new grids (accurate).
Definition CD_BrownianWalkerStepper.H:291
void makeSuperParticles()
Merge to ItoSolver.particles_per_cell, checking weight conservation if asked.
Definition CD_BrownianWalkerStepper.cpp:706
void printStepReport() override
Print a step report showing the local and global particle counts.
Definition CD_BrownianWalkerStepper.cpp:379
void parseRuntimeOptions() override
Parse runtime options from ParmParse. Re-reads verbosity, ppc, CFL, and load balancing flag.
Definition CD_BrownianWalkerStepper.cpp:99
void setDiffusion()
Set the mesh diffusion function on the solver.
Definition CD_BrownianWalkerStepper.cpp:161
void synchronizeSolverTimes(const int a_step, const Real a_time, const Real a_dt) override
Update internal time/step counters and forward them to the solver.
Definition CD_BrownianWalkerStepper.cpp:362
void regrid(const int a_lmin, const int a_oldFinestLevel, const int a_newFinestLevel) override
Regrid the solver onto the new mesh and remake superparticles.
Definition CD_BrownianWalkerStepper.cpp:671
void writePlotData(LevelData< EBCellFAB > &a_output, int &a_icomp, const std::string &a_outputRealm, const int a_level) const override
Write plot data into the output holder.
Definition CD_BrownianWalkerStepper.cpp:334
RealVect m_velocity
The advective field used when m_constantVelocity is true.
Definition CD_BrownianWalkerStepper.H:363
void postCheckpointSetup() override
Post-checkpoint setup. Remaps particles, makes superparticles, and restores advection and diffusion f...
Definition CD_BrownianWalkerStepper.cpp:287
void registerRealms() override
Register the realm(s) used in the simulation.
Definition CD_BrownianWalkerStepper.cpp:516
void postRegrid() override
Post-regrid hook. Clears temporary mesh storage and restores flow fields.
Definition CD_BrownianWalkerStepper.cpp:685
Real m_omega
Angular velocity of the solid-body rotation advection field.
Definition CD_BrownianWalkerStepper.H:342
void allocate() override
Allocate internal storage in the solver.
Definition CD_BrownianWalkerStepper.cpp:538
Vector< std::string > getPlotVariableNames() const override
Return the names of the output variables contributed by this stepper.
Definition CD_BrownianWalkerStepper.cpp:323
Vector< long int > getCheckpointLoads(const std::string &a_realm, const int a_level) const override
Return per-patch computational loads for checkpointing and plotting.
Definition CD_BrownianWalkerStepper.cpp:1004
RefCountedPtr< ItoSpecies > m_species
Species definition passed to the Ito solver.
Definition CD_BrownianWalkerStepper.H:322
bool m_constantVelocity
If true, the advective field is spatially constant rather than rotational.
Definition CD_BrownianWalkerStepper.H:357
void loadBalanceBoxesParticles(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)
Load balance by directly remapping particles to the new grids and counting them.
Definition CD_BrownianWalkerStepper.cpp:911
virtual ~BrownianWalkerStepper()
Destructor.
Definition CD_BrownianWalkerStepper.cpp:93
void plotParticles() const noexcept
Write the solver's bulk particles to an H5Part file, one per plot step.
Definition CD_BrownianWalkerStepper.cpp:405
void postInitialize() override
Post-initialization hook. No operations are performed.
Definition CD_BrownianWalkerStepper.cpp:135
bool loadBalanceThisRealm(const std::string &a_realm) const override
Return whether the given realm should be load balanced by this stepper.
Definition CD_BrownianWalkerStepper.cpp:216
void postPlot() override
Perform post-plot operations. Writes the particles if asked to.
Definition CD_BrownianWalkerStepper.cpp:394
void initialData() override
Fill the solver with initial particles, make superparticles, and set flow fields.
Definition CD_BrownianWalkerStepper.cpp:113
void loadBalanceBoxesMesh(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)
Load balance using particle counts estimated from mesh-deposited data.
Definition CD_BrownianWalkerStepper.cpp:764
Real m_mobility
Spatially uniform particle mobility.
Definition CD_BrownianWalkerStepper.H:337
Real computeTotalWeight()
Compute the global total weight of the bulk particles.
Definition CD_BrownianWalkerStepper.cpp:736
void setVelocity()
Compute and assign the solid-body rotation velocity field to the solver.
Definition CD_BrownianWalkerStepper.cpp:178
Real computeDt() override
Compute the next time step as m_cfl * ItoSolver::computeDt().
Definition CD_BrownianWalkerStepper.cpp:351
void setAdvectionDiffusion()
Set the velocity and diffusion fields on the mesh if the solver is mobile/diffusive.
Definition CD_BrownianWalkerStepper.cpp:144
void registerOperators() override
Register the operators required by the solver.
Definition CD_BrownianWalkerStepper.cpp:527
Base class for advancing equations.
Definition CD_TimeStepper.H:32
Namespace containing physics models for use with chombo-discharge.
Definition CD_AdvectionDiffusion.H:16
which_phase
Enumeration of supported phases.
Definition CD_MultiFluidIndexSpace.H:38