ImpactX
|
#include <ImpactX.H>
Public Member Functions | |
ImpactX () | |
ImpactX (ImpactX const &)=delete | |
ImpactX (ImpactX &&)=delete | |
void | operator= (ImpactX const &)=delete |
void | operator= (ImpactX &&)=delete |
void | initGrids () |
void | initBeamDistributionFromInputs () |
void | initLatticeElementsFromInputs () |
void | add_particles (amrex::ParticleReal bunch_charge, distribution::KnownDistributions distr, int npart) |
void | validate () |
bool | early_param_check () |
void | evolve () |
void | init_warning_logger () |
void | ResizeMesh () |
![]() | |
AmrCore () | |
AmrCore (const RealBox *rb, int max_level_in, const Vector< int > &n_cell_in, int coord=-1, Vector< IntVect > ref_ratios=Vector< IntVect >(), const int *is_per=nullptr) | |
AmrCore (const RealBox &rb, int max_level_in, const Vector< int > &n_cell_in, int coord, Vector< IntVect > const &ref_ratios, Array< int, AMREX_SPACEDIM > const &is_per) | |
AmrCore (Geometry const &level_0_geom, AmrInfo const &amr_info) | |
AmrCore (AmrCore &&rhs) noexcept | |
AmrCore & | operator= (AmrCore &&rhs) noexcept |
AmrCore (const AmrCore &rhs)=delete | |
AmrCore & | operator= (const AmrCore &rhs)=delete |
~AmrCore () override | |
void | InitFromScratch (Real time) |
virtual void | regrid (int lbase, Real time, bool initial=false) |
void | printGridSummary (std::ostream &os, int min_lev, int max_lev) const noexcept |
![]() | |
AmrMesh () | |
AmrMesh (const RealBox *rb, int max_level_in, const Vector< int > &n_cell_in, int coord=-1, Vector< IntVect > refrat=Vector< IntVect >(), const int *is_per=nullptr) | |
AmrMesh (const RealBox &rb, int max_level_in, const Vector< int > &n_cell_in, int coord, Vector< IntVect > const &a_refrat, Array< int, AMREX_SPACEDIM > const &is_per) | |
AmrMesh (Geometry const &level_0_geom, AmrInfo const &amr_info) | |
AmrMesh (const AmrMesh &rhs)=delete | |
AmrMesh & | operator= (const AmrMesh &rhs)=delete |
AmrMesh (AmrMesh &&rhs)=default | |
AmrMesh & | operator= (AmrMesh &&rhs)=default |
virtual | ~AmrMesh ()=default |
int | Verbose () const noexcept |
int | maxLevel () const noexcept |
int | finestLevel () const noexcept |
IntVect | refRatio (int lev) const noexcept |
int | MaxRefRatio (int lev) const noexcept |
const Vector< IntVect > & | refRatio () const noexcept |
const Vector< Geometry > & | Geom () const noexcept |
const Vector< DistributionMapping > & | DistributionMap () const noexcept |
const Vector< BoxArray > & | boxArray () const noexcept |
const Geometry & | Geom (int lev) const noexcept |
const DistributionMapping & | DistributionMap (int lev) const noexcept |
const BoxArray & | boxArray (int lev) const noexcept |
Vector< Geometry > | Geom (int a_coarsest_lev, int a_finest_lev) const noexcept |
Vector< BoxArray > | boxArray (int a_coarsest_lev, int a_finest_lev) const noexcept |
Vector< DistributionMapping > | DistributionMap (int a_coarsest_lev, int a_finest_lev) const noexcept |
Vector< Geometry > & | Geom () noexcept |
Geometry & | Geom (int lev) noexcept |
void | SetMaxGridSize (int new_mgs) noexcept |
void | SetMaxGridSize (const IntVect &new_mgs) noexcept |
void | SetMaxGridSize (const Vector< int > &new_mgs) noexcept |
void | SetMaxGridSize (const Vector< IntVect > &new_mgs) noexcept |
void | SetBlockingFactor (int new_bf) noexcept |
void | SetBlockingFactor (const IntVect &new_bf) noexcept |
void | SetBlockingFactor (const Vector< int > &new_bf) noexcept |
void | SetBlockingFactor (const Vector< IntVect > &new_bf) noexcept |
void | SetGridEff (Real eff) noexcept |
void | SetNProper (int n) noexcept |
void | SetFinestLevel (int new_finest_level) noexcept |
void | SetDistributionMap (int lev, const DistributionMapping &dmap_in) noexcept |
void | SetBoxArray (int lev, const BoxArray &ba_in) noexcept |
void | SetGeometry (int lev, const Geometry &geom_in) noexcept |
int | GetLevel (Box const &domain) noexcept |
void | ClearDistributionMap (int lev) noexcept |
void | ClearBoxArray (int lev) noexcept |
int | nErrorBuf (int lev, int direction=0) const noexcept |
const IntVect & | nErrorBufVect (int lev) const noexcept |
Real | gridEff () const noexcept |
int | nProper () const noexcept |
const IntVect & | blockingFactor (int lev) const noexcept |
const IntVect & | maxGridSize (int lev) const noexcept |
bool | LevelDefined (int lev) noexcept |
bool | useFixedCoarseGrids () const noexcept |
int | useFixedUpToLevel () const noexcept |
void | ChopGrids (int lev, BoxArray &ba, int target_size) const |
BoxArray | MakeBaseGrids () const |
void | MakeNewGrids (int lbase, Real time, int &new_finest, Vector< BoxArray > &new_grids) |
void | MakeNewGrids (Real time=0.0) |
virtual void | ManualTagsPlacement (int, TagBoxArray &, const Vector< IntVect > &) |
virtual void | PostProcessBaseGrids (BoxArray &) const |
virtual BoxArray | GetAreaNotToTag (int) |
long | CountCells (int lev) noexcept |
virtual DistributionMapping | MakeDistributionMap (int lev, BoxArray const &ba) |
Public Attributes | |
std::unique_ptr< ImpactXParticleContainer > | m_particle_container |
std::unique_ptr< ImpactXParticleContainer > | m_particles_lost |
std::unordered_map< int, amrex::MultiFab > | m_rho |
std::unordered_map< int, amrex::MultiFab > | m_phi |
std::unordered_map< int, std::unordered_map< std::string, amrex::MultiFab > > | m_space_charge_field |
std::list< KnownElements > | m_lattice |
Private Member Functions | |
void | ErrorEst (int lev, amrex::TagBoxArray &tags, amrex::Real time, int ngrow) override |
Tag cells for refinement. TagBoxArray tags is built on level lev grids. More... | |
void | MakeNewLevelFromScratch (int lev, amrex::Real time, const amrex::BoxArray &ba, const amrex::DistributionMapping &dm) override |
void | MakeNewLevelFromCoarse (int lev, amrex::Real time, const amrex::BoxArray &ba, const amrex::DistributionMapping &dm) override |
Make a new level using provided BoxArray and DistributionMapping and fill. More... | |
void | RemakeLevel (int lev, amrex::Real time, const amrex::BoxArray &ba, const amrex::DistributionMapping &dm) override |
Remake an existing level using provided BoxArray and DistributionMapping. More... | |
void | ClearLevel (int lev) override |
Delete level data. More... | |
impactx::ImpactX::ImpactX | ( | ) |
Construct an ImpactX simulation object
|
delete |
|
delete |
void impactx::ImpactX::add_particles | ( | amrex::ParticleReal | bunch_charge, |
distribution::KnownDistributions | distr, | ||
int | npart | ||
) |
Generate and add n particles to the particle container
Will also resize the geometry based on the updated particle distribution's extent and then redistribute particles in according AMReX grid boxes.
bunch_charge | bunch charge (C) |
distr | distribution function to draw from (object) |
npart | number of particles to draw |
|
overrideprivatevirtual |
bool impactx::ImpactX::early_param_check | ( | ) |
Check inputs for unused parameters (e.g. typos) after step 1
|
overrideprivate |
Tag cells for refinement. TagBoxArray tags is built on level lev grids.
Tag cells for refinement. TagBoxArray tags is built on level lev grids.
void impactx::ImpactX::evolve | ( | ) |
Run the main simulation loop for a number of steps
void impactx::ImpactX::init_warning_logger | ( | ) |
Query input for warning logger variables and set up warning logger accordingly
Input variables are: always_warn_immediately
and abort_on_warning_threshold
.
void impactx::ImpactX::initBeamDistributionFromInputs | ( | ) |
Initialize the particle beam distribution
This clears and initialized the particle beam from input file and command-line options, as parsed by amrex::ParmParse.
void impactx::ImpactX::initGrids | ( | ) |
Initialize AMReX blocks/grids for domain decomposition & space charge mesh.
This must come first, before particle beams and lattice elements are initialized.
void impactx::ImpactX::initLatticeElementsFromInputs | ( | ) |
Initialize the list of lattice elements
This clears and initialized the accelerator lattice elements from input file and command-line options, as parsed by amrex::ParmParse.
|
overrideprivate |
Make a new level using provided BoxArray and DistributionMapping and fill.
Make a new level using provided BoxArray and DistributionMapping and fill with interpolated coarse level data.
|
overrideprivate |
Make a new level from scratch using provided BoxArray and DistributionMapping. Only used during initialization.
|
delete |
|
delete |
|
overrideprivate |
Remake an existing level using provided BoxArray and DistributionMapping.
Remake an existing level using provided BoxArray and DistributionMapping and fill with existing fine and coarse data.
void impactx::ImpactX::ResizeMesh | ( | ) |
Resize the mesh, based on the extent of the bunch of particle
This only changes the physical extent of the mesh, but not the number of grid cells.
void impactx::ImpactX::validate | ( | ) |
Validate the simulation is ready to run via
std::list<KnownElements> impactx::ImpactX::m_lattice |
these are elements defining the accelerator lattice
std::unique_ptr<ImpactXParticleContainer> impactx::ImpactX::m_particle_container |
these are the physical/beam particles of the simulation
std::unique_ptr<ImpactXParticleContainer> impactx::ImpactX::m_particles_lost |
former beam particles that got lost in apertures, the wall, etc.
std::unordered_map<int, amrex::MultiFab> impactx::ImpactX::m_phi |
scalar potential per level
std::unordered_map<int, amrex::MultiFab> impactx::ImpactX::m_rho |
charge density per level
std::unordered_map<int, std::unordered_map<std::string, amrex::MultiFab> > impactx::ImpactX::m_space_charge_field |
space charge field (vector) per level