ImpactX
Functions
impactx::spacecharge Namespace Reference

Functions

void ForceFromSelfFields (std::unordered_map< int, std::unordered_map< std::string, amrex::MultiFab > > &space_charge_field, std::unordered_map< int, amrex::MultiFab > const &phi, amrex::Vector< amrex::Geometry > const &geom)
 
void GatherAndPush (ImpactXParticleContainer &pc, std::unordered_map< int, std::unordered_map< std::string, amrex::MultiFab > > const &space_charge_field, const amrex::Vector< amrex::Geometry > &geom, amrex::ParticleReal const slice_ds)
 
void PoissonSolve (ImpactXParticleContainer const &pc, std::unordered_map< int, amrex::MultiFab > &rho, std::unordered_map< int, amrex::MultiFab > &phi)
 

Function Documentation

◆ ForceFromSelfFields()

void impactx::spacecharge::ForceFromSelfFields ( std::unordered_map< int, std::unordered_map< std::string, amrex::MultiFab > > &  space_charge_field,
std::unordered_map< int, amrex::MultiFab > const &  phi,
const amrex::Vector< amrex::Geometry > &  geom 
)

Calculate the space charge force field from the electric potential

This resets the values in scf_<component> to zero and then calculates the space charge force field.

Parameters
[in,out]space_charge_fieldspace charge force component in x,y,z per level
[in]phiscalar potential per level
[in]geomgeometry object

◆ GatherAndPush()

void impactx::spacecharge::GatherAndPush ( ImpactXParticleContainer pc,
std::unordered_map< int, std::unordered_map< std::string, amrex::MultiFab > > const &  space_charge_field,
const amrex::Vector< amrex::Geometry > &  geom,
amrex::ParticleReal const  slice_ds 
)

Gather force fields and push particles in x,y,z

This gathers the space charge field with respect to particle position and shape. The momentum of all particles is then pushed using a common time step given by the reference particle speed and ds slice. The position push is done in the lattice elements and not here.

Parameters
[in,out]pccontainer of the particles that deposited rho
[in]space_charge_fieldspace charge force component in x,y,z per level
[in]geomgeometry object
[in]slice_dssegment length in meters

◆ PoissonSolve()

void impactx::spacecharge::PoissonSolve ( ImpactXParticleContainer const &  pc,
std::unordered_map< int, amrex::MultiFab > &  rho,
std::unordered_map< int, amrex::MultiFab > &  phi 
)

Calculate the electric potential from charge density

This resets the values in phi to zero and then calculates the space charge potential phi.

Parameters
[in]pccontainer of the particles that deposited rho
[in]rhocharge per level
[in,out]phiscalar potential per level