ImpactX
Loading...
Searching...
No Matches
impactx::ImpactX Class Reference

#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)
 
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 ()
 

Public Attributes

std::unique_ptr< initialization::AmrCoreDataamr_data
 
std::list< elements::KnownElementsm_lattice
 

Private Attributes

bool m_grids_initialized = false
 

Detailed Description

An ImpactX simulation

This is the central ImpactX simulation class

Constructor & Destructor Documentation

◆ ImpactX() [1/3]

impactx::ImpactX::ImpactX ( )

Construct an ImpactX simulation object

◆ ImpactX() [2/3]

impactx::ImpactX::ImpactX ( ImpactX const & )
delete

◆ ImpactX() [3/3]

impactx::ImpactX::ImpactX ( ImpactX && )
delete

◆ ~ImpactX()

impactx::ImpactX::~ImpactX ( )

Destruct the ImpactX simulation object

Member Function Documentation

◆ add_particles()

void impactx::ImpactX::add_particles ( amrex::ParticleReal bunch_charge,
distribution::KnownDistributions distr,
amrex::Long 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.

Parameters
bunch_chargebunch charge (C)
distrdistribution function to draw from (object)
npartnumber of particles to draw

◆ early_param_check()

bool impactx::ImpactX::early_param_check ( )

Check inputs for unused parameters (e.g. typos) after step 1

Returns
true if successful

◆ evolve()

void impactx::ImpactX::evolve ( )

Run the main simulation loop

◆ finalize()

void impactx::ImpactX::finalize ( )

Deallocate all contexts and data

◆ finalize_elements()

void impactx::ImpactX::finalize_elements ( )

Finalize elements

◆ init_grids()

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.

◆ init_warning_logger()

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.

◆ initBeamDistributionFromInputs()

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.

◆ initialized()

bool impactx::ImpactX::initialized ( )
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.

◆ initLatticeElementsFromInputs()

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.

◆ operator=() [1/2]

void impactx::ImpactX::operator= ( ImpactX && )
delete

◆ operator=() [2/2]

void impactx::ImpactX::operator= ( ImpactX const & )
delete

◆ ResizeMesh()

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.

◆ track_envelope()

void impactx::ImpactX::track_envelope ( )

Run the envelope tracking simulation loop

Modeled as linear transport of the covariance matrix.

◆ track_particles()

void impactx::ImpactX::track_particles ( )

Run the particle tracking simulation loop

◆ track_reference()

void impactx::ImpactX::track_reference ( RefPart & ref)

Run the reference orbit tracking simulation loop

◆ validate()

void impactx::ImpactX::validate ( )

Validate the simulation is ready to run the particle tracking loop via

See also
track_particles

Member Data Documentation

◆ amr_data

std::unique_ptr<initialization::AmrCoreData> impactx::ImpactX::amr_data

The AMReX core object that contains AMR hierarchy,

See also
amrex::AmrCore

Inside here, we store our particle containers and space charge fields.

◆ m_grids_initialized

bool impactx::ImpactX::m_grids_initialized = false
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.

◆ m_lattice

std::list<elements::KnownElements> impactx::ImpactX::m_lattice

these are elements defining the accelerator lattice


The documentation for this class was generated from the following files: