|
ImpactX
|
#include <ImpactX.H>
Public Member Functions | |
| ImpactX () | |
| ImpactX (ImpactX const &)=delete | |
| ImpactX (ImpactX &&)=delete | |
| void | operator= (ImpactX const &)=delete |
| void | operator= (ImpactX &&)=delete |
| ~ImpactX () | |
| void | finalize () |
| void | finalize_elements () |
| void | init_grids () |
| void | initBeamDistributionFromInputs () |
| void | initLatticeElementsFromInputs () |
| void | add_particles (amrex::ParticleReal bunch_charge, distribution::KnownDistributions distr, amrex::Long npart, std::optional< distribution::SpinvMF > spin_distr=std::nullopt) |
| void | validate () |
| bool | early_param_check () |
| void | evolve () |
| void | track_particles () |
| void | track_envelope () |
| void | track_reference (RefPart &ref) |
| void | init_warning_logger () |
| void | ResizeMesh () |
| bool | initialized () |
| void | call_hook (std::string const &name) |
Public Attributes | |
| std::unique_ptr< initialization::AmrCoreData > | amr_data |
| std::list< elements::KnownElements > | m_lattice |
| std::unordered_map< std::string, std::function< void(ImpactX *)> > | m_hook |
| TrackingState | m_tracking_state |
| hooks that users can call | |
Private Attributes | |
| bool | m_grids_initialized = false |
| impactx::ImpactX::ImpactX | ( | ) |
Construct an ImpactX simulation object
|
delete |
|
delete |
| impactx::ImpactX::~ImpactX | ( | ) |
Destruct the ImpactX simulation object
| void impactx::ImpactX::add_particles | ( | amrex::ParticleReal | bunch_charge, |
| distribution::KnownDistributions | distr, | ||
| amrex::Long | npart, | ||
| std::optional< distribution::SpinvMF > | spin_distr = std::nullopt ) |
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 |
| spin_distr | optional spin distribution |
| void impactx::ImpactX::call_hook | ( | std::string const & | name | ) |
| bool impactx::ImpactX::early_param_check | ( | ) |
Check inputs for unused parameters (e.g. typos) after step 1
| void impactx::ImpactX::evolve | ( | ) |
Run the main simulation loop
| void impactx::ImpactX::finalize | ( | ) |
Deallocate all contexts and data
| void impactx::ImpactX::finalize_elements | ( | ) |
Finalize elements
| void impactx::ImpactX::init_grids | ( | ) |
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::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.
|
inline |
Was init_grids already called?
Some operations, like resizing a simulation in terms of cells and changing blocking factors are not possible after they were initialized in AMReX. This keeps track of this.
| 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.
|
delete |
|
delete |
| 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::track_envelope | ( | ) |
Run the envelope tracking simulation loop
Modeled as linear transport of the covariance matrix.
| void impactx::ImpactX::track_particles | ( | ) |
Run the particle tracking simulation loop
| void impactx::ImpactX::track_reference | ( | RefPart & | ref | ) |
Run the reference orbit tracking simulation loop
| void impactx::ImpactX::validate | ( | ) |
Validate the simulation is ready to run the particle tracking loop via
| std::unique_ptr<initialization::AmrCoreData> impactx::ImpactX::amr_data |
The AMReX core object that contains AMR hierarchy,
Inside here, we store our particle containers and space charge fields.
|
private |
Keeps track if init_grids was called.
Some operations, like resizing a simulation in terms of cells and changing blocking factors are not possible after they were initialized in AMReX. This keeps track of this.
| std::unordered_map< std::string, std::function<void(ImpactX *)> > impactx::ImpactX::m_hook |
| std::list<elements::KnownElements> impactx::ImpactX::m_lattice |
these are elements defining the accelerator lattice
| TrackingState impactx::ImpactX::m_tracking_state |
hooks that users can call
A few states during tracking loops, useful to know in hooks (Python callback functions).