Hipace
Functions
Salame.cpp File Reference
#include "Salame.H"
#include "particles/particles_utils/FieldGather.H"
#include "utils/GPUUtil.H"
#include "utils/HipaceProfilerWrapper.H"

Functions

void SalameModule (Hipace *hipace, const int n_iter, const bool do_advance, int &last_islice, bool &overloaded, const int current_N_level, const int step, const int islice)
 
void SalameInitializeSxSyWithBeam (Hipace *hipace, const int lev)
 
void SalameGetJxJyFromBxBy (Hipace *hipace, const int lev)
 
void SalameOnlyAdvancePlasma (Hipace *hipace, const int lev)
 
std::pair< amrex::Real, amrex::Real > SalameGetW (Hipace *hipace, const int current_N_level, const int islice)
 
void SalameMultiplyBeamWeight (const amrex::Real W, Hipace *hipace)
 

Function Documentation

◆ SalameGetJxJyFromBxBy()

void SalameGetJxJyFromBxBy ( Hipace hipace,
const int  lev 
)

Approximate the extra jx and jy from the SALAME beam using Bx By and chi

Parameters
[in]hipacepointer to Hipace instance
[in]levMR level

◆ SalameGetW()

std::pair<amrex::Real, amrex::Real> SalameGetW ( Hipace hipace,
const int  current_N_level,
const int  islice 
)

Calculate the new weighting factor of the SALAME beam using the difference in E fields. The average is weighted using the SALAME beam current.

Parameters
[in]hipacepointer to Hipace instance
[in]current_N_levelnumber of MR levels active on the current slice
[in]isliceslice index of the whole domain
Returns
new beam weighting factor and new total SALAME beam current on this slice

◆ SalameInitializeSxSyWithBeam()

void SalameInitializeSxSyWithBeam ( Hipace hipace,
const int  lev 
)

Initialize Sx and Sy with the contribution from the SALAME beam

Parameters
[in]hipacepointer to Hipace instance
[in]levMR level

◆ SalameModule()

void SalameModule ( Hipace hipace,
const int  n_iter,
const bool  do_advance,
int last_islice,
bool &  overloaded,
const int  current_N_level,
const int  step,
const int  islice 
)

Calculate new weight for this slice of SALAME beams and recompute the effected fields

Parameters
[in]hipacepointer to Hipace instance
[in]n_iterthe number of SALAME iterations to be done
[in]do_advanceif the SALAME-only field should be computed exactly with plasma particles
[in,out]last_islicethe slice index of the previous slice with SALAME
[in,out]overloadedif the SALAME beam was overloaded in the last slice
[in]current_N_levelnumber of MR levels active on the current slice
[in]steptime step of simulation
[in]isliceslice index of the whole domain

◆ SalameMultiplyBeamWeight()

void SalameMultiplyBeamWeight ( const amrex::Real  W,
Hipace hipace 
)

Multiply SALAME beam weight on this slice with W

Parameters
[in]Wweight multiplier
[in]hipacepointer to Hipace instance

◆ SalameOnlyAdvancePlasma()

void SalameOnlyAdvancePlasma ( Hipace hipace,
const int  lev 
)

Advance plasma particles to the temp slice using only Bx and By from the SALAME beam

Parameters
[in]hipacepointer to Hipace instance
[in]levMR level