Hipace
Public Member Functions | Public Attributes | Private Attributes | List of all members
MultiBeam Class Reference

#include <MultiBeam.H>

Public Member Functions

 MultiBeam ()
 
 ~MultiBeam ()
 
void DepositCurrentSlice (Fields &fields, amrex::Vector< amrex::Geometry > const &geom, const int lev, const int step, const bool do_beam_jx_jy_deposition, const bool do_beam_jz_deposition, const bool do_beam_rhomjz_deposition, const int which_slice, const int which_beam_slice, const bool only_highest=false)
 
void shiftSlippedParticles (const int slice, amrex::Geometry const &geom)
 
void AdvanceBeamParticlesSlice (const Fields &fields, amrex::Vector< amrex::Geometry > const &gm, const int slice, int const current_N_level)
 
void InSituComputeDiags (int step, int islice, int max_step, amrex::Real physical_time, amrex::Real max_time)
 
void InSituWriteToFile (int step, amrex::Real time, const amrex::Geometry &geom, int max_step, amrex::Real max_time)
 
amrex::Real InitData (const amrex::Geometry &geom)
 
BeamParticleContainergetBeam (int i)
 Return 1 species. More...
 
const BeamParticleContainergetBeam (int i) const
 Return 1 species. More...
 
int get_nbeams () const
 
std::string get_name (int i) const
 
void TagByLevel (const int current_N_level, amrex::Vector< amrex::Geometry > const &geom3D, const int which_slice)
 Store the finest level of every beam particle on which_slice in the cpu() attribute. More...
 
void ReorderParticles (int beam_slice, int step, amrex::Geometry &slice_geom)
 Reorder beam particles to speed-up push and current deposition. More...
 
bool isSalameNow (const int step)
 returns if the SALAME algorithm should be used on this slice More...
 
bool AnySpeciesSalame ()
 returns if any beam uses the SALAME algorithm More...
 
void shiftBeamSlices ()
 

Public Attributes

amrex::Vector< std::string > m_names {"no_beam"}
 
amrex::Vector< BeamParticleContainerm_all_beams
 

Private Attributes

int m_nbeams {0}
 
amrex::Vector< amrex::Long > m_n_real_particles
 

Constructor & Destructor Documentation

◆ MultiBeam()

MultiBeam::MultiBeam ( )

Constructor

◆ ~MultiBeam()

MultiBeam::~MultiBeam ( )
inline

Destructor

Member Function Documentation

◆ AdvanceBeamParticlesSlice()

void MultiBeam::AdvanceBeamParticlesSlice ( const Fields fields,
amrex::Vector< amrex::Geometry > const &  gm,
const int  slice,
int const  current_N_level 
)

Loop over all beam species and advance slice islice of all beam species

Parameters
[in]fieldsField object, with 2D slice MultiFabs
[in]gmGeometry object at level lev
[in]slicelongitudinal slice
[in]current_N_levelnumber of MR levels active on the current slice

◆ AnySpeciesSalame()

bool MultiBeam::AnySpeciesSalame ( )

returns if any beam uses the SALAME algorithm

◆ DepositCurrentSlice()

void MultiBeam::DepositCurrentSlice ( Fields fields,
amrex::Vector< amrex::Geometry > const &  geom,
const int  lev,
const int  step,
const bool  do_beam_jx_jy_deposition,
const bool  do_beam_jz_deposition,
const bool  do_beam_rhomjz_deposition,
const int  which_slice,
const int  which_beam_slice,
const bool  only_highest = false 
)

Loop over all beam species and deposit their current on the 2D XY slice

Parameters
[in]fieldsField object, with 2D slice MultiFabs
[in]geomGeometry vector for all levels
[in]levMR level
[in]steptime step of simulation
[in]do_beam_jx_jy_depositionwhether the beam deposits Jx and Jy
[in]do_beam_jz_depositionwhether the beam deposits Jz
[in]do_beam_rhomjz_depositionwhether the beam deposits rhomjz
[in]which_slicedefines if this, next or salame slice is handled
[in]which_beam_slicedefines if this or the next beam slice is handled
[in]only_highestif the particles deposit only on their highest MR level

◆ get_name()

std::string MultiBeam::get_name ( int  i) const
inline

returns the name of a beam

◆ get_nbeams()

int MultiBeam::get_nbeams ( ) const
inline

returns the number of beams

◆ getBeam() [1/2]

BeamParticleContainer& MultiBeam::getBeam ( int  i)
inline

Return 1 species.

Parameters
[in]iindex of the beam

◆ getBeam() [2/2]

const BeamParticleContainer& MultiBeam::getBeam ( int  i) const
inline

Return 1 species.

Parameters
[in]iindex of the beam

◆ InitData()

amrex::Real MultiBeam::InitData ( const amrex::Geometry geom)

Loop over species and init them

Parameters
[in]geomSimulation geometry
Returns
physical time at which the simulation will start

◆ InSituComputeDiags()

void MultiBeam::InSituComputeDiags ( int  step,
int  islice,
int  max_step,
amrex::Real  physical_time,
amrex::Real  max_time 
)

Compute reduced beam diagnostics of current slice, store in member variable.

Parameters
[in]steptime step of simulation
[in]islicecurrent slice, on which diags are computed.
[in]max_stepmaximum time step of simulation
[in]physical_timephysical time at the given step
[in]max_timemaximum time of simulation

◆ InSituWriteToFile()

void MultiBeam::InSituWriteToFile ( int  step,
amrex::Real  time,
const amrex::Geometry geom,
int  max_step,
amrex::Real  max_time 
)

Write reduced beam diagnostics to file

Parameters
[in]steptime step of simulation
[in]timephysical time at the given step
[in]geomSimulation geometry
[in]max_stepmaximum time step of simulation
[in]max_timemaximum time of simulation

◆ isSalameNow()

bool MultiBeam::isSalameNow ( const int  step)

returns if the SALAME algorithm should be used on this slice

Parameters
[in]steptime step of simulation

◆ ReorderParticles()

void MultiBeam::ReorderParticles ( int  beam_slice,
int  step,
amrex::Geometry slice_geom 
)

Reorder beam particles to speed-up push and current deposition.

Parameters
[in]beam_slicebeam slice to reorder, WhichBeamSlice::This WhichBeamSlice::Next
[in]stepcurrent time step
[in]slice_geomGeometry object for one xy slice

◆ shiftBeamSlices()

void MultiBeam::shiftBeamSlices ( )
inline

◆ shiftSlippedParticles()

void MultiBeam::shiftSlippedParticles ( const int  slice,
amrex::Geometry const &  geom 
)

◆ TagByLevel()

void MultiBeam::TagByLevel ( const int  current_N_level,
amrex::Vector< amrex::Geometry > const &  geom3D,
const int  which_slice 
)

Store the finest level of every beam particle on which_slice in the cpu() attribute.

Parameters
[in]current_N_levelnumber of MR levels active on the current slice
[in]geom3DGeometry object for the whole domain
[in]which_sliceslice to mark

Member Data Documentation

◆ m_all_beams

amrex::Vector<BeamParticleContainer> MultiBeam::m_all_beams

contains all beam containers

◆ m_n_real_particles

amrex::Vector<amrex::Long> MultiBeam::m_n_real_particles
private

number of real particles per beam, as opposed to ghost particles

◆ m_names

amrex::Vector<std::string> MultiBeam::m_names {"no_beam"}

names of all beam containers

◆ m_nbeams

int MultiBeam::m_nbeams {0}
private

number of beam containers


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