ImpactX
Loading...
Searching...
No Matches
impactx Namespace Reference

Namespaces

namespace  detail
 
namespace  diagnostics
 
namespace  distribution
 
namespace  elements
 
namespace  envelope
 
namespace  initialization
 
namespace  integrators
 
namespace  particles
 
namespace  transformation
 

Classes

struct  Config
 
struct  CopyAndMarkNegative
 
struct  Envelope
 
class  ImpactX
 
class  ImpactXParticleContainer
 
struct  IntSoA
 
class  ParConstIterSoA
 
class  ParIterSoA
 
struct  ParticleChunk
 
struct  RealSoA
 
struct  RefPart
 

Typedefs

using Map6x6 = amrex::SmallMatrix<amrex::ParticleReal, 6, 6, amrex::Order::F, 1>
 
using CovarianceMatrix = Map6x6
 

Enumerations

enum class  CoordSystem { s , t }
 

Functions

SpaceChargeAlgo get_space_charge_algo ()
 
std::string to_string (SpaceChargeAlgo sca)
 
 AMREX_ENUM (SpaceChargeAlgo, False, True_3D, Gauss3D, True_2D)
 
void read_element (std::string const &element_name, std::list< elements::KnownElements > &m_lattice, int nslice_default, int mapsteps_default)
 
void collect_lost_particles (ImpactXParticleContainer &source)
 
void push (ImpactXParticleContainer &pc, elements::KnownElements &element_variant, int step, int period)
 
void push (RefPart &ref, elements::KnownElements &element_variant)
 
template<typename T_Element>
void push_all (ImpactXParticleContainer &pc, T_Element &element, int step, int period, bool omp_parallel=true)
 
ParticleChunk split_equally (amrex::Long npart, amrex::Long index, amrex::Long size)
 

Typedef Documentation

◆ CovarianceMatrix

this is the 6x6 covariance matrix

◆ Map6x6

using impactx::Map6x6 = amrex::SmallMatrix<amrex::ParticleReal, 6, 6, amrex::Order::F, 1>

this is a 6x6 matrix

Enumeration Type Documentation

◆ CoordSystem

enum class impactx::CoordSystem
strong
Enumerator

fixed s as the independent variable

fixed t as the independent variable

Function Documentation

◆ AMREX_ENUM()

impactx::AMREX_ENUM ( SpaceChargeAlgo ,
False ,
True_3D ,
Gauss3D ,
True_2D  )

Space Charge: Implemented algorithms

◆ collect_lost_particles()

void impactx::collect_lost_particles ( ImpactXParticleContainer & source)

Move lost particles into a separate container

If particles are marked as lost, by setting their id to negative, we will move them to another particle container, store their position when lost and stop pushing them in the beamline.

Parameters
sourcethe beam particle container that might loose particles

◆ get_space_charge_algo()

SpaceChargeAlgo impactx::get_space_charge_algo ( )

Return the currently active space charge algorithm

◆ push() [1/2]

void impactx::push ( ImpactXParticleContainer & pc,
elements::KnownElements & element_variant,
int step,
int period )

Push a whole particle beam (incl. reference particle) through an element

Parameters
[in,out]pccontainer of the particles to push
[in,out]element_varianta single element to push the particles through
[in]stepglobal step for diagnostics
[in]periodfor periodic lattices, this is the current period (turn or cycle)

◆ push() [2/2]

void impactx::push ( RefPart & ref,
elements::KnownElements & element_variant )

Push the reference particle through an element

Parameters
[in,out]refthe reference particle
[in,out]element_varianta single element to push the particles through

◆ push_all()

template<typename T_Element>
void impactx::push_all ( ImpactXParticleContainer & pc,
T_Element & element,
int step,
int period,
bool omp_parallel = true )

Push all particles in a particle container.

This element pushes first the reference particle, then all other particles. All particles are pushed independently with the same logic. Particles are relative to the reference particle.

Parameters
[in,out]pcparticle container to push
[in,out]elementthe beamline element
[in]stepglobal step for diagnostics
[in]periodfor periodic lattices, this is the current period (turn or cycle)
[in]omp_parallelallow threading via OpenMP for the particle iterator loop (note: if OMP backend is active)

◆ read_element()

void impactx::read_element ( std::string const & element_name,
std::list< elements::KnownElements > & m_lattice,
int nslice_default,
int mapsteps_default )

Read a lattice element

Read a lattice element from amrex::ParmParse, initialize it and append it to m_lattice.

Parameters
[in]element_nameelement name
[in,out]m_latticethe accelerator lattice
[in]nslice_default
[in]mapsteps_default

◆ split_equally()

ParticleChunk impactx::split_equally ( amrex::Long npart,
amrex::Long index,
amrex::Long size )

Split an array of contiguous elements into well-balanched chunks.

This function contains the auxiliary math to split npart contiguous particles into contiguous chunks of size, returning the individual starting offset and chunk size. It also deals with distributing remainders well.

This can be used for distributed logic for MPI and OpenMP parallelism alike.

Parameters
nparttotal number of elements/particles
indexmy index in parallelization, e.g., MPI rank or OpenMP thread id
sizethe parallelization space, e.g., MPI size or OpenMP max threads
Returns
offset and size of the chunk for a specific index

◆ to_string()

std::string impactx::to_string ( SpaceChargeAlgo sca)

A user-friendly string

Returns a string that is similar to the spelling in user input options.