OSHUN  beta
Arbitrary Order Spherical-Harmonic 1D-3P Vlasov-Fokker-Planck-Maxwell code
Vlasov-Fokker-Planck operators in 1D

Data Structures

class  self_f00_implicit_step
 
class  self_f00_implicit_collisions
 
class  self_f00_explicit_step
 The top-level container for collisions on l=0. More...
 
class  self_f00_explicit_collisions
 
class  self_flm_implicit_step
 Collisions for l >= 1. More...
 
class  self_flm_implicit_collisions
 
class  self_collisions
 The top-level container for self collisions over all species on l=0. More...
 
class  collisions
 
class  interspecies_f00_explicit_step
 The top-level container for collisions on l=0. More...
 
class  interspecies_f00_RKfunctor
 
class  interspecies_f00_explicit_collisions
 
class  interspecies_flm_implicit_step
 Collisions for l >= 1. More...
 
class  interspecies_flm_implicit_collisions
 
class  interspecies_collisions
 The top-level container for interspecies collisions over all species on l=0. More...
 
class  Spatial_Advection_1D
 
class  Electric_Field_1D
 
class  Magnetic_Field_1D
 
class  Current_1D
 
class  Faraday_1D
 
class  Ampere_1D
 
class  Spatial_Advection_1D_f1
 
class  Electric_Field_1D_f1
 
class  Magnetic_Field_1D_f1
 
class  VlasovFunctor1D_f1_explicitE
 
class  VlasovFunctor1D_f1_explicitEB
 
class  VlasovFunctor1D_f1_implicitE_p1
 
class  VlasovFunctor1D_f1_implicitEB_p1
 
class  VlasovFunctor1D_f1_implicitE_p2
 
class  f00_step
 Collisions for l=0. More...
 
class  Anisotropic_Collisions
 Middle container for collisions on l >= 1. More...
 
class  explicit_f00
 The top-level container for collisions on l=0. More...
 

Functions

void self_f00_implicit_step::update_C_Rosenbluth (valarray< double > &fin)
 
double self_f00_implicit_step::update_D_Rosenbluth (const size_t &k, valarray< double > &fin, const double &delta)
 
void self_f00_implicit_step::update_D_and_delta (valarray< double > &fin)
 
void self_f00_implicit_step::update_D_inversebremsstrahlung (const double &Z0, const double &heatingcoefficient, const double &vos)
 
double self_f00_implicit_step::calc_delta_ChangCooper (const size_t &k, const double &C, const double &D)
 
 self_f00_implicit_step::self_f00_implicit_step (const size_t &nump, const double &pmax, const double &_mass, const double &_deltat, bool &_ib)
 
void self_f00_implicit_step::takestep (valarray< double > &fin, valarray< double > &fh, const double &Z0, const double &heating, const double &cooling)
 
void self_f00_implicit_step::getleftside (valarray< double > &fin, const double &Z0, const double &heating, const double &cooling, Array2D< double > &LHStemp)
 
 self_f00_implicit_collisions::self_f00_implicit_collisions (const DistFunc1D &DFin, const double &deltat)
 Constructors/Destructors. More...
 
void self_f00_implicit_collisions::loop (SHarmonic1D &SHin, valarray< double > &Zarray, const double time, SHarmonic1D &SHout)
 
double self_f00_explicit_step::G (const int &n, const valarray< double > &fin)
 
 self_f00_explicit_step::self_f00_explicit_step (const size_t &nump, const double &pmax, const double &_mass)
 Constructor that needs a distribution function input. More...
 
void self_f00_explicit_step::takestep (const valarray< double > &fin, valarray< double > &fh)
 
 self_f00_RKfunctor::self_f00_RKfunctor (const size_t &nump, const double &pmax, const double &mass)
 Constructor for RK4 method on f00. More...
 
 self_f00_RKfunctor::~self_f00_RKfunctor ()
 
void self_f00_RKfunctor::operator() (const valarray< double > &fin, valarray< double > &fslope)
 
void self_f00_RKfunctor::operator() (const valarray< double > &fin, valarray< double > &fslope, size_t dir)
 
void self_f00_RKfunctor::operator() (const valarray< double > &fin, const valarray< double > &f2in, valarray< double > &fslope)
 
 self_f00_explicit_collisions::self_f00_explicit_collisions (const DistFunc1D &DFin, const double &deltat)
 Constructors/Destructors. More...
 
void self_f00_explicit_collisions::loop (SHarmonic1D &SHin, SHarmonic1D &SHout)
 
 self_flm_implicit_step::self_flm_implicit_step (double pmax, size_t nump, double mass)
 
void self_flm_implicit_step::reset_coeff (const valarray< double > &f00, double Zvalue, const double Delta_t)
 Resets coefficients and integrals to use in the matrix solve. More...
 
void self_flm_implicit_step::advance (valarray< complex< double > > &fin, const int el)
 Perform a matrix solve to calculate effect of collisions on f >= 1. More...
 
 self_flm_implicit_collisions::self_flm_implicit_collisions (const DistFunc1D &DFin, const double &deltat)
 Constructors/Destructors. More...
 
void self_flm_implicit_collisions::advancef1 (DistFunc1D &DF, valarray< double > &Zarray, DistFunc1D &DFh)
 Advance f1_loop for 2D code. More...
 
void self_flm_implicit_collisions::advanceflm (DistFunc1D &DF, valarray< double > &Zarray, DistFunc1D &DFh)
 Advance flm_loop for 2D code. More...
 
 self_collisions::self_collisions (const DistFunc1D &DFin, const double &deltat)
 Constructors/Destructors. More...
 
void self_collisions::advancef00 (SHarmonic1D &f00, valarray< double > &Zarray, const double time, SHarmonic1D &f00h)
 
void self_collisions::advancef1 (DistFunc1D &DF, valarray< double > &Zarray, DistFunc1D &DFh)
 
void self_collisions::advanceflm (DistFunc1D &DF, valarray< double > &Zarray, DistFunc1D &DFh)
 
 collisions::collisions (const State1D &Yin, const double &deltat)
 Constructors/Destructors. More...
 
void collisions::advance (State1D &Y, const Clock &W)
 
void collisions::advancef0 (State1D &Y, const Clock &W, State1D &Yh)
 
void collisions::advancef1 (State1D &Y, State1D &Yh)
 
void collisions::advanceflm (State1D &Y, State1D &Yh)
 
vector< self_collisionscollisions::self ()
 
 interspecies_f00_explicit_step::interspecies_f00_explicit_step (const DistFunc1D &DF1, const DistFunc1D &DF2, const double &deltat)
 Constructors/Destructors. More...
 
valarray< double > interspecies_f00_explicit_step::takestep (const valarray< double > &f1in, const valarray< double > &f2in)
 Collisions between species 1 and 2 in 0,0 harmonic. More...
 
void interspecies_f00_explicit_step::calculateintegrals (const valarray< double > &f1in, const valarray< double > &f2in)
 Remap Distribution to momentum grid of colliding particles. More...
 
void interspecies_f00_explicit_step::remapintegrals ()
 Remap Distribution to momentum grid of colliding particles. More...
 
 interspecies_f00_RKfunctor::interspecies_f00_RKfunctor (const DistFunc1D &DF1, const DistFunc1D &DF2, const double &smalldt)
 Constructor for RK4 method on f00. More...
 
 interspecies_f00_RKfunctor::~interspecies_f00_RKfunctor ()
 
void interspecies_f00_RKfunctor::operator() (const valarray< double > &fin1, valarray< double > &fslope)
 
void interspecies_f00_RKfunctor::operator() (const valarray< double > &fin1, const valarray< double > &fin2, valarray< double > &fslope)
 
void interspecies_f00_RKfunctor::operator() (const valarray< double > &fin1, valarray< double > &fslope, size_t dir)
 
 interspecies_f00_explicit_collisions::interspecies_f00_explicit_collisions (const DistFunc1D &DF1, const DistFunc1D &DF2, const double &deltat)
 Constructors/Destructors. More...
 
void interspecies_f00_explicit_collisions::rkloop (SHarmonic1D &SH1, const SHarmonic1D &SH2)
 
 interspecies_flm_implicit_step::interspecies_flm_implicit_step (double pmax, size_t nump)
 
void interspecies_flm_implicit_step::reset_coeff (const valarray< double > &f00, const double Delta_t)
 Resets coefficients and integrals to use in the matrix solve. More...
 
void interspecies_flm_implicit_step::advance (valarray< complex< double > > &fin, const int el)
 Perform a matrix solve to calculate effect of collisions on f >= 1. More...
 
 interspecies_flm_implicit_collisions::interspecies_flm_implicit_collisions (const DistFunc1D &DFin, const double &deltat)
 Constructors/Destructors. More...
 
void interspecies_flm_implicit_collisions::advancef1 (DistFunc1D &DF)
 Advance f1_loop for 2D code. More...
 
void interspecies_flm_implicit_collisions::advanceflm (DistFunc1D &DF)
 Advance flm_loop for 2D code. More...
 
 interspecies_collisions::interspecies_collisions (const State1D &Yin, const size_t &sind, const double &deltat)
 Constructors/Destructors. More...
 
void interspecies_collisions::advancef00 (State1D &Y, const size_t &sind)
 Remap Distribution to momentum grid of colliding particles. More...
 
 Spatial_Advection_1D::Spatial_Advection_1D (size_t Nl, size_t Nm, double pmin, double pmax, size_t Np, double xmin, double xmax, size_t Nx)
 
void Spatial_Advection_1D::operator() (const DistFunc1D &Din, DistFunc1D &Dh)
 
void Spatial_Advection_1D::es1d (const DistFunc1D &Din, DistFunc1D &Dh)
 
void Spatial_Advection_1D::f1only (const DistFunc1D &Din, DistFunc1D &Dh)
 
 Electric_Field_1D::Electric_Field_1D (size_t Nl, size_t Nm, double pmin, double pmax, size_t Np, double xmin, double xmax, size_t Nx)
 
void Electric_Field_1D::operator() (const DistFunc1D &Din, const Field1D &FEx, const Field1D &FEy, const Field1D &FEz, DistFunc1D &Dh)
 
void Electric_Field_1D::es1d (const DistFunc1D &Din, const Field1D &FEx, const Field1D &FEy, const Field1D &FEz, DistFunc1D &Dh)
 
void Electric_Field_1D::f1only (const DistFunc1D &Din, const Field1D &FEx, const Field1D &FEy, const Field1D &FEz, DistFunc1D &Dh)
 
void Electric_Field_1D::Implicit_Ex (const DistFunc1D &Din, const Field1D &FEx, DistFunc1D &Dh)
 
void Electric_Field_1D::Implicit_Ey (const DistFunc1D &Din, const Field1D &FEy, DistFunc1D &Dh)
 
void Electric_Field_1D::Implicit_Ez (const DistFunc1D &Din, const Field1D &FEz, DistFunc1D &Dh)
 
void Electric_Field_1D::Implicit_Ex_f1only (const DistFunc1D &Din, const Field1D &FEx, DistFunc1D &Dh)
 
void Electric_Field_1D::Implicit_Ey_f1only (const DistFunc1D &Din, const Field1D &FEy, DistFunc1D &Dh)
 
void Electric_Field_1D::Implicit_Ez_f1only (const DistFunc1D &Din, const Field1D &FEz, DistFunc1D &Dh)
 
void Electric_Field_1D::MakeG00 (SHarmonic1D &f)
 
void Electric_Field_1D::MakeGH (SHarmonic1D &f, size_t l)
 
 Magnetic_Field_1D::Magnetic_Field_1D (size_t Nl, size_t Nm, double pmin, double pmax, size_t Np, double xmin, double xmax, size_t Nx)
 
void Magnetic_Field_1D::operator() (const DistFunc1D &Din, const Field1D &FBx, const Field1D &FBy, const Field1D &FBz, DistFunc1D &Dh)
 
void Magnetic_Field_1D::f1only (const DistFunc1D &Din, const Field1D &FBx, const Field1D &FBy, const Field1D &FBz, DistFunc1D &Dh)
 
void Magnetic_Field_1D::implicit (DistFunc1D &Din, const Field1D &FBx, const Field1D &FBy, const Field1D &FBz, double dt)
 
 Current_1D::Current_1D (double pmin, double pmax, size_t Np, size_t Nx)
 
void Current_1D::operator() (const DistFunc1D &Din, Field1D &FExh, Field1D &FEyh, Field1D &FEzh)
 
void Current_1D::es1d (const DistFunc1D &Din, Field1D &FExh)
 
 Faraday_1D::Faraday_1D (double xmin, double xmax, size_t Nx)
 
void Faraday_1D::operator() (EMF1D &EMFin, EMF1D &EMFh)
 
 Ampere_1D::Ampere_1D (double xmin, double xmax, size_t Nx)
 
void Ampere_1D::operator() (EMF1D &EMFin, EMF1D &EMFh)
 

Variables

double self_f00_implicit_step::mass
 
double self_f00_implicit_step::dt
 
bool self_f00_implicit_step::ib
 
valarray< double > self_f00_implicit_step::vr
 Define the velocity axis. More...
 
valarray< double > self_f00_implicit_step::dvr
 
valarray< double > self_f00_implicit_step::vrh
 
valarray< double > self_f00_implicit_step::dtoverv2
 
valarray< double > self_f00_implicit_step::p2dp
 Various coefficients for the integrals. More...
 
valarray< double > self_f00_implicit_step::p2dpm1
 
valarray< double > self_f00_implicit_step::phdp
 
valarray< double > self_f00_implicit_step::phdpm1
 
valarray< double > self_f00_implicit_step::p4dp
 
valarray< double > self_f00_implicit_step::laser_Inv_Uav6
 
valarray< double > self_f00_implicit_step::C_RB
 Rosenbluth Potentials. More...
 
valarray< double > self_f00_implicit_step::D_RB
 
double self_f00_implicit_step::I4_Lnee
 
valarray< double > self_f00_implicit_step::delta_CC
 Chang-Cooper weighting delta. More...
 
double self_f00_implicit_step::c_kpre
 Constants. More...
 
double self_f00_implicit_step::vw_coeff_cube
 
Formulary self_f00_implicit_step::formulas
 
valarray< double > self_f00_implicit_collisions::fin
 
valarray< double > self_f00_implicit_collisions::fout
 
valarray< double > self_f00_implicit_collisions::xgrid
 
bool self_f00_implicit_collisions::ib
 
self_f00_implicit_step self_f00_implicit_collisions::collide
 
bool self_f00_implicit_collisions::IB_heating
 Switches for inverse bremsstrahlung and maxwellian cooling. More...
 
bool self_f00_implicit_collisions::MX_cooling
 
valarray< double > self_f00_implicit_collisions::heatingprofile
 
valarray< double > self_f00_implicit_collisions::coolingprofile
 
int self_f00_implicit_collisions::Nbc
 Number of boundary cells in each direction. More...
 
int self_f00_implicit_collisions::szx
 Total cells including boundary cells in x-direction. More...
 
double self_f00_explicit_step::mass
 Array output by getslope. More...
 
valarray< double > self_f00_explicit_step::vr
 Define the velocity axis. More...
 
valarray< double > self_f00_explicit_step::U4
 Various coefficients for the integrals. More...
 
valarray< double > self_f00_explicit_step::U4m1
 
valarray< double > self_f00_explicit_step::U2
 
valarray< double > self_f00_explicit_step::U2m1
 
valarray< double > self_f00_explicit_step::U1
 
valarray< double > self_f00_explicit_step::U1m1
 
valarray< double > self_f00_explicit_step::U3
 
valarray< double > self_f00_explicit_step::Qn
 
valarray< double > self_f00_explicit_step::Pn
 
valarray< double > self_f00_explicit_step::J1
 The integrals. More...
 
valarray< double > self_f00_explicit_step::I2
 
valarray< double > self_f00_explicit_step::I4
 
double self_f00_explicit_step::c_kpre
 Constants. More...
 
int self_f00_explicit_step::NB
 
Formulary self_f00_explicit_step::formulas
 
self_f00_explicit_step self_f00_RKfunctor::collide
 
valarray< double > self_f00_explicit_collisions::fin
 
Algorithms::RK4< valarray< double > > self_f00_explicit_collisions::RK
 
self_f00_RKfunctor self_f00_explicit_collisions::rkf00
 
size_t self_f00_explicit_collisions::num_h
 
double self_f00_explicit_collisions::h
 
int self_f00_explicit_collisions::Nbc
 Number of boundary cells in each direction. More...
 
int self_f00_explicit_collisions::szx
 Total cells including boundary cells in x-direction. More...
 
valarray< double > self_flm_implicit_step::vr
 
valarray< double > self_flm_implicit_step::U4
 
valarray< double > self_flm_implicit_step::U4m1
 
valarray< double > self_flm_implicit_step::U2
 
valarray< double > self_flm_implicit_step::U2m1
 
valarray< double > self_flm_implicit_step::U1
 
valarray< double > self_flm_implicit_step::U1m1
 
valarray< double > self_flm_implicit_step::J1m
 
valarray< double > self_flm_implicit_step::I0
 
valarray< double > self_flm_implicit_step::I2
 
valarray< double > self_flm_implicit_step::df0
 
valarray< double > self_flm_implicit_step::ddf0
 
valarray< double > self_flm_implicit_step::Scattering_Term
 
Array2D< double > self_flm_implicit_step::Alpha_Tri
 
bool self_flm_implicit_step::if_tridiagonal
 
double self_flm_implicit_step::mass
 
double self_flm_implicit_step::I0_density
 
double self_flm_implicit_step::I2_temperature
 
double self_flm_implicit_step::_ZLOGei
 
double self_flm_implicit_step::_LOGee
 
double self_flm_implicit_step::kpre
 
double self_flm_implicit_step::Dt
 
Formulary self_flm_implicit_step::formulas
 
double self_flm_implicit_collisions::Dt
 
int self_flm_implicit_collisions::Nbc
 Number of boundary cells in each direction. More...
 
int self_flm_implicit_collisions::szx
 Total cells including boundary cells in x-direction. More...
 
int self_flm_implicit_collisions::f1_m_upperlimit
 
size_t self_flm_implicit_collisions::l0
 Number of m harmonics. More...
 
size_t self_flm_implicit_collisions::m0
 Number of m harmonics. More...
 
valarray< complex< double > > self_flm_implicit_collisions::fc
 Dummy array. More...
 
valarray< double > self_flm_implicit_collisions::f00
 Array for isotropic component distribution function. Needed for calculating coefficients. More...
 
self_flm_implicit_step self_flm_implicit_collisions::implicit_step
 The object that is responsible for performing the algebra required for the integrals. More...
 
self_f00_explicit_collisions self_collisions::self_f00_exp_collisions
 
self_f00_implicit_collisions self_collisions::self_f00_imp_collisions
 
self_flm_implicit_collisions self_collisions::self_flm_collisions
 
State1D collisions::Yh
 
vector< self_collisionscollisions::self_coll
 
valarray< double > interspecies_f00_explicit_step::fslope
 
double interspecies_f00_explicit_step::dt
 
Formulary interspecies_f00_explicit_step::formulary
 
double interspecies_f00_explicit_step::m1
 
double interspecies_f00_explicit_step::m2
 
double interspecies_f00_explicit_step::z1
 
double interspecies_f00_explicit_step::z2
 
double interspecies_f00_explicit_step::n1
 
double interspecies_f00_explicit_step::n2
 
double interspecies_f00_explicit_step::T1
 
double interspecies_f00_explicit_step::T2
 
double interspecies_f00_explicit_step::Gamma12
 
double interspecies_f00_explicit_step::kpre
 
valarray< double > interspecies_f00_explicit_step::pgrid_s1
 
valarray< double > interspecies_f00_explicit_step::pgrid_s2
 
valarray< double > interspecies_f00_explicit_step::df0
 
valarray< double > interspecies_f00_explicit_step::U4
 
valarray< double > interspecies_f00_explicit_step::U4m1
 
valarray< double > interspecies_f00_explicit_step::U2
 
valarray< double > interspecies_f00_explicit_step::U2m1
 
valarray< double > interspecies_f00_explicit_step::U1
 
valarray< double > interspecies_f00_explicit_step::U1m1
 
valarray< double > interspecies_f00_explicit_step::U3
 
valarray< double > interspecies_f00_explicit_step::Qn
 
valarray< double > interspecies_f00_explicit_step::Pn
 
valarray< double > interspecies_f00_explicit_step::J1_s2
 The integrals. More...
 
valarray< double > interspecies_f00_explicit_step::I2_s2
 
valarray< double > interspecies_f00_explicit_step::I4_s2
 
valarray< double > interspecies_f00_explicit_step::J1_s1
 The integrals. More...
 
valarray< double > interspecies_f00_explicit_step::I2_s1
 
valarray< double > interspecies_f00_explicit_step::I4_s1
 
int interspecies_f00_explicit_step::Nbc
 Number of boundary cells in each direction. More...
 
int interspecies_f00_explicit_step::szx
 Total cells including boundary cells in x-direction. More...
 
interspecies_f00_explicit_step interspecies_f00_RKfunctor::collide
 
interspecies_f00_RKfunctor interspecies_f00_explicit_collisions::rkf00
 
valarray< double > interspecies_f00_explicit_collisions::fin1
 
valarray< double > interspecies_f00_explicit_collisions::fin2
 
Algorithms::RK4< valarray< double > > interspecies_f00_explicit_collisions::RK4
 
size_t interspecies_f00_explicit_collisions::num_h
 
double interspecies_f00_explicit_collisions::h
 
int interspecies_f00_explicit_collisions::Nbc
 Number of boundary cells in each direction. More...
 
int interspecies_f00_explicit_collisions::szx
 Total cells including boundary cells in x-direction. More...
 
valarray< double > interspecies_flm_implicit_step::vr
 
valarray< double > interspecies_flm_implicit_step::U4
 
valarray< double > interspecies_flm_implicit_step::U4m1
 
valarray< double > interspecies_flm_implicit_step::U2
 
valarray< double > interspecies_flm_implicit_step::U2m1
 
valarray< double > interspecies_flm_implicit_step::U1
 
valarray< double > interspecies_flm_implicit_step::U1m1
 
valarray< double > interspecies_flm_implicit_step::J1m
 
valarray< double > interspecies_flm_implicit_step::I0
 
valarray< double > interspecies_flm_implicit_step::I2
 
valarray< double > interspecies_flm_implicit_step::df0
 
valarray< double > interspecies_flm_implicit_step::ddf0
 
valarray< double > interspecies_flm_implicit_step::Scattering_Term
 
Array2D< double > interspecies_flm_implicit_step::Alpha_Tri
 
bool interspecies_flm_implicit_step::if_tridiagonal
 
double interspecies_flm_implicit_step::I0_density
 
double interspecies_flm_implicit_step::I2_temperature
 
double interspecies_flm_implicit_step::_ZLOGei
 
double interspecies_flm_implicit_step::_LOGee
 
double interspecies_flm_implicit_step::kpre
 
double interspecies_flm_implicit_step::Dt
 
Formulary interspecies_flm_implicit_step::formulas
 
double interspecies_flm_implicit_collisions::Dt
 
int interspecies_flm_implicit_collisions::Nbc
 Number of boundary cells in each direction. More...
 
int interspecies_flm_implicit_collisions::szx
 Total cells including boundary cells in x-direction. More...
 
size_t interspecies_flm_implicit_collisions::l0
 Number of m harmonics. More...
 
size_t interspecies_flm_implicit_collisions::m0
 Number of m harmonics. More...
 
valarray< complex< double > > interspecies_flm_implicit_collisions::fc
 Dummy array. More...
 
valarray< double > interspecies_flm_implicit_collisions::f00
 Array for isotropic component distribution function. Needed for calculating coefficients. More...
 
interspecies_flm_implicit_step interspecies_flm_implicit_collisions::implicit_step
 The object that is responsible for performing the algebra required for the integrals. More...
 
vector< interspecies_f00_explicit_collisionsinterspecies_collisions::interspecies_f00_collisions
 
SHarmonic1D Spatial_Advection_1D::fd1
 
SHarmonic1D Spatial_Advection_1D::fd2
 
complex< double > Spatial_Advection_1D::A00
 
complex< double > Spatial_Advection_1D::A10
 
complex< double > Spatial_Advection_1D::A20
 
Array2D< complex< double > > Spatial_Advection_1D::A1
 
Array2D< complex< double > > Spatial_Advection_1D::A2
 
valarray< complex< double > > Spatial_Advection_1D::vr
 
SHarmonic1D Electric_Field_1D::H
 
SHarmonic1D Electric_Field_1D::G
 
SHarmonic1D Electric_Field_1D::TMP
 
complex< double > Electric_Field_1D::A100
 
complex< double > Electric_Field_1D::C100
 
complex< double > Electric_Field_1D::A210
 
complex< double > Electric_Field_1D::B211
 
complex< double > Electric_Field_1D::C311
 
complex< double > Electric_Field_1D::A310
 
Array2D< complex< double > > Electric_Field_1D::A1
 
Array2D< complex< double > > Electric_Field_1D::A2
 
valarray< complex< double > > Electric_Field_1D::B1
 
valarray< complex< double > > Electric_Field_1D::B2
 
valarray< complex< double > > Electric_Field_1D::C1
 
valarray< complex< double > > Electric_Field_1D::C3
 
Array2D< complex< double > > Electric_Field_1D::C2
 
Array2D< complex< double > > Electric_Field_1D::C4
 
valarray< complex< double > > Electric_Field_1D::pr
 
valarray< complex< double > > Electric_Field_1D::invpr
 
valarray< complex< double > > Electric_Field_1D::Hp0
 
SHarmonic1D Magnetic_Field_1D::FLM
 
valarray< complex< double > > Magnetic_Field_1D::A1
 
valarray< complex< double > > Magnetic_Field_1D::B1
 
Array2D< complex< double > > Magnetic_Field_1D::A2
 
complex< double > Magnetic_Field_1D::A3
 
Field1D Current_1D::Jx
 
Field1D Current_1D::Jy
 
Field1D Current_1D::Jz
 
double Current_1D::small
 
Field1D Faraday_1D::tmpE
 
complex< double > Faraday_1D::idx
 
size_t Faraday_1D::numx
 
Field1D Ampere_1D::tmpB
 
complex< double > Ampere_1D::idx
 
size_t Ampere_1D::numx
 

Detailed Description

These are all the VFP objects used to describe the evolution of distribution function in the 1D code

Function Documentation

◆ advance() [1/3]

void interspecies_flm_implicit_step::advance ( valarray< complex< double > > &  fin,
const int  el 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/interspeciescollisions.h>

Perform a matrix solve to calculate effect of collisions on f >= 1.

Parameters
finInput distribution function
[in]elNumber of elements in matrix (?)

Definition at line 568 of file interspeciescollisions.cpp.

References interspecies_flm_implicit_step::_LOGee, interspecies_flm_implicit_step::Alpha_Tri, interspecies_flm_implicit_step::ddf0, interspecies_flm_implicit_step::df0, Array2D< T >::dim1(), Array2D< T >::dim2(), interspecies_flm_implicit_step::Dt, Gauss_Seidel(), interspecies_flm_implicit_step::if_tridiagonal, interspecies_flm_implicit_step::kpre, interspecies_flm_implicit_step::Scattering_Term, Thomas_Tridiagonal(), and interspecies_flm_implicit_step::vr.

Referenced by interspecies_flm_implicit_collisions::advancef1(), and interspecies_flm_implicit_collisions::advanceflm().

568  {
569 //-------------------------------------------------------------------
570 // Collisions
571 //-------------------------------------------------------------------
572  Array2D<double> Alpha(Alpha_Tri);
573  valarray<complex<double> > fout(fin);
574 
575 
576 // ZEROTH CELL FOR TRIDIAGONAL ARRAY
577 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
578  if (el > 1) {
579  Alpha(0,0) = 0.0;
580  }
581 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
582 
583  if ( !(if_tridiagonal) ) {
584 
585 // CONSTRUCT COEFFICIENTS and then full array
586 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
587  double LL(el);
588  double A1( (LL+1.0)*(LL+2.0) / ((2.0*LL+1.0)*(2.0*LL+3.0)) );
589  double A2( (-1.0) *(LL-1.0)* LL / ((2.0*LL+1.0)*(2.0*LL-1.0)) );
590  double B1( (-1.0) *( 0.5 *LL*(LL+1.0) +(LL+1.0) ) / ((2.0*LL+1.0)*(2.0*LL+3.0)) );
591  double B2( ( (-0.5)*LL*(LL+1.0) +(LL+2.0) ) / ((2.0*LL+1.0)*(2.0*LL+3.0)) );
592  double B3( ( 0.5 *LL*(LL+1.0) +(LL-1.0) ) / ((2.0*LL+1.0)*(2.0*LL-1.0)) );
593  double B4( ( 0.5 *LL*(LL+1.0) - LL ) / ((2.0*LL+1.0)*(2.0*LL-1.0)) );
594 
595 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
596  for (int i(0); i < Alpha.dim1()-1; ++i){
597  double t1( A1*ddf0[i] + B1*df0[i] );
598  t1 *= (-1.0) * _LOGee * kpre * Dt;
599  double t2( A1*ddf0[i] + B2*df0[i] );
600  t2 *= (-1.0) * _LOGee * kpre * Dt;
601  double t3( A2*ddf0[i] + B3*df0[i] );
602  t3 *= (-1.0) * _LOGee * kpre * Dt;
603  double t4( A2*ddf0[i] + B4*df0[i] );
604  t4 *= (-1.0) * _LOGee * kpre * Dt;
605 
606  Alpha(i,0) += t1 * ( 2.0*M_PI*pow(vr[0]/vr[i],el+2)*vr[0]*vr[0]*(vr[1]-vr[0]) );
607  Alpha(i,0) += t3 * ( 2.0*M_PI*pow(vr[0]/vr[i],el) *vr[0]*vr[0]*(vr[1]-vr[0]) );
608 
609  for (int j(1); j < i; ++j){
610  Alpha(i,j) += t1 * ( 2.0*M_PI*pow(vr[j]/vr[i],el+2)*vr[j]*vr[j]*(vr[j+1]-vr[j-1]) );
611  Alpha(i,j) += t3 * ( 2.0*M_PI*pow(vr[j]/vr[i],el) *vr[j]*vr[j]*(vr[j+1]-vr[j-1]) );
612  }
613 
614  Alpha(i,i) += t1 * ( 2.0*M_PI *vr[i]*vr[i]*(vr[i]-vr[i-1]) );
615  Alpha(i,i) += t3 * ( 2.0*M_PI *vr[i]*vr[i]*(vr[i]-vr[i-1]) );
616 
617  Alpha(i,i) += t2 * ( 2.0*M_PI *vr[i]*vr[i]*(vr[i+1]-vr[i]) );
618  Alpha(i,i) += t4 * ( 2.0*M_PI *vr[i]*vr[i]*(vr[i+1]-vr[i]) );
619 
620  for (int j(i+1); j < Alpha.dim2()-1; ++j){
621  Alpha(i,j) += t2 * ( 2.0*M_PI*pow(vr[j]/vr[i],-el-1)*vr[j]*vr[j]*(vr[j+1]-vr[j-1]) );
622  Alpha(i,j) += t4 * ( 2.0*M_PI*pow(vr[j]/vr[i],-el+1)*vr[j]*vr[j]*(vr[j+1]-vr[j-1]) );
623  }
624  }
625 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
626  }
627 
628 // INCLUDE SCATTERING TERM
629 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
630  double ll1(static_cast<double>(el));
631  ll1 *= (-0.5)*(ll1 + 1.0);
632 
633  for (int i(0); i < Alpha.dim1(); ++i){
634  Alpha(i,i) += 1.0 - ll1 * Scattering_Term[i];
635  }
636 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
637 
638 
639 // SOLVE A * Fout = Fin
640 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
641  //for (int i(0); i < fin.size(); ++i){ // Estimate Fout = Fin / A(i,i)
642  // fout[i] /= Alpha(i,i);
643  //}
644 
645  if ( if_tridiagonal ) {
646  if ( !(Thomas_Tridiagonal(Alpha, fin, fout)) ) { // Invert A * fout = fin
647  cout << "WARNING: Matrix is not diagonally dominant" << endl;
648  }
649  }
650  else {
651  if ( !(Gauss_Seidel(Alpha, fin, fout)) ) { // Invert A * fout = fin
652  cout << "WARNING: Matrix is not diagonally dominant" << endl;
653  }
654  }
655 
656  fin = fout;
657 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
658 
659  }
bool Thomas_Tridiagonal(Array2D< double > &A, valarray< double > &d, valarray< double > &xk)
The tridiagonal solver for implicit collisions.
Definition: nmethods.cpp:216
bool Gauss_Seidel(Array2D< double > &A, valarray< complex< double > > &b, valarray< complex< double > > &xk)
Performs Gauss-Seidel method on Ax = b.
Definition: nmethods.cpp:29
Here is the call graph for this function:
Here is the caller graph for this function:

◆ advance() [2/3]

void self_flm_implicit_step::advance ( valarray< complex< double > > &  fin,
const int  el 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/collisions.h>

Perform a matrix solve to calculate effect of collisions on f >= 1.

Parameters
finInput distribution function
[in]elNumber of elements in matrix (?)

SOLVE A * Fout = Fin

Definition at line 1126 of file collisions.cpp.

References self_flm_implicit_step::_LOGee, self_flm_implicit_step::Alpha_Tri, self_flm_implicit_step::ddf0, self_flm_implicit_step::df0, Array2D< T >::dim1(), Array2D< T >::dim2(), self_flm_implicit_step::Dt, Gauss_Seidel(), self_flm_implicit_step::if_tridiagonal, self_flm_implicit_step::kpre, self_flm_implicit_step::Scattering_Term, Thomas_Tridiagonal(), and self_flm_implicit_step::vr.

Referenced by self_flm_implicit_collisions::advancef1(), and self_flm_implicit_collisions::advanceflm().

1126  {
1127 //-------------------------------------------------------------------
1128 // Collisions
1129 //-------------------------------------------------------------------
1130  Array2D<double> Alpha(Alpha_Tri);
1131  valarray<complex<double> > fout(fin);
1132 
1133 
1134 // ZEROTH CELL FOR TRIDIAGONAL ARRAY
1135 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1136  if (el > 1) {
1137  Alpha(0,0) = 0.0;
1138  }
1139 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1140 
1141  if ( !(if_tridiagonal) ) {
1142 
1143 // CONSTRUCT COEFFICIENTS and then full array
1144 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1145  double LL(el);
1146  double A1( (LL+1.0)*(LL+2.0) / ((2.0*LL+1.0)*(2.0*LL+3.0)) );
1147  double A2( (-1.0) *(LL-1.0)* LL / ((2.0*LL+1.0)*(2.0*LL-1.0)) );
1148  double B1( (-1.0) *( 0.5 *LL*(LL+1.0) +(LL+1.0) ) / ((2.0*LL+1.0)*(2.0*LL+3.0)) );
1149  double B2( ( (-0.5)*LL*(LL+1.0) +(LL+2.0) ) / ((2.0*LL+1.0)*(2.0*LL+3.0)) );
1150  double B3( ( 0.5 *LL*(LL+1.0) +(LL-1.0) ) / ((2.0*LL+1.0)*(2.0*LL-1.0)) );
1151  double B4( ( 0.5 *LL*(LL+1.0) - LL ) / ((2.0*LL+1.0)*(2.0*LL-1.0)) );
1152 
1153 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1154  for (int i(0); i < Alpha.dim1()-1; ++i){
1155  double t1( A1*ddf0[i] + B1*df0[i] );
1156  t1 *= (-1.0) * _LOGee * kpre * Dt;
1157  double t2( A1*ddf0[i] + B2*df0[i] );
1158  t2 *= (-1.0) * _LOGee * kpre * Dt;
1159  double t3( A2*ddf0[i] + B3*df0[i] );
1160  t3 *= (-1.0) * _LOGee * kpre * Dt;
1161  double t4( A2*ddf0[i] + B4*df0[i] );
1162  t4 *= (-1.0) * _LOGee * kpre * Dt;
1163 
1164  Alpha(i,0) += t1 * ( 2.0*M_PI*pow(vr[0]/vr[i],el+2)*vr[0]*vr[0]*(vr[1]-vr[0]) );
1165  Alpha(i,0) += t3 * ( 2.0*M_PI*pow(vr[0]/vr[i],el) *vr[0]*vr[0]*(vr[1]-vr[0]) );
1166 
1167  for (int j(1); j < i; ++j){
1168  Alpha(i,j) += t1 * ( 2.0*M_PI*pow(vr[j]/vr[i],el+2)*vr[j]*vr[j]*(vr[j+1]-vr[j-1]) );
1169  Alpha(i,j) += t3 * ( 2.0*M_PI*pow(vr[j]/vr[i],el) *vr[j]*vr[j]*(vr[j+1]-vr[j-1]) );
1170  }
1171 
1172  Alpha(i,i) += t1 * ( 2.0*M_PI *vr[i]*vr[i]*(vr[i]-vr[i-1]) );
1173  Alpha(i,i) += t3 * ( 2.0*M_PI *vr[i]*vr[i]*(vr[i]-vr[i-1]) );
1174 
1175  Alpha(i,i) += t2 * ( 2.0*M_PI *vr[i]*vr[i]*(vr[i+1]-vr[i]) );
1176  Alpha(i,i) += t4 * ( 2.0*M_PI *vr[i]*vr[i]*(vr[i+1]-vr[i]) );
1177 
1178  for (int j(i+1); j < Alpha.dim2()-1; ++j){
1179  Alpha(i,j) += t2 * ( 2.0*M_PI*pow(vr[j]/vr[i],-el-1)*vr[j]*vr[j]*(vr[j+1]-vr[j-1]) );
1180  Alpha(i,j) += t4 * ( 2.0*M_PI*pow(vr[j]/vr[i],-el+1)*vr[j]*vr[j]*(vr[j+1]-vr[j-1]) );
1181  }
1182  }
1183 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1184  }
1185 
1186 // INCLUDE SCATTERING TERM
1187 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1188  double ll1(static_cast<double>(el));
1189  ll1 *= (-0.5)*(ll1 + 1.0);
1190 
1191  for (int i(0); i < Alpha.dim1(); ++i){
1192  Alpha(i,i) += 1.0 - ll1 * Scattering_Term[i];
1193  }
1194 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1195 
1196 
1197 
1198 
1200  //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1201 // for (int i(0); i < fin.size(); ++i){ // Estimate Fout = Fin / A(i,i)
1202 // fout[i] /= Alpha(i,i);
1203 // }
1204 
1205  if ( if_tridiagonal ) {
1206  if ( !(Thomas_Tridiagonal(Alpha, fin, fout)) ) { // Invert A * fout = fin
1207  cout << "WARNING: Matrix is not diagonally dominant" << endl;
1208  }
1209  }
1210  else {
1211  if ( !(Gauss_Seidel(Alpha, fin, fout)) ) { // Invert A * fout = fin
1212  cout << "WARNING: Matrix is not diagonally dominant" << endl;
1213  }
1214  }
1215 
1216 
1217 
1218 
1219 
1220  fin = fout;
1221 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1222 
1223 }
bool Thomas_Tridiagonal(Array2D< double > &A, valarray< double > &d, valarray< double > &xk)
The tridiagonal solver for implicit collisions.
Definition: nmethods.cpp:216
valarray< double > df0
Definition: collisions.h:252
valarray< double > vr
Definition: collisions.h:243
valarray< double > ddf0
Definition: collisions.h:252
valarray< double > Scattering_Term
Definition: collisions.h:255
Array2D< double > Alpha_Tri
Definition: collisions.h:256
bool Gauss_Seidel(Array2D< double > &A, valarray< complex< double > > &b, valarray< complex< double > > &xk)
Performs Gauss-Seidel method on Ax = b.
Definition: nmethods.cpp:29
Here is the call graph for this function:
Here is the caller graph for this function:

◆ advance() [3/3]

void collisions::advance ( State1D Y,
const Clock W 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/collisions.h>

Definition at line 1417 of file collisions.cpp.

References collisions::advancef0(), collisions::advancef1(), collisions::advanceflm(), State1D::DF(), DistFunc1D::dim(), Input::List(), State1D::Species(), and collisions::Yh.

Referenced by main().

1419 {
1420  Yh = complex<double>(0.0,0.0);
1421 
1422  if (Input::List().f00_implicitorexplicit > 0) advancef0(Yin,W,Yh);
1423 
1424  if (Input::List().flm_collisions){
1425  advancef1(Yin,Yh);
1426  advanceflm(Yin,Yh);
1427  }
1428 
1429  for (size_t s(0); s < Yin.Species(); ++s){
1430  for (size_t i(0); i < Yin.DF(s).dim(); ++i){
1431  Yin.DF(s)(i) = Yh.DF(s)(i);
1432  }
1433  }
1434 }
void advanceflm(State1D &Y, State1D &Yh)
DistFunc1D & DF(size_t s)
Definition: state.h:602
State1D Yh
Definition: collisions.h:372
void advancef0(State1D &Y, const Clock &W, State1D &Yh)
Input_List & List()
Definition: input.cpp:1585
void advancef1(State1D &Y, State1D &Yh)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ advancef0()

void collisions::advancef0 ( State1D Y,
const Clock W,
State1D Yh 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/collisions.h>

Definition at line 1436 of file collisions.cpp.

References State1D::DF(), State1D::HYDRO(), collisions::self_coll, State1D::Species(), Clock::time(), and Hydro1D::Zarray().

Referenced by collisions::advance().

1438 {
1439  size_t sdummy(0);
1440 
1441 
1442  for(size_t s(0); s < Yin.Species(); ++s)
1443  {
1444  self_coll[s].advancef00(Yin.DF(s)(0,0),Yin.HYDRO().Zarray(),W.time(),Yh.DF(s)(0,0));
1445 
1446  if (Yin.Species() > 1)
1447  {
1448  for (size_t sind(0); sind < Yin.Species(); ++sind){
1449  // std::cout << "\n\n sdummy = " << sdummy << ",sind = " << sind << ", s = " << s << "\n\n";
1450  if (s!=sind) {
1451  // std::cout << "\n\n12\n\n";
1452  // unself_f00_coll[sdummy].rkloop(Yin.SH(s,0,0),Yin.SH(sind,0,0)); ++sdummy;
1453 
1454  }
1455  }
1456  }
1457 
1458 
1459  // Yin.DF(s).checknan();
1460 
1461  }
1462 
1463 }
vector< self_collisions > self_coll
Definition: collisions.h:373
double time() const
DistFunc1D & DF(size_t s)
Definition: state.h:602
Here is the call graph for this function:
Here is the caller graph for this function:

◆ advancef00() [1/2]

void interspecies_collisions::advancef00 ( State1D Yin,
const size_t &  sind 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/interspeciescollisions.h>

Remap Distribution to momentum grid of colliding particles.

Advance f00 collisions for all species

Definition at line 837 of file interspeciescollisions.cpp.

References State1D::SH(), and State1D::Species().

837  {
838 // //-------------------------------------------------------------------
839  // size_t sind(0);
840 
841  for (size_t s(0); s<Yin.Species(); ++s){
842  if (s!=sind) {
843 
844  interspecies_f00_collisions[sind].rkloop(Yin.SH(sind,0,0),Yin.SH(s,0,0));
845  std::cout << "\n\n sind,s = " << sind << "," << s << "\n\n";
846  // ++sind;
847  }
848 
849  }
850 }
vector< interspecies_f00_explicit_collisions > interspecies_f00_collisions
SHarmonic1D & SH(size_t s, size_t lh, size_t mh)
Definition: state.h:605
size_t Species() const
Definition: state.h:596
Here is the call graph for this function:

◆ advancef00() [2/2]

void self_collisions::advancef00 ( SHarmonic1D f00,
valarray< double > &  Zarray,
const double  time,
SHarmonic1D f00h 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/collisions.h>

Definition at line 1369 of file collisions.cpp.

References Input::List(), self_f00_implicit_collisions::loop(), self_f00_explicit_collisions::loop(), self_collisions::self_f00_exp_collisions, and self_collisions::self_f00_imp_collisions.

1369  {
1370 //-------------------------------------------------------------------
1371 
1372  if (Input::List().f00_implicitorexplicit){
1373  if (Input::List().f00_implicitorexplicit == 2) {
1374  self_f00_imp_collisions.loop(f00,Zarray,time,f00h);
1375  }
1376  else if (Input::List().f00_implicitorexplicit == 1) {
1377  self_f00_exp_collisions.loop(f00,f00h);
1378  }
1379  }
1380 }
self_f00_explicit_collisions self_f00_exp_collisions
Definition: collisions.h:343
self_f00_implicit_collisions self_f00_imp_collisions
Definition: collisions.h:344
void loop(SHarmonic1D &SHin, valarray< double > &Zarray, const double time, SHarmonic1D &SHout)
Definition: collisions.cpp:442
void loop(SHarmonic1D &SHin, SHarmonic1D &SHout)
Definition: collisions.cpp:787
Input_List & List()
Definition: input.cpp:1585
Here is the call graph for this function:

◆ advancef1() [1/4]

void interspecies_flm_implicit_collisions::advancef1 ( DistFunc1D DF)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/interspeciescollisions.h>

Advance f1_loop for 2D code.

Definition at line 694 of file interspeciescollisions.cpp.

References interspecies_flm_implicit_step::advance(), interspecies_flm_implicit_collisions::Dt, interspecies_flm_implicit_collisions::f00, interspecies_flm_implicit_collisions::fc, interspecies_flm_implicit_collisions::implicit_step, interspecies_flm_implicit_collisions::Nbc, interspecies_flm_implicit_step::reset_coeff(), and interspecies_flm_implicit_collisions::szx.

694  {
695 //-------------------------------------------------------------------
696 // This is the calculation for the harmonics f10, f11
697 // To be specific, this routine does just l=1
698 // To be specific, this routine differs from 'f1_loop1D' above only in one place: the loop is on m=0 and m=1
699 //-------------------------------------------------------------------
700 
701  // For every location in space within the domain of this node
702 
703  for (size_t ix(0); ix < szx-2*Nbc; ++ix){
704 
705 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
706  // "00" harmonic --> Valarray
707  for (size_t ip(0); ip < fc.size(); ++ip){
708  f00[ip] = (DF(0,0)(ip,ix+Nbc)).real();
709  }
710  // Reset the integrals and coefficients
712 
713  // Loop over the harmonics for this (x,y)
714  for(int m(0); m < 2; ++m){
715 
716  // This harmonic --> Valarray
717  for (int ip(0); ip < DF(1,m).nump(); ++ip) {
718  fc[ip] = DF(1,m)(ip,ix+Nbc);
719  }
720 
721  // Take an implicit step
723 
724  // Valarray --> This harmonic
725  for (int ip(0); ip < DF(1,m).nump(); ++ip) {
726  DF(1,m)(ip,ix+Nbc) = fc[ip];
727  }
728  }
729 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
730  }
731  }
valarray< complex< double > > fc
Dummy array.
int szx
Total cells including boundary cells in x-direction.
interspecies_flm_implicit_step implicit_step
The object that is responsible for performing the algebra required for the integrals.
void reset_coeff(const valarray< double > &f00, const double Delta_t)
Resets coefficients and integrals to use in the matrix solve.
int Nbc
Number of boundary cells in each direction.
valarray< double > f00
Array for isotropic component distribution function. Needed for calculating coefficients.
void advance(valarray< complex< double > > &fin, const int el)
Perform a matrix solve to calculate effect of collisions on f >= 1.
Here is the call graph for this function:

◆ advancef1() [2/4]

void self_flm_implicit_collisions::advancef1 ( DistFunc1D DF,
valarray< double > &  Zarray,
DistFunc1D DFh 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/collisions.h>

Advance f1_loop for 2D code.

Definition at line 1266 of file collisions.cpp.

References self_flm_implicit_step::advance(), self_flm_implicit_collisions::Dt, self_flm_implicit_collisions::f00, self_flm_implicit_collisions::f1_m_upperlimit, self_flm_implicit_collisions::fc, self_flm_implicit_collisions::implicit_step, self_flm_implicit_step::reset_coeff(), and self_flm_implicit_collisions::szx.

Referenced by self_collisions::advancef1().

1266  {
1267 //-------------------------------------------------------------------
1268 // This is the collision calculation for the harmonics f10, f11
1269 //-------------------------------------------------------------------
1270 
1271 // For every location in space within the domain of this node
1272 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1273  for (size_t ix(0); ix < szx; ++ix){
1274 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1275  // "00" harmonic --> Valarray
1276  for (size_t ip(0); ip < fc.size(); ++ip){
1277  f00[ip] = (DF(0,0)(ip,ix)).real();
1278  }
1279  // Reset the integrals and coefficients
1280  implicit_step.reset_coeff(f00, Zarray[ix], Dt);
1281 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1282 
1283 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1284  // Loop over the harmonics for this (x,y)
1285  for(int m(0); m < f1_m_upperlimit; ++m){
1286 
1287  // This harmonic --> Valarray
1288  for (int ip(0); ip < DF(1,m).nump(); ++ip) {
1289  fc[ip] = DF(1,m)(ip,ix);
1290  }
1291 
1292 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1293  // Take an implicit step
1294  implicit_step.advance(fc, 1);
1295 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1296 
1297  // Valarray --> This harmonic
1298  for (int ip(0); ip < DF(1,m).nump(); ++ip) {
1299  DFh(1,m)(ip,ix) = fc[ip];
1300  }
1301  }
1302 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1303  }
1304 }
int szx
Total cells including boundary cells in x-direction.
Definition: collisions.h:308
valarray< double > f00
Array for isotropic component distribution function. Needed for calculating coefficients.
Definition: collisions.h:315
valarray< complex< double > > fc
Dummy array.
Definition: collisions.h:314
void reset_coeff(const valarray< double > &f00, double Zvalue, const double Delta_t)
Resets coefficients and integrals to use in the matrix solve.
Definition: collisions.cpp:898
void advance(valarray< complex< double > > &fin, const int el)
Perform a matrix solve to calculate effect of collisions on f >= 1.
self_flm_implicit_step implicit_step
The object that is responsible for performing the algebra required for the integrals.
Definition: collisions.h:318
Here is the call graph for this function:
Here is the caller graph for this function:

◆ advancef1() [3/4]

void self_collisions::advancef1 ( DistFunc1D DF,
valarray< double > &  Zarray,
DistFunc1D DFh 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/collisions.h>

Definition at line 1389 of file collisions.cpp.

References self_flm_implicit_collisions::advancef1(), and self_collisions::self_flm_collisions.

1389  {
1390 //-------------------------------------------------------------------
1391  self_flm_collisions.advancef1(DFin,Zarray,DFh);
1392 }
self_flm_implicit_collisions self_flm_collisions
Definition: collisions.h:345
void advancef1(DistFunc1D &DF, valarray< double > &Zarray, DistFunc1D &DFh)
Advance f1_loop for 2D code.
Here is the call graph for this function:

◆ advancef1() [4/4]

void collisions::advancef1 ( State1D Y,
State1D Yh 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/collisions.h>

Definition at line 1467 of file collisions.cpp.

References State1D::DF(), State1D::HYDRO(), collisions::self_coll, State1D::Species(), and Hydro1D::Zarray().

Referenced by Electric_Field_Methods::Implicit_E_Field::advance(), and collisions::advance().

1469 {
1470  size_t sdummy(0);
1471 
1472 
1473  for(size_t s(0); s < Yin.Species(); ++s)
1474  {
1475  self_coll[s].advancef1(Yin.DF(s), Yin.HYDRO().Zarray(), Yh.DF(s) );
1476 
1477  if (Yin.Species() > 1)
1478  {
1479  for (size_t sind(0); sind < Yin.Species(); ++sind){
1480 
1481  if (s!=sind) {
1482 
1483 
1484  }
1485  }
1486  }
1487 
1488  }
1489 
1490 }
vector< self_collisions > self_coll
Definition: collisions.h:373
DistFunc1D & DF(size_t s)
Definition: state.h:602
Here is the call graph for this function:
Here is the caller graph for this function:

◆ advanceflm() [1/4]

void interspecies_flm_implicit_collisions::advanceflm ( DistFunc1D DF)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/interspeciescollisions.h>

Advance flm_loop for 2D code.

Definition at line 737 of file interspeciescollisions.cpp.

References interspecies_flm_implicit_step::advance(), interspecies_flm_implicit_collisions::Dt, interspecies_flm_implicit_collisions::f00, interspecies_flm_implicit_collisions::fc, interspecies_flm_implicit_collisions::implicit_step, interspecies_flm_implicit_collisions::l0, interspecies_flm_implicit_collisions::m0, interspecies_flm_implicit_collisions::Nbc, interspecies_flm_implicit_step::reset_coeff(), and interspecies_flm_implicit_collisions::szx.

738  {
739 //-------------------------------------------------------------------
740 // This is the calculation for the high order harmonics
741 // To be specific, this routine does l=2 to l0
742 // To be specific, this routine differs from 'flm_loop1D' aboe only in one place: the loop over m all m from 0 to ((m0 < l)? m0:l)
743 //-------------------------------------------------------------------
744 
745  // For every location in space within the domain of this node
746 
747  for (size_t ix(0); ix < szx-2*Nbc; ++ix){
748 
749 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
750  // "00" harmonic --> Valarray
751  for (size_t ip(0); ip < fc.size(); ++ip){
752  f00[ip] = (DF(0,0)(ip,ix+Nbc)).real();
753  }
754  // Reset the integrals and coefficients
755  // --> Assume you did that when you called f1_loop
757  // Loop over the harmonics for this (x,y)
758  for(int l(2); l < l0+1 ; ++l){
759  for(int m(0); m < ((m0 < l)? m0:l)+1; ++m){
760 
761  // This harmonic --> Valarray
762  for (size_t ip(0); ip < fc.size(); ++ip){
763  fc[ip] = (DF(l,m))(ip,ix+Nbc);
764  }
765 
766  // Take an implicit step
768 
769  // Valarray --> This harmonic
770  for (size_t ip(0); ip < fc.size(); ++ip){
771  DF(l,m)(ip,ix+Nbc) = fc[ip];
772  }
773  }
774  }
775  }
776 
777  return;
778 
779  }
valarray< complex< double > > fc
Dummy array.
int szx
Total cells including boundary cells in x-direction.
interspecies_flm_implicit_step implicit_step
The object that is responsible for performing the algebra required for the integrals.
void reset_coeff(const valarray< double > &f00, const double Delta_t)
Resets coefficients and integrals to use in the matrix solve.
int Nbc
Number of boundary cells in each direction.
valarray< double > f00
Array for isotropic component distribution function. Needed for calculating coefficients.
void advance(valarray< complex< double > > &fin, const int el)
Perform a matrix solve to calculate effect of collisions on f >= 1.
Here is the call graph for this function:

◆ advanceflm() [2/4]

void self_flm_implicit_collisions::advanceflm ( DistFunc1D DF,
valarray< double > &  Zarray,
DistFunc1D DFh 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/collisions.h>

Advance flm_loop for 2D code.

Definition at line 1310 of file collisions.cpp.

References self_flm_implicit_step::advance(), self_flm_implicit_collisions::Dt, self_flm_implicit_collisions::f00, self_flm_implicit_collisions::fc, self_flm_implicit_collisions::implicit_step, self_flm_implicit_collisions::l0, self_flm_implicit_collisions::m0, self_flm_implicit_step::reset_coeff(), and self_flm_implicit_collisions::szx.

Referenced by self_collisions::advanceflm().

1311 {
1312 //-------------------------------------------------------------------
1313 // This is the calculation for the high order harmonics
1314 // To be specific, this routine does l=2 to l0
1315 // To be specific, this routine differs from 'flm_loop1D' aboe only in one place: the loop over m all m from 0 to ((m0 < l)? m0:l)
1316 //-------------------------------------------------------------------
1317 
1318  // For every location in space within the domain of this node
1319 
1320  for (size_t ix(0); ix < szx; ++ix){
1321 
1322 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1323  // "00" harmonic --> Valarray
1324  for (size_t ip(0); ip < fc.size(); ++ip){
1325  f00[ip] = (DF(0,0)(ip,ix)).real();
1326  }
1327  // Reset the integrals and coefficients
1328  // --> Assume you did that when you called f1_loop
1329  implicit_step.reset_coeff(f00, Zarray[ix], Dt);
1330  // Loop over the harmonics for this (x,y)
1331  for(int l(2); l < l0+1 ; ++l){
1332  for(int m(0); m < ((m0 < l)? m0:l)+1; ++m){
1333 // std::cout << "(l,m) = " << l << "," << m << "\n";
1334  // This harmonic --> Valarray
1335  for (size_t ip(0); ip < fc.size(); ++ip){
1336  fc[ip] = (DF(l,m))(ip,ix);
1337  }
1338 
1339  // Take an implicit step
1340  implicit_step.advance(fc, l);
1341 
1342  // Valarray --> This harmonic
1343  for (size_t ip(0); ip < fc.size(); ++ip){
1344  DFh(l,m)(ip,ix) = fc[ip];
1345  }
1346  }
1347  }
1348  }
1349 
1350  // return;
1351 
1352 }
int szx
Total cells including boundary cells in x-direction.
Definition: collisions.h:308
size_t l0
Number of m harmonics.
Definition: collisions.h:311
valarray< double > f00
Array for isotropic component distribution function. Needed for calculating coefficients.
Definition: collisions.h:315
valarray< complex< double > > fc
Dummy array.
Definition: collisions.h:314
void reset_coeff(const valarray< double > &f00, double Zvalue, const double Delta_t)
Resets coefficients and integrals to use in the matrix solve.
Definition: collisions.cpp:898
size_t m0
Number of m harmonics.
Definition: collisions.h:312
void advance(valarray< complex< double > > &fin, const int el)
Perform a matrix solve to calculate effect of collisions on f >= 1.
self_flm_implicit_step implicit_step
The object that is responsible for performing the algebra required for the integrals.
Definition: collisions.h:318
Here is the call graph for this function:
Here is the caller graph for this function:

◆ advanceflm() [3/4]

void self_collisions::advanceflm ( DistFunc1D DF,
valarray< double > &  Zarray,
DistFunc1D DFh 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/collisions.h>

Definition at line 1383 of file collisions.cpp.

References self_flm_implicit_collisions::advanceflm(), and self_collisions::self_flm_collisions.

1383  {
1384 //-------------------------------------------------------------------
1385  self_flm_collisions.advanceflm(DFin,Zarray,DFh);
1386 }
void advanceflm(DistFunc1D &DF, valarray< double > &Zarray, DistFunc1D &DFh)
Advance flm_loop for 2D code.
self_flm_implicit_collisions self_flm_collisions
Definition: collisions.h:345
Here is the call graph for this function:

◆ advanceflm() [4/4]

void collisions::advanceflm ( State1D Y,
State1D Yh 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/collisions.h>

Definition at line 1492 of file collisions.cpp.

References State1D::DF(), State1D::HYDRO(), collisions::self_coll, State1D::Species(), and Hydro1D::Zarray().

Referenced by collisions::advance().

1494 {
1495  size_t sdummy(0);
1496 
1497 
1498  for(size_t s(0); s < Yin.Species(); ++s)
1499  {
1500  self_coll[s].advanceflm(Yin.DF(s), Yin.HYDRO().Zarray(), Yh.DF(s) );
1501 
1502  if (Yin.Species() > 1)
1503  {
1504  for (size_t sind(0); sind < Yin.Species(); ++sind){
1505 
1506  if (s!=sind) {
1507 
1508 
1509  }
1510  }
1511  }
1512 
1513 
1514  // Yin.DF(s).checknan();
1515 
1516  }
1517 
1518 }
vector< self_collisions > self_coll
Definition: collisions.h:373
DistFunc1D & DF(size_t s)
Definition: state.h:602
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Ampere_1D()

Ampere_1D::Ampere_1D ( double  xmin,
double  xmax,
size_t  Nx 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/vlasov.h>

Definition at line 1379 of file vlasov.cpp.

References Ampere_1D::idx.

1383  : tmpB(Nx), numx(Nx) {
1384 
1385  idx = complex<double>((-1.0)/ (2.0*(xmax-xmin)/double(Nx))); // -1/(2dx)
1386 
1387 }
Field1D tmpB
Definition: vlasov.h:163
complex< double > idx
Definition: vlasov.h:164
size_t numx
Definition: vlasov.h:165

◆ calc_delta_ChangCooper()

double self_f00_implicit_step::calc_delta_ChangCooper ( const size_t &  k,
const double &  C,
const double &  D 
)
private

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/collisions.h>

Definition at line 224 of file collisions.cpp.

References self_f00_implicit_step::dvr.

Referenced by self_f00_implicit_step::update_D_and_delta().

224  {
225  double answer(0.5);
226  double W = 0.5*(dvr[k-1]+dvr[k])*C/D;
227 
228  if (W > 1.0e-8){
229  answer = 1.0/W - 1.0/(exp(W)-1.0);
230  }
231  return answer;
232 }
valarray< double > dvr
Definition: collisions.h:32
Here is the caller graph for this function:

◆ calculateintegrals()

void interspecies_f00_explicit_step::calculateintegrals ( const valarray< double > &  f1in,
const valarray< double > &  f2in 
)
private

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/interspeciescollisions.h>

Remap Distribution to momentum grid of colliding particles.

Pause for density and temperature

The other density and temperature

Definition at line 198 of file interspeciescollisions.cpp.

References interspecies_f00_explicit_step::I2_s2, interspecies_f00_explicit_step::I4_s2, interspecies_f00_explicit_step::J1_s2, interspecies_f00_explicit_step::m1, interspecies_f00_explicit_step::m2, Algorithms::moment(), interspecies_f00_explicit_step::n1, interspecies_f00_explicit_step::n2, interspecies_f00_explicit_step::pgrid_s1, interspecies_f00_explicit_step::T1, interspecies_f00_explicit_step::T2, interspecies_f00_explicit_step::U1, interspecies_f00_explicit_step::U1m1, interspecies_f00_explicit_step::U2, interspecies_f00_explicit_step::U2m1, interspecies_f00_explicit_step::U4, and interspecies_f00_explicit_step::U4m1.

Referenced by interspecies_f00_explicit_step::takestep().

198  {
199 
200 
201 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
202 // Evaluate the integrals in a standard manner
203  I4_s2[0] = 0;
204  for (int n(1); n < I4_s2.size(); ++n) {
205  I4_s2[n] = U4[n]*f2in[n]+U4m1[n]*f2in[n-1];
206  I4_s2[n] += I4_s2[n-1];
207  // std::cout << "\n I4= " << I4_s2[n] << "\n\n";
208  }
209 
210  I2_s2[0] = 0;
211  for (int n(1); n < I2_s2.size(); ++n) {
212  I2_s2[n] = U2[n]*f2in[n]+U2m1[n]*f2in[n-1];
213  I2_s2[n] += I2_s2[n-1];
214  // std::cout << "\n I2= " << I2_s2[n] << "\n\n";
215  }
216 
218  n2 = (4.0*M_PI*I2_s2[I2_s2.size()-1]);
219 
220  T2 = m2*(I4_s2[I4_s2.size()-1]/3.0/I2_s2[I2_s2.size()-1]);
221 
222  // std::cout << "\n n2= " << n2 << "\n\n";
223  // std::cout << "\n T2= " << T2 << "\n\n";
224 
225  J1_s2[J1_s2.size()-1] = 0;
226  for (int n(J1_s2.size()-2); n > -1; --n) {
227  J1_s2[n] = U1[n+1]*f2in[n+1]+U1m1[n+1]*f2in[n];
228  J1_s2[n] += J1_s2[n+1];
229  }
230 
231  // for (int k(0); k < I2_s2.size(); ++k){
232  // I4_s2[k] /= pgrid_s2[k]*pgrid_s2[k];
233  // J1_s2[k] *= pgrid_s2[k];
234  // }
235 
236  I4_s2 *= 4.0 * M_PI;
237  I2_s2 *= 4.0 * M_PI;
238  J1_s2 *= 4.0 * M_PI;
239 
240 
242  // for (size_t ip(0); ip < f1in.size() ; ++ip)
243  // {
244  // std::cout << "f1[" << pgrid_s1[ip] << "] = " << f1in[ip] << "\n";
245 
246  // // f1[ip]=f1in[ip];
247  // }
248  n1 = 4.0*M_PI*(Algorithms::moment(f1in,pgrid_s1,2.0));
249  T1 = 4.0*M_PI*m1*(Algorithms::moment(f1in,pgrid_s1,4.0))/3.0/n1;
250 
251 
252 
253  // exit(1);
254 
255 }
valarray< double > J1_s2
The integrals.
T moment(const vector< T > q, const vector< T > x, const int p)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ collisions()

collisions::collisions ( const State1D Yin,
const double &  deltat 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/collisions.h>

Constructors/Destructors.

Definition at line 1395 of file collisions.cpp.

References State1D::DF(), collisions::self_coll, and State1D::Species().

1395  :Yh(Yin)
1396 //-------------------------------------------------------------------
1397 // Constructor
1398 //-------------------------------------------------------------------
1399 {
1400  for(size_t s(0); s < Yin.Species(); ++s){
1401  self_coll.push_back( self_collisions(Yin.DF(s),deltat) );
1402 
1403 
1404  if (Yin.Species() > 1){
1405  for (size_t sind(0); sind < Yin.Species(); ++sind){
1406 // if (s!=sind) unself_f00_coll.push_back(interspecies_f00_explicit_collisions(Yin.DF(s),Yin.DF(sind),deltat));
1407  }
1408 
1409 
1410 
1411  }
1412 
1413  }
1414  // exit(1);
1415 }
The top-level container for self collisions over all species on l=0.
Definition: collisions.h:331
vector< self_collisions > self_coll
Definition: collisions.h:373
DistFunc1D & DF(size_t s)
Definition: state.h:602
State1D Yh
Definition: collisions.h:372
size_t Species() const
Definition: state.h:596
Here is the call graph for this function:

◆ Current_1D()

Current_1D::Current_1D ( double  pmin,
double  pmax,
size_t  Np,
size_t  Nx 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/vlasov.h>

Definition at line 38 of file vlasov.cpp.

References Current_1D::small.

40  : Jx(Nx), Jy(Nx), Jz(Nx), small(0.5*pmax/Np) {
41 // pr(Algorithms::MakeAxis(complex<double>(pmin),
42 // complex<double>(pmax),
43 // Np)),
44 // invg(pr) {
45  small *= small; small *= small; small *= 0.5*pmax/Np;
46  small *= 0.2; small *= 1.0/(1.5*pmax/Np);
47 // for (size_t i(0); i < pr.size(); ++i) {
48 // invg[i] = 1.0 / (sqrt(1.0+pr[i]*pr[i]));
49 // }
50 };
Field1D Jz
Definition: vlasov.h:128
Field1D Jy
Definition: vlasov.h:128
double small
Definition: vlasov.h:129
Field1D Jx
Definition: vlasov.h:128

◆ Electric_Field_1D()

Electric_Field_1D::Electric_Field_1D ( size_t  Nl,
size_t  Nm,
double  pmin,
double  pmax,
size_t  Np,
double  xmin,
double  xmax,
size_t  Nx 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/vlasov.h>

Definition at line 90 of file vlasov.cpp.

References Electric_Field_1D::A1, Electric_Field_1D::A100, Electric_Field_1D::A2, Electric_Field_1D::A210, Electric_Field_1D::A310, Electric_Field_1D::B1, Electric_Field_1D::B2, Electric_Field_1D::B211, Electric_Field_1D::C1, Electric_Field_1D::C100, Electric_Field_1D::C2, Electric_Field_1D::C3, Electric_Field_1D::C311, Electric_Field_1D::C4, Electric_Field_1D::Hp0, Electric_Field_1D::invpr, and Electric_Field_1D::pr.

96  : A1(Nl+1,Nm+1), A2(Nl+1,Nm+1),
97  B1(Nl+1), B2(Nl+1),
98  C1(Nl+1), C2(Nl+1,Nm+1), C3(Nl+1), C4(Nl+1,Nm+1),
99  Hp0(Nl+1),
100  H(Np,Nx), G(Np,Nx), TMP(Np,Nx),
101  // pr(Algorithms::MakeAxis(complex<double>(complex<double>(pmax/2.0/Np)),
102  // complex<double>(pmax),
103  // Np)),
104 
105  pr(Algorithms::MakeCAxis(complex<double>(0.0),
106  complex<double>(pmax),
107  Np)),
108  invpr(pr)
109 {
110 // - - - - - - - - - - - - - - - - - - - - - - - - - - -
111  complex<double> lc, mc;
112 
113 // Inverted momentum axis
114  for (size_t i(0); i < pr.size(); ++i) {
115  invpr[i] = 1.0/pr[i];
116  }
117  double idp = (-1.0)/ (2.0*(pmax-pmin)/double(Np)); // -1/(2dp)
118  // double idp = (-1.0)/ (2.0*(pmax-pmax/2.0/double(Np))/double(Np-1));
119 
120 // - - - - - - - - - - - - - - - - - - - - - - - - - - -
121 // Calculate the A1 * l/(l+1) * 1/(2Dp), A2 * (-1)/(2Dp) parameters
122  for (size_t l(1); l < Nl+1; ++l){
123  for (size_t m(0); m<((Nm<l)?Nm:l)+1; ++m){
124  lc = complex<double>(l);
125  mc = complex<double>(m);
126  A1(l,m) = idp *(-1.0) * (lc+1.0-mc)/(2.0*lc+1.0) * lc/(lc+1.0);
127  A2(l,m) = idp * (lc+mc)/(2.0*lc+1.0);
128  }
129  }
130  A1(0,0) = idp;
131  // A2[0] is not used
132 
133 // - - - - - - - - - - - - - - - - - - - - - - - - - - -
134 
135 // Calculate the "B1, B2" parameters
136 // - - - - - - - - - - - - - - - - - - - - - - - - - - -
137  for (size_t l(1); l<Nl+1; ++l){
138  lc = complex<double>(l);
139  B1[l] = idp * lc* lc /(2.0*lc+1.0);
140  B2[l] = idp * lc*(lc+1.0)/(2.0*lc+1.0);
141  }
142  B2[0] = 1.0;
143 // - - - - - - - - - - - - - - - - - - - - - - - - - - -
144 
145 // Calculate the "C1, C3" parameters
146 // - - - - - - - - - - - - - - - - - - - - - - - - - - -
147  for (size_t l(1); l<Nl+1; ++l){
148  lc = complex<double>(l);
149  C1[l] = (-0.5) * idp * lc /((2.0*lc+1.0)*(lc+1.0));
150  C3[l] = (-0.5) * idp /(2.0*lc+1.0);
151  }
152  C1[0] = 0.5 * idp;
153 // - - - - - - - - - - - - - - - - - - - - - - - - - - -
154 
155 // Calculate the "C2, C4" parameters
156 // - - - - - - - - - - - - - - - - - - - - - - - - - - -
157  for (size_t l(2); l<Nl+1; ++l){
158  for (size_t m(2); m<((Nm<l)?Nm:l)+1; ++m){
159  lc = complex<double>(l);
160  mc = complex<double>(m);
161  C2(l,m) = (0.5) * idp * lc * (lc-mc+2.0)*(lc-mc+1.0)/((2.0*lc+1.0)*(lc+1.0));
162  C4(l,m) = (0.5) * idp * (lc+mc-1.0)*(lc+mc)/(2.0*lc+1.0);
163  }
164  }
165 // - - - - - - - - - - - - - - - - - - - - - - - - - - -
166 
167 // - - - - - - - - - - - - - - - - - - - - - - - - - - -
168 // -2*Dp*H at the 0 momentum cell
169  Hp0[0] = 1.0 / pr[0];
170  for (size_t l(1); l < Nl+1; ++l) {
171  double ld(l);
172  Hp0[l] = Hp0[l-1] * (pr[0]/pr[1]) * (2.0*ld+1.0)/(2.0*ld-1.0);
173  }
174  Hp0 *= (-2.0)*(pr[1]-pr[0]);
175 
176  A100 = complex<double>(idp);
177  C100 = complex<double>(0.5*idp);
178  A210 = complex<double>(1.0/3.0*idp);
179  B211 = complex<double>(2.0/3.0);
180  A310 = complex<double>(2.0/5.0*idp);
181  C311 = complex<double>(-0.5*idp/5.0);
182 
183 }
valarray< complex< double > > C3
Definition: vlasov.h:76
complex< double > A100
Definition: vlasov.h:72
Array2D< complex< double > > C2
Definition: vlasov.h:77
SHarmonic1D H
Definition: vlasov.h:70
complex< double > C100
Definition: vlasov.h:72
complex< double > A210
Definition: vlasov.h:72
complex< double > A310
Definition: vlasov.h:72
complex< double > C311
Definition: vlasov.h:72
complex< double > B211
Definition: vlasov.h:72
Array2D< complex< double > > A1
Definition: vlasov.h:74
valarray< complex< double > > B2
Definition: vlasov.h:75
valarray< complex< double > > pr
Definition: vlasov.h:78
SHarmonic1D TMP
Definition: vlasov.h:70
valarray< T > MakeCAxis(const T min, const T max, const size_t N)
SHarmonic1D G
Definition: vlasov.h:70
valarray< complex< double > > C1
Definition: vlasov.h:76
valarray< complex< double > > B1
Definition: vlasov.h:75
Array2D< complex< double > > C4
Definition: vlasov.h:77
valarray< complex< double > > invpr
Definition: vlasov.h:78
valarray< complex< double > > Hp0
Definition: vlasov.h:78
Array2D< complex< double > > A2
Definition: vlasov.h:74

◆ es1d() [1/3]

void Spatial_Advection_1D::es1d ( const DistFunc1D Din,
DistFunc1D Dh 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/vlasov.h>

Definition at line 1280 of file vlasov.cpp.

References Spatial_Advection_1D::A1, Spatial_Advection_1D::A2, Spatial_Advection_1D::fd1, Spatial_Advection_1D::fd2, DistFunc1D::l0(), DistFunc1D::mass(), SHarmonic1D::mpaxis(), and Spatial_Advection_1D::vr.

1280  {
1281 //--------------------------------------------------------------
1282 
1283  valarray<complex<double> > vt(vr); vt *= 1.0/Din.mass();
1284 
1285  size_t l0(Din.l0());
1286 
1287  fd1 = Din(0,0); fd1 = fd1.Dx();
1288 
1289  vt *= A1(0,0); Dh(1,0) += fd1.mpaxis(vt);
1290 
1291  for (size_t l(1); l < l0; ++l) {
1292  fd1 = Din(l,0); //std::cout << "\n \n before dx, l = " << l << " \n";
1293  fd1 = fd1.Dx(); //std::cout << " \n after dx\n";
1294 
1295  vt *= A2(l,0)/A1(l-1,0); fd2 = fd1; Dh(l-1,0) += fd1.mpaxis(vt);
1296  vt *= A1(l,0)/A2(l ,0); Dh(l+1,0) += fd2.mpaxis(vt);
1297  }
1298 
1299  fd1 = Din(l0,0); fd1 = fd1.Dx();
1300  vt *= A2(l0,0)/A1(l0-1,0); Dh(l0-1,0) += fd1.mpaxis(vt);
1301  // vt *= 1.0/A2(l0,0);
1302 }
SHarmonic1D fd2
Definition: vlasov.h:31
double mass() const
Definition: state.h:400
Array2D< complex< double > > A2
Definition: vlasov.h:33
valarray< complex< double > > vr
Definition: vlasov.h:34
Array2D< complex< double > > A1
Definition: vlasov.h:33
SHarmonic1D fd1
Definition: vlasov.h:31
size_t l0() const
Definition: state.h:396
SHarmonic1D & mpaxis(const valarray< complex< double > > &shmulti)
Definition: state.cpp:122
Here is the call graph for this function:

◆ es1d() [2/3]

void Electric_Field_1D::es1d ( const DistFunc1D Din,
const Field1D FEx,
const Field1D FEy,
const Field1D FEz,
DistFunc1D Dh 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/vlasov.h>

Definition at line 379 of file vlasov.cpp.

References Electric_Field_1D::A1, Electric_Field_1D::A2, Field1D::array(), Electric_Field_1D::G, Electric_Field_1D::H, DistFunc1D::l0(), Electric_Field_1D::MakeG00(), Electric_Field_1D::MakeGH(), SHarmonic1D::mxaxis(), DistFunc1D::q(), and Electric_Field_1D::TMP.

381  {
382 //--------------------------------------------------------------
383 // This is the core calculation for the electric field
384 //--------------------------------------------------------------
385 
386  complex<double> ii(0.0,1.0);
387 
388  valarray<complex<double> > Ex(FEx.array());
389  // valarray<complex<double> > Em(FEz.array());
390  // Em *= (-1.0)*ii;
391  // Em += FEy.array();
392  // valarray<complex<double> > Ep(FEz.array());
393  // Ep *= ii;
394  // Ep += FEy.array();
395 
396  Ex *= Din.q();
397  // Em *= Din.q();
398  // Ep *= Din.q();
399 
400  size_t l0(Din.l0());
401  // size_t m0(Din.m0());
402 
403 
404 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
405 // m = 0, l = 0
406 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
407  MakeG00(Din(0,0));
408  Ex *= A1(0,0); TMP = G; Dh(1,0) += G.mxaxis(Ex);
409 
410 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
411 // m = 0, l = 1
412 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
413  MakeGH(Din(1,0),1);
414  Ex *= A2(1,0) / A1(0,0); Dh(0,0) += H.mxaxis(Ex);
415  Ex *= A1(1,0) / A2(1,0); TMP = G; Dh(2,0) += G.mxaxis(Ex);
416 
417 
418 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
419 // m = 0, 1 < l < l0
420 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
421  for (size_t l(2); l < l0; ++l){
422  MakeGH(Din(l,0),l);
423  Ex *= A2(l,0) / A1(l-1,0); TMP = H; Dh(l-1,0) += H.mxaxis(Ex);
424 
425  Ex *= A1(l,0) / A2(l,0); TMP = G; Dh(l+1,0) += G.mxaxis(Ex);
426 
427  }
428 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
429 // m = 0, l = l0
430 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
431  MakeGH(Din(l0,0),l0);
432  Ex *= A2(l0,0) / A1(l0-1,0); TMP = H; Dh(l0-1,0) += H.mxaxis(Ex);
433 
434 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
435 
436 
437 }
void MakeG00(SHarmonic1D &f)
Definition: vlasov.cpp:828
SHarmonic1D H
Definition: vlasov.h:70
SHarmonic1D & mxaxis(const valarray< complex< double > > &shmulti)
Definition: state.cpp:126
valarray< complex< double > > & array() const
Definition: state.h:196
double q() const
Definition: state.h:399
Array2D< complex< double > > A1
Definition: vlasov.h:74
SHarmonic1D TMP
Definition: vlasov.h:70
void MakeGH(SHarmonic1D &f, size_t l)
Definition: vlasov.cpp:807
SHarmonic1D G
Definition: vlasov.h:70
size_t l0() const
Definition: state.h:396
Array2D< complex< double > > A2
Definition: vlasov.h:74
Here is the call graph for this function:

◆ es1d() [3/3]

void Current_1D::es1d ( const DistFunc1D Din,
Field1D FExh 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/vlasov.h>

Definition at line 71 of file vlasov.cpp.

References DistFunc1D::getcurrent(), Current_1D::Jx, and Field1D::numx().

71  {
72 
73  valarray<double> temp(Din(0).numx());
74 
75  temp = Din.getcurrent(0);
76 
77  for (size_t i(0); i < Jx.numx(); ++i) {
78  Jx(i) = complex<double >(temp[i]);//+4.0/3.0*3.1415926*small*Din(1,0)(1,i);
79  }
80 
81  Exh += Jx;
82 
83 }
size_t numx() const
Definition: state.h:197
valarray< double > getcurrent(size_t dir)
Definition: state.cpp:965
Field1D Jx
Definition: vlasov.h:128
Here is the call graph for this function:

◆ f1only() [1/3]

void Spatial_Advection_1D::f1only ( const DistFunc1D Din,
DistFunc1D Dh 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/vlasov.h>

Definition at line 1306 of file vlasov.cpp.

References Spatial_Advection_1D::A00, Spatial_Advection_1D::A10, SHarmonic1D::Dx(), Spatial_Advection_1D::fd1, DistFunc1D::mass(), SHarmonic1D::mpaxis(), and Spatial_Advection_1D::vr.

1306  {
1307 //--------------------------------------------------------------
1308 
1309  valarray<complex<double> > vt(vr); vt *= 1.0/Din.mass();
1310 
1311  fd1 = Din(0,0);
1312  fd1 = fd1.Dx(); vt *= A00;
1313  Dh(1,0) += (fd1.mpaxis(vt));
1314 
1315  fd1 = Din(1,0);
1316  fd1 = fd1.Dx(); vt *= A10/A00;
1317  Dh(0,0) += (fd1.mpaxis(vt));
1318 
1319 // fd1 = Din(0,0); fd1 *= complex<double>(1.0/3.0);
1320 // fd1 = fd1.Dx(); vt *= A20/A10;
1321 // Dh(1,0) += (fd1.mpaxis(vt));
1322 
1323 }
complex< double > A00
Definition: vlasov.h:32
double mass() const
Definition: state.h:400
valarray< complex< double > > vr
Definition: vlasov.h:34
SHarmonic1D fd1
Definition: vlasov.h:31
SHarmonic1D & Dx()
Definition: state.cpp:185
complex< double > A10
Definition: vlasov.h:32
SHarmonic1D & mpaxis(const valarray< complex< double > > &shmulti)
Definition: state.cpp:122
Here is the call graph for this function:

◆ f1only() [2/3]

void Electric_Field_1D::f1only ( const DistFunc1D Din,
const Field1D FEx,
const Field1D FEy,
const Field1D FEz,
DistFunc1D Dh 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/vlasov.h>

Definition at line 633 of file vlasov.cpp.

References Electric_Field_1D::A100, Electric_Field_1D::A210, Field1D::array(), Electric_Field_1D::B211, Electric_Field_1D::C100, Electric_Field_1D::G, Electric_Field_1D::H, DistFunc1D::l0(), DistFunc1D::m0(), Electric_Field_1D::MakeG00(), Electric_Field_1D::MakeGH(), SHarmonic1D::mxaxis(), DistFunc1D::q(), SHarmonic1D::Re(), and Electric_Field_1D::TMP.

635  {
636 //--------------------------------------------------------------
637 // This is the core calculation for the electric field
638 //--------------------------------------------------------------
639 
640  complex<double> ii(0.0,1.0);
641 
642  valarray<complex<double> > Ex(FEx.array());
643  valarray<complex<double> > Em(FEz.array());
644  Em *= (-1.0)*ii;
645  Em += FEy.array();
646  valarray<complex<double> > Ep(FEz.array());
647  Ep *= ii;
648  Ep += FEy.array();
649 
650  Ex *= Din.q();
651  Em *= Din.q();
652  Ep *= Din.q();
653 
654  size_t l0(Din.l0());
655  size_t m0(Din.m0());
656 
657  SHarmonic1D f20(Din(0,0));
658  f20 *= complex<double>(1.0/3.0);
659 
660 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
661 // m = 0, l = 0
662 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
663  MakeG00(Din(0,0));
664  Ex *= A100; TMP = G; Dh(1,0) += G.mxaxis(Ex);
665  Em *= C100; Dh(1,1) += TMP.mxaxis(Em);
666 
667 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
668 // m = 0, l = 1
669 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
670  MakeGH(Din(1,0),1);
671  Ex *= A210 / A100; Dh(0,0) += H.mxaxis(Ex);
672 
673 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
674 // m = 0, 1 < l < l0
675 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
676 
677 // MakeGH(f20,2);
678 // Ex *= A310 / A210; TMP = H; Dh(1,0) += H.mxaxis(Ex);
679 // Em *= C311 / C100; Dh(1,1) += TMP.mxaxis(Em);
680 
681 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
682 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
683 // m = 1, l = 1
684 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
685  MakeGH(Din(1,1),1);
686  Ep *= B211; H = H.mxaxis(Ep); Dh(0,0) += H.Re();
687 
688 }
complex< double > A100
Definition: vlasov.h:72
void MakeG00(SHarmonic1D &f)
Definition: vlasov.cpp:828
SHarmonic1D H
Definition: vlasov.h:70
complex< double > C100
Definition: vlasov.h:72
SHarmonic1D & mxaxis(const valarray< complex< double > > &shmulti)
Definition: state.cpp:126
complex< double > A210
Definition: vlasov.h:72
SHarmonic1D & Re()
Definition: state.cpp:130
A 1D Spherical Harmonic.
Definition: state.h:57
valarray< complex< double > > & array() const
Definition: state.h:196
complex< double > B211
Definition: vlasov.h:72
size_t m0() const
Definition: state.h:397
double q() const
Definition: state.h:399
SHarmonic1D TMP
Definition: vlasov.h:70
void MakeGH(SHarmonic1D &f, size_t l)
Definition: vlasov.cpp:807
SHarmonic1D G
Definition: vlasov.h:70
size_t l0() const
Definition: state.h:396
Here is the call graph for this function:

◆ f1only() [3/3]

void Magnetic_Field_1D::f1only ( const DistFunc1D Din,
const Field1D FBx,
const Field1D FBy,
const Field1D FBz,
DistFunc1D Dh 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/vlasov.h>

Definition at line 1120 of file vlasov.cpp.

References Magnetic_Field_1D::A1, Magnetic_Field_1D::A3, Field1D::array(), Magnetic_Field_1D::B1, Magnetic_Field_1D::FLM, SHarmonic1D::mxaxis(), DistFunc1D::q(), and SHarmonic1D::Re().

1122  {
1123 //--------------------------------------------------------------
1124 // This is the core calculation for the magnetic field
1125 //--------------------------------------------------------------
1126 
1127  complex<double> ii(0.0,1.0);
1128 
1129  valarray<complex<double> > Bx(FBx.array());
1130  valarray<complex<double> > Bm(FBy.array());
1131  Bm *= (-1.0)*ii;
1132  Bm += FBz.array();
1133  valarray<complex<double> > Bp(FBy.array());
1134  Bp *= ii;
1135  Bp += FBz.array();
1136 
1137  Bx *= Din.q();
1138  Bm *= Din.q();
1139  Bp *= Din.q();
1140 
1141  size_t l0(B1.size()-1);
1142  size_t m0(A1.size()-1);
1143 
1144 // - - - - - - - - - - - - - - - - - - - - - - - - - - -
1145 // m = 0, 1 < l < l0+1
1146 // - - - - - - - - - - - - - - - - - - - - - - - - - - -
1147  Bp *= A3;
1148  for (size_t l(1); l < l0+1; ++l){
1149  FLM = Din(l,0); Dh(l,1) += FLM.mxaxis(Bp);
1150  }
1151 
1152 // - - - - - - - - - - - - - - - - - - - - - - - - - - -
1153 // m = 1, l = 1
1154 // - - - - - - - - - - - - - - - - - - - - - - - - - - -
1155  FLM = Din(1,1); Bx *= A1[1]; Dh(1,1) += FLM.mxaxis(Bx);
1156  FLM = Din(1,1); Bm *= B1[1]; FLM = FLM.mxaxis(Bm); Dh(1,0) += FLM.Re();
1157 
1158 // // - - - - - - - - - - - - - - - - - - - - - - - - - - -
1159 // // m = 1, l > 1
1160 // // - - - - - - - - - - - - - - - - - - - - - - - - - - -
1161 // for (size_t l(2); l < l0+1; ++l){
1162 // FLM = Din(l,1); Dh(l,2) += FLM.mxaxis(Bp);
1163 // FLM = Din(l,1); Dh(l,1) += FLM.mxaxis(Bx);
1164 // FLM = Din(l,1); Bm *= B1[l]/B1[l-1]; FLM = FLM.mxaxis(Bm); Dh(l,0) += FLM.Re();
1165 // }
1166 // Bm *= 1.0/B1[l0];
1167 
1168 // // - - - - - - - - - - - - - - - - - - - - - - - - - - -
1169 // // m > 1, l = m
1170 // // - - - - - - - - - - - - - - - - - - - - - - - - - - -
1171 // for (size_t m(2); m < m0; ++m){
1172 // FLM = Din(m,m); Bx *= A1[m]/A1[m-1]; Dh(m,m ) += FLM.mxaxis(Bx);
1173 // FLM = Din(m,m); Bm *= A2(m,m); Dh(m,m-1) += FLM.mxaxis(Bm);
1174 // for (size_t l(m+1); l < l0+1; ++l){
1175 // FLM = Din(l,m); Dh(l,m+1) += FLM.mxaxis(Bp);
1176 // FLM = Din(l,m); Dh(l,m ) += FLM.mxaxis(Bx);
1177 // FLM = Din(l,m); Bm *= A2(l,m)/A2(l-1,m); Dh(l,m-1) += FLM.mxaxis(Bm);
1178 // }
1179 // Bm *= 1.0/A2(l0,m);
1180 // }
1181 
1182 // // - - - - - - - - - - - - - - - - - - - - - - - - - - -
1183 // // m = m0, l >= m0
1184 // // - - - - - - - - - - - - - - - - - - - - - - - - - - -
1185 // FLM = Din(m0,m0); Bx *= A1[m0]/A1[m0-1]; Dh(m0,m0) += FLM.mxaxis(Bx);
1186 // FLM = Din(m0,m0); Bm *= A2(m0,m0)/*/A2(l0,m0-1)*/; Dh(m0,m0-1) += FLM.mxaxis(Bm);
1187 // for (size_t l(m0+1); l < l0+1; ++l){
1188 // FLM = Din(l,m0); Dh(l,m0 ) += FLM.mxaxis(Bx);
1189 // FLM = Din(l,m0); Bm *= A2(l,m0)/A2(l-1,m0); Dh(l,m0-1) += FLM.mxaxis(Bm);
1190 // }
1191 
1192 }
valarray< complex< double > > B1
Definition: vlasov.h:106
complex< double > A3
Definition: vlasov.h:108
SHarmonic1D FLM
Definition: vlasov.h:104
valarray< complex< double > > A1
Definition: vlasov.h:106
SHarmonic1D & mxaxis(const valarray< complex< double > > &shmulti)
Definition: state.cpp:126
SHarmonic1D & Re()
Definition: state.cpp:130
valarray< complex< double > > & array() const
Definition: state.h:196
double q() const
Definition: state.h:399
Here is the call graph for this function:

◆ Faraday_1D()

Faraday_1D::Faraday_1D ( double  xmin,
double  xmax,
size_t  Nx 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/vlasov.h>

Definition at line 1330 of file vlasov.cpp.

References Faraday_1D::idx.

1334  : tmpE(Nx), numx(Nx) {
1335 
1336  idx = complex<double>((-1.0)/ (2.0*(xmax-xmin)/double(Nx))); // -1/(2dx)
1337 
1338 }
complex< double > idx
Definition: vlasov.h:146
size_t numx
Definition: vlasov.h:147
Field1D tmpE
Definition: vlasov.h:145

◆ G()

double self_f00_explicit_step::G ( const int &  n,
const valarray< double > &  fin 
)
private

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/collisions.h>

Calculate G for low momentum cells

Parameters
[in]nNumber of low momentum cells being treated differently.
[in]finInput distribution function.
Returns
Returns G value for n cells.

Definition at line 621 of file collisions.cpp.

References self_f00_explicit_step::J1, and self_f00_explicit_step::vr.

Referenced by self_f00_explicit_step::takestep().

621  {
622 //-------------------------------------------------------------------
623  double i2s, i4s;
624  double f00( (fin[0] - fin[1]*(vr[0]*vr[0])/(vr[1]*vr[1]))/
625  (1.0 - (vr[0]*vr[0])/(vr[1]*vr[1])) );
626 
627  i2s = f00*pow(vr[n],3)/3.0 + (fin[1]-f00)*pow(vr[n],5)/(vr[1]*vr[1])*0.2;
628  i4s = f00*pow(vr[n],5)*0.2 + (fin[1]-f00)*pow(vr[n],7)/(vr[1]*vr[1]*7.0);
629 
630  return fin[n]*i4s + (pow(vr[n],3)*fin[n]-3.0*i2s) * J1[n];
631 }
valarray< double > vr
Define the velocity axis.
Definition: collisions.h:129
valarray< double > J1
The integrals.
Definition: collisions.h:135
Here is the caller graph for this function:

◆ getleftside()

void self_f00_implicit_step::getleftside ( valarray< double > &  fin,
const double &  Z0,
const double &  heating,
const double &  cooling,
Array2D< double > &  LHStemp 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/collisions.h>

Calculate Rosenbluth and Chang-Cooper quantities

Also fills in I4_Lnee (the temperature for the Lnee calculation)

And takes care of boundaries

Normalizing quantities (Inspired by previous collision routines and OSHUN notes by M. Tzoufras)

< ZLogLambda

Fill in matrix

Boundaries by hand – This operates on f(0)

Definition at line 343 of file collisions.cpp.

References self_f00_implicit_step::c_kpre, self_f00_implicit_step::C_RB, self_f00_implicit_step::D_RB, self_f00_implicit_step::delta_CC, self_f00_implicit_step::dtoverv2, self_f00_implicit_step::dvr, self_f00_implicit_step::formulas, self_f00_implicit_step::I4_Lnee, self_f00_implicit_step::ib, Formulary::LOGee(), Formulary::LOGei(), self_f00_implicit_step::update_C_Rosenbluth(), self_f00_implicit_step::update_D_and_delta(), self_f00_implicit_step::update_D_inversebremsstrahlung(), and Formulary::Zeta.

Referenced by self_f00_implicit_collisions::loop().

343  {
344 
345  double collisional_coefficient;
346  double heating_coefficient;
347 
348 // Array2D<double> LHS(fin.size(),fin.size());
349 
351  update_C_Rosenbluth(fin);
352  update_D_and_delta(fin);
353 
355  collisional_coefficient = formulas.LOGee(C_RB[C_RB.size()-1],I4_Lnee/3.0/C_RB[C_RB.size()-1]);
356  collisional_coefficient *= 4.0*M_PI/3.0*c_kpre;
357 
358 
359 
360  heating_coefficient = formulas.Zeta*Z0*formulas.LOGei(C_RB[C_RB.size()-1],I4_Lnee/3.0/C_RB[C_RB.size()-1],Z0*formulas.Zeta);
361  heating_coefficient *= c_kpre / 6.0 * pow(vos,2.0) * C_RB[C_RB.size()-1];
362  heating_coefficient /= collisional_coefficient;
363 
364  if (ib) update_D_inversebremsstrahlung(Z0, heating_coefficient,vos);
365 
367 
368  size_t ip(0);
369 
371  LHStemp(ip, ip + 1) = - dtoverv2[ip] * collisional_coefficient
372  * (C_RB[ip + 1] * (1.0 - delta_CC[ip + 1])
373  + D_RB[ip + 1] / dvr[ip + 1]);
374 
375  LHStemp(ip , ip) = 1.0 - dtoverv2[ip] * collisional_coefficient
376  * (C_RB[ip + 1] * delta_CC[ip + 1] - D_RB[ip + 1] / dvr[ip + 1]
377  - C_RB[ip] * (1.0 - delta_CC[ip]) - D_RB[ip] / dvr[ip]);
378 
379 
380  for (ip = 1; ip < fin.size() - 1; ++ip){
381  LHStemp(ip, ip + 1) = - dtoverv2[ip] * collisional_coefficient
382  * (C_RB[ip + 1] * (1.0 - delta_CC[ip + 1])
383  + D_RB[ip + 1] / dvr[ip + 1]);
384 
385  LHStemp(ip , ip) = 1.0 - dtoverv2[ip] * collisional_coefficient
386  * (C_RB[ip + 1] * delta_CC[ip + 1] - D_RB[ip + 1] / dvr[ip + 1]
387  - C_RB[ip] * (1.0 - delta_CC[ip]) - D_RB[ip] / dvr[ip]);
388 
389  LHStemp(ip, ip - 1) = dtoverv2[ip] * collisional_coefficient
390  * (C_RB[ip] * delta_CC[ip]
391  - D_RB[ip] / dvr[ip]);
392 
393  }
394 
395  ip = fin.size() - 1;
396 
397  LHStemp(ip , ip) = 1.0 - dtoverv2[ip] * collisional_coefficient
398  * (C_RB[ip + 1] * delta_CC[ip + 1]
399  - C_RB[ip] * (1.0 - delta_CC[ip]) - D_RB[ip] / dvr[ip]);
400 
401  LHStemp(ip, ip - 1) = dtoverv2[ip] * collisional_coefficient
402  * (C_RB[ip] * delta_CC[ip]
403  - D_RB[ip] / dvr[ip]);
404 
405 // std::cout << "\n\n LHS = \n";
406 // for (size_t i(0); i < LHS.dim1(); ++i) {
407 // std::cout << "i = " << i << " :::: ";
408 // for (size_t j(0); j < LHS.dim2(); ++j) {
409 // std::cout << LHS(i, j) << " ";
410 // }
411 // std::cout << "\n";
412 // }
413 
414 //
415 // Thomas_Tridiagonal(LHS,fin,fh);
416 
417 }
double c_kpre
Constants.
Definition: collisions.h:48
void update_D_inversebremsstrahlung(const double &Z0, const double &heatingcoefficient, const double &vos)
Definition: collisions.cpp:235
double Zeta
Definition: formulary.h:104
double LOGee(double ne, double Te)
Definition: formulary.cpp:226
valarray< double > dvr
Definition: collisions.h:32
void update_D_and_delta(valarray< double > &fin)
Definition: collisions.cpp:166
double LOGei(double ne, double Te, double Z)
Definition: formulary.cpp:249
valarray< double > C_RB
Rosenbluth Potentials.
Definition: collisions.h:41
valarray< double > dtoverv2
Definition: collisions.h:34
valarray< double > D_RB
Definition: collisions.h:41
valarray< double > delta_CC
Chang-Cooper weighting delta.
Definition: collisions.h:45
void update_C_Rosenbluth(valarray< double > &fin)
Definition: collisions.cpp:104
Here is the call graph for this function:
Here is the caller graph for this function:

◆ implicit()

void Magnetic_Field_1D::implicit ( DistFunc1D Din,
const Field1D FBx,
const Field1D FBy,
const Field1D FBz,
double  dt 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/vlasov.h>

Distribution function vector. 1 Nmx1 vector per momentum cell

Multiply Right Side to create right side vector

Unpack

Definition at line 973 of file vlasov.cpp.

References Field1D::array(), DistFunc1D::q(), and Thomas_Tridiagonal().

975  {
976 //--------------------------------------------------------------
977 // This is the core calculation for the magnetic field
978 //--------------------------------------------------------------
979 
980  complex<double> ii(0.0,1.0);
981 
982  valarray<complex<double> > Bx(FBx.array());
983  valarray<complex<double> > Bm(FBy.array());
984  Bm *= (-1.0)*ii;
985  Bm += FBz.array();
986  valarray<complex<double> > Bp(FBy.array());
987  Bp *= ii;
988  Bp += FBz.array();
989 
990  Bx *= Din.q();//Din.mass();
991  Bm *= Din.q();//Din.mass();
992  Bp *= Din.q();//Din.mass();
993 
994  size_t l0(1);
995  size_t m0(1);
996 
997  int Nm(0);
998  size_t ind(0);
999  size_t indp(0);
1000 
1001  complex<double> temp(0.0,0.0);
1002 
1003  for (size_t i(0); i<Din(0,0).numx(); ++i)
1004  {
1005  for (size_t l(1); l < l0+1; ++l)
1006  {
1007  Nm = (l<m0?l:m0);
1008  valarray<complex<double>> fin((0.0,0.0),2*Nm+1);
1009  valarray<complex<double>> RHSv((0.0,0.0),2*Nm+1);
1010  Array2D<complex<double>> LHS(2*Nm+1,2*Nm+1);
1011  Array2D<complex<double>> RHS(2*Nm+1,2*Nm+1);
1012 
1013  //* The matrices corresponding to RHS and LHS are computed
1014  // They apply to the vector
1015  // [ f_l^m ] -> 0 index but applies to Nm th harmonic
1016  // ...
1017  // [ f_l^2 ]
1018  // [ f_l^1 ]
1019  // [ f_l^0 ] -> Nm index but applies to 0th harmonic
1020  // [ f_l^-1 ]
1021  // [ f_l^-2 ]
1022  // ...
1023  // [ f_l^-m ] *//
1024  RHS(0,0) = 1.0-ii*double(Nm)*dt/2.0*Bx[i];
1025  LHS(0,0) = conj(RHS(0,0));
1026  RHS(0,1) = 0.25*dt*Bp[i];
1027  LHS(0,1) = -0.25*dt*Bp[i];
1028 
1029  for (int m(Nm-1);m>0;--m)
1030  {
1031  ind = Nm-m;
1032 
1033  RHS(ind,ind) = 1.0-ii*double(m)*dt/2.0*Bx[i];
1034  LHS(ind,ind) = conj(RHS(ind,ind));
1035 
1036  RHS(ind,ind+1) = 0.25*dt*Bp[i];
1037  LHS(ind,ind+1) = -0.25*dt*Bp[i];
1038 
1039  RHS(ind,ind-1) = -0.25*dt*(l-m)*(l+m+1)*Bm[i];
1040  LHS(ind,ind-1) = 0.25*dt*(l-m)*(l+m+1)*Bm[i];
1041  }
1042 
1043  RHS(Nm,Nm) = 1.0;
1044  LHS(Nm,Nm) = 1.0;
1045  RHS(Nm,Nm-1) = -0.25*dt*(l)*(l+1)*Bm[i];
1046  LHS(Nm,Nm-1) = 0.25*dt*(l)*(l+1)*Bm[i];
1047 
1048  //* Fill in bottom half which is a series of reflections and complex conjugates
1049  RHS(Nm,Nm+1) = conj(RHS(Nm,Nm-1));
1050  LHS(Nm,Nm+1) = conj(LHS(Nm,Nm-1));
1051 
1052  for (int m(-1);m>-Nm;--m)
1053  {
1054  ind = Nm-m;
1055  indp = Nm-abs(m);
1056 
1057  RHS(ind,ind) = conj(RHS(indp,indp));
1058  LHS(ind,ind) = conj(LHS(indp,indp));
1059 
1060  RHS(ind,ind+1) = conj(RHS(indp,indp-1));
1061  LHS(ind,ind+1) = conj(LHS(indp,indp-1));
1062 
1063  RHS(ind,ind-1) = conj(RHS(indp,indp+1));
1064  LHS(ind,ind-1) = conj(LHS(indp,indp+1));
1065  }
1066 
1067  RHS(2*Nm,2*Nm) = conj(RHS(0,0));
1068  LHS(2*Nm,2*Nm) = conj(LHS(0,0));
1069  RHS(2*Nm,2*Nm-1) = conj(RHS(0,1));
1070  LHS(2*Nm,2*Nm-1) = conj(LHS(0,1));
1071 
1072  for (size_t k(0); k < Din(0,0).nump(); ++k) {
1074  fin[0] = Din(l, Nm)(k, i);
1075  for (int m(Nm - 1); m > 1; --m) {
1076  ind = Nm - m;
1077  fin[ind] = Din(l, m)(k, i);
1078  }
1079  fin[Nm] = Din(l, 0)(k, i);
1080  for (int m(-1); m > -Nm; --m) {
1081  ind = Nm - m;
1082  fin[ind] = conj(Din(l, abs(m))(k, i));
1083  }
1084  fin[2 * Nm] = conj(Din(l, Nm)(k, i));
1085 
1087  RHSv[0] = fin[0] * RHS(0, 0) + fin[1] * RHS(0, 1);
1088  for (size_t mm(1); mm < 2 * Nm; ++mm) {
1089  RHSv[mm] = fin[mm - 1] * RHS(mm, mm - 1) + fin[mm] * RHS(mm, mm) + fin[mm + 1] * RHS(mm, mm + 1);
1090  }
1091  RHSv[2 * Nm] = fin[2 * Nm - 1] * RHS(2 * Nm, 2 * Nm - 1) + fin[2 * Nm] * RHS(2 * Nm, 2 * Nm);
1092 
1093 // std::cout << "\n\n LHS = \n";
1094 // for (size_t i(0); i < LHS.dim1(); ++i) {
1095 // std::cout << "i = " << i << " :::: ";
1096 // for (size_t j(0); j < LHS.dim2(); ++j) {
1097 // std::cout << LHS(i, j) << " ";
1098 // }
1099 // std::cout << "\n";
1100 // }
1101 
1102  Thomas_Tridiagonal(LHS,RHSv,fin);
1103 
1105  Din(l,Nm)(k,i) = fin[0];
1106  for (int m(Nm-1);m>1;--m)
1107  {
1108  ind = Nm-m;
1109  Din(l,m)(k,i) = fin[ind];
1110  }
1111  Din(l,0)(k,i) = fin[Nm];
1112 
1113  }
1114 
1115  }
1116  }
1117 
1118 }
bool Thomas_Tridiagonal(Array2D< double > &A, valarray< double > &d, valarray< double > &xk)
The tridiagonal solver for implicit collisions.
Definition: nmethods.cpp:216
valarray< complex< double > > & array() const
Definition: state.h:196
double q() const
Definition: state.h:399
Here is the call graph for this function:

◆ Implicit_Ex()

void Electric_Field_1D::Implicit_Ex ( const DistFunc1D Din,
const Field1D FEx,
DistFunc1D Dh 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/vlasov.h>

Definition at line 443 of file vlasov.cpp.

References Electric_Field_1D::A1, Electric_Field_1D::A2, Field1D::array(), Electric_Field_1D::G, Electric_Field_1D::H, Electric_Field_1D::MakeG00(), Electric_Field_1D::MakeGH(), SHarmonic1D::mxaxis(), and DistFunc1D::q().

443  {
444 //--------------------------------------------------------------
445 // This is the calculation for the implicit electric field in x,
446 // which is to say Ex as it acts on the first few harmonics.
447 //--------------------------------------------------------------
448 
449  valarray<complex<double> > Ex(FEx.array());
450  Ex *= Din.q();
451 
452 // m = 0, l = 0
453  MakeG00(Din(0,0));
454  Ex *= A1(0,0); Dh(1,0) += G.mxaxis(Ex);
455 
456 // m = 0, l = 1
457  MakeGH(Din(1,0),1);
458  Ex *= A2(1,0) / A1(0,0); Dh(0,0) += H.mxaxis(Ex);
459  Ex *= A1(1,0) / A2(1,0); Dh(2,0) += G.mxaxis(Ex);
460 
461 // m = 0, l = 2
462  MakeGH(Din(2,0),2);
463  Ex *= A2(2,0) / A1(1,0); Dh(1,0) += H.mxaxis(Ex);
464 
465 // m = 0, l = 3
466  MakeGH(Din(3,0),3);
467  Ex *= A2(3,0) / A2(2,0); Dh(2,0) += H.mxaxis(Ex);
468 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
469 
470 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
471 // m = 1, l = 1
472  MakeGH(Din(1,1),1);
473  Ex *= A1(1,1) / A2(3,0); Dh(2,1) += G.mxaxis(Ex);
474 
475 // m = 1, l = 2
476  MakeGH(Din(2,1),2);
477  Ex *= A2(2,1) / A1(1,1); Dh(1,1) += H.mxaxis(Ex);
478 
479 // m = 1, l = 3
480  MakeGH(Din(3,1),3);
481  Ex *= A2(3,1) / A2(2,1); Dh(2,1) += H.mxaxis(Ex);
482 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
483 
484 
485 }
void MakeG00(SHarmonic1D &f)
Definition: vlasov.cpp:828
SHarmonic1D H
Definition: vlasov.h:70
SHarmonic1D & mxaxis(const valarray< complex< double > > &shmulti)
Definition: state.cpp:126
valarray< complex< double > > & array() const
Definition: state.h:196
double q() const
Definition: state.h:399
Array2D< complex< double > > A1
Definition: vlasov.h:74
void MakeGH(SHarmonic1D &f, size_t l)
Definition: vlasov.cpp:807
SHarmonic1D G
Definition: vlasov.h:70
Array2D< complex< double > > A2
Definition: vlasov.h:74
Here is the call graph for this function:

◆ Implicit_Ex_f1only()

void Electric_Field_1D::Implicit_Ex_f1only ( const DistFunc1D Din,
const Field1D FEx,
DistFunc1D Dh 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/vlasov.h>

Definition at line 693 of file vlasov.cpp.

References Electric_Field_1D::A100, Electric_Field_1D::A210, Field1D::array(), Electric_Field_1D::G, Electric_Field_1D::H, Electric_Field_1D::MakeG00(), Electric_Field_1D::MakeGH(), SHarmonic1D::mxaxis(), and DistFunc1D::q().

693  {
694 //--------------------------------------------------------------
695 // This is the calculation for the implicit electric field in x,
696 // which is to say Ex as it acts on the first few harmonics.
697 //--------------------------------------------------------------
698 
699  valarray<complex<double> > Ex(FEx.array());
700  Ex *= Din.q();
701 
702  SHarmonic1D f20(Din(0,0));
703  f20 *= complex<double>(1.0/3.0);
704 
705 // m = 0, l = 0
706  MakeG00(Din(0,0));
707  Ex *= A100; Dh(1,0) += G.mxaxis(Ex);
708 
709 // m = 0, l = 1
710  MakeGH(Din(1,0),1);
711  Ex *= A210 / A100; Dh(0,0) += H.mxaxis(Ex);
712  // Ex *= A1(1,0) / A2(1,0); Dh(2,0) += G.mxaxis(Ex);
713 
714 // m = 0, l = 2
715 // MakeGH(f20,2);
716 // Ex *= A310 / A210; TMP = H; Dh(1,0) += H.mxaxis(Ex);
717 
718 
719 }
complex< double > A100
Definition: vlasov.h:72
void MakeG00(SHarmonic1D &f)
Definition: vlasov.cpp:828
SHarmonic1D H
Definition: vlasov.h:70
SHarmonic1D & mxaxis(const valarray< complex< double > > &shmulti)
Definition: state.cpp:126
complex< double > A210
Definition: vlasov.h:72
A 1D Spherical Harmonic.
Definition: state.h:57
valarray< complex< double > > & array() const
Definition: state.h:196
double q() const
Definition: state.h:399
void MakeGH(SHarmonic1D &f, size_t l)
Definition: vlasov.cpp:807
SHarmonic1D G
Definition: vlasov.h:70
Here is the call graph for this function:

◆ Implicit_Ey()

void Electric_Field_1D::Implicit_Ey ( const DistFunc1D Din,
const Field1D FEy,
DistFunc1D Dh 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/vlasov.h>

Definition at line 488 of file vlasov.cpp.

References Field1D::array(), Electric_Field_1D::B1, Electric_Field_1D::B2, Electric_Field_1D::C1, Electric_Field_1D::C3, Electric_Field_1D::C4, Electric_Field_1D::G, Electric_Field_1D::H, DistFunc1D::m0(), Electric_Field_1D::MakeG00(), Electric_Field_1D::MakeGH(), SHarmonic1D::mxaxis(), DistFunc1D::q(), SHarmonic1D::Re(), and Electric_Field_1D::TMP.

488  {
489 //--------------------------------------------------------------
490 // This is the calculation for the implicit electric field in y
491 // and z, which is to say Ex as it acts on the first few harmonics.
492 //--------------------------------------------------------------
493 
494  valarray<complex<double> > Em(FEy.array());
495  valarray<complex<double> > Ep(FEy.array());
496 
497 
498  Em *= Din.q();;
499  Ep *= Din.q();;
500 
501 // m = 0, l = 0
502  MakeG00(Din(0,0));
503  Em *= C1[0]; Dh(1,1) += G.mxaxis(Em);
504 
505 // m = 0, l = 1
506  MakeGH(Din(1,0),1);
507  Em *= C1[1] / C1[0]; Dh(2,1) += G.mxaxis(Em);
508 
509 // m = 0, 1 < l < l0
510  MakeGH(Din(2,0),2);
511  Em *= C3[2] / C1[1]; Dh(1,1) += H.mxaxis(Em);
512 
513 // m = 0, l = 3
514  MakeGH(Din(3,0),3);
515  Em *= C3[3] / C3[2]; Dh(2,1) += H.mxaxis(Em);
516 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
517 
518 
519 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
520 // m = 1, l = 1
521  MakeGH(Din(1,1),1);
522  Ep *= B2[1]; H = H.mxaxis(Ep); Dh(0,0) += H.Re();
523  Em *= C1[1] / C3[3]; TMP = G; Dh(2,2) += TMP.mxaxis(Em);
524  Ep *= B1[1] / B2[1]; G = G.mxaxis(Ep); Dh(2,0) += G.Re();
525 
526 // m = 1, l = 2
527  MakeGH(Din(2,1),2);
528  Ep *= B2[2] / B1[1]; H = H.mxaxis(Ep); Dh(1,0) += H.Re();
529 
530 // m = 1, l = 3
531  MakeGH(Din(3,1),3);
532  Em *= C3[3] / C1[1]; TMP = H; Dh(2,2) += TMP.mxaxis(Em);
533  Ep *= B2[3] / B2[2]; H = H.mxaxis(Ep); Dh(2,0) += H.Re();
534 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
535 
536 
537 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
538 // m = 2, l = 2
539  MakeGH(Din(2,2),2);
540  Ep *= C4(2,2) / B2[3]; Dh(1,1) += H.mxaxis(Ep);
541 
542 // m = 2, l = 3
543  MakeGH(Din(3,2),3);
544  Ep *= C4(3,2) / C4(2,2); Dh(2,1) += H.mxaxis(Ep);
545 
546  size_t m0(Din.m0());
547  if ( m0 > 2) {
548 // m = 3, l = 3
549  MakeGH(Din(3,3),3);
550  Ep *= C4(3,3) / C4(3,2); Dh(2,2) += H.mxaxis(Ep);
551  }
552 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
553 }
valarray< complex< double > > C3
Definition: vlasov.h:76
void MakeG00(SHarmonic1D &f)
Definition: vlasov.cpp:828
SHarmonic1D H
Definition: vlasov.h:70
SHarmonic1D & mxaxis(const valarray< complex< double > > &shmulti)
Definition: state.cpp:126
SHarmonic1D & Re()
Definition: state.cpp:130
valarray< complex< double > > & array() const
Definition: state.h:196
size_t m0() const
Definition: state.h:397
double q() const
Definition: state.h:399
valarray< complex< double > > B2
Definition: vlasov.h:75
SHarmonic1D TMP
Definition: vlasov.h:70
void MakeGH(SHarmonic1D &f, size_t l)
Definition: vlasov.cpp:807
SHarmonic1D G
Definition: vlasov.h:70
valarray< complex< double > > C1
Definition: vlasov.h:76
valarray< complex< double > > B1
Definition: vlasov.h:75
Array2D< complex< double > > C4
Definition: vlasov.h:77
Here is the call graph for this function:

◆ Implicit_Ey_f1only()

void Electric_Field_1D::Implicit_Ey_f1only ( const DistFunc1D Din,
const Field1D FEy,
DistFunc1D Dh 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/vlasov.h>

Definition at line 722 of file vlasov.cpp.

References Field1D::array(), Electric_Field_1D::B211, Electric_Field_1D::C100, Electric_Field_1D::G, Electric_Field_1D::H, Electric_Field_1D::MakeG00(), Electric_Field_1D::MakeGH(), SHarmonic1D::mxaxis(), DistFunc1D::q(), and SHarmonic1D::Re().

722  {
723 //--------------------------------------------------------------
724 // This is the calculation for the implicit electric field in y
725 // and z, which is to say Ex as it acts on the first few harmonics.
726 //--------------------------------------------------------------
727 
728  valarray<complex<double> > Em(FEy.array());
729  valarray<complex<double> > Ep(FEy.array());
730 
731  SHarmonic1D f20(Din(0,0));
732  f20 *= complex<double>(1.0/3.0);
733 
734  Em *= Din.q();
735  Ep *= Din.q();
736 
737 // m = 0, l = 0
738  MakeG00(Din(0,0));
739  Em *= C100; Dh(1,1) += G.mxaxis(Em);
740 
741 // m = 0, l = 1
742  // MakeGH(Din(1,0),1);
743  // Em *= C1[1] / C1[0]; Dh(2,1) += G.mxaxis(Em);
744 
745 // m = 0, 1 < l < l0
746 // MakeGH(f20,2);
747 // Em *= C311 / C100; Dh(1,1) += TMP.mxaxis(Em);
748 
749 // m = 0, l = 3
750  // MakeGH(Din(3,0),3);
751  // Em *= C3[3] / C3[2]; Dh(2,1) += H.mxaxis(Em);
752 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
753 
754 
755 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
756 // m = 1, l = 1
757  MakeGH(Din(1,1),1);
758  Ep *= B211; H = H.mxaxis(Ep); Dh(0,0) += H.Re();
759 }
void MakeG00(SHarmonic1D &f)
Definition: vlasov.cpp:828
SHarmonic1D H
Definition: vlasov.h:70
complex< double > C100
Definition: vlasov.h:72
SHarmonic1D & mxaxis(const valarray< complex< double > > &shmulti)
Definition: state.cpp:126
SHarmonic1D & Re()
Definition: state.cpp:130
A 1D Spherical Harmonic.
Definition: state.h:57
valarray< complex< double > > & array() const
Definition: state.h:196
complex< double > B211
Definition: vlasov.h:72
double q() const
Definition: state.h:399
void MakeGH(SHarmonic1D &f, size_t l)
Definition: vlasov.cpp:807
SHarmonic1D G
Definition: vlasov.h:70
Here is the call graph for this function:

◆ Implicit_Ez()

void Electric_Field_1D::Implicit_Ez ( const DistFunc1D Din,
const Field1D FEz,
DistFunc1D Dh 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/vlasov.h>

Definition at line 556 of file vlasov.cpp.

References Field1D::array(), Electric_Field_1D::B1, Electric_Field_1D::B2, Electric_Field_1D::C1, Electric_Field_1D::C3, Electric_Field_1D::C4, Electric_Field_1D::G, Electric_Field_1D::H, DistFunc1D::m0(), Electric_Field_1D::MakeG00(), Electric_Field_1D::MakeGH(), SHarmonic1D::mxaxis(), DistFunc1D::q(), SHarmonic1D::Re(), and Electric_Field_1D::TMP.

556  {
557 //--------------------------------------------------------------
558 // This is the calculation for the implicit electric field in y
559 // and z, which is to say Ex as it acts on the first few harmonics.
560 //--------------------------------------------------------------
561  complex<double> ii(0.0,1.0);
562 
563 
564  valarray<complex<double> > Em(FEz.array());
565  Em *= (-1.0)*ii;
566 
567 
568  valarray<complex<double> > Ep(FEz.array());
569  Ep *= ii;
570  // Ep += FEy.array();
571  //
572  // Ex *= Din.q();;
573  Em *= Din.q();
574  Ep *= Din.q();
575 
576 
577 
578 // m = 0, l = 0
579  MakeG00(Din(0,0));
580  Em *= C1[0]; Dh(1,1) += G.mxaxis(Em);
581 
582 // m = 0, l = 1
583  MakeGH(Din(1,0),1);
584  Em *= C1[1] / C1[0]; Dh(2,1) += G.mxaxis(Em);
585 
586 // m = 0, 1 < l < l0
587  MakeGH(Din(2,0),2);
588  Em *= C3[2] / C1[1]; Dh(1,1) += H.mxaxis(Em);
589 
590 // m = 0, l = 3
591  MakeGH(Din(3,0),3);
592  Em *= C3[3] / C3[2]; Dh(2,1) += H.mxaxis(Em);
593 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
594 
595 
596 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
597 // m = 1, l = 1
598  MakeGH(Din(1,1),1);
599  Ep *= B2[1]; H = H.mxaxis(Ep); Dh(0,0) += H.Re();
600  Em *= C1[1] / C3[3]; TMP = G; Dh(2,2) += TMP.mxaxis(Em);
601  Ep *= B1[1] / B2[1]; G = G.mxaxis(Ep); Dh(2,0) += G.Re();
602 
603 // m = 1, l = 2
604  MakeGH(Din(2,1),2);
605  Ep *= B2[2] / B1[1]; H = H.mxaxis(Ep); Dh(1,0) += H.Re();
606 
607 // m = 1, l = 3
608  MakeGH(Din(3,1),3);
609  Em *= C3[3] / C1[1]; TMP = H; Dh(2,2) += TMP.mxaxis(Em);
610  Ep *= B2[3] / B2[2]; H = H.mxaxis(Ep); Dh(2,0) += H.Re();
611 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
612 
613 
614 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
615 // m = 2, l = 2
616  MakeGH(Din(2,2),2);
617  Ep *= C4(2,2) / B2[3]; Dh(1,1) += H.mxaxis(Ep);
618 
619 // m = 2, l = 3
620  MakeGH(Din(3,2),3);
621  Ep *= C4(3,2) / C4(2,2); Dh(2,1) += H.mxaxis(Ep);
622 
623  size_t m0(Din.m0());
624  if ( m0 > 2) {
625 // m = 3, l = 3
626  MakeGH(Din(3,3),3);
627  Ep *= C4(3,3) / C4(3,2); Dh(2,2) += H.mxaxis(Ep);
628  }
629 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
630 }
valarray< complex< double > > C3
Definition: vlasov.h:76
void MakeG00(SHarmonic1D &f)
Definition: vlasov.cpp:828
SHarmonic1D H
Definition: vlasov.h:70
SHarmonic1D & mxaxis(const valarray< complex< double > > &shmulti)
Definition: state.cpp:126
SHarmonic1D & Re()
Definition: state.cpp:130
valarray< complex< double > > & array() const
Definition: state.h:196
size_t m0() const
Definition: state.h:397
double q() const
Definition: state.h:399
valarray< complex< double > > B2
Definition: vlasov.h:75
SHarmonic1D TMP
Definition: vlasov.h:70
void MakeGH(SHarmonic1D &f, size_t l)
Definition: vlasov.cpp:807
SHarmonic1D G
Definition: vlasov.h:70
valarray< complex< double > > C1
Definition: vlasov.h:76
valarray< complex< double > > B1
Definition: vlasov.h:75
Array2D< complex< double > > C4
Definition: vlasov.h:77
Here is the call graph for this function:

◆ Implicit_Ez_f1only()

void Electric_Field_1D::Implicit_Ez_f1only ( const DistFunc1D Din,
const Field1D FEz,
DistFunc1D Dh 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/vlasov.h>

Definition at line 762 of file vlasov.cpp.

References Field1D::array(), Electric_Field_1D::B211, Electric_Field_1D::C100, Electric_Field_1D::G, Electric_Field_1D::H, Electric_Field_1D::MakeG00(), Electric_Field_1D::MakeGH(), SHarmonic1D::mxaxis(), and SHarmonic1D::Re().

762  {
763 //--------------------------------------------------------------
764 // This is the calculation for the implicit electric field in y
765 // and z, which is to say Ex as it acts on the first few harmonics.
766 //--------------------------------------------------------------
767  complex<double> ii(0.0,1.0);
768  SHarmonic1D f20(Din(0,0));
769  f20 *= complex<double>(1.0/3.0);
770 
771  valarray<complex<double> > Em(FEz.array());
772  Em *= (-1.0)*ii;
773 
774 
775  valarray<complex<double> > Ep(FEz.array());
776  Ep *= ii;
777  // m = 0, l = 0
778  MakeG00(Din(0,0));
779  Em *= C100; Dh(1,1) += G.mxaxis(Em);
780 
781 // m = 0, l = 1
782  // MakeGH(Din(1,0),1);
783  // Em *= C1[1] / C1[0]; Dh(2,1) += G.mxaxis(Em);
784 
785 // m = 0, 1 < l < l0
786 // Din(2,0) = Din(0,0);
787 // Din(2,0) *= complex<double>(1.0/3.0);
788 //
789 // MakeGH(f20,2);
790 // Em *= C311 / C100; Dh(1,1) += TMP.mxaxis(Em);
791 
792 // // m = 0, l = 3
793 // MakeGH(Din(3,0),3);
794 // Em *= C3[3] / C3[2]; Dh(2,1) += H.mxaxis(Em);
795 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
796 
797 
798 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
799 // m = 1, l = 1
800  MakeGH(Din(1,1),1);
801  Ep *= B211; H = H.mxaxis(Ep); Dh(0,0) += H.Re();
802 }
void MakeG00(SHarmonic1D &f)
Definition: vlasov.cpp:828
SHarmonic1D H
Definition: vlasov.h:70
complex< double > C100
Definition: vlasov.h:72
SHarmonic1D & mxaxis(const valarray< complex< double > > &shmulti)
Definition: state.cpp:126
SHarmonic1D & Re()
Definition: state.cpp:130
A 1D Spherical Harmonic.
Definition: state.h:57
valarray< complex< double > > & array() const
Definition: state.h:196
complex< double > B211
Definition: vlasov.h:72
void MakeGH(SHarmonic1D &f, size_t l)
Definition: vlasov.cpp:807
SHarmonic1D G
Definition: vlasov.h:70
Here is the call graph for this function:

◆ interspecies_collisions()

interspecies_collisions::interspecies_collisions ( const State1D Yin,
const size_t &  sind,
const double &  deltat 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/interspeciescollisions.h>

Constructors/Destructors.

Definition at line 785 of file interspeciescollisions.cpp.

References State1D::DF(), and State1D::Species().

791  {
792 
793  // size_t sind(0);
794  for (size_t s(0); s<Yin.Species(); ++s){
795  if (s!=sind) {
796 
797  interspecies_f00_collisions.push_back(interspecies_f00_explicit_collisions(Yin.DF(sind),Yin.DF(s),deltat));
798  std::cout << "\n\n sind,s = " << sind << "," << s << ", size = " <<interspecies_f00_collisions.size() << "\n\n";
799  }
800  }
801 
802  }
vector< interspecies_f00_explicit_collisions > interspecies_f00_collisions
DistFunc1D & DF(size_t s)
Definition: state.h:602
size_t Species() const
Definition: state.h:596
Here is the call graph for this function:

◆ interspecies_f00_explicit_collisions()

interspecies_f00_explicit_collisions::interspecies_f00_explicit_collisions ( const DistFunc1D DF1,
const DistFunc1D DF2,
const double &  deltat 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/interspeciescollisions.h>

Constructors/Destructors.

Definition at line 313 of file interspeciescollisions.cpp.

References Input::Input_List::BoundaryCells, interspecies_f00_explicit_collisions::h, Input::List(), interspecies_f00_explicit_collisions::Nbc, interspecies_f00_explicit_collisions::num_h, Input::Input_List::NxLocal, and interspecies_f00_explicit_collisions::szx.

317  :
318  rkf00(DF1, DF2, deltat),
319  fin1(0.0,DF1(0,0).nump()), fin2(0.0,DF2(0,0).nump()),
320  RK4(fin1),
321  num_h(size_t(deltat/Input::List().small_dt)+1)
322  // h(Input::List().small_dt)
323  {
324 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
325  h = deltat/static_cast<double>(num_h);
327  szx = Input::List().NxLocal[0]; //Input::List().numx; // size of useful x axis
328  }
std::vector< size_t > NxLocal
Definition: input.h:168
int szx
Total cells including boundary cells in x-direction.
int Nbc
Number of boundary cells in each direction.
Algorithms::RK4< valarray< double > > RK4
Input_List & List()
Definition: input.cpp:1585
int BoundaryCells
Definition: input.h:50
Here is the call graph for this function:

◆ interspecies_f00_explicit_step()

interspecies_f00_explicit_step::interspecies_f00_explicit_step ( const DistFunc1D DF1,
const DistFunc1D DF2,
const double &  deltat 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/interspeciescollisions.h>

Constructors/Destructors.

Definition at line 39 of file interspeciescollisions.cpp.

References Input::Input_List::BoundaryCells, interspecies_f00_explicit_step::kpre, Input::List(), interspecies_f00_explicit_step::m1, interspecies_f00_explicit_step::m2, DistFunc1D::mass(), interspecies_f00_explicit_step::Nbc, Input::Input_List::NxLocal, interspecies_f00_explicit_step::pgrid_s2, interspecies_f00_explicit_step::Pn, DistFunc1D::q(), interspecies_f00_explicit_step::Qn, interspecies_f00_explicit_step::szx, interspecies_f00_explicit_step::U1, interspecies_f00_explicit_step::U1m1, interspecies_f00_explicit_step::U2, interspecies_f00_explicit_step::U2m1, interspecies_f00_explicit_step::U3, interspecies_f00_explicit_step::U4, interspecies_f00_explicit_step::U4m1, interspecies_f00_explicit_step::z1, and interspecies_f00_explicit_step::z2.

43  : dt(deltat),
44 // pgrid_s1(Algorithms::MakeAxis(DF1.pmax()/(2.0*DF1(0,0).nump()-1.0),DF1.pmax(),DF1(0,0).nump())),
45 // pgrid_s2(Algorithms::MakeAxis(DF2.pmax()/(2.0*DF2(0,0).nump()-1.0),DF2.pmax(),DF2(0,0).nump())),
46  pgrid_s1(Algorithms::MakeCAxis(0.0,DF1.pmax(),DF1(0,0).nump())),
47  pgrid_s2(Algorithms::MakeCAxis(0.0,DF2.pmax(),DF2(0,0).nump())),
48  // f1(DF1(0,0)),f2(DF2(0,0)),
49  fslope(0.0, DF1(0,0).nump()),
50  // f0(0.0, DF1(0,0).nump()),
51  df0(0.0, DF1(0,0).nump()),
52 
53  U4(0.0, DF2(0,0).nump()),
54  U4m1(0.0, DF2(0,0).nump()),
55  U2(0.0, DF2(0,0).nump()),
56  U2m1(0.0, DF2(0,0).nump()),
57  U1(0.0, DF2(0,0).nump()),
58  U1m1(0.0, DF2(0,0).nump()),
59 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
60 
61  J1_s2(0.0, DF2(0,0).nump()),
62  I2_s2(0.0, DF2(0,0).nump()),
63  I4_s2(0.0, DF2(0,0).nump()),
64 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
65  U3(0.0, DF2(0,0).nump()),
66  Qn(0.0, DF2(0,0).nump()),
67  Pn(0.0, DF2(0,0).nump()),
68 
69  J1_s1(0.0, DF2(0,0).nump()),
70  I2_s1(0.0, DF2(0,0).nump()),
71  I4_s1(0.0, DF2(0,0).nump())
72  {
73 
75  szx = Input::List().NxLocal[0];
76 
77  m2 = DF2.mass() ; m1 = DF1.mass();
78  z2 = DF2.q(); z1 = DF1.q();
79 
80 
81 
82  double re(2.8179402894e-13); //classical electron radius
83  double kp(sqrt(4.0*M_PI*(Input::List().density_np)*re));
84  kpre = re*kp;
85 
86  // f1.reserve(DF1(0,0).nump());
87 
88 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
89  // Determine U4, U4m1, U2, U2m1, U1, U1m1
90  for (size_t i(1); i < DF2(0,0).nump(); ++i) {
91  U4[i] = 0.5 * pow(pgrid_s2[i],4) * (pgrid_s2[i]-pgrid_s2[i-1]);
92  U4m1[i] = 0.5 * pow(pgrid_s2[i-1],4) * (pgrid_s2[i]-pgrid_s2[i-1]);
93  U2[i] = 0.5 * pgrid_s2[i]*pgrid_s2[i] * (pgrid_s2[i]-pgrid_s2[i-1]);
94  U2m1[i] = 0.5 * pgrid_s2[i-1]*pgrid_s2[i-1] * (pgrid_s2[i]-pgrid_s2[i-1]);
95  U1[i] = 0.5 * pgrid_s2[i] * (pgrid_s2[i]-pgrid_s2[i-1]);
96  U1m1[i] = 0.5 * pgrid_s2[i-1] * (pgrid_s2[i]-pgrid_s2[i-1]);
97  }
98 
99 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
100  // Determine U3
101  for (size_t i(0); i < U3.size(); ++i) {
102  U3[i] = pow(pgrid_s2[i],3);
103  }
104  // Determine Qn
105  Qn[0] = 1.0 / ((pgrid_s2[0]*pgrid_s2[0]*pgrid_s2[1])/2.0);
106  for (size_t i(1); i < Qn.size()-1; ++i) {
107  Qn[i] = 1.0 / (pgrid_s2[i]*pgrid_s2[i]*(pgrid_s2[i+1]-pgrid_s2[i-1])/2.0);
108  }
109  // Determine Pn
110  for (size_t i(0); i < Pn.size()-1; ++i) {
111  Pn[i] = 1.0 / ((pgrid_s2[i+1]-pgrid_s2[i])/2.0*(pgrid_s2[i+1]+pgrid_s2[i]));
112  }
113 
114  }
std::vector< size_t > NxLocal
Definition: input.h:168
valarray< double > J1_s1
The integrals.
double mass() const
Definition: state.h:400
valarray< double > J1_s2
The integrals.
int Nbc
Number of boundary cells in each direction.
double pmax() const
Definition: state.h:398
double q() const
Definition: state.h:399
valarray< T > MakeCAxis(const T min, const T max, const size_t N)
Input_List & List()
Definition: input.cpp:1585
int szx
Total cells including boundary cells in x-direction.
int BoundaryCells
Definition: input.h:50
Here is the call graph for this function:

◆ interspecies_f00_RKfunctor()

interspecies_f00_RKfunctor::interspecies_f00_RKfunctor ( const DistFunc1D DF1,
const DistFunc1D DF2,
const double &  smalldt 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/interspeciescollisions.h>

Constructor for RK4 method on f00.

Parameters
finInput distribution
[in]tout_startHmm...

Definition at line 302 of file interspeciescollisions.cpp.

303  :collide(DF1,DF2,smalldt){}
interspecies_f00_explicit_step collide

◆ interspecies_flm_implicit_collisions()

interspecies_flm_implicit_collisions::interspecies_flm_implicit_collisions ( const DistFunc1D DFin,
const double &  deltat 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/interspeciescollisions.h>

Constructors/Destructors.

Definition at line 673 of file interspeciescollisions.cpp.

References Input::Input_List::BoundaryCells, Input::List(), interspecies_flm_implicit_collisions::Nbc, Input::Input_List::NxLocal, and interspecies_flm_implicit_collisions::szx.

677  : f00(0.0, DFin(0).nump()),
678  fc(0.0,DFin(0).nump()),
679  l0(DFin.l0()),
680  m0(DFin.m0()),//Yin.SH(0,0).m0())
681  implicit_step(DFin.pmax(),DFin(0).nump()),
682  Dt(deltat) //
683  {
684 
685 
687  szx = Input::List().NxLocal[0];
688 
689  }
std::vector< size_t > NxLocal
Definition: input.h:168
valarray< complex< double > > fc
Dummy array.
int szx
Total cells including boundary cells in x-direction.
interspecies_flm_implicit_step implicit_step
The object that is responsible for performing the algebra required for the integrals.
double pmax() const
Definition: state.h:398
size_t m0() const
Definition: state.h:397
int Nbc
Number of boundary cells in each direction.
valarray< double > f00
Array for isotropic component distribution function. Needed for calculating coefficients.
Input_List & List()
Definition: input.cpp:1585
size_t l0() const
Definition: state.h:396
int BoundaryCells
Definition: input.h:50
Here is the call graph for this function:

◆ interspecies_flm_implicit_step()

interspecies_flm_implicit_step::interspecies_flm_implicit_step ( double  pmax,
size_t  nump 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/interspeciescollisions.h>

Definition at line 376 of file interspeciescollisions.cpp.

References interspecies_flm_implicit_step::kpre, Input::List(), interspecies_flm_implicit_step::U1, interspecies_flm_implicit_step::U1m1, interspecies_flm_implicit_step::U2, interspecies_flm_implicit_step::U2m1, interspecies_flm_implicit_step::U4, interspecies_flm_implicit_step::U4m1, and interspecies_flm_implicit_step::vr.

380  :
381 // Pre-Calculated Constants
382 // INCLUDED pmax[0] here only because pmax currently is vector having elements for two species
383 // vr(Algorithms::MakeAxis(pmax/(2.0*nump-1.0),pmax,nump)),
384  vr(Algorithms::MakeCAxis(0.0,pmax,nump)),
385 // Constants for Integrals
386  U4(0.0, nump),
387  U4m1(0.0,nump),
388  U2(0.0, nump),
389  U2m1(0.0,nump),
390  U1(0.0, nump),
391  U1m1(0.0,nump),
392 // Integrals
393  J1m(0.0, nump),
394  I0(0.0, nump),
395  I2(0.0, nump),
396  Scattering_Term(0.0, nump),
397  df0(0.0, nump),
398  ddf0(0.0, nump),
399 // Matrices
400  Alpha_Tri(nump, nump),
402 // Make matrix vk/vn
403  {
404 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
405 
406  double re(2.8179402894e-13); //classical electron radius
407  double kp(sqrt(4.0*M_PI*(Input::List().density_np)*re));
408  kpre = re*kp;
409 
410  // Determine vr
411  for (size_t i(0); i < vr.size(); ++i) {
412  vr[i] = vr[i] / (sqrt(1.0+vr[i]*vr[i]));
413  }
414 
415  // Determine U4, U4m1, U2, U2m1, U1, U1m1 for the integrals
416  for (size_t i(1); i < U4.size(); ++i) {
417  U4[i] = 0.5 * pow(vr[i],4) * (vr[i]-vr[i-1]);
418  U4m1[i] = 0.5 * pow(vr[i-1],4) * (vr[i]-vr[i-1]);
419  U2[i] = 0.5 * vr[i]*vr[i] * (vr[i]-vr[i-1]);
420  U2m1[i] = 0.5 * vr[i-1]*vr[i-1] * (vr[i]-vr[i-1]);
421  U1[i] = 0.5 * vr[i] * (vr[i]-vr[i-1]);
422  U1m1[i] = 0.5 * vr[i-1] * (vr[i]-vr[i-1]);
423  }
424  }
valarray< T > MakeCAxis(const T min, const T max, const size_t N)
Input_List & List()
Definition: input.cpp:1585
Here is the call graph for this function:

◆ loop() [1/2]

void self_f00_implicit_collisions::loop ( SHarmonic1D SHin,
valarray< double > &  Zarray,
const double  time,
SHarmonic1D SHout 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/collisions.h>

This loop calls the RK4_f00 private member that is responsible for setting up the RK4 algorithm to advance the collision step.

Get time and heating profile Ray-trace would go here

Make vos(x,t)

Unpack

Definition at line 442 of file collisions.cpp.

References self_f00_implicit_collisions::collide, self_f00_implicit_collisions::coolingprofile, self_f00_implicit_collisions::fin, self_f00_implicit_step::getleftside(), self_f00_implicit_collisions::heatingprofile, self_f00_implicit_collisions::ib, self_f00_implicit_collisions::IB_heating, Input::Input_List::lambda_0, Input::List(), SHarmonic1D::nump(), SHarmonic1D::numx(), Setup_Y::parseprofile(), self_f00_implicit_collisions::szx, Thomas_Tridiagonal(), and self_f00_implicit_collisions::xgrid.

Referenced by self_collisions::advancef00().

442  {
443 
444  //-------------------------------------------------------------------
445  // This loop scans all the locations in configuration space
446  // and calls the implicit Chang-Cooper/Langdon/Epperlein algorithm
447  //-------------------------------------------------------------------
448  // Initialization
449  //-------------------------------------------------------------------
450 
451  int ixtimesnump;
452  Array2D<double> LHS(f00.numx()*f00.nump(),f00.numx()*f00.nump());
453  valarray<double> RHSv(0.0,f00.numx()*f00.nump());
454  valarray<double> solution(0.0,f00.numx()*f00.nump());
455 
456  Array2D<double> LHStemp(f00.nump(),f00.nump());
457 
458  double timecoeff;
459  if (IB_heating && ib){
460 
463  Setup_Y::parseprofile(xgrid, Input::List().intensity_profile_str, heatingprofile);
464  Setup_Y::parseprofile(time, Input::List().intensity_time_profile_str, timecoeff);
465 
467  heatingprofile *= (Input::List().lambda_0 * sqrt(7.3e-19*Input::List().I_0))*timecoeff;
468 
469  }
470 
471 
472  for (size_t ix(0); ix < szx; ++ix){
473  // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
474  // Copy data for a specific location in space to valarray
475  // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
476  for (size_t ip(0); ip < fin.size(); ++ip){
477  fin[ip] = (f00(ip,ix)).real();
478 // std::cout << "fin[" << ip << "] = " << fin[ip] << "\n";
479  }
480 //
481 // collide.takestep(fin,fout,Zarray[ix],heatingprofile[ix],coolingprofile[ix]);
482 
483  collide.getleftside(fin,Zarray[ix],heatingprofile[ix],coolingprofile[ix],LHStemp);
484 
485  ixtimesnump = ix * f00.nump();
486 
487  for (size_t ip(0); ip < fin.size(); ++ip){
488  if (ip == 0)
489  {
490  LHS(ip + ixtimesnump, ip + 1 + ixtimesnump) = LHStemp(ip, ip + 1);
491  }
492  else if (ip == f00.nump() - 1)
493  {
494  LHS(ip + ixtimesnump, ip - 1 + ixtimesnump) = LHStemp(ip, ip - 1);
495  }
496  else {
497  LHS(ip + ixtimesnump, ip - 1 + ixtimesnump) = LHStemp(ip, ip - 1);
498  LHS(ip + ixtimesnump, ip + 1 + ixtimesnump) = LHStemp(ip, ip + 1);
499  }
500 
501  LHS(ip + ixtimesnump, ip + ixtimesnump) = LHStemp(ip, ip);
502 
503  RHSv[ip + ixtimesnump] = fin[ip];
504 // std::cout << "fin[" << ip << "] = " << fin[ip] << "\n";
505  }
506 
507 
508  // Return updated data to the harmonic
509  /*for (size_t ip(0); ip < fin.size(); ++ip){
510  f00h(ip,ix) = fout[ip];
511 // std::cout << "fout[" << ip << "] = " << fout[ip] << "\n";
512  }*/
513  }
514 
515  Thomas_Tridiagonal(LHS,RHSv,solution);
516 
518  for (size_t ix(0); ix < szx; ++ix){
519  ixtimesnump = ix * f00.nump();
520  for (size_t ip(0); ip < fin.size(); ++ip){
521  f00h(ip,ix) = solution[ip + ixtimesnump];
522  }
523  }
524 
525 
526  //-------------------------------------------------------------------
527 
528 }
bool Thomas_Tridiagonal(Array2D< double > &A, valarray< double > &d, valarray< double > &xk)
The tridiagonal solver for implicit collisions.
Definition: nmethods.cpp:216
valarray< double > coolingprofile
Definition: collisions.h:100
valarray< double > fin
Definition: collisions.h:90
void getleftside(valarray< double > &fin, const double &Z0, const double &heating, const double &cooling, Array2D< double > &LHStemp)
Definition: collisions.cpp:343
valarray< double > xgrid
Definition: collisions.h:91
int szx
Total cells including boundary cells in x-direction.
Definition: collisions.h:104
self_f00_implicit_step collide
Definition: collisions.h:93
Input_List & List()
Definition: input.cpp:1585
bool IB_heating
Switches for inverse bremsstrahlung and maxwellian cooling.
Definition: collisions.h:96
void parseprofile(const valarray< double > &grid, std::string &str_profile, valarray< double > &profile)
{ function_description }
Definition: setup.cpp:410
valarray< double > heatingprofile
Definition: collisions.h:99
double lambda_0
Definition: input.h:120
Here is the call graph for this function:
Here is the caller graph for this function:

◆ loop() [2/2]

void self_f00_explicit_collisions::loop ( SHarmonic1D SHin,
SHarmonic1D SHout 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/collisions.h>

This loop calls the RK4_f00 private member that is responsible for setting up the RK4 algorithm to advance the collision step.

Definition at line 787 of file collisions.cpp.

References self_f00_explicit_collisions::fin, self_f00_explicit_collisions::h, self_f00_explicit_collisions::num_h, self_f00_explicit_collisions::RK, self_f00_explicit_collisions::rkf00, and self_f00_explicit_collisions::szx.

Referenced by self_collisions::advancef00().

787  {
788 
789  //-------------------------------------------------------------------
790  // This loop scans all the locations in configuration space
791  // and calls the RK4 for explicit integration at each location
792  //-------------------------------------------------------------------
793  // Initialization
794 
795  for (size_t ix(0); ix < szx; ++ix){
796  // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
797 
798  // Copy data for a specific location in space to valarray
799  for (size_t ip(0); ip < fin.size(); ++ip){
800  fin[ip] = (f00(ip,ix)).real();
801  }
802 
803  // std::cout << "\n\n h = " << num_h << ", \n \n";
804  // Time loop: Update the valarray
805  for (size_t h_step(0); h_step < num_h; ++h_step){
806  fin = RK(fin,h,&rkf00);
807  }
808 
809  // Return updated data to the harmonic
810  for (int ip(0); ip < fin.size(); ++ip){
811  f00h(ip,ix) = fin[ip];
812  }
813 
814 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
815  }
816 
817 
818 }
int szx
Total cells including boundary cells in x-direction.
Definition: collisions.h:218
self_f00_RKfunctor rkf00
Definition: collisions.h:212
valarray< double > fin
Definition: collisions.h:203
Algorithms::RK4< valarray< double > > RK
Definition: collisions.h:210
Here is the caller graph for this function:

◆ Magnetic_Field_1D()

Magnetic_Field_1D::Magnetic_Field_1D ( size_t  Nl,
size_t  Nm,
double  pmin,
double  pmax,
size_t  Np,
double  xmin,
double  xmax,
size_t  Nx 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/vlasov.h>

Definition at line 849 of file vlasov.cpp.

References Magnetic_Field_1D::A1, Magnetic_Field_1D::A2, Magnetic_Field_1D::A3, and Magnetic_Field_1D::B1.

855  : A1(Nm+1), B1(Nl+1), A2(Nl+1,Nm+1), A3(0.5),
856  FLM(Np,Nx)
857 {
858 // - - - - - - - - - - - - - - - - - - - - - - - - - - -
859  complex<double> lc, mc;
860  complex<double> c01(0.0,1.0);
861 
862 // Calculate the "A1" parameters
863 // - - - - - - - - - - - - - - - - - - - - - - - - - - -
864  for (size_t m(0); m < Nm+1; ++m){
865  mc = complex<double>(m);
866  A1[m] = (-1.0)*c01*mc;
867  }
868 // - - - - - - - - - - - - - - - - - - - - - - - - - - -
869 
870 // Calculate the "A2" parameters
871 // - - - - - - - - - - - - - - - - - - - - - - - - - - -
872  for (size_t l(1); l < Nl+1; ++l)
873  for (size_t m=0; m<((Nm<l)?Nm:l)+1; ++m){
874  lc = complex<double>(l);
875  mc = complex<double>(m);
876  A2(l,m) = (-0.5)*(lc+1.0-mc)*(lc+mc);
877  }
878 // - - - - - - - - - - - - - - - - - - - - - - - - - - -
879 
880 // Calculate the "A3" parameters
881 // - - - - - - - - - - - - - - - - - - - - - - - - - - -
882  A3 = 0.5;
883 // - - - - - - - - - - - - - - - - - - - - - - - - - - -
884 
885 // Calculate the "B1" parameters
886 // - - - - - - - - - - - - - - - - - - - - - - - - - - -
887  for (size_t l(0); l < Nl+1; ++l){
888  lc = complex<double>(l);
889  B1[l] = (-1.0)*lc*(lc+1.0);
890  }
891 // - - - - - - - - - - - - - - - - - - - - - - - - - - -
892 
893 }
valarray< complex< double > > B1
Definition: vlasov.h:106
complex< double > A3
Definition: vlasov.h:108
SHarmonic1D FLM
Definition: vlasov.h:104
valarray< complex< double > > A1
Definition: vlasov.h:106
Array2D< complex< double > > A2
Definition: vlasov.h:107

◆ MakeG00()

void Electric_Field_1D::MakeG00 ( SHarmonic1D f)
private

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/vlasov.h>

Definition at line 828 of file vlasov.cpp.

References SHarmonic1D::Dp(), Electric_Field_1D::G, SHarmonic1D::numx(), and Electric_Field_1D::pr.

Referenced by Electric_Field_1D::es1d(), Electric_Field_1D::f1only(), Electric_Field_1D::Implicit_Ex(), Electric_Field_1D::Implicit_Ex_f1only(), Electric_Field_1D::Implicit_Ey(), Electric_Field_1D::Implicit_Ey_f1only(), Electric_Field_1D::Implicit_Ez(), Electric_Field_1D::Implicit_Ez_f1only(), and Electric_Field_1D::operator()().

828  {
829 //--------------------------------------------------------------
830  G = f; G = G.Dp();
831 
832  complex<double> p0p1_sq( pr[0]*pr[0]/(pr[1]*pr[1]) ),
833  inv_mp0p1_sq( 1.0/(1.0-p0p1_sq) ),
834  g_r = -4.0*(pr[1]-pr[0]) * pr[0]/(pr[1]*pr[1]),
835  // g_r = 2.0*(pr[0]/pr[1]/pr[1]),
836  f00;
837 
838  for (size_t i(0); i < f.numx(); ++i) {
839  f00 = ( f(0,i) - f(1,i) * p0p1_sq) * inv_mp0p1_sq;
840  G(0,i) = ( f(1,i) - f00) * g_r;
841  }
842 }
size_t numx() const
Definition: state.h:72
SHarmonic1D & Dp()
Definition: state.cpp:139
valarray< complex< double > > pr
Definition: vlasov.h:78
SHarmonic1D G
Definition: vlasov.h:70
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MakeGH()

void Electric_Field_1D::MakeGH ( SHarmonic1D f,
size_t  l 
)
private

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/vlasov.h>

Definition at line 807 of file vlasov.cpp.

References SHarmonic1D::Dp(), Electric_Field_1D::G, Electric_Field_1D::H, Electric_Field_1D::Hp0, Electric_Field_1D::invpr, SHarmonic1D::mpaxis(), SHarmonic1D::numx(), and Electric_Field_1D::pr.

Referenced by Electric_Field_1D::es1d(), Electric_Field_1D::f1only(), Electric_Field_1D::Implicit_Ex(), Electric_Field_1D::Implicit_Ex_f1only(), Electric_Field_1D::Implicit_Ey(), Electric_Field_1D::Implicit_Ey_f1only(), Electric_Field_1D::Implicit_Ez(), Electric_Field_1D::Implicit_Ez_f1only(), and Electric_Field_1D::operator()().

807  {
808 //--------------------------------------------------------------
809  valarray<complex<double> > invpax(invpr);
810  complex<double> ld(el);
811 
812  invpax *= (-2.0)*(ld+1.0) * (pr[1]-pr[0]);
813 
814  G = f; H = f;
815  G = G.Dp();
816  H = H.mpaxis(invpax);
817  H += G;
818  G *= -(2.0*ld+1.0)/ld;
819  G += H;
820 
821  for (size_t i(0); i < G.numx(); ++i) G(0,i) = 0.0;
822  for (size_t i(0); i < H.numx(); ++i) H(0,i) = f(1,i) * Hp0[el];
823 }
SHarmonic1D H
Definition: vlasov.h:70
size_t numx() const
Definition: state.h:72
SHarmonic1D & Dp()
Definition: state.cpp:139
valarray< complex< double > > pr
Definition: vlasov.h:78
SHarmonic1D G
Definition: vlasov.h:70
valarray< complex< double > > invpr
Definition: vlasov.h:78
valarray< complex< double > > Hp0
Definition: vlasov.h:78
SHarmonic1D & mpaxis(const valarray< complex< double > > &shmulti)
Definition: state.cpp:122
Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator()() [1/12]

void Spatial_Advection_1D::operator() ( const DistFunc1D Din,
DistFunc1D Dh 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/vlasov.h>

Definition at line 1249 of file vlasov.cpp.

References Spatial_Advection_1D::A1, Spatial_Advection_1D::A2, SHarmonic1D::Dx(), Spatial_Advection_1D::fd1, Spatial_Advection_1D::fd2, DistFunc1D::l0(), DistFunc1D::m0(), DistFunc1D::mass(), SHarmonic1D::mpaxis(), and Spatial_Advection_1D::vr.

1249  {
1250 //--------------------------------------------------------------
1251 
1252  valarray<complex<double> > vt(vr); vt *= 1.0/Din.mass();
1253 
1254  size_t l0(Din.l0());
1255  size_t m0(Din.m0());
1256 
1257  for (size_t m(0); m < ((m0<l0)?(m0+1):m0); ++m){
1258 
1259  fd1 = Din(m,m); fd1 = fd1.Dx();
1260 
1261  vt *= A1(m,m); Dh(m+1,m) += fd1.mpaxis(vt);
1262 
1263  for (size_t l(m+1); l < l0; ++l) {
1264  fd1 = Din(l,m); fd1 = fd1.Dx();
1265 
1266  vt *= A2(l,m)/A1(l-1,m); fd2 = fd1; Dh(l-1,m) += fd1.mpaxis(vt);
1267  vt *= A1(l,m)/A2(l ,m); Dh(l+1,m) += fd2.mpaxis(vt);
1268  }
1269 
1270  fd1 = Din(l0,m); fd1 = fd1.Dx();
1271  vt *= A2(l0,m)/A1(l0-1,m); Dh(l0-1,m) += fd1.mpaxis(vt);
1272  vt *= 1.0/A2(l0,m);
1273  }
1274 
1275 
1276 }
SHarmonic1D fd2
Definition: vlasov.h:31
double mass() const
Definition: state.h:400
Array2D< complex< double > > A2
Definition: vlasov.h:33
valarray< complex< double > > vr
Definition: vlasov.h:34
Array2D< complex< double > > A1
Definition: vlasov.h:33
size_t m0() const
Definition: state.h:397
SHarmonic1D fd1
Definition: vlasov.h:31
SHarmonic1D & Dx()
Definition: state.cpp:185
size_t l0() const
Definition: state.h:396
SHarmonic1D & mpaxis(const valarray< complex< double > > &shmulti)
Definition: state.cpp:122
Here is the call graph for this function:

◆ operator()() [2/12]

void Electric_Field_1D::operator() ( const DistFunc1D Din,
const Field1D FEx,
const Field1D FEy,
const Field1D FEz,
DistFunc1D Dh 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/vlasov.h>

Definition at line 187 of file vlasov.cpp.

References Electric_Field_1D::A1, Electric_Field_1D::A2, Field1D::array(), Electric_Field_1D::B1, Electric_Field_1D::B2, Electric_Field_1D::C1, Electric_Field_1D::C2, Electric_Field_1D::C3, Electric_Field_1D::C4, Electric_Field_1D::G, Electric_Field_1D::H, DistFunc1D::l0(), DistFunc1D::m0(), Electric_Field_1D::MakeG00(), Electric_Field_1D::MakeGH(), SHarmonic1D::mxaxis(), DistFunc1D::q(), SHarmonic1D::Re(), and Electric_Field_1D::TMP.

189  {
190 //--------------------------------------------------------------
191 // This is the core calculation for the electric field
192 //--------------------------------------------------------------
193 
194  complex<double> ii(0.0,1.0);
195 
196  valarray<complex<double> > Ex(FEx.array());
197  valarray<complex<double> > Em(FEz.array());
198  Em *= (-1.0)*ii;
199  Em += FEy.array();
200  valarray<complex<double> > Ep(FEz.array());
201  Ep *= ii;
202  Ep += FEy.array();
203 
204  Ex *= Din.q();
205  Em *= Din.q();
206  Ep *= Din.q();
207 
208  size_t l0(Din.l0());
209  size_t m0(Din.m0());
210 
211 
212 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
213 // m = 0, l = 0
214 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
215  MakeG00(Din(0,0));
216  Ex *= A1(0,0); TMP = G; Dh(1,0) += G.mxaxis(Ex);
217  Em *= C1[0]; Dh(1,1) += TMP.mxaxis(Em);
218 
219 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
220 // m = 0, l = 1
221 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
222  MakeGH(Din(1,0),1);
223  Ex *= A2(1,0) / A1(0,0); Dh(0,0) += H.mxaxis(Ex);
224  Ex *= A1(1,0) / A2(1,0); TMP = G; Dh(2,0) += G.mxaxis(Ex);
225  Em *= C1[1] / C1[0] ; Dh(2,1) += TMP.mxaxis(Em);
226 
227 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
228 // m = 0, 1 < l < l0
229 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
230  for (size_t l(2); l < l0; ++l){
231  MakeGH(Din(l,0),l);
232  Ex *= A2(l,0) / A1(l-1,0); TMP = H; Dh(l-1,0) += H.mxaxis(Ex);
233  Em *= C3[l] / C1[l-1]; Dh(l-1,1) += TMP.mxaxis(Em);
234  Ex *= A1(l,0) / A2(l,0); TMP = G; Dh(l+1,0) += G.mxaxis(Ex);
235  Em *= C1[l] / C3[l]; Dh(l+1,1) += TMP.mxaxis(Em);
236  }
237 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
238 // m = 0, l = l0
239 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
240  MakeGH(Din(l0,0),l0);
241  Ex *= A2(l0,0) / A1(l0-1,0); TMP = H; Dh(l0-1,0) += H.mxaxis(Ex);
242  Em *= C3[l0] / C1[l0-1]; Dh(l0-1,1) += TMP.mxaxis(Em);
243 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
244 
245 
246 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
247 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
248 // m = 1, l = 1
249 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
250  MakeGH(Din(1,1),1);
251  Ep *= B2[1]; H = H.mxaxis(Ep); Dh(0,0) += H.Re();
252  Ex *= A1(1,1) / A2(l0,0); TMP = G; Dh(2,1) += G.mxaxis(Ex);
253  Em *= C1[1] / C3[l0]; G = TMP; Dh(2,2) += TMP.mxaxis(Em);
254  Ep *= B1[1] / B2[1]; G = G.mxaxis(Ep); Dh(2,0) += G.Re();
255 
256 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
257 // m = 1, l = 2
258 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
259  MakeGH(Din(2,1),2);
260  Ex *= A2(2,1) / A1(1,1); TMP = H; Dh(1,1) += TMP.mxaxis(Ex);
261  Ep *= B2[2] / B1[1]; H = H.mxaxis(Ep); Dh(1,0) += H.Re();
262  Ex *= A1(2,1) / A2(2,1); TMP = G; Dh(3,1) += G.mxaxis(Ex);
263  Em *= C1[2] / C1[1]; G = TMP; Dh(3,2) += TMP.mxaxis(Em);
264  Ep *= B1[2] / B2[2]; G = G.mxaxis(Ep); Dh(3,0) += G.Re();
265 
266 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
267 // m = 1, 1 < l < l0
268 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
269  for (size_t l(3); l < l0; ++l){
270  MakeGH(Din(l,1),l);
271  Ex *= A2(l,1) / A1(l-1,1); TMP = H; Dh(l-1,1) += H.mxaxis(Ex);
272  Em *= C3[l] / C1[l-1]; H = TMP; Dh(l-1,2) += TMP.mxaxis(Em);
273  Ep *= B2[l] / B1[l-1]; H = H.mxaxis(Ep); Dh(l-1,0) += H.Re();
274  Ex *= A1(l,1) / A2(l,1); TMP = G; Dh(l+1,1) += G.mxaxis(Ex);
275  Em *= C1[l] / C3[l]; G = TMP; Dh(l+1,2) += TMP.mxaxis(Em);
276  Ep *= B1[l] / B2[l]; G = G.mxaxis(Ep); Dh(l+1,0) += G.Re();
277  }
278 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
279 // m = 1, l = l0
280 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
281  MakeGH(Din(l0,1),l0);
282  Ex *= A2(l0,1) / A1(l0-1,1); TMP = H; Dh(l0-1,1) += H.mxaxis(Ex);
283  Em *= C3[l0] / C1[l0-1]; H = TMP; Dh(l0-1,2) += TMP.mxaxis(Em);
284  Ep *= B2[l0] / B1[l0-1]; H = H.mxaxis(Ep); Dh(l0-1,0) += H.Re();
285 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
286 
287 
288 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
289  C4(l0,1) = B2[l0];
290  for (size_t m(2); m < m0; ++m){
291 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
292 // m > 1 , l = m
293 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
294  MakeGH(Din(m,m),m);
295  Ep *= C4(m,m) / C4(l0,m-1); Dh(m-1,m-1) += H.mxaxis(Ep);
296  Ex *= A1(m,m) / A2(l0,m-1); TMP = G; Dh(m+1,m ) += G.mxaxis(Ex);
297  Em *= C1[m] / C3[l0]; G = TMP; Dh(m+1,m+1) += TMP.mxaxis(Em);
298  Ep *= C2(m,m) / C4(m,m); Dh(m+1,m-1) += G.mxaxis(Ep);
299 
300 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
301 // m > 1 , l = m+1
302 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
303  MakeGH(Din(m+1,m),m+1);
304  Ex *= A2(m+1,m) / A1(m,m); TMP = H; Dh(m ,m ) += TMP.mxaxis(Ex);
305  Ep *= C4(m+1,m) / C2(m,m); Dh(m ,m-1) += H.mxaxis(Ep);
306  if ( m+1 < l0) { //always true except when m = m0-1 = l0-1
307  Ex *= A1(m+1,m) / A2(m+1,m); TMP = G; Dh(m+2,m ) += G.mxaxis(Ex);
308  Em *= C1[m+1] / C1[m]; G = TMP; Dh(m+2,m+1) += TMP.mxaxis(Em);
309  Ep *= C2(m+1,m) / C4(m+1,m); Dh(m+2,m-1) += G.mxaxis(Ep);
310 
311 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
312 // m > 1, 1 < l < l0
313 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
314  for (size_t l(m+2); l < l0; ++l){
315  MakeGH(Din(l,m),l);
316  Ex *= A2(l,m) / A1(l-1,m); TMP = H; Dh(l-1,m ) += H.mxaxis(Ex);
317  Em *= C3[l] / C1[l-1]; H = TMP; Dh(l-1,m+1) += TMP.mxaxis(Em);
318  Ep *= C4(l,m) / C2(l-1,m); Dh(l-1,m-1) += H.mxaxis(Ep);
319  Ex *= A1(l,m) / A2(l,m); TMP = G; Dh(l+1,m ) += G.mxaxis(Ex);
320  Em *= C1[l] / C3[l]; G = TMP; Dh(l+1,m+1) += TMP.mxaxis(Em);
321  Ep *= C2(l,m) / C4(l,m); Dh(l+1,m-1) += G.mxaxis(Ep);
322  }
323 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
324 // m > 1, l = l0
325 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
326  MakeGH(Din(l0,m),l0);
327  Ex *= A2(l0,m) / A1(l0-1,m); TMP = H; Dh(l0-1,m ) += H.mxaxis(Ex);
328  Em *= C3[l0] / C1[l0-1]; H = TMP; Dh(l0-1,m+1) += TMP.mxaxis(Em);
329  Ep *= C4(l0,m) / C2(l0-1,m); Dh(l0-1,m-1) += H.mxaxis(Ep);
330  }
331  }
332 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
333 
334 
335 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
336  MakeGH(Din(m0,m0),m0);
337  Ep *= C4(m0,m0) / C4(l0,m0-1); Dh(m0-1,m0-1) += H.mxaxis(Ep);
338 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
339 // m = m0, l0 > l > m0
340 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
341  if ( m0 < l0) {
342  Ex *= A1(m0,m0) / A2(l0,m0-1); TMP = G; Dh(m0+1,m0 ) += TMP.mxaxis(Ex);
343  Ep *= C2(m0,m0) / C4(m0,m0); Dh(m0+1,m0-1) += G.mxaxis(Ep);
344 
345 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
346 // m = m0 , l = m0+1
347 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
348  MakeGH(Din(m0+1,m0),m0+1);
349  Ex *= A2(m0+1,m0) / A1(m0,m0); TMP = H; Dh(m0,m0 ) += TMP.mxaxis(Ex);
350  Ep *= C4(m0+1,m0) / C2(m0,m0); Dh(m0,m0-1) += H.mxaxis(Ep);
351  if ( m0+1 < l0) {
352  Ex *= A1(m0+1,m0) / A2(m0+1,m0); TMP = G; Dh(m0+2,m0 )+= TMP.mxaxis(Ex);
353  Ep *= C2(m0+1,m0) / C4(m0+1,m0); Dh(m0+2,m0-1)+= G.mxaxis(Ep);
354 
355 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
356 // m = m0, m0+2 < l < l0
357 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
358  for (size_t l(m0+2); l < l0; ++l){
359  MakeGH(Din(l,m0),l);
360  Ex *= A2(l,m0) / A1(l-1,m0); TMP = H; Dh(l-1,m0) += TMP.mxaxis(Ex);
361  Ep *= C4(l,m0) / C2(l-1,m0); Dh(l-1,m0-1) += H.mxaxis(Ep);
362  Ex *= A1(l,m0) / A2(l, m0); TMP = G; Dh(l+1,m0 ) += TMP.mxaxis(Ex);
363  Ep *= C2(l,m0) / C4(l, m0); Dh(l+1,m0-1) += G.mxaxis(Ep);
364  }
365 
366 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
367 // m > 1, l = l0
368 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
369  MakeGH(Din(l0,m0),l0);
370  Ex *= A2(l0,m0) / A1(l0-1,m0); TMP = H; Dh(l0-1,m0) += TMP.mxaxis(Ex);
371  Ep *= C4(l0,m0) / C2(l0-1,m0); Dh(l0-1,m0-1) += H.mxaxis(Ep);
372  }
373  }
374 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
375 
376 }
valarray< complex< double > > C3
Definition: vlasov.h:76
void MakeG00(SHarmonic1D &f)
Definition: vlasov.cpp:828
Array2D< complex< double > > C2
Definition: vlasov.h:77
SHarmonic1D H
Definition: vlasov.h:70
SHarmonic1D & mxaxis(const valarray< complex< double > > &shmulti)
Definition: state.cpp:126
SHarmonic1D & Re()
Definition: state.cpp:130
valarray< complex< double > > & array() const
Definition: state.h:196
size_t m0() const
Definition: state.h:397
double q() const
Definition: state.h:399
Array2D< complex< double > > A1
Definition: vlasov.h:74
valarray< complex< double > > B2
Definition: vlasov.h:75
SHarmonic1D TMP
Definition: vlasov.h:70
void MakeGH(SHarmonic1D &f, size_t l)
Definition: vlasov.cpp:807
SHarmonic1D G
Definition: vlasov.h:70
valarray< complex< double > > C1
Definition: vlasov.h:76
valarray< complex< double > > B1
Definition: vlasov.h:75
Array2D< complex< double > > C4
Definition: vlasov.h:77
size_t l0() const
Definition: state.h:396
Array2D< complex< double > > A2
Definition: vlasov.h:74
Here is the call graph for this function:

◆ operator()() [3/12]

void interspecies_f00_RKfunctor::operator() ( const valarray< double > &  fin1,
valarray< double > &  fslope 
)
virtual

◆ operator()() [4/12]

void interspecies_f00_RKfunctor::operator() ( const valarray< double > &  fin1,
const valarray< double > &  fin2,
valarray< double > &  fslope 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/interspeciescollisions.h>

Definition at line 305 of file interspeciescollisions.cpp.

References interspecies_f00_RKfunctor::collide, and interspecies_f00_explicit_step::takestep().

305  {
306  fslope = collide.takestep(fin1,fin2);
307  }
interspecies_f00_explicit_step collide
valarray< double > takestep(const valarray< double > &f1in, const valarray< double > &f2in)
Collisions between species 1 and 2 in 0,0 harmonic.
Here is the call graph for this function:

◆ operator()() [5/12]

void interspecies_f00_RKfunctor::operator() ( const valarray< double > &  fin1,
valarray< double > &  fslope,
size_t  dir 
)
virtual

◆ operator()() [6/12]

void Magnetic_Field_1D::operator() ( const DistFunc1D Din,
const Field1D FBx,
const Field1D FBy,
const Field1D FBz,
DistFunc1D Dh 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/vlasov.h>

Definition at line 898 of file vlasov.cpp.

References Magnetic_Field_1D::A1, Magnetic_Field_1D::A2, Magnetic_Field_1D::A3, Field1D::array(), Magnetic_Field_1D::B1, Magnetic_Field_1D::FLM, SHarmonic1D::mxaxis(), DistFunc1D::q(), and SHarmonic1D::Re().

900  {
901 //--------------------------------------------------------------
902 // This is the core calculation for the magnetic field
903 //--------------------------------------------------------------
904 
905  complex<double> ii(0.0,1.0);
906 
907  valarray<complex<double> > Bx(FBx.array());
908  valarray<complex<double> > Bm(FBy.array());
909  Bm *= (-1.0)*ii;
910  Bm += FBz.array();
911  valarray<complex<double> > Bp(FBy.array());
912  Bp *= ii;
913  Bp += FBz.array();
914 
915  Bx *= Din.q();
916  Bm *= Din.q();
917  Bp *= Din.q();
918 
919  size_t l0(B1.size()-1);
920  size_t m0(A1.size()-1);
921 
922 // - - - - - - - - - - - - - - - - - - - - - - - - - - -
923 // m = 0, 1 < l < l0+1
924 // - - - - - - - - - - - - - - - - - - - - - - - - - - -
925  Bp *= A3;
926  for (size_t l(1); l < l0+1; ++l){
927  FLM = Din(l,0); Dh(l,1) += FLM.mxaxis(Bp);
928  }
929 
930 // - - - - - - - - - - - - - - - - - - - - - - - - - - -
931 // m = 1, l = 1
932 // - - - - - - - - - - - - - - - - - - - - - - - - - - -
933  FLM = Din(1,1); Bx *= A1[1]; Dh(1,1) += FLM.mxaxis(Bx);
934  FLM = Din(1,1); Bm *= B1[1]; FLM = FLM.mxaxis(Bm); Dh(1,0) += FLM.Re();
935 
936 // - - - - - - - - - - - - - - - - - - - - - - - - - - -
937 // m = 1, l > 1
938 // - - - - - - - - - - - - - - - - - - - - - - - - - - -
939  for (size_t l(2); l < l0+1; ++l){
940  FLM = Din(l,1); Dh(l,2) += FLM.mxaxis(Bp);
941  FLM = Din(l,1); Dh(l,1) += FLM.mxaxis(Bx);
942  FLM = Din(l,1); Bm *= B1[l]/B1[l-1]; FLM = FLM.mxaxis(Bm); Dh(l,0) += FLM.Re();
943  }
944  Bm *= 1.0/B1[l0];
945 
946 // - - - - - - - - - - - - - - - - - - - - - - - - - - -
947 // m > 1, l = m
948 // - - - - - - - - - - - - - - - - - - - - - - - - - - -
949  for (size_t m(2); m < m0; ++m){
950  FLM = Din(m,m); Bx *= A1[m]/A1[m-1]; Dh(m,m ) += FLM.mxaxis(Bx);
951  FLM = Din(m,m); Bm *= A2(m,m); Dh(m,m-1) += FLM.mxaxis(Bm);
952  for (size_t l(m+1); l < l0+1; ++l){
953  FLM = Din(l,m); Dh(l,m+1) += FLM.mxaxis(Bp);
954  FLM = Din(l,m); Dh(l,m ) += FLM.mxaxis(Bx);
955  FLM = Din(l,m); Bm *= A2(l,m)/A2(l-1,m); Dh(l,m-1) += FLM.mxaxis(Bm);
956  }
957  Bm *= 1.0/A2(l0,m);
958  }
959 
960 // - - - - - - - - - - - - - - - - - - - - - - - - - - -
961 // m = m0, l >= m0
962 // - - - - - - - - - - - - - - - - - - - - - - - - - - -
963  FLM = Din(m0,m0); Bx *= A1[m0]/A1[m0-1]; Dh(m0,m0) += FLM.mxaxis(Bx);
964  FLM = Din(m0,m0); Bm *= A2(m0,m0)/*/A2(l0,m0-1)*/; Dh(m0,m0-1) += FLM.mxaxis(Bm);
965  for (size_t l(m0+1); l < l0+1; ++l){
966  FLM = Din(l,m0); Dh(l,m0 ) += FLM.mxaxis(Bx);
967  FLM = Din(l,m0); Bm *= A2(l,m0)/A2(l-1,m0); Dh(l,m0-1) += FLM.mxaxis(Bm);
968  }
969 
970 }
valarray< complex< double > > B1
Definition: vlasov.h:106
complex< double > A3
Definition: vlasov.h:108
SHarmonic1D FLM
Definition: vlasov.h:104
valarray< complex< double > > A1
Definition: vlasov.h:106
Array2D< complex< double > > A2
Definition: vlasov.h:107
SHarmonic1D & mxaxis(const valarray< complex< double > > &shmulti)
Definition: state.cpp:126
SHarmonic1D & Re()
Definition: state.cpp:130
valarray< complex< double > > & array() const
Definition: state.h:196
double q() const
Definition: state.h:399
Here is the call graph for this function:

◆ operator()() [7/12]

void Current_1D::operator() ( const DistFunc1D Din,
Field1D FExh,
Field1D FEyh,
Field1D FEzh 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/vlasov.h>

Definition at line 53 of file vlasov.cpp.

References DistFunc1D::getcurrent(), Current_1D::Jx, Current_1D::Jy, Current_1D::Jz, and Field1D::numx().

53  {
54 
55  Array2D<double> temp(3,Din(0).numx());
56 
57  temp = Din.getcurrent();
58 
59  for (size_t i(0); i < Jx.numx(); ++i) {
60  Jx(i) = complex<double >(temp(0,i));
61  Jy(i) = complex<double >(temp(1,i));
62  Jz(i) = complex<double >(temp(2,i));
63  }
64 
65  Exh += Jx;
66  Eyh += Jy;
67  Ezh += Jz;
68 
69 }
size_t numx() const
Definition: state.h:197
Field1D Jz
Definition: vlasov.h:128
Field1D Jy
Definition: vlasov.h:128
valarray< double > getcurrent(size_t dir)
Definition: state.cpp:965
Field1D Jx
Definition: vlasov.h:128
Here is the call graph for this function:

◆ operator()() [8/12]

void Faraday_1D::operator() ( EMF1D EMFin,
EMF1D EMFh 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/vlasov.h>

Definition at line 1342 of file vlasov.cpp.

References EMF1D::By(), EMF1D::Bz(), Field1D::Dx(), EMF1D::Ey(), EMF1D::Ez(), Faraday_1D::idx, and Faraday_1D::tmpE.

1342  {
1343 //--------------------------------------------------------------
1344 // This is the core calculation for Faraday's Law
1345 //--------------------------------------------------------------
1346 
1347 // dBx/dt += - dEz/dy
1348 // tmpE = Fin.Ez();
1349 // tmpE *= (-1.0) * idy;
1350 // Yh.EMF().Bx() += tmpE.Dy();
1351 
1352 // dBy/dt += dEz/dx
1353  tmpE = EMFin.Ez();
1354  tmpE *= idx;
1355  EMFh.By() += tmpE.Dx();
1356  // EMFh.By()(numx-1) = 0.0;
1357 
1358 // dBz/dt += dEx/dy
1359 // tmpE = Ein.Ex();
1360 // tmpE *= idy;
1361 // Yh.EMF().Bz() += tmpE.Dy();
1362 
1363 // dBz/dt += - dEy/dx
1364  tmpE = EMFin.Ey();
1365  tmpE *= (-1.0) * idx;
1366  EMFh.Bz() += tmpE.Dx();
1367 
1368  // EMFh.Bz()(numx-1) = 0.0;
1369 
1370 }
Field1D & Dx()
Definition: state.cpp:450
Field1D & By()
Definition: state.h:294
complex< double > idx
Definition: vlasov.h:146
Field1D & Ez()
Definition: state.h:292
Field1D tmpE
Definition: vlasov.h:145
Field1D & Bz()
Definition: state.h:295
Field1D & Ey()
Definition: state.h:291
Here is the call graph for this function:

◆ operator()() [9/12]

void Ampere_1D::operator() ( EMF1D EMFin,
EMF1D EMFh 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/vlasov.h>

Definition at line 1391 of file vlasov.cpp.

References EMF1D::By(), EMF1D::Bz(), Field1D::Dx(), EMF1D::Ey(), EMF1D::Ez(), Ampere_1D::idx, and Ampere_1D::tmpB.

1391  {
1392 //--------------------------------------------------------------
1393 // This is the core calculation for Ampere's Law
1394 //--------------------------------------------------------------
1395 
1396 // dEx/dt += dBz/dy
1397 // tmpB = Fin.Bz();
1398 // tmpB *= idy;
1399 // Fh.Ex() += tmpB.Dy();
1400 
1401 // dEy/dt += - dBz/dx
1402  tmpB = EMFin.Bz();
1403  tmpB *= (-1.0) * idx;
1404  EMFh.Ey() += tmpB.Dx();
1405 
1406  //.Dx();
1407  // EMFh.Ey()(numx-1) = 0.0;
1408 
1409 // dEz/dt += - dBx/dy
1410 // tmpB = Fin.Bx();
1411 // tmpB *= (-1.0) * idy;
1412 // Fh.Ez() += tmpB.Dy();
1413 
1414 // dEz/dt += dBy/dx
1415  tmpB = EMFin.By();
1416  tmpB *= idx;
1417  EMFh.Ez() += tmpB.Dx();
1418  // EMFh.Ez()(numx-1) = 0.0;
1419 
1420 }
Field1D & Dx()
Definition: state.cpp:450
Field1D & By()
Definition: state.h:294
Field1D tmpB
Definition: vlasov.h:163
complex< double > idx
Definition: vlasov.h:164
Field1D & Ez()
Definition: state.h:292
Field1D & Bz()
Definition: state.h:295
Field1D & Ey()
Definition: state.h:291
Here is the call graph for this function:

◆ operator()() [10/12]

void self_f00_RKfunctor::operator() ( const valarray< double > &  fin,
valarray< double > &  fslope 
)
virtual

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/collisions.h>

{ item_description }

Implements Algorithms::AbstFunctor< valarray< double > >.

Definition at line 753 of file collisions.cpp.

References self_f00_RKfunctor::collide, and self_f00_explicit_step::takestep().

753  {
754  collide.takestep(fin,fslope);
755 }
void takestep(const valarray< double > &fin, valarray< double > &fh)
Definition: collisions.cpp:639
self_f00_explicit_step collide
Definition: collisions.h:170
Here is the call graph for this function:

◆ operator()() [11/12]

void self_f00_RKfunctor::operator() ( const valarray< double > &  fin,
valarray< double > &  fslope,
size_t  dir 
)
virtual

◆ operator()() [12/12]

void self_f00_RKfunctor::operator() ( const valarray< double > &  fin,
const valarray< double > &  f2in,
valarray< double > &  fslope 
)

◆ remapintegrals()

void interspecies_f00_explicit_step::remapintegrals ( )
private

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/interspeciescollisions.h>

Remap Distribution to momentum grid of colliding particles.

Initialize

Find nearest cell and distance from it

Interpolate

Definition at line 262 of file interspeciescollisions.cpp.

References interspecies_f00_explicit_step::I2_s1, interspecies_f00_explicit_step::I2_s2, interspecies_f00_explicit_step::I4_s1, interspecies_f00_explicit_step::I4_s2, interspecies_f00_explicit_step::J1_s1, interspecies_f00_explicit_step::J1_s2, interspecies_f00_explicit_step::pgrid_s1, and interspecies_f00_explicit_step::pgrid_s2.

Referenced by interspecies_f00_explicit_step::takestep().

262  {
263 
264 
265  double cell_s2 = 0;
266  double dp_s2 = pgrid_s2[2]-pgrid_s2[1];
267  double dist = 0.0;
268 
270  I4_s1[0] = 0.0;
271  I2_s1[0] = 0.0;
272  J1_s1[J1_s1.size()-1] = 0.0;
273 
274  int n(0);
275 
276  while ( (n < pgrid_s1.size()) && (pgrid_s1[n] < pgrid_s2[pgrid_s2.size()-1]))
277  {
278  dist = modf( pgrid_s1[n]/dp_s2 , &cell_s2 );
279  // std::cout << "p[" << n << "]=" << pgrid_s1[n] << ", dist=" << dist << ", cell_s2 = " << cell_s2 << "\n";
280  I4_s1[n] = I4_s2[static_cast<size_t>(cell_s2)]*(1.0-dist) + I4_s2[static_cast<size_t>(cell_s2)+1]*dist;
281  I2_s1[n] = I2_s2[static_cast<size_t>(cell_s2)]*(1.0-dist) + I2_s2[static_cast<size_t>(cell_s2)+1]*dist;
282  J1_s1[n] = J1_s2[static_cast<size_t>(cell_s2)]*(1.0-dist) + J1_s2[static_cast<size_t>(cell_s2)+1]*dist;
283  ++n;
284  }
285  while (n < pgrid_s1.size())
286  {
287  I4_s1[n] = I4_s2[I4_s2.size()];
288  I2_s1[n] = I2_s2[I2_s2.size()];
289  J1_s1[n] = 0.0;
290  ++n;
291  }
292 
293  }
valarray< double > J1_s1
The integrals.
valarray< double > J1_s2
The integrals.
Here is the caller graph for this function:

◆ reset_coeff() [1/2]

void interspecies_flm_implicit_step::reset_coeff ( const valarray< double > &  fin,
const double  Delta_t 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/interspeciescollisions.h>

Resets coefficients and integrals to use in the matrix solve.

Parameters
[in]finInput distribution function
[in]Delta_ttimestep

Definition at line 433 of file interspeciescollisions.cpp.

References interspecies_flm_implicit_step::_LOGee, interspecies_flm_implicit_step::_ZLOGei, interspecies_flm_implicit_step::Alpha_Tri, interspecies_flm_implicit_step::ddf0, interspecies_flm_implicit_step::df0, interspecies_flm_implicit_step::Dt, interspecies_flm_implicit_step::formulas, interspecies_flm_implicit_step::I0, interspecies_flm_implicit_step::I0_density, interspecies_flm_implicit_step::I2, interspecies_flm_implicit_step::I2_temperature, interspecies_flm_implicit_step::J1m, interspecies_flm_implicit_step::kpre, Formulary::LOGee(), Formulary::LOGei(), interspecies_flm_implicit_step::Scattering_Term, interspecies_flm_implicit_step::U1, interspecies_flm_implicit_step::U1m1, interspecies_flm_implicit_step::U2, interspecies_flm_implicit_step::U2m1, interspecies_flm_implicit_step::U4, interspecies_flm_implicit_step::U4m1, interspecies_flm_implicit_step::vr, and Formulary::Zeta.

Referenced by interspecies_flm_implicit_collisions::advancef1(), and interspecies_flm_implicit_collisions::advanceflm().

433  {
434 //-------------------------------------------------------------------
435 // Reset the coefficients based on f_0^0
436 //-------------------------------------------------------------------
437 
438 // Calculate Dt
439  Dt = Delta_t;
440 
441 // INTEGRALS
442 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
443 // Temperature integral I2 = 4*pi / (v^2) * int_0^v f(u)*u^4du
444  I2[0] = 0;
445  for (int k(1); k < I2.size(); ++k) {
446  I2[k] = U4[k]*fin[k]+U4m1[k]*fin[k-1];
447  I2[k] += I2[k-1];
448  }
449  I2 *= 4.0 * M_PI;
450  I2_temperature = I2[I2.size()-1];
451  for (int k(0); k < I2.size(); ++k){
452  I2[k] /= vr[k]*vr[k];
453  }
454 
455 // Density integral I0 = 4*pi*int_0^v f(u)*u^2du
456  I0[0] = 0;
457  for (int k(1); k < I0.size(); ++k) {
458  I0[k] = U2[k]*fin[k]+U2m1[k]*fin[k-1];
459  I0[k] += I0[k-1];
460  }
461  I0 *= 4.0 * M_PI;
462  I0_density = I0[I0.size()-1];
463 
464 // Integral J_(-1) = 4*pi * v * int_0^v f(u)*u^4du
465  J1m[J1m.size()-1] = 0;
466  for (int k(J1m.size()-2); k > -1; --k) {
467  J1m[k] = U1[k+1]*fin[k+1]+U1m1[k+1]*fin[k];
468  J1m[k] += J1m[k+1];
469  }
470  for (int k(0); k < J1m.size(); ++k){
471  J1m[k] *= 4.0 * M_PI *vr[k];
472  }
473 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
474 
475 // COULOMB LOGARITHMS
476 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
479 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
480 
481 
482 // BASIC INTEGRALS FOR THE TRIDIAGONAL PART
483 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
484 // Temporary arrays
485  valarray<double> TriI1(fin), TriI2(fin);
486 
487  for (int i(0); i < TriI1.size(); ++i){
488  TriI1[i] = I0[i] + (2.0*J1m[i] - I2[i]) / 3.0 ; // (-I2 + 2*J_{-1} + 3*I0) / 3
489  TriI2[i] = ( I2[i] + J1m[i] ) / 3.0 ; // ( I2 + J_{-1} ) / 3
490  }
491 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
492 
493 
494 // SCATTERING TERM
495 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
496  Scattering_Term = TriI1;
497  Scattering_Term *= _LOGee; // Electron-electron contribution
498  Scattering_Term[0] = 0.0;
499  Scattering_Term += _ZLOGei * I0_density; // Ion-electron contribution
500  for (int i(0); i < Scattering_Term.size(); ++i){ // Multiply by 1/v^3
501  Scattering_Term[i] /= pow(vr[i],3);
502  }
503  Scattering_Term *= kpre * Dt;
504 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
505 
506 
507 // MAKE TRIDIAGONAL ARRAY
508 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
509  Alpha_Tri = 0.0;
510  double IvDnDm1, IvDnDp1, Ivsq2Dn;
511  Alpha_Tri(0,0) = 8.0 * M_PI * fin[0]; // 8*pi*f0[0]
512  for (int i(1); i < TriI1.size()-1; ++i){
513  IvDnDm1 = 1.0 / (vr[i] * 0.5*(vr[i+1]-vr[i-1]) * (vr[i] -vr[i-1])); // ( v*D_n*D_{n-1/2} )^(-1)
514  IvDnDp1 = 1.0 / (vr[i] * 0.5*(vr[i+1]-vr[i-1]) * (vr[i+1]-vr[i] )); // ( v*D_n*D_{n+1/2} )^(-1)
515  Ivsq2Dn = 1.0 / (vr[i] * vr[i] * (vr[i+1]-vr[i-1])); // ( v^2 * 2*D_n )^(-1)
516  Alpha_Tri(i, i ) = 8.0 * M_PI * fin[i] - TriI2[i] * (IvDnDm1 + IvDnDp1);
517  Alpha_Tri(i, i-1) = TriI2[i] * IvDnDm1 - TriI1[i] * Ivsq2Dn;
518  Alpha_Tri(i, i+1) = TriI2[i] * IvDnDp1 + TriI1[i] * Ivsq2Dn;
519  }
520  Alpha_Tri *= (-1.0) * _LOGee * kpre * Dt; // (-1) because the matrix moves to the LHS in the equation
521 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
522 
523 // CALCULATE DERIVATIVES
524 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
525 
526 // Evaluate the derivative
527  for (int n(1); n < fin.size()-1; ++n) {
528  df0[n] = fin[n+1]-fin[n-1];
529  df0[n] /= vr[n+1]-vr[n-1];
530  }
531 
532 // Evaluate the second derivative
533 // -df/dv_{n-1/2}
534  for (int n(1); n < fin.size(); ++n) {
535  ddf0[n] = (fin[n-1]-fin[n]) ;
536  ddf0[n] /= vr[n] - vr[n-1] ;
537  }
538 // D(df/dv)/Dv
539  for (int n(1); n < fin.size()-1; ++n) {
540  ddf0[n] -= ddf0[n+1];
541  ddf0[n] /= 0.5*(vr[n+1]-vr[n-1]);
542  }
543 
544 // Calculate zeroth cell
545  double f00 = ( fin[0] - ( (vr[0]*vr[0])/(vr[1]*vr[1]) ) *fin[1] )
546  / (1.0 - (vr[0]*vr[0])/(vr[1]*vr[1]));
547  ddf0[0] = 2.0 * (fin[1] - f00) / (vr[1]*vr[1]);
548  df0[0] = ddf0[0] * vr[0];
549 
550 // Calculate 1/(2v)*(d^2f)/(dv^2), 1/v^2*df/dv
551  for (int n(0); n < fin.size()-1; ++n) {
552  df0[n] /= vr[n]*vr[n];
553  ddf0[n] /= 2.0 *vr[n];
554  }
555 
556 
557 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
558 
559  }
double Zeta
Definition: formulary.h:104
double LOGee(double ne, double Te)
Definition: formulary.cpp:226
double LOGei(double ne, double Te, double Z)
Definition: formulary.cpp:249
Here is the call graph for this function:
Here is the caller graph for this function:

◆ reset_coeff() [2/2]

void self_flm_implicit_step::reset_coeff ( const valarray< double > &  fin,
double  Zvalue,
const double  Delta_t 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/collisions.h>

Resets coefficients and integrals to use in the matrix solve.

Parameters
[in]finInput distribution function
[in]Delta_ttimestep

Definition at line 898 of file collisions.cpp.

References self_flm_implicit_step::_LOGee, self_flm_implicit_step::_ZLOGei, self_flm_implicit_step::Alpha_Tri, self_flm_implicit_step::ddf0, self_flm_implicit_step::df0, self_flm_implicit_step::Dt, self_flm_implicit_step::formulas, self_flm_implicit_step::I0, self_flm_implicit_step::I0_density, self_flm_implicit_step::I2, self_flm_implicit_step::I2_temperature, self_flm_implicit_step::J1m, self_flm_implicit_step::kpre, Formulary::LOGee(), Formulary::LOGei(), self_flm_implicit_step::Scattering_Term, self_flm_implicit_step::U1, self_flm_implicit_step::U1m1, self_flm_implicit_step::U2, self_flm_implicit_step::U2m1, self_flm_implicit_step::U4, self_flm_implicit_step::U4m1, self_flm_implicit_step::vr, and Formulary::Zeta.

Referenced by self_flm_implicit_collisions::advancef1(), and self_flm_implicit_collisions::advanceflm().

898  {
899 //-------------------------------------------------------------------
900 // Reset the coefficients based on f_0^0
901 //-------------------------------------------------------------------
902 
903 // Calculate Dt
904  Dt = Delta_t;
905 
906  double idp = 1.0/(vr[2] - vr[1]);
907 
908 
909 // INTEGRALS
910 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
911 // Temperature integral I2 = 4*pi / (v^2) * int_0^v f(u)*u^4du
912 // Density integral I0 = 4*pi*int_0^v f(u)*u^2du
913 
914 // I2[0] = U4[0]*fin[0];
915 // I0[0] = U2[0]*fin[0];
916  I2[0] = 0;
917  I0[0] = 0;
918 
919  for (int k(1); k < I2.size(); ++k) {
920  I2[k] = U4[k]*fin[k]+U4m1[k]*fin[k-1];
921  I2[k] += I2[k-1];
922 
923  I0[k] = U2[k]*fin[k]+U2m1[k]*fin[k-1];
924  I0[k] += I0[k-1];
925 
926 // I2[k] = U4[k]*fin[k];
927 // I2[k] += I2[k-1];
928 //
929 // I0[k] = U2[k]*fin[k];
930 // I0[k] += I0[k-1];
931  }
932  I0_density = 4.0*M_PI*I0[I0.size()-1];
933 
934 
935  I2_temperature = I2[I2.size()-1]/3.0/I0[I0.size()-1];
936 
937 
938  // Integral J_(-1) = 4*pi * v * int_0^v f(u)*u^4du
939  J1m[J1m.size()-1] = 0;
940  for (int k(J1m.size()-2); k > -1; --k) {
941  J1m[k] = U1[k+1]*fin[k+1]+U1m1[k+1]*fin[k];
942  J1m[k] += J1m[k+1];
943  }
944 
945 
946  /*J1m[J1m.size()-1] = fin[J1m.size()-1]*U1[U1.size()-1];
947 
948  *//*std::cout << "\nI2[" << U1.size()-1 << "] = " << I2[U1.size()-1] << endl;
949  std::cout << "I0[" << U1.size()-1 << "] = " << I0[U1.size()-1] << endl;
950  std::cout << "J1[" << U1.size()-1 << "] = " << J1m[U1.size()-1] << endl;
951  std::cout << "\n\n";*//*
952 
953 
954  for (int k(J1m.size()-2); k > -1; --k) {
955  J1m[k] = U1[k]*fin[k];//+U1m1[k+1]*fin[k];
956  J1m[k] += J1m[k+1];
957 
958  *//*std::cout << "\nI2[" << k << "] = " << I2[k] << endl;
959  std::cout << "I0[" << k << "] = " << I0[k] << endl;
960  std::cout << "J1[" << k << "] = " << J1m[k] << endl;
961  std::cout << "\n\n";*//*
962  }*/
963 
964 
965  for (int k(0); k < J1m.size(); ++k){
966  I2[k] /= vr[k] * vr[k] / 4.0 / M_PI;
967  I0[k] *= 4.0 * M_PI;
968  J1m[k] *= 4.0 * M_PI * vr[k];
969  }
970 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
971 
972 // COULOMB LOGARITHMS
973 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
976 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
977 
978 
979 // BASIC INTEGRALS FOR THE TRIDIAGONAL PART
980 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
981 // Temporary arrays
982  valarray<double> TriI1(fin), TriI2(fin);
983 
984  for (int i(0); i < TriI1.size(); ++i){
985  TriI1[i] = I0[i] + (2.0*J1m[i] - I2[i]) / 3.0 ; // (-I2 + 2*J_{-1} + 3*I0) / 3
986  TriI2[i] = ( I2[i] + J1m[i] ) / 3.0 ; // ( I2 + J_{-1} ) / 3
987  }
988 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
989 
990 
991 // SCATTERING TERM
992 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
993  Scattering_Term = TriI1;
994  Scattering_Term *= _LOGee; // Electron-electron contribution
995  Scattering_Term[0] = 0.0;
996  Scattering_Term += _ZLOGei * I0_density; // Ion-electron contribution
997 
998  for (int i(0); i < Scattering_Term.size(); ++i){ // Multiply by 1/v^3
999  Scattering_Term[i] /= pow(vr[i],3);
1000  }
1001  Scattering_Term *= kpre * Dt;
1002 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1003 
1004 
1005 // MAKE TRIDIAGONAL ARRAY
1006 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1007  Alpha_Tri = 0.0;
1008 
1009 
1010  double IvDnDm1, IvDnDp1, Ivsq2Dn;
1011  Alpha_Tri(0,0) = 8.0 * M_PI * fin[0]; // 8*pi*f0[0]
1012  for (int i(1); i < TriI1.size()-1; ++i){
1013  IvDnDm1 = 1.0 / (vr[i] * 0.5*(vr[i+1]-vr[i-1]) * (vr[i] - vr[i-1])); // ( v*D_n*D_{n-1/2} )^(-1)
1014  IvDnDp1 = 1.0 / (vr[i] * 0.5*(vr[i+1]-vr[i-1]) * (vr[i+1] - vr[i] )); // ( v*D_n*D_{n+1/2} )^(-1)
1015  Ivsq2Dn = 1.0 / (vr[i] * vr[i] * (vr[i+1] - vr[i-1])); // ( v^2 * 2*D_n )^(-1)
1016  Alpha_Tri(i, i ) = 8.0 * M_PI * fin[i] - TriI2[i] * (IvDnDm1 + IvDnDp1);
1017  Alpha_Tri(i, i-1) = TriI2[i] * IvDnDm1 - TriI1[i] * Ivsq2Dn;
1018  Alpha_Tri(i, i+1) = TriI2[i] * IvDnDp1 + TriI1[i] * Ivsq2Dn;
1019  }
1020 
1021  /*Alpha_Tri(0,0) = 8.0 * M_PI * fin[0]; // 8*pi*f0[0]
1022  for (int i(1); i < TriI1.size()-1; ++i){
1023  Alpha_Tri(i, i ) = - 2.0 * TriI2[i] / vr[i] * idp * idp;
1024  Alpha_Tri(i, i-1) = TriI2[i] / vr[i] * idp * idp - TriI1[i] / 2.0 / vr[i] / vr[i] * idp;
1025  Alpha_Tri(i, i+1) = TriI2[i] / vr[i] * idp * idp + TriI1[i] / 2.0 / vr[i] / vr[i] * idp;
1026  }*/
1027 
1028 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1029 
1030 
1031  Alpha_Tri *= (-1.0) * _LOGee * kpre * Dt; // (-1) because the matrix moves to the LHS in the equation
1032 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1033 /*
1034 
1035 // CALCULATE DERIVATIVES
1036 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1037 
1038  df0[0] = (fin[1] - fin[0]);
1039  df0[0] /= (vr[1] - vr[0]);
1040 // Evaluate the derivative
1041  for (int n(1); n < fin.size()-1; ++n) {
1042  df0[n] = fin[n+1] - fin[n-1];
1043  df0[n] /= vr[n+1] - vr[n-1];
1044  }
1045  df0[df0.size()-1] = fin[df0.size()-1] - fin[df0.size()-2];
1046  df0[df0.size()-1] /= vr[df0.size()-1] - vr[df0.size()-2];
1047 
1048  ddf0[0] = fin[0] - 2.0*fin[1] + fin[2];
1049  ddf0[0] /= vr[1] - vr[0];
1050  ddf0[0] /= vr[1] - vr[0];
1051 // Evaluate the second derivative
1052 // -df/dv_{n-1/2}
1053  for (int n(1); n < fin.size()-1; ++n) {
1054  ddf0[n] = fin[n+1] - 2.0*fin[n] + fin[n-1];
1055  ddf0[n] /= vr[n] - vr[n-1];
1056  ddf0[n] /= vr[n] - vr[n-1];
1057 // ddf0[n] = (fin[n-1]-fin[n]) ;
1058 // ddf0[n] /= vr[n] - vr[n-1] ;
1059  }
1060 
1061  ddf0[ddf0.size()-1] = fin[ddf0.size()-1] - 2.0*fin[ddf0.size()-2] + fin[ddf0.size()-3];
1062  ddf0[ddf0.size()-1] /= vr[vr.size()-1] - vr[vr.size()-2];
1063  ddf0[ddf0.size()-1] /= vr[vr.size()-1] - vr[vr.size()-2];
1064 
1065 // D(df/dv)/Dv
1066 // for (int n(1); n < fin.size()-1; ++n) {
1067 // ddf0[n] -= ddf0[n+1];
1068 // ddf0[n] /= 0.5*(vr[n+1]-vr[n-1]);
1069 // }
1070 
1071 // Calculate zeroth cell
1072 // double f00 = ( fin[0] - ( (vr[0]*vr[0])/(vr[1]*vr[1]) ) *fin[1] )
1073 // / (1.0 - (vr[0]*vr[0])/(vr[1]*vr[1]));
1074 // ddf0[0] = 2.0 * (fin[1] - f00) / (vr[1]*vr[1]);
1075 // df0[0] = ddf0[0] * vr[0];
1076 
1077 // Calculate 1/(2v)*(d^2f)/(dv^2), 1/v^2*df/dv
1078  for (int n(0); n < fin.size()-1; ++n) {
1079  df0[n] /= vr[n]*vr[n];
1080  ddf0[n] /= 2.0 *vr[n];
1081  }
1082 */
1083 
1084 
1085  // Evaluate the derivative
1086  for (int n(1); n < fin.size()-1; ++n) {
1087  df0[n] = fin[n+1]-fin[n-1];
1088  df0[n] /= vr[n+1]-vr[n-1];
1089  }
1090 
1091 // Evaluate the second derivative
1092 // -df/dv_{n-1/2}
1093  for (int n(1); n < fin.size(); ++n) {
1094  ddf0[n] = (fin[n-1]-fin[n]) ;
1095  ddf0[n] /= vr[n] - vr[n-1] ;
1096  }
1097 // D(df/dv)/Dv
1098  for (int n(1); n < fin.size()-1; ++n) {
1099  ddf0[n] -= ddf0[n+1];
1100  ddf0[n] /= 0.5*(vr[n+1]-vr[n-1]);
1101  }
1102 
1103 // Calculate zeroth cell
1104  double f00 = ( fin[0] - ( (vr[0]*vr[0])/(vr[1]*vr[1]) ) *fin[1] )
1105  / (1.0 - (vr[0]*vr[0])/(vr[1]*vr[1]));
1106  ddf0[0] = 2.0 * (fin[1] - f00) / (vr[1]*vr[1]);
1107  df0[0] = ddf0[0] * vr[0];
1108 
1109 // Calculate 1/(2v)*(d^2f)/(dv^2), 1/v^2*df/dv
1110  for (int n(0); n < fin.size()-1; ++n) {
1111  df0[n] /= vr[n]*vr[n];
1112  ddf0[n] /= 2.0 *vr[n];
1113  }
1114 
1115 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1116 
1117 }
double Zeta
Definition: formulary.h:104
valarray< double > df0
Definition: collisions.h:252
valarray< double > I0
Definition: collisions.h:249
valarray< double > I2
Definition: collisions.h:249
double LOGee(double ne, double Te)
Definition: formulary.cpp:226
double LOGei(double ne, double Te, double Z)
Definition: formulary.cpp:249
valarray< double > U1m1
Definition: collisions.h:246
valarray< double > U2
Definition: collisions.h:246
valarray< double > vr
Definition: collisions.h:243
valarray< double > U4
Definition: collisions.h:246
valarray< double > U2m1
Definition: collisions.h:246
valarray< double > ddf0
Definition: collisions.h:252
valarray< double > U4m1
Definition: collisions.h:246
valarray< double > J1m
Definition: collisions.h:249
valarray< double > U1
Definition: collisions.h:246
valarray< double > Scattering_Term
Definition: collisions.h:255
Array2D< double > Alpha_Tri
Definition: collisions.h:256
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rkloop()

void interspecies_f00_explicit_collisions::rkloop ( SHarmonic1D SH1,
const SHarmonic1D SH2 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/interspeciescollisions.h>

This loop calls the RK4_f00 private member that is responsible for setting up the RK4 algorithm to advance the collision step.

Definition at line 333 of file interspeciescollisions.cpp.

References interspecies_f00_explicit_collisions::fin1, interspecies_f00_explicit_collisions::fin2, interspecies_f00_explicit_collisions::Nbc, interspecies_f00_explicit_collisions::num_h, and interspecies_f00_explicit_collisions::szx.

333  {
334 //-------------------------------------------------------------------
335 // This loop scans all the locations in configuration space
336 // and calls the RK4 for explicit integration at each location
337 //-------------------------------------------------------------------
338  // std::cout << "\n\n DF1 = " << fin1.size();
339  // std::cout << ", DF2 = " << fin2.size() << " \n\n";
340  // valarray<double> fin1(0.0,SH1.nump()),fin2(0.0,SH2.nump());
341  for (size_t ix(0); ix < szx-2*Nbc; ++ix){
342 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
343  // Copy data for a specific location in space to valarray
344  for (size_t ip(0); ip < fin1.size(); ++ip){
345  fin1[ip] = (SH1(ip,ix+Nbc)).real();
346  }
347 
348  for (size_t ip(0); ip < fin2.size(); ++ip){
349  fin2[ip] = (SH2(ip,ix+Nbc)).real();
350  }
351 
352  // // Time loop: Update the valarray
353  for (size_t h_step(0); h_step < num_h; ++h_step){
354 // fin1 = RK4(fin1,fin2,h,&rkf00);
355  }
356  // // std::cout << "\n\n 11 \n\n";
357  // // Return updated data to the harmonic
358  for (int ip(0); ip < fin1.size(); ++ip){
359  // std::cout << "\n\nfin[" << ip << "] = "<< fin1[ip];
360  SH1(ip,ix+Nbc) = fin1[ip];
361  }
362 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
363  }
364 
365  }
int szx
Total cells including boundary cells in x-direction.
int Nbc
Number of boundary cells in each direction.

◆ self()

vector< self_collisions > collisions::self ( )

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/collisions.h>

Definition at line 1523 of file collisions.cpp.

References collisions::self_coll.

1523  {
1524 
1525  return self_coll;
1526 
1527 }
vector< self_collisions > self_coll
Definition: collisions.h:373

◆ self_collisions()

self_collisions::self_collisions ( const DistFunc1D DFin,
const double &  deltat 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/collisions.h>

Constructors/Destructors.

Definition at line 1358 of file collisions.cpp.

1362  : self_f00_exp_collisions(DFin, deltat),
1363  self_f00_imp_collisions(DFin, deltat),
1364  self_flm_collisions(DFin, deltat){}
self_f00_explicit_collisions self_f00_exp_collisions
Definition: collisions.h:343
self_f00_implicit_collisions self_f00_imp_collisions
Definition: collisions.h:344
self_flm_implicit_collisions self_flm_collisions
Definition: collisions.h:345

◆ self_f00_explicit_collisions()

self_f00_explicit_collisions::self_f00_explicit_collisions ( const DistFunc1D DFin,
const double &  deltat 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/collisions.h>

Constructors/Destructors.

Definition at line 769 of file collisions.cpp.

References Input::Input_List::BoundaryCells, self_f00_explicit_collisions::h, Input::List(), self_f00_explicit_collisions::Nbc, self_f00_explicit_collisions::num_h, Input::Input_List::NxLocal, and self_f00_explicit_collisions::szx.

773  : fin(0.0, DFin(0,0).nump()),
774  RK(fin),
775  rkf00(DFin(0,0).nump(), DFin.pmax(), DFin.mass()),
776  num_h(size_t(deltat/Input::List().small_dt)+1)
777 {
778  h = deltat/static_cast<double>(num_h);
779 
781  szx = Input::List().NxLocal[0]; // size of useful x axis
782 }
std::vector< size_t > NxLocal
Definition: input.h:168
int szx
Total cells including boundary cells in x-direction.
Definition: collisions.h:218
self_f00_RKfunctor rkf00
Definition: collisions.h:212
double mass() const
Definition: state.h:400
valarray< double > fin
Definition: collisions.h:203
int Nbc
Number of boundary cells in each direction.
Definition: collisions.h:217
double pmax() const
Definition: state.h:398
Input_List & List()
Definition: input.cpp:1585
Algorithms::RK4< valarray< double > > RK
Definition: collisions.h:210
int BoundaryCells
Definition: input.h:50
Here is the call graph for this function:

◆ self_f00_explicit_step()

self_f00_explicit_step::self_f00_explicit_step ( const size_t &  nump,
const double &  pmax,
const double &  _mass 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/collisions.h>

Constructor that needs a distribution function input.

Parameters
fslopeThe distribution function that is input and transformed.Velocity axis < Integrals

Definition at line 536 of file collisions.cpp.

References self_f00_explicit_step::c_kpre, Input::List(), self_f00_explicit_step::NB, Input::Input_List::NB_algorithms, self_f00_explicit_step::Pn, self_f00_explicit_step::Qn, self_f00_explicit_step::U1, self_f00_explicit_step::U1m1, self_f00_explicit_step::U2, self_f00_explicit_step::U2m1, self_f00_explicit_step::U3, self_f00_explicit_step::U4, self_f00_explicit_step::U4m1, and self_f00_explicit_step::vr.

544  :
545  mass(_mass),
546 // vr(Algorithms::MakeAxis(pmax/(2.0*nump-1.0),pmax,nump)),
547  vr(Algorithms::MakeCAxis(0.0,pmax,nump)),
548 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
549 
550  U4(0.0, nump),
551  U4m1(0.0, nump),
552  U2(0.0, nump),
553  U2m1(0.0, nump),
554  U1(0.0, nump),
555  U1m1(0.0, nump),
556 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
557 
558  J1(0.0, nump),
559  I2(0.0, nump),
560  I4(0.0, nump),
561 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
562  U3(0.0, nump),
563  Qn(0.0, nump),
564  Pn(0.0, nump)
565 
567 {
568 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
569 
570  //classical electron radius
571  double re(2.8179402894e-13); //< classical electron radius
572  double kp(sqrt(4.0*M_PI*(Input::List().density_np)*re)); //< sqrt(4*pi*n_{e0}*re).
573  c_kpre = 4.0*M_PI/3.0*re*kp; //< (4*pi*re)^1.5*sqrt(n_{e0})/3.
575 
576 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
577 
578  // Determine vr
579  for (size_t i(0); i < vr.size(); ++i) {
580  vr[i] = vr[i] / (sqrt(1.0+vr[i]*vr[i]));
581  }
582 
583 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
584  // Determine U4, U4m1, U2, U2m1, U1, U1m1
585  for (size_t i(1); i < U4.size(); ++i) {
586  U4[i] = 0.5 * pow(vr[i],4) * (vr[i]-vr[i-1]);
587  U4m1[i] = 0.5 * pow(vr[i-1],4) * (vr[i]-vr[i-1]);
588  U2[i] = 0.5 * vr[i]*vr[i] * (vr[i]-vr[i-1]);
589  U2m1[i] = 0.5 * vr[i-1]*vr[i-1] * (vr[i]-vr[i-1]);
590  U1[i] = 0.5 * vr[i] * (vr[i]-vr[i-1]);
591  U1m1[i] = 0.5 * vr[i-1] * (vr[i]-vr[i-1]);
592  }
593 
594 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
595  // Determine U3
596  for (size_t i(0); i < U3.size(); ++i) {
597  U3[i] = pow(vr[i],3);
598  }
599  // Determine Qn
600  Qn[0] = 1.0 / ((vr[0]*vr[0]*vr[1])/2.0);
601  for (size_t i(1); i < Qn.size()-1; ++i) {
602  Qn[i] = 1.0 / (vr[i]*vr[i]*(vr[i+1]-vr[i-1])/2.0);
603  }
604  // Determine Pn
605  for (size_t i(0); i < Pn.size()-1; ++i) {
606  Pn[i] = 1.0 / ((vr[i+1]-vr[i])/2.0*(vr[i+1]+vr[i]));
607 
608 
609  }
610 
611 }
valarray< double > Pn
Definition: collisions.h:132
valarray< double > I2
Definition: collisions.h:135
valarray< double > U4m1
Definition: collisions.h:132
double mass
Array output by getslope.
Definition: collisions.h:127
valarray< double > vr
Define the velocity axis.
Definition: collisions.h:129
valarray< double > U4
Various coefficients for the integrals.
Definition: collisions.h:132
valarray< double > U1m1
Definition: collisions.h:132
valarray< double > U2m1
Definition: collisions.h:132
valarray< double > U2
Definition: collisions.h:132
valarray< double > U1
Definition: collisions.h:132
valarray< double > U3
Definition: collisions.h:132
valarray< double > Qn
Definition: collisions.h:132
double c_kpre
Constants.
Definition: collisions.h:138
valarray< double > I4
Definition: collisions.h:135
valarray< T > MakeCAxis(const T min, const T max, const size_t N)
Input_List & List()
Definition: input.cpp:1585
valarray< double > J1
The integrals.
Definition: collisions.h:135
int NB_algorithms
Definition: input.h:78
Here is the call graph for this function:

◆ self_f00_implicit_collisions()

self_f00_implicit_collisions::self_f00_implicit_collisions ( const DistFunc1D DFin,
const double &  deltat 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/collisions.h>

Constructors/Destructors.

Definition at line 423 of file collisions.cpp.

References Input::Input_List::BoundaryCells, Input::List(), self_f00_implicit_collisions::Nbc, Input::Input_List::NxLocal, and self_f00_implicit_collisions::szx.

427  : fin(0.0, DFin(0,0).nump()), fout(0.0, DFin(0,0).nump()),
428  xgrid(Algorithms::MakeCAxis(Input::List().xminLocal[0],Input::List().xmaxLocal[0],Input::List().NxLocal[0])),
430  heatingprofile(0.0,DFin(0,0).numx()), coolingprofile(0.0,DFin(0,0).numx()),
431  ib(((DFin.q() == -1) && (DFin.mass() == 1))),
432  collide(DFin(0,0).nump(),DFin.pmax(),DFin.mass(), deltat, ib)
433 {
434 
436  szx = Input::List().NxLocal[0]; // size of useful x axis
437 }
int Nbc
Number of boundary cells in each direction.
Definition: collisions.h:103
std::vector< size_t > NxLocal
Definition: input.h:168
valarray< double > coolingprofile
Definition: collisions.h:100
valarray< double > fin
Definition: collisions.h:90
valarray< double > xgrid
Definition: collisions.h:91
double mass() const
Definition: state.h:400
int szx
Total cells including boundary cells in x-direction.
Definition: collisions.h:104
valarray< double > fout
Definition: collisions.h:90
double pmax() const
Definition: state.h:398
double q() const
Definition: state.h:399
self_f00_implicit_step collide
Definition: collisions.h:93
valarray< T > MakeCAxis(const T min, const T max, const size_t N)
Input_List & List()
Definition: input.cpp:1585
bool IB_heating
Switches for inverse bremsstrahlung and maxwellian cooling.
Definition: collisions.h:96
int BoundaryCells
Definition: input.h:50
valarray< double > heatingprofile
Definition: collisions.h:99
Here is the call graph for this function:

◆ self_f00_implicit_step()

self_f00_implicit_step::self_f00_implicit_step ( const size_t &  nump,
const double &  pmax,
const double &  _mass,
const double &  _deltat,
bool &  _ib 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/collisions.h>

Collisions

Laser

Cooling

Definition at line 44 of file collisions.cpp.

References self_f00_implicit_step::c_kpre, self_f00_implicit_step::dt, self_f00_implicit_step::dtoverv2, self_f00_implicit_step::dvr, self_f00_implicit_step::laser_Inv_Uav6, Input::List(), self_f00_implicit_step::mass, self_f00_implicit_step::p2dp, self_f00_implicit_step::p2dpm1, self_f00_implicit_step::p4dp, self_f00_implicit_step::phdp, self_f00_implicit_step::phdpm1, self_f00_implicit_step::vr, self_f00_implicit_step::vrh, and self_f00_implicit_step::vw_coeff_cube.

44  :
45  vr(Algorithms::MakeCAxis(0.0,pmax,nump)), C_RB(0.0,nump+1), D_RB(0.0,nump+1), delta_CC(0.0,nump+1),
46  mass(_mass), dt(_deltat),
47  dvr(0.0,nump), vrh(0.0,nump), dtoverv2(nump),
48  p2dp(0.0,nump),p2dpm1(0.0,nump),phdp(0.0,nump),phdpm1(0.0,nump), p4dp(0.0,nump), laser_Inv_Uav6(0.0,nump),
49  I4_Lnee(0.0), ib(_ib)
50 {
51 //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
52 //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
54  //classical electron radius
55  double re(2.8179402894e-13); //< classical electron radius
56  double kp(sqrt(4.0*M_PI*(Input::List().density_np)*re)); //< sqrt(4*pi*n_{e0}*re).
57  c_kpre = re*kp; //< (4*pi*re)^1.5*sqrt(n_{e0})/3.
58 
59  // Determine vr
60  for (size_t i(0); i < vr.size(); ++i) {
61  vr[i] /= mass;
62  }
63 
64  for (size_t i(0); i < vr.size()-1; ++i) {
65  vrh[i] = 0.5*(vr[i+1] - vr[i]);
66  dvr[i] = (vr[i+1] - vr[i]);
67  }
68  vrh[vrh.size()-1] = 0.0;
69  dvr[vrh.size()-1] = dvr[vrh.size()-2];
70 
71  for (size_t i(1); i < vr.size(); ++i) {
72  p2dp[i] = 0.5 * vr[i]*vr[i] * (vr[i]-vr[i-1]);
73  p2dpm1[i] = 0.5 * vr[i-1]*vr[i-1] * (vr[i]-vr[i-1]);
74  p4dp[i] = 0.5 * pow(vr[i],4) * (vr[i]-vr[i-1]);
75 // p4dpm1[i] = 0.5 * pow(vr[i-1],4) * (vr[i]-vr[i-1]);
76  phdp[i] = 0.5 * vrh[i] * (vrh[i]-vrh[i-1]);
77  phdpm1[i] = 0.5 * vrh[i-1] * (vrh[i]-vrh[i-1]);
78  }
79 
80 
81  for (size_t i(0); i < vr.size(); ++i) {
82  dtoverv2[i] = dt / vr[i] / vr[i] / dvr[i];
83  }
84 //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
85 //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
87  for (size_t i(0); i < vr.size(); ++i) {
88  laser_Inv_Uav6[i] = pow( 2.0/(vr[i+1]+vr[i]), 6);
89  }
90 
91  double omega_0(3.0e+10*2.0*M_PI/(1.0e-4*Input::List().lambda_0));
92  double omega_p(5.64 * 1.0e+4*sqrt(Input::List().density_np));
93  vw_coeff_cube = omega_p/omega_0 * c_kpre;
94 //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
95 //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
97 
98 }
double c_kpre
Constants.
Definition: collisions.h:48
valarray< double > vr
Define the velocity axis.
Definition: collisions.h:31
valarray< double > dvr
Definition: collisions.h:32
valarray< double > p4dp
Definition: collisions.h:38
valarray< double > p2dp
Various coefficients for the integrals.
Definition: collisions.h:38
valarray< double > phdp
Definition: collisions.h:38
valarray< double > phdpm1
Definition: collisions.h:38
valarray< double > p2dpm1
Definition: collisions.h:38
valarray< double > laser_Inv_Uav6
Definition: collisions.h:38
valarray< double > C_RB
Rosenbluth Potentials.
Definition: collisions.h:41
valarray< T > MakeCAxis(const T min, const T max, const size_t N)
Input_List & List()
Definition: input.cpp:1585
valarray< double > dtoverv2
Definition: collisions.h:34
valarray< double > D_RB
Definition: collisions.h:41
valarray< double > delta_CC
Chang-Cooper weighting delta.
Definition: collisions.h:45
valarray< double > vrh
Definition: collisions.h:33
Here is the call graph for this function:

◆ self_f00_RKfunctor()

self_f00_RKfunctor::self_f00_RKfunctor ( const size_t &  nump,
const double &  pmax,
const double &  mass 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/collisions.h>

Constructor for RK4 method on f00.

Parameters
finInput distribution
[in]tout_startHmm...

Definition at line 743 of file collisions.cpp.

747  :collide(nump,pmax,mass){}
self_f00_explicit_step collide
Definition: collisions.h:170

◆ self_flm_implicit_collisions()

self_flm_implicit_collisions::self_flm_implicit_collisions ( const DistFunc1D DFin,
const double &  deltat 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/collisions.h>

Constructors/Destructors.

Definition at line 1237 of file collisions.cpp.

References Input::Input_List::BoundaryCells, self_flm_implicit_collisions::f1_m_upperlimit, Input::List(), self_flm_implicit_collisions::m0, self_flm_implicit_collisions::Nbc, Input::Input_List::NxLocal, and self_flm_implicit_collisions::szx.

1241  : f00(0.0, DFin(0).nump()),
1242  fc(0.0,DFin(0).nump()),
1243  l0(DFin.l0()),
1244  m0(DFin.m0()),//Yin.SH(0,0).m0())
1245  implicit_step(DFin.pmax(),DFin(0).nump(),DFin.mass()),
1246  Dt(deltat) //
1247 {
1248 
1249 
1251  szx = Input::List().NxLocal[0];
1252 
1253  if (m0 == 0) {
1254  f1_m_upperlimit = 1;
1255  }
1256  else {
1257  f1_m_upperlimit = 2;
1258  }
1259 
1260 
1261 }
std::vector< size_t > NxLocal
Definition: input.h:168
int szx
Total cells including boundary cells in x-direction.
Definition: collisions.h:308
double mass() const
Definition: state.h:400
size_t l0
Number of m harmonics.
Definition: collisions.h:311
valarray< double > f00
Array for isotropic component distribution function. Needed for calculating coefficients.
Definition: collisions.h:315
valarray< complex< double > > fc
Dummy array.
Definition: collisions.h:314
double pmax() const
Definition: state.h:398
size_t m0() const
Definition: state.h:397
size_t m0
Number of m harmonics.
Definition: collisions.h:312
Input_List & List()
Definition: input.cpp:1585
int Nbc
Number of boundary cells in each direction.
Definition: collisions.h:307
size_t l0() const
Definition: state.h:396
self_flm_implicit_step implicit_step
The object that is responsible for performing the algebra required for the integrals.
Definition: collisions.h:318
int BoundaryCells
Definition: input.h:50
Here is the call graph for this function:

◆ self_flm_implicit_step()

self_flm_implicit_step::self_flm_implicit_step ( double  pmax,
size_t  nump,
double  mass 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/collisions.h>

Definition at line 829 of file collisions.cpp.

References self_flm_implicit_step::kpre, Input::List(), self_flm_implicit_step::mass, self_flm_implicit_step::U1, self_flm_implicit_step::U1m1, self_flm_implicit_step::U2, self_flm_implicit_step::U2m1, self_flm_implicit_step::U4, self_flm_implicit_step::U4m1, and self_flm_implicit_step::vr.

833  :
834 // Pre-Calculated Constants
835 
836 // vr(Algorithms::MakeAxis(pmax/(2.0*nump-1.0),pmax,nump)),
837  vr(Algorithms::MakeCAxis(0.0,pmax,nump)),
838 // Constants for Integrals
839  U4(0.0, nump),
840  U4m1(0.0,nump),
841  U2(0.0, nump),
842  U2m1(0.0,nump),
843  U1(0.0, nump),
844  U1m1(0.0,nump),
845 // Integrals
846  J1m(0.0, nump),
847  I0(0.0, nump),
848  I2(0.0, nump),
849  Scattering_Term(0.0, nump),
850  df0(0.0, nump),
851  ddf0(0.0, nump),
852 // Matrices
853  Alpha_Tri(nump, nump),
855  mass(_mass)
856 // Make matrix vk/vn
857 {
858 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
859 
860  double re(2.8179402894e-13); //classical electron radius
861  double kp(sqrt(4.0*M_PI*(Input::List().density_np)*re));
862 
863  kpre = re*kp;
864 
865  // Determine vr
866  for (size_t i(0); i < vr.size(); ++i) {
867 // vr[i] = vr[i] / (sqrt(1.0+vr[i]*vr[i]));
868  vr[i] /= mass;
869  }
870 
871 // U4[0] = pow(vr[0],4) * (vr[1]-vr[0]);
872 // U2[0] = vr[0]*vr[0] * (vr[1]-vr[0]);
873 // U1[0] = vr[0] * (vr[1]-vr[0]);
874 
875  // Determine U4, U4m1, U2, U2m1, U1, U1m1 for the integrals
876  for (size_t i(1); i < U4.size(); ++i) {
877  U4[i] = 0.5 * pow(vr[i],4) * (vr[i]-vr[i-1]);
878  U4m1[i] = 0.5 * pow(vr[i-1],4) * (vr[i]-vr[i-1]);
879  U2[i] = 0.5 * vr[i]*vr[i] * (vr[i]-vr[i-1]);
880  U2m1[i] = 0.5 * vr[i-1]*vr[i-1] * (vr[i]-vr[i-1]);
881  U1[i] = 0.5 * vr[i] * (vr[i]-vr[i-1]);
882  U1m1[i] = 0.5 * vr[i-1] * (vr[i]-vr[i-1]);
883 
884 // U4[i] = pow(vr[i],4) * (vr[i]-vr[i-1]);
885 // U2[i] = vr[i]*vr[i] * (vr[i]-vr[i-1]);
886 // U1[i] = vr[i] * (vr[i]-vr[i-1]);
887 
888  }
889 }
valarray< double > df0
Definition: collisions.h:252
valarray< double > I0
Definition: collisions.h:249
valarray< double > I2
Definition: collisions.h:249
valarray< double > U1m1
Definition: collisions.h:246
valarray< double > U2
Definition: collisions.h:246
valarray< double > vr
Definition: collisions.h:243
valarray< double > U4
Definition: collisions.h:246
valarray< double > U2m1
Definition: collisions.h:246
valarray< T > MakeCAxis(const T min, const T max, const size_t N)
Input_List & List()
Definition: input.cpp:1585
valarray< double > ddf0
Definition: collisions.h:252
valarray< double > U4m1
Definition: collisions.h:246
valarray< double > J1m
Definition: collisions.h:249
valarray< double > U1
Definition: collisions.h:246
valarray< double > Scattering_Term
Definition: collisions.h:255
Array2D< double > Alpha_Tri
Definition: collisions.h:256
Here is the call graph for this function:

◆ Spatial_Advection_1D()

Spatial_Advection_1D::Spatial_Advection_1D ( size_t  Nl,
size_t  Nm,
double  pmin,
double  pmax,
size_t  Np,
double  xmin,
double  xmax,
size_t  Nx 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/vlasov.h>

Definition at line 1199 of file vlasov.cpp.

References Spatial_Advection_1D::A00, Spatial_Advection_1D::A1, Spatial_Advection_1D::A10, Spatial_Advection_1D::A2, Spatial_Advection_1D::A20, and Spatial_Advection_1D::vr.

1205  : A1(Nl+1,Nm+1), A2(Nl+1,Nm+1),
1206  fd1(Np,Nx), fd2(Np,Nx),
1207  // vr(Algorithms::MakeAxis(complex<double>(pmax/2.0/Np),
1208  // complex<double>(pmax),
1209  // Np)) {
1210 
1211  vr(Algorithms::MakeCAxis(complex<double>(0.0),
1212  complex<double>(pmax),
1213  Np)){
1214 // - - - - - - - - - - - - - - - - - - - - - - - - - - -
1215 
1216  complex<double> lc, mc;
1217 
1218  for (size_t i(0); i < vr.size(); ++i) {
1219  vr[i] = vr[i]/(sqrt(1.0+vr[i]*vr[i]));
1220  }
1221 
1222  double idx = (-1.0) / (2.0*(xmax-xmin)/double(Nx)); // -1/(2dx)
1223 
1224 
1225 // - - - - - - - - - - - - - - - - - - - - - - - - - - -
1226 // Calculate the "A1, A2" parameters
1227  for (size_t l(0); l < Nl+1; ++l){
1228  for (size_t m=0; m<((Nm<l)?Nm:l)+1; ++m){
1229  lc = complex<double>(l);
1230  mc = complex<double>(m);
1231  A1(l,m) = idx *(-1.0) * (lc-mc+1.0) / (2.0*lc+1.0);
1232  A2(l,m) = idx *(-1.0) * (lc+mc) / (2.0*lc+1.0);
1233  }
1234  }
1235  A2(0,0) = 1.0;
1236 
1237  // Calculate the "A1, A2" parameters
1238  A00 = complex<double>(idx);
1239  A10 = complex<double>(idx/3.0);
1240  A20 = complex<double>(idx*2.0/5.0);
1241 
1242 
1243 
1244 }
SHarmonic1D fd2
Definition: vlasov.h:31
complex< double > A00
Definition: vlasov.h:32
Array2D< complex< double > > A2
Definition: vlasov.h:33
valarray< complex< double > > vr
Definition: vlasov.h:34
complex< double > A20
Definition: vlasov.h:32
Array2D< complex< double > > A1
Definition: vlasov.h:33
SHarmonic1D fd1
Definition: vlasov.h:31
valarray< T > MakeCAxis(const T min, const T max, const size_t N)
complex< double > A10
Definition: vlasov.h:32

◆ takestep() [1/3]

valarray< double > interspecies_f00_explicit_step::takestep ( const valarray< double > &  f1in,
const valarray< double > &  f2in 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/interspeciescollisions.h>

Collisions between species 1 and 2 in 0,0 harmonic.

Parameters
[in]f1inInput distribution function, the change to which is returned
[in]f2inInput distribution function, f1 collides with f2
[in]Delta_ttimestep
[in]df1the delta f1

Definition at line 125 of file interspeciescollisions.cpp.

References interspecies_f00_explicit_step::calculateintegrals(), interspecies_f00_explicit_step::df0, interspecies_f00_explicit_step::dt, interspecies_f00_explicit_step::formulary, interspecies_f00_explicit_step::fslope, interspecies_f00_explicit_step::Gamma12, interspecies_f00_explicit_step::I2_s1, interspecies_f00_explicit_step::I4_s1, interspecies_f00_explicit_step::J1_s1, interspecies_f00_explicit_step::kpre, Formulary::LOGii(), interspecies_f00_explicit_step::m1, interspecies_f00_explicit_step::m2, interspecies_f00_explicit_step::n1, interspecies_f00_explicit_step::n2, interspecies_f00_explicit_step::pgrid_s1, interspecies_f00_explicit_step::remapintegrals(), interspecies_f00_explicit_step::T1, interspecies_f00_explicit_step::T2, interspecies_f00_explicit_step::z1, and interspecies_f00_explicit_step::z2.

Referenced by interspecies_f00_RKfunctor::operator()().

125  {
126 
127  // valarray<double> temp(f1in.size());
128  double temp = 0.0;
129  double mu = m2/m1;
130 
131  calculateintegrals(f1in,f2in);
132  remapintegrals();
133 
134  for (int n(1); n < f1in.size()-1; ++n) {
135  df0[n] = f1in[n+1]-f1in[n-1];
136  df0[n] /= pgrid_s1[n+1]-pgrid_s1[n-1];
137  }
138 
139  df0[0] = f1in[1]-f1in[0];
140  df0[0]/= pgrid_s1[1]-pgrid_s1[0];
141 
142  df0[f1in.size()-1] = f1in[f1in.size()-1]-f1in[f1in.size()-2];
143  df0[f1in.size()-1]/= pgrid_s1[f1in.size()-1]-pgrid_s1[f1in.size()-2];
144 
145  int ipp(1);
146  int ipm(0);
147 
148  Gamma12 = -1.0*kpre*n2*(z1*z1*z2*z2)*formulary.LOGii(m1,z1,n1,T1,
149  m2,z2,n2,T2);
150 
151  temp = (I4_s1[ipp]+J1_s1[ipp])*df0[ipp]*pgrid_s1[ipp]+3.0/mu*I2_s1[ipp]*f1in[ipp];
152  temp -= (I4_s1[ipm]+J1_s1[ipm])*df0[ipm]*pgrid_s1[ipm]+3.0/mu*I2_s1[ipm]*f1in[ipm];
153  temp /= pgrid_s1[ipp]-pgrid_s1[ipm];
154  temp /= 3.0*(0.25*pow(pgrid_s1[ipm]+pgrid_s1[ipp],2.0));
155 
156  fslope[0] = temp;
157  // std::cout << "\n fslope[0]=" << temp*Gamma12*dt << "\n\n";
158 
159  for (int ip(1);ip < f1in.size()-2;++ip)
160  {
161  ipp=ip+1;
162  ipm=ip-1;
163  temp = (I4_s1[ipp]+J1_s1[ipp])*df0[ipp]*pgrid_s1[ipp]+3.0/mu*I2_s1[ipp]*f1in[ipp];
164  // std::cout << "\n fslope1[ " << ip << "]="<< temp << "\n\n";
165  temp -= (I4_s1[ipm]+J1_s1[ipm])*df0[ipm]*pgrid_s1[ipm]+3.0/mu*I2_s1[ipm]*f1in[ipm];
166  // std::cout << "\n fslope2[ " << ip << "]="<< temp << "\n\n";
167  temp /= pgrid_s1[ipp]-pgrid_s1[ipm];
168  // std::cout << "\n fslope3[ " << ip << "]="<< temp << "\n\n";
169  temp /= 3.0*(0.25*pow(pgrid_s1[ipm]+pgrid_s1[ipp],2.0));
170  // std::cout << "\n fslope4[ " << ip << "]="<< temp << "\n\n";
171  // temp *= Gamma12*dt;
172  fslope[ip] = temp;
173 
174  // std::cout << "\n fslope[ " << ip << "]="<< temp*Gamma12*dt << "\n\n";
175  }
176  // std::cout << "\n fslope5[ " << Gamma12 << "\n\n";
177  ipp=f1in.size()-1;ipm=f1in.size()-2;
178 
179  temp = (I4_s1[ipp]+J1_s1[ipp])*df0[ipp]*pgrid_s1[ipp]+3.0/mu*I2_s1[ipp]*f1in[ipp];
180  temp -= (I4_s1[ipm]+J1_s1[ipm])*df0[ipm]*pgrid_s1[ipm]+3.0/mu*I2_s1[ipm]*f1in[ipm];
181  temp /= pgrid_s1[ipp]-pgrid_s1[ipm];
182  temp /= 3.0*(0.25*pow(pgrid_s1[ipm]+pgrid_s1[ipp],2.0));
183 
184  fslope[f1in.size()-1] = temp;
185  // std::cout << "\n fslope[last]=" << temp*Gamma12*dt << "\n\n";
186 
188  // fslope[f1in.size()-1] = 0.0;
189  // }
190  // exit(1);
191  return fslope;
192  }
valarray< double > J1_s1
The integrals.
void remapintegrals()
Remap Distribution to momentum grid of colliding particles.
void calculateintegrals(const valarray< double > &f1in, const valarray< double > &f2in)
Remap Distribution to momentum grid of colliding particles.
double LOGii(double m1, double Z1, double n1, double T1, double m2, double Z2, double n2, double T2)
Definition: formulary.cpp:271
Here is the call graph for this function:
Here is the caller graph for this function:

◆ takestep() [2/3]

void self_f00_implicit_step::takestep ( valarray< double > &  fin,
valarray< double > &  fh,
const double &  Z0,
const double &  heating,
const double &  cooling 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/collisions.h>

Calculate Rosenbluth and Chang-Cooper quantities

Also fills in I4_Lnee (the temperature for the Lnee calculation)

And takes care of boundaries

Normalizing quantities (Inspired by previous collision routines and OSHUN notes by M. Tzoufras)

< ZLogLambda

Fill in matrix

Boundaries by hand – This operates on f(0)

Definition at line 266 of file collisions.cpp.

References self_f00_implicit_step::c_kpre, self_f00_implicit_step::C_RB, self_f00_implicit_step::D_RB, self_f00_implicit_step::delta_CC, self_f00_implicit_step::dtoverv2, self_f00_implicit_step::dvr, self_f00_implicit_step::formulas, self_f00_implicit_step::I4_Lnee, self_f00_implicit_step::ib, Formulary::LOGee(), Formulary::LOGei(), Thomas_Tridiagonal(), self_f00_implicit_step::update_C_Rosenbluth(), self_f00_implicit_step::update_D_and_delta(), self_f00_implicit_step::update_D_inversebremsstrahlung(), and Formulary::Zeta.

266  {
267 
268  double collisional_coefficient;
269  double heating_coefficient;
270 
271  Array2D<double> LHS(fin.size(),fin.size());
272 
274  update_C_Rosenbluth(fin);
275  update_D_and_delta(fin);
276 
278  collisional_coefficient = formulas.LOGee(C_RB[C_RB.size()-1],I4_Lnee/3.0/C_RB[C_RB.size()-1]);
279  collisional_coefficient *= 4.0*M_PI/3.0*c_kpre;
280 
281 
282 
283  heating_coefficient = formulas.Zeta*Z0*formulas.LOGei(C_RB[C_RB.size()-1],I4_Lnee/3.0/C_RB[C_RB.size()-1],Z0*formulas.Zeta);
284  heating_coefficient *= c_kpre / 6.0 * pow(vos,2.0) * C_RB[C_RB.size()-1];
285  heating_coefficient /= collisional_coefficient;
286 
287  if (ib) update_D_inversebremsstrahlung(Z0, heating_coefficient, vos);
288 
290 
291  size_t ip(0);
292 
294  LHS(ip, ip + 1) = - dtoverv2[ip] * collisional_coefficient
295  * (C_RB[ip + 1] * (1.0 - delta_CC[ip + 1])
296  + D_RB[ip + 1] / dvr[ip + 1]);
297 
298  LHS(ip , ip) = 1.0 - dtoverv2[ip] * collisional_coefficient
299  * (C_RB[ip + 1] * delta_CC[ip + 1] - D_RB[ip + 1] / dvr[ip + 1]
300  - C_RB[ip] * (1.0 - delta_CC[ip]) - D_RB[ip] / dvr[ip]);
301 
302 
303  for (ip = 1; ip < fin.size() - 1; ++ip){
304  LHS(ip, ip + 1) = - dtoverv2[ip] * collisional_coefficient
305  * (C_RB[ip + 1] * (1.0 - delta_CC[ip + 1])
306  + D_RB[ip + 1] / dvr[ip + 1]);
307 
308  LHS(ip , ip) = 1.0 - dtoverv2[ip] * collisional_coefficient
309  * (C_RB[ip + 1] * delta_CC[ip + 1] - D_RB[ip + 1] / dvr[ip + 1]
310  - C_RB[ip] * (1.0 - delta_CC[ip]) - D_RB[ip] / dvr[ip]);
311 
312  LHS(ip, ip - 1) = dtoverv2[ip] * collisional_coefficient
313  * (C_RB[ip] * delta_CC[ip]
314  - D_RB[ip] / dvr[ip]);
315 
316  }
317 
318  ip = fin.size() - 1;
319 
320  LHS(ip , ip) = 1.0 - dtoverv2[ip] * collisional_coefficient
321  * (C_RB[ip + 1] * delta_CC[ip + 1]
322  - C_RB[ip] * (1.0 - delta_CC[ip]) - D_RB[ip] / dvr[ip]);
323 
324  LHS(ip, ip - 1) = dtoverv2[ip] * collisional_coefficient
325  * (C_RB[ip] * delta_CC[ip]
326  - D_RB[ip] / dvr[ip]);
327 
328 // std::cout << "\n\n LHS = \n";
329 // for (size_t i(0); i < LHS.dim1(); ++i) {
330 // std::cout << "i = " << i << " :::: ";
331 // for (size_t j(0); j < LHS.dim2(); ++j) {
332 // std::cout << LHS(i, j) << " ";
333 // }
334 // std::cout << "\n";
335 // }
336 
337 
338  Thomas_Tridiagonal(LHS,fin,fh);
339 
340 }
double c_kpre
Constants.
Definition: collisions.h:48
void update_D_inversebremsstrahlung(const double &Z0, const double &heatingcoefficient, const double &vos)
Definition: collisions.cpp:235
bool Thomas_Tridiagonal(Array2D< double > &A, valarray< double > &d, valarray< double > &xk)
The tridiagonal solver for implicit collisions.
Definition: nmethods.cpp:216
double Zeta
Definition: formulary.h:104
double LOGee(double ne, double Te)
Definition: formulary.cpp:226
valarray< double > dvr
Definition: collisions.h:32
void update_D_and_delta(valarray< double > &fin)
Definition: collisions.cpp:166
double LOGei(double ne, double Te, double Z)
Definition: formulary.cpp:249
valarray< double > C_RB
Rosenbluth Potentials.
Definition: collisions.h:41
valarray< double > dtoverv2
Definition: collisions.h:34
valarray< double > D_RB
Definition: collisions.h:41
valarray< double > delta_CC
Chang-Cooper weighting delta.
Definition: collisions.h:45
void update_C_Rosenbluth(valarray< double > &fin)
Definition: collisions.cpp:104
Here is the call graph for this function:

◆ takestep() [3/3]

void self_f00_explicit_step::takestep ( const valarray< double > &  fin,
valarray< double > &  fh 
)

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/collisions.h>

Compute collision integrals and advance to next step

Parameters
[in]finInput distribution function
Returns
Output distribution function

Definition at line 639 of file collisions.cpp.

References self_f00_explicit_step::c_kpre, self_f00_explicit_step::formulas, self_f00_explicit_step::G(), self_f00_explicit_step::I2, self_f00_explicit_step::I4, self_f00_explicit_step::J1, Formulary::LOGee(), self_f00_explicit_step::NB, self_f00_explicit_step::Pn, self_f00_explicit_step::Qn, self_f00_explicit_step::U1, self_f00_explicit_step::U1m1, self_f00_explicit_step::U2, self_f00_explicit_step::U2m1, self_f00_explicit_step::U3, self_f00_explicit_step::U4, self_f00_explicit_step::U4m1, and self_f00_explicit_step::vr.

Referenced by self_f00_RKfunctor::operator()().

639  {
640 //-------------------------------------------------------------------
641 // Collisions
642 //-------------------------------------------------------------------
643  double Ln_ee;
644 
645 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
646 // Evaluate the integrals in a standard manner
647  I4[0] = 0;
648  for (int n(1); n < I4.size(); ++n) {
649  I4[n] = U4[n]*fin[n]+U4m1[n]*fin[n-1];
650  I4[n] += I4[n-1];
651  }
652 
653  I2[0] = 0;
654  for (int n(1); n < I2.size(); ++n) {
655  I2[n] = U2[n]*fin[n]+U2m1[n]*fin[n-1];
656  I2[n] += I2[n-1];
657  }
658 
659  J1[J1.size()-1] = 0;
660  for (int n(J1.size()-2); n > -1; --n) {
661  J1[n] = U1[n+1]*fin[n+1]+U1m1[n+1]*fin[n];
662  J1[n] += J1[n+1];
663 
664  }
665 
666 
667 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
668 // Use I2 and I4 to calculate the Coulomb logarithm now, the
669 // arrays I2 I4 will be modified later and it will be too late.
670 
671  // if (mass == 100.0){
672  // std::cout<< "\n\n\n temp = " << mass*I4[I4.size()-1]/3.0/I2[I4.size()-1] << "\n\n\n";
673  // }
674  Ln_ee = formulas.LOGee(4.0*M_PI*I2[I2.size()-1],I4[I4.size()-1]/3.0/I2[I4.size()-1]);
675 
676  // // I2_temperature = I2[I2.size()-1];
677  // for (int k(0); k < I4.size(); ++k){
678  // I4[k] /= vr[k]*vr[k];
679  // }
680 
681 
682 // <><><><><><><><><><><><><><><><><><>
683 // Tony's Energy Conserving Algorithm
684 // <><><><><><><><><><><><><><><><><><>
685 
686 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
687 // Evaluate G using the standard integrals
688 // J1 needs to be used again later so it is not modified!
689  for (int n(0); n < I4.size(); ++n) {
690  I2[n] *= J1[n]; // J1(n) * I2(n)
691  I2[n] *= -3.0; // -3 * J1(n) * I2(n)
692  I4[n] += U3[n] * J1[n]; // I4(n) + u_n^3 * J1(n)
693  I4[n] *= fin[n]; // fn * I4(n) + u_n^3 * fn * J1(n)
694  I4[n] += I2[n]; // Gn = fn * I4(n) + u_n^3 * fn * J1(n) - 3 * J1(n) * I2(n)
695  //
696 
697  }
698 
699 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
700 // Evaluate G assuming a parabolic f(v << vt)
701  for (int n(0); n < NB; ++n) {
702  I4[n] = G(n,fin);
703 
704  }
705 
706 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
707 // Find -DG
708  fh[0] = (-1.0)*I4[0];
709  for (int n(0); n < I4.size()-1; ++n) I4[n] -= I4[n+1];
710 
711 // Find -DG/(vDv)
712  fh[0] *= 2.0/ (vr[0]*vr[0]);
713  for (int n(0); n < I4.size()-1; ++n) I4[n] *= Pn[n];
714 
715 // Find DDG/(vDv)
716  fh[0] -= I4[0];
717  for (int n(0); n < I4.size()-1; ++n) I4[n] -= I4[n+1];
718 
719 // Find DDG/(v^3*DDv)
720  fh[0] *= Qn[0];
721  for (int n(0); n < I4.size()-1; ++n) fh[n+1] = Qn[n+1]*I4[n];
722 
723 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
724 // Normalize
725  fh *= c_kpre * Ln_ee;
726 }
valarray< double > Pn
Definition: collisions.h:132
valarray< double > I2
Definition: collisions.h:135
double LOGee(double ne, double Te)
Definition: formulary.cpp:226
valarray< double > U4m1
Definition: collisions.h:132
valarray< double > vr
Define the velocity axis.
Definition: collisions.h:129
valarray< double > U4
Various coefficients for the integrals.
Definition: collisions.h:132
valarray< double > U1m1
Definition: collisions.h:132
double G(const int &n, const valarray< double > &fin)
Definition: collisions.cpp:621
valarray< double > U2m1
Definition: collisions.h:132
valarray< double > U2
Definition: collisions.h:132
valarray< double > U1
Definition: collisions.h:132
valarray< double > U3
Definition: collisions.h:132
valarray< double > Qn
Definition: collisions.h:132
double c_kpre
Constants.
Definition: collisions.h:138
valarray< double > I4
Definition: collisions.h:135
valarray< double > J1
The integrals.
Definition: collisions.h:135
Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_C_Rosenbluth()

void self_f00_implicit_step::update_C_Rosenbluth ( valarray< double > &  fin)
private

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/collisions.h>

Remember that C is defined on the boundaries of the velocity grid Therefore, C[0] is C_{1/2} aka C(v=0) and, C[1] is C_{3/2} aka C(v[1st point, 0th index C style])

Definition at line 104 of file collisions.cpp.

References self_f00_implicit_step::C_RB, self_f00_implicit_step::dvr, self_f00_implicit_step::I4_Lnee, self_f00_implicit_step::p4dp, and self_f00_implicit_step::vr.

Referenced by self_f00_implicit_step::getleftside(), and self_f00_implicit_step::takestep().

104  {
108 
109  C_RB[0] = 0.0;
110  I4_Lnee = 0.0;
111  for (int n(1); n < C_RB.size(); ++n) {
112 // C_RB[n] = p2dp[n-1] * fin[n-1] + p2dpm1[n-1] * fin[n - 2];
113  C_RB[n] = vr[n - 1] * vr[n - 1] * dvr[n - 1] * fin[n - 1];
114 
115 
116  C_RB[n] += C_RB[n - 1];
117 
118 
119  I4_Lnee += p4dp[n - 1] * fin[n - 1];
120 
121  }
122  C_RB *= 4.0 * M_PI;
123  I4_Lnee *= 4.0 * M_PI;
124 }
valarray< double > vr
Define the velocity axis.
Definition: collisions.h:31
valarray< double > dvr
Definition: collisions.h:32
valarray< double > p4dp
Definition: collisions.h:38
valarray< double > C_RB
Rosenbluth Potentials.
Definition: collisions.h:41
Here is the caller graph for this function:

◆ update_D_and_delta()

void self_f00_implicit_step::update_D_and_delta ( valarray< double > &  fin)
private

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/collisions.h>

Remember that D and delta are defined on the boundaries of the velocity grid Therefore, D[0] = D_{1/2} = D(v=0) and, D[1] D = D_{3/2} D(v[1st point, 0th index C-style])

Definition at line 166 of file collisions.cpp.

References self_f00_implicit_step::C_RB, self_f00_implicit_step::calc_delta_ChangCooper(), self_f00_implicit_step::D_RB, self_f00_implicit_step::delta_CC, Input::List(), and self_f00_implicit_step::update_D_Rosenbluth().

Referenced by self_f00_implicit_step::getleftside(), and self_f00_implicit_step::takestep().

166  {
167  size_t iterations(0);
168  bool iteration_check(0);
169  double D(0.0);
170  double Dold(10.0);
171  double delta(0.5);
172 
173 
177 
178 
179  D_RB[0] = 0.0;
180  D_RB[D_RB.size()-1] = 0.0;
181 
182  delta_CC[0] = 0.5;
183  delta_CC[D_RB.size()-1] = 0.0;
184 
185  for (size_t k(1); k < fin.size(); ++k){
186  delta = 0.5;
187  D = 0.0;
188  Dold = 10.0;
189  iterations = 0;
190  iteration_check = 0;
191  do
192  {
193  D = update_D_Rosenbluth(k,fin,delta);
194 // std::cout << ", D[" << k << "] = " << D;
195  if (fabs(D-Dold) < Input::List().RB_D_tolerance*(1.0+fabs(D+Dold))) iteration_check = 1;
196 
197  delta = calc_delta_ChangCooper(k, C_RB[k], D);
198 // std::cout << ", delta[" << k << "] = " << delta;
199  ++iterations;
200 
201  if (iterations > Input::List().RB_D_itmax) iteration_check = 1;
202  Dold = D;
203 
204  } while(!iteration_check);
205 // std::cout << "\n Chang-cooper iterations = " << iterations << "\n";
206 
207 
208  D_RB[k] = D;
209  delta_CC[k] = delta;
210 
211 
212 
213 // std::cout << "\n C[" << k << "] = " << C_RB[k];
214 // std::cout << ", D[" << k << "] = " << D;
215 // std::cout << ", delta[" << k << "] = " << delta;
216 
217 
218  }
219 // exit(1);
220 
221 }
double update_D_Rosenbluth(const size_t &k, valarray< double > &fin, const double &delta)
Definition: collisions.cpp:127
valarray< double > C_RB
Rosenbluth Potentials.
Definition: collisions.h:41
Input_List & List()
Definition: input.cpp:1585
valarray< double > D_RB
Definition: collisions.h:41
valarray< double > delta_CC
Chang-Cooper weighting delta.
Definition: collisions.h:45
double calc_delta_ChangCooper(const size_t &k, const double &C, const double &D)
Definition: collisions.cpp:224
Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_D_inversebremsstrahlung()

void self_f00_implicit_step::update_D_inversebremsstrahlung ( const double &  Z0,
const double &  heatingcoefficient,
const double &  vos 
)
private

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/collisions.h>

< ZLogLambda

Definition at line 235 of file collisions.cpp.

References self_f00_implicit_step::C_RB, self_f00_implicit_step::D_RB, self_f00_implicit_step::formulas, self_f00_implicit_step::I4_Lnee, self_f00_implicit_step::laser_Inv_Uav6, Formulary::LOGee(), Formulary::LOGei(), self_f00_implicit_step::vr, self_f00_implicit_step::vw_coeff_cube, and Formulary::Zeta.

Referenced by self_f00_implicit_step::getleftside(), and self_f00_implicit_step::takestep().

235  {
236 
237  double vw_cube;// = vw_coeff_cube; * ZLn_ei * 4.0*M_PI*I2;;
238 
239  double temperature = I4_Lnee/3.0/C_RB[C_RB.size()-1];
240  vw_cube = Z0*formulas.Zeta*formulas.LOGei(C_RB[C_RB.size()-1],temperature,Z0*formulas.Zeta);
241  vw_cube *= vw_coeff_cube * C_RB[C_RB.size()-1];
242 
243  double ZLnee = Z0*formulas.Zeta*formulas.LOGee(C_RB[C_RB.size()-1],temperature);
244 
245  double g, b0, nueff, xsi;
246 
247 // xsi = 3.84+(142.59-65.48*vos/sqrt(temperature)/(27.3*vos/sqrt(temperature)+vos*vos/temperature);
248 
249 
250  for (size_t ip(1); ip < D_RB.size()-1; ++ip){
251 // b0 = (vos*vos+5.0*vr[ip]*vr[ip])/(5.0*vr[ip]*vr[ip]);
252 // nueff = ZLnee/pow(vr[ip]*vr[ip]+vos*vos/xsi,1.5);
253 // g = 1.0 - b0*nueff*vw_cube/(1.0+b0*b0*nuOeff*vw_cube);
254 
255 
256 
257  g = laser_Inv_Uav6[ip] * vw_cube * vw_cube;
258  g = 1.0 / (1.0 + g);
259 
260  D_RB[ip] += heating_coefficient * g / vr[ip];
261  }
262 
263 }
valarray< double > vr
Define the velocity axis.
Definition: collisions.h:31
double Zeta
Definition: formulary.h:104
double LOGee(double ne, double Te)
Definition: formulary.cpp:226
double LOGei(double ne, double Te, double Z)
Definition: formulary.cpp:249
valarray< double > laser_Inv_Uav6
Definition: collisions.h:38
valarray< double > C_RB
Rosenbluth Potentials.
Definition: collisions.h:41
valarray< double > D_RB
Definition: collisions.h:41
Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_D_Rosenbluth()

double self_f00_implicit_step::update_D_Rosenbluth ( const size_t &  k,
valarray< double > &  fin,
const double &  delta 
)
private

#include </Users/archis/Dropbox/work/dev/oshun/oshun-OS/OSHUN/1d_cpp/source/collisions.h>

Only needs to be np-1

Initialize at last point, which is the sum from np-1 to np-1

Now n = np - 1

So innersum = f_{np} * (1-delta_{np-1/2})

  • f_{np-1} * (delta_{np-1/2})

Using indexing from Kingham2004. v is defined from 1 to nv, obviously So k = 1 is the first velocity cell and distribution function point. Therefore, all the l's should be referenced to with l - 1

Definition at line 127 of file collisions.cpp.

References self_f00_implicit_step::dvr, and self_f00_implicit_step::vr.

Referenced by self_f00_implicit_step::update_D_and_delta().

127  {
128 
129  double answer(0.0);
130 
131  valarray<double> innersum(fin.size() - 1);
132 
133  int n(innersum.size()-1);
134 
136  innersum[n] = (1.0 - delta) * fin[n + 1] + delta * fin[n];
137  innersum[n] *= (vr[n + 1] * vr[n + 1] - vr[n] * vr[n]);
138 
139 
140  --n;
141 
142  for (n; n > -1; --n) {
143  innersum[n] = (1.0 - delta) * fin[n + 1] + delta * fin[n];
144  innersum[n] *= (vr[n + 1] * vr[n + 1] - vr[n] * vr[n]);
145 
146  innersum[n] += innersum[n + 1];
147 
148 // std::cout << "\n innersum[" << n << "] = " << innersum[n] << "\n";
149 
150  }
151 
155  for (size_t l(1); l < k + 1; ++l) {
156  answer += vr[l - 1] * vr[l - 1] * dvr[l - 1] * innersum[l - 1];
157  }
158 
159  answer *= 4.0 * M_PI;
160  answer *= 1.0 / (vr[k - 1] + vr[k]);
161 
162  return answer;
163 }
valarray< double > vr
Define the velocity axis.
Definition: collisions.h:31
valarray< double > dvr
Definition: collisions.h:32
Here is the caller graph for this function:

◆ ~interspecies_f00_RKfunctor()

interspecies_f00_RKfunctor::~interspecies_f00_RKfunctor ( )
inline

◆ ~self_f00_RKfunctor()

self_f00_RKfunctor::~self_f00_RKfunctor ( )
inline

Variable Documentation

◆ _LOGee [1/2]

double interspecies_flm_implicit_step::_LOGee
private

◆ _LOGee [2/2]

double self_flm_implicit_step::_LOGee
private

◆ _ZLOGei [1/2]

double interspecies_flm_implicit_step::_ZLOGei
private

◆ _ZLOGei [2/2]

double self_flm_implicit_step::_ZLOGei
private

Definition at line 262 of file collisions.h.

Referenced by self_flm_implicit_step::reset_coeff().

◆ A00

complex<double> Spatial_Advection_1D::A00
private

◆ A1 [1/3]

Array2D< complex<double> > Spatial_Advection_1D::A1
private

◆ A1 [2/3]

Array2D< complex<double> > Electric_Field_1D::A1
private

◆ A1 [3/3]

valarray< complex<double> > Magnetic_Field_1D::A1
private

◆ A10

complex<double> Spatial_Advection_1D::A10
private

◆ A100

complex<double> Electric_Field_1D::A100
private

◆ A2 [1/3]

Array2D< complex<double> > Spatial_Advection_1D::A2
private

◆ A2 [2/3]

Array2D< complex<double> > Electric_Field_1D::A2
private

◆ A2 [3/3]

Array2D< complex<double> > Magnetic_Field_1D::A2
private

◆ A20

complex<double> Spatial_Advection_1D::A20
private

Definition at line 32 of file vlasov.h.

Referenced by Spatial_Advection_1D::Spatial_Advection_1D().

◆ A210

complex<double> Electric_Field_1D::A210
private

◆ A3

complex<double> Magnetic_Field_1D::A3
private

◆ A310

complex<double> Electric_Field_1D::A310
private

Definition at line 72 of file vlasov.h.

Referenced by Electric_Field_1D::Electric_Field_1D().

◆ Alpha_Tri [1/2]

Array2D<double> interspecies_flm_implicit_step::Alpha_Tri
private

◆ Alpha_Tri [2/2]

Array2D<double> self_flm_implicit_step::Alpha_Tri
private

◆ B1 [1/2]

valarray< complex<double> > Electric_Field_1D::B1
private

◆ B1 [2/2]

valarray< complex<double> > Magnetic_Field_1D::B1
private

◆ B2

valarray< complex<double> > Electric_Field_1D::B2
private

◆ B211

complex<double> Electric_Field_1D::B211
private

◆ C1

valarray< complex<double> > Electric_Field_1D::C1
private

◆ C100

complex<double> Electric_Field_1D::C100
private

◆ C2

Array2D< complex<double> > Electric_Field_1D::C2
private

Definition at line 77 of file vlasov.h.

Referenced by Electric_Field_1D::Electric_Field_1D(), and Electric_Field_1D::operator()().

◆ C3

valarray< complex<double> > Electric_Field_1D::C3
private

◆ C311

complex<double> Electric_Field_1D::C311
private

Definition at line 72 of file vlasov.h.

Referenced by Electric_Field_1D::Electric_Field_1D().

◆ C4

Array2D< complex<double> > Electric_Field_1D::C4
private

◆ c_kpre [1/2]

double self_f00_implicit_step::c_kpre
private

◆ c_kpre [2/2]

double self_f00_explicit_step::c_kpre
private

◆ C_RB

◆ collide [1/3]

interspecies_f00_explicit_step interspecies_f00_RKfunctor::collide
private

Definition at line 83 of file interspeciescollisions.h.

Referenced by interspecies_f00_RKfunctor::operator()().

◆ collide [2/3]

self_f00_implicit_step self_f00_implicit_collisions::collide
private

Definition at line 93 of file collisions.h.

Referenced by self_f00_implicit_collisions::loop().

◆ collide [3/3]

self_f00_explicit_step self_f00_RKfunctor::collide
private

Definition at line 170 of file collisions.h.

Referenced by self_f00_RKfunctor::operator()().

◆ coolingprofile

valarray<double> self_f00_implicit_collisions::coolingprofile
private

Definition at line 100 of file collisions.h.

Referenced by self_f00_implicit_collisions::loop().

◆ D_RB

◆ ddf0 [1/2]

valarray<double> interspecies_flm_implicit_step::ddf0
private

◆ ddf0 [2/2]

valarray<double> self_flm_implicit_step::ddf0
private

◆ delta_CC

valarray<double> self_f00_implicit_step::delta_CC
private

◆ df0 [1/3]

valarray<double> interspecies_f00_explicit_step::df0
private

Definition at line 54 of file interspeciescollisions.h.

Referenced by interspecies_f00_explicit_step::takestep().

◆ df0 [2/3]

valarray<double> interspecies_flm_implicit_step::df0
private

◆ df0 [3/3]

valarray<double> self_flm_implicit_step::df0
private

◆ dt [1/2]

double self_f00_implicit_step::dt
private

Definition at line 28 of file collisions.h.

Referenced by self_f00_implicit_step::self_f00_implicit_step().

◆ dt [2/2]

double interspecies_f00_explicit_step::dt
private

Definition at line 45 of file interspeciescollisions.h.

Referenced by interspecies_f00_explicit_step::takestep().

◆ Dt [1/4]

double interspecies_flm_implicit_step::Dt
private

◆ Dt [2/4]

double interspecies_flm_implicit_collisions::Dt
private

◆ Dt [3/4]

double self_flm_implicit_step::Dt
private

◆ Dt [4/4]

double self_flm_implicit_collisions::Dt
private

◆ dtoverv2

valarray<double> self_f00_implicit_step::dtoverv2
private

◆ dvr

◆ f00 [1/2]

valarray<double> interspecies_flm_implicit_collisions::f00
private

Array for isotropic component distribution function. Needed for calculating coefficients.

Definition at line 215 of file interspeciescollisions.h.

Referenced by interspecies_flm_implicit_collisions::advancef1(), and interspecies_flm_implicit_collisions::advanceflm().

◆ f00 [2/2]

valarray<double> self_flm_implicit_collisions::f00
private

Array for isotropic component distribution function. Needed for calculating coefficients.

Definition at line 315 of file collisions.h.

Referenced by self_flm_implicit_collisions::advancef1(), and self_flm_implicit_collisions::advanceflm().

◆ f1_m_upperlimit

int self_flm_implicit_collisions::f1_m_upperlimit
private

◆ fc [1/2]

valarray<complex<double> > interspecies_flm_implicit_collisions::fc
private

◆ fc [2/2]

valarray<complex<double> > self_flm_implicit_collisions::fc
private

Dummy array.

Definition at line 314 of file collisions.h.

Referenced by self_flm_implicit_collisions::advancef1(), and self_flm_implicit_collisions::advanceflm().

◆ fd1

SHarmonic1D Spatial_Advection_1D::fd1
private

◆ fd2

SHarmonic1D Spatial_Advection_1D::fd2
private

Definition at line 31 of file vlasov.h.

Referenced by Spatial_Advection_1D::es1d(), and Spatial_Advection_1D::operator()().

◆ fin [1/2]

valarray<double> self_f00_implicit_collisions::fin
private

Definition at line 90 of file collisions.h.

Referenced by self_f00_implicit_collisions::loop().

◆ fin [2/2]

valarray<double> self_f00_explicit_collisions::fin
private

Definition at line 203 of file collisions.h.

Referenced by self_f00_explicit_collisions::loop().

◆ fin1

valarray<double> interspecies_f00_explicit_collisions::fin1
private

◆ fin2

valarray<double> interspecies_f00_explicit_collisions::fin2
private

◆ FLM

SHarmonic1D Magnetic_Field_1D::FLM
private

Definition at line 104 of file vlasov.h.

Referenced by Magnetic_Field_1D::f1only(), and Magnetic_Field_1D::operator()().

◆ formulary

Formulary interspecies_f00_explicit_step::formulary
private

Definition at line 46 of file interspeciescollisions.h.

Referenced by interspecies_f00_explicit_step::takestep().

◆ formulas [1/4]

◆ formulas [2/4]

Formulary self_f00_explicit_step::formulas
private

Definition at line 140 of file collisions.h.

Referenced by self_f00_explicit_step::takestep().

◆ formulas [3/4]

Formulary interspecies_flm_implicit_step::formulas
private

◆ formulas [4/4]

Formulary self_flm_implicit_step::formulas
private

Definition at line 264 of file collisions.h.

Referenced by self_flm_implicit_step::reset_coeff().

◆ fout

valarray<double> self_f00_implicit_collisions::fout
private

Definition at line 90 of file collisions.h.

◆ fslope

valarray<double> interspecies_f00_explicit_step::fslope
private

◆ G

◆ Gamma12

double interspecies_f00_explicit_step::Gamma12
private

Definition at line 51 of file interspeciescollisions.h.

Referenced by interspecies_f00_explicit_step::takestep().

◆ H

◆ h [1/2]

double interspecies_f00_explicit_collisions::h
private

◆ h [2/2]

double self_f00_explicit_collisions::h
private

◆ heatingprofile

valarray<double> self_f00_implicit_collisions::heatingprofile
private

Definition at line 99 of file collisions.h.

Referenced by self_f00_implicit_collisions::loop().

◆ Hp0

valarray< complex<double> > Electric_Field_1D::Hp0
private

Definition at line 78 of file vlasov.h.

Referenced by Electric_Field_1D::Electric_Field_1D(), and Electric_Field_1D::MakeGH().

◆ I0 [1/2]

valarray<double> interspecies_flm_implicit_step::I0
private

◆ I0 [2/2]

valarray<double> self_flm_implicit_step::I0
private

Definition at line 249 of file collisions.h.

Referenced by self_flm_implicit_step::reset_coeff().

◆ I0_density [1/2]

double interspecies_flm_implicit_step::I0_density
private

◆ I0_density [2/2]

double self_flm_implicit_step::I0_density
private

Definition at line 261 of file collisions.h.

Referenced by self_flm_implicit_step::reset_coeff().

◆ I2 [1/3]

valarray<double> self_f00_explicit_step::I2
private

Definition at line 135 of file collisions.h.

Referenced by self_f00_explicit_step::takestep().

◆ I2 [2/3]

valarray<double> interspecies_flm_implicit_step::I2
private

◆ I2 [3/3]

valarray<double> self_flm_implicit_step::I2
private

Definition at line 249 of file collisions.h.

Referenced by self_flm_implicit_step::reset_coeff().

◆ I2_s1

valarray<double> interspecies_f00_explicit_step::I2_s1
private

◆ I2_s2

valarray<double> interspecies_f00_explicit_step::I2_s2
private

◆ I2_temperature [1/2]

double interspecies_flm_implicit_step::I2_temperature
private

◆ I2_temperature [2/2]

double self_flm_implicit_step::I2_temperature
private

Definition at line 261 of file collisions.h.

Referenced by self_flm_implicit_step::reset_coeff().

◆ I4

valarray<double> self_f00_explicit_step::I4
private

Definition at line 135 of file collisions.h.

Referenced by self_f00_explicit_step::takestep().

◆ I4_Lnee

◆ I4_s1

valarray<double> interspecies_f00_explicit_step::I4_s1
private

◆ I4_s2

valarray<double> interspecies_f00_explicit_step::I4_s2
private

◆ ib [1/2]

bool self_f00_implicit_step::ib
private

◆ ib [2/2]

bool self_f00_implicit_collisions::ib
private

Definition at line 92 of file collisions.h.

Referenced by self_f00_implicit_collisions::loop().

◆ IB_heating

bool self_f00_implicit_collisions::IB_heating
private

Switches for inverse bremsstrahlung and maxwellian cooling.

Definition at line 96 of file collisions.h.

Referenced by self_f00_implicit_collisions::loop().

◆ idx [1/2]

complex<double> Faraday_1D::idx
private

Definition at line 146 of file vlasov.h.

Referenced by Faraday_1D::Faraday_1D(), and Faraday_1D::operator()().

◆ idx [2/2]

complex<double> Ampere_1D::idx
private

Definition at line 164 of file vlasov.h.

Referenced by Ampere_1D::Ampere_1D(), and Ampere_1D::operator()().

◆ if_tridiagonal [1/2]

bool interspecies_flm_implicit_step::if_tridiagonal
private

Definition at line 160 of file interspeciescollisions.h.

Referenced by interspecies_flm_implicit_step::advance().

◆ if_tridiagonal [2/2]

bool self_flm_implicit_step::if_tridiagonal
private

Definition at line 257 of file collisions.h.

Referenced by self_flm_implicit_step::advance().

◆ implicit_step [1/2]

interspecies_flm_implicit_step interspecies_flm_implicit_collisions::implicit_step
private

The object that is responsible for performing the algebra required for the integrals.

Definition at line 218 of file interspeciescollisions.h.

Referenced by interspecies_flm_implicit_collisions::advancef1(), and interspecies_flm_implicit_collisions::advanceflm().

◆ implicit_step [2/2]

self_flm_implicit_step self_flm_implicit_collisions::implicit_step
private

The object that is responsible for performing the algebra required for the integrals.

Definition at line 318 of file collisions.h.

Referenced by self_flm_implicit_collisions::advancef1(), and self_flm_implicit_collisions::advanceflm().

◆ interspecies_f00_collisions

vector<interspecies_f00_explicit_collisions> interspecies_collisions::interspecies_f00_collisions
private

Definition at line 243 of file interspeciescollisions.h.

◆ invpr

valarray< complex<double> > Electric_Field_1D::invpr
private

Definition at line 78 of file vlasov.h.

Referenced by Electric_Field_1D::Electric_Field_1D(), and Electric_Field_1D::MakeGH().

◆ J1

valarray<double> self_f00_explicit_step::J1
private

The integrals.

Definition at line 135 of file collisions.h.

Referenced by self_f00_explicit_step::G(), and self_f00_explicit_step::takestep().

◆ J1_s1

valarray<double> interspecies_f00_explicit_step::J1_s1
private

◆ J1_s2

valarray<double> interspecies_f00_explicit_step::J1_s2
private

◆ J1m [1/2]

valarray<double> interspecies_flm_implicit_step::J1m
private

◆ J1m [2/2]

valarray<double> self_flm_implicit_step::J1m
private

Definition at line 249 of file collisions.h.

Referenced by self_flm_implicit_step::reset_coeff().

◆ Jx

Field1D Current_1D::Jx
private

Definition at line 128 of file vlasov.h.

Referenced by Current_1D::es1d(), and Current_1D::operator()().

◆ Jy

Field1D Current_1D::Jy
private

Definition at line 128 of file vlasov.h.

Referenced by Current_1D::operator()().

◆ Jz

Field1D Current_1D::Jz
private

Definition at line 128 of file vlasov.h.

Referenced by Current_1D::operator()().

◆ kpre [1/3]

double interspecies_f00_explicit_step::kpre
private

◆ kpre [2/3]

◆ kpre [3/3]

double self_flm_implicit_step::kpre
private

◆ l0 [1/2]

size_t interspecies_flm_implicit_collisions::l0
private

Number of m harmonics.

Definition at line 211 of file interspeciescollisions.h.

Referenced by interspecies_flm_implicit_collisions::advanceflm().

◆ l0 [2/2]

size_t self_flm_implicit_collisions::l0
private

Number of m harmonics.

Definition at line 311 of file collisions.h.

Referenced by self_flm_implicit_collisions::advanceflm().

◆ laser_Inv_Uav6

valarray<double> self_f00_implicit_step::laser_Inv_Uav6
private

◆ m0 [1/2]

size_t interspecies_flm_implicit_collisions::m0
private

Number of m harmonics.

Definition at line 212 of file interspeciescollisions.h.

Referenced by interspecies_flm_implicit_collisions::advanceflm().

◆ m0 [2/2]

size_t self_flm_implicit_collisions::m0
private

◆ m1

◆ m2

◆ mass [1/3]

double self_f00_implicit_step::mass
private

Definition at line 27 of file collisions.h.

Referenced by self_f00_implicit_step::self_f00_implicit_step().

◆ mass [2/3]

double self_f00_explicit_step::mass
private

Array output by getslope.

Definition at line 127 of file collisions.h.

◆ mass [3/3]

double self_flm_implicit_step::mass
private

Definition at line 258 of file collisions.h.

Referenced by self_flm_implicit_step::self_flm_implicit_step().

◆ MX_cooling

bool self_f00_implicit_collisions::MX_cooling
private

Definition at line 97 of file collisions.h.

◆ n1

double interspecies_f00_explicit_step::n1
private

◆ n2

double interspecies_f00_explicit_step::n2
private

◆ NB

int self_f00_explicit_step::NB
private

◆ Nbc [1/6]

int interspecies_f00_explicit_step::Nbc
private

Number of boundary cells in each direction.

Definition at line 63 of file interspeciescollisions.h.

Referenced by interspecies_f00_explicit_step::interspecies_f00_explicit_step().

◆ Nbc [2/6]

int self_f00_implicit_collisions::Nbc
private

Number of boundary cells in each direction.

Definition at line 103 of file collisions.h.

Referenced by self_f00_implicit_collisions::self_f00_implicit_collisions().

◆ Nbc [3/6]

int interspecies_f00_explicit_collisions::Nbc
private

◆ Nbc [4/6]

int interspecies_flm_implicit_collisions::Nbc
private

◆ Nbc [5/6]

int self_f00_explicit_collisions::Nbc
private

Number of boundary cells in each direction.

Definition at line 217 of file collisions.h.

Referenced by self_f00_explicit_collisions::self_f00_explicit_collisions().

◆ Nbc [6/6]

int self_flm_implicit_collisions::Nbc
private

Number of boundary cells in each direction.

Definition at line 307 of file collisions.h.

Referenced by self_flm_implicit_collisions::self_flm_implicit_collisions().

◆ num_h [1/2]

size_t interspecies_f00_explicit_collisions::num_h
private

◆ num_h [2/2]

size_t self_f00_explicit_collisions::num_h
private

◆ numx [1/2]

size_t Faraday_1D::numx
private

Definition at line 147 of file vlasov.h.

◆ numx [2/2]

size_t Ampere_1D::numx
private

Definition at line 165 of file vlasov.h.

◆ p2dp

valarray<double> self_f00_implicit_step::p2dp
private

Various coefficients for the integrals.

Definition at line 38 of file collisions.h.

Referenced by self_f00_implicit_step::self_f00_implicit_step().

◆ p2dpm1

valarray<double> self_f00_implicit_step::p2dpm1
private

Definition at line 38 of file collisions.h.

Referenced by self_f00_implicit_step::self_f00_implicit_step().

◆ p4dp

valarray<double> self_f00_implicit_step::p4dp
private

◆ pgrid_s1

valarray<double> interspecies_f00_explicit_step::pgrid_s1
private

◆ pgrid_s2

valarray<double> interspecies_f00_explicit_step::pgrid_s2
private

◆ phdp

valarray<double> self_f00_implicit_step::phdp
private

Definition at line 38 of file collisions.h.

Referenced by self_f00_implicit_step::self_f00_implicit_step().

◆ phdpm1

valarray<double> self_f00_implicit_step::phdpm1
private

Definition at line 38 of file collisions.h.

Referenced by self_f00_implicit_step::self_f00_implicit_step().

◆ Pn [1/2]

valarray<double> interspecies_f00_explicit_step::Pn
private

◆ Pn [2/2]

valarray<double> self_f00_explicit_step::Pn
private

◆ pr

valarray< complex<double> > Electric_Field_1D::pr
private

◆ Qn [1/2]

valarray<double> interspecies_f00_explicit_step::Qn
private

◆ Qn [2/2]

valarray<double> self_f00_explicit_step::Qn
private

◆ RK

Algorithms::RK4<valarray<double> > self_f00_explicit_collisions::RK
private

This object contains the RK4 algorithm that advances the collision operator. Inside of it is the Collide object that contains all the relevant collision integral algebra.

Definition at line 210 of file collisions.h.

Referenced by self_f00_explicit_collisions::loop().

◆ RK4

Algorithms::RK4<valarray<double> > interspecies_f00_explicit_collisions::RK4
private

Definition at line 116 of file interspeciescollisions.h.

◆ rkf00 [1/2]

interspecies_f00_RKfunctor interspecies_f00_explicit_collisions::rkf00
private

Definition at line 114 of file interspeciescollisions.h.

◆ rkf00 [2/2]

self_f00_RKfunctor self_f00_explicit_collisions::rkf00
private

Definition at line 212 of file collisions.h.

Referenced by self_f00_explicit_collisions::loop().

◆ Scattering_Term [1/2]

valarray<double> interspecies_flm_implicit_step::Scattering_Term
private

◆ Scattering_Term [2/2]

valarray<double> self_flm_implicit_step::Scattering_Term
private

◆ self_coll

vector<self_collisions> collisions::self_coll
private

◆ self_f00_exp_collisions

self_f00_explicit_collisions self_collisions::self_f00_exp_collisions
private

Definition at line 343 of file collisions.h.

Referenced by self_collisions::advancef00().

◆ self_f00_imp_collisions

self_f00_implicit_collisions self_collisions::self_f00_imp_collisions
private

Definition at line 344 of file collisions.h.

Referenced by self_collisions::advancef00().

◆ self_flm_collisions

self_flm_implicit_collisions self_collisions::self_flm_collisions
private

Definition at line 345 of file collisions.h.

Referenced by self_collisions::advancef1(), and self_collisions::advanceflm().

◆ small

double Current_1D::small
private

Definition at line 129 of file vlasov.h.

Referenced by Current_1D::Current_1D().

◆ szx [1/6]

int interspecies_f00_explicit_step::szx
private

Total cells including boundary cells in x-direction.

Definition at line 64 of file interspeciescollisions.h.

Referenced by interspecies_f00_explicit_step::interspecies_f00_explicit_step().

◆ szx [2/6]

int self_f00_implicit_collisions::szx
private

Total cells including boundary cells in x-direction.

Definition at line 104 of file collisions.h.

Referenced by self_f00_implicit_collisions::loop(), and self_f00_implicit_collisions::self_f00_implicit_collisions().

◆ szx [3/6]

int interspecies_f00_explicit_collisions::szx
private

Total cells including boundary cells in x-direction.

Definition at line 123 of file interspeciescollisions.h.

Referenced by interspecies_f00_explicit_collisions::interspecies_f00_explicit_collisions(), and interspecies_f00_explicit_collisions::rkloop().

◆ szx [4/6]

int interspecies_flm_implicit_collisions::szx
private

◆ szx [5/6]

int self_f00_explicit_collisions::szx
private

Total cells including boundary cells in x-direction.

Definition at line 218 of file collisions.h.

Referenced by self_f00_explicit_collisions::loop(), and self_f00_explicit_collisions::self_f00_explicit_collisions().

◆ szx [6/6]

int self_flm_implicit_collisions::szx
private

Total cells including boundary cells in x-direction.

Definition at line 308 of file collisions.h.

Referenced by self_flm_implicit_collisions::advancef1(), self_flm_implicit_collisions::advanceflm(), and self_flm_implicit_collisions::self_flm_implicit_collisions().

◆ T1

double interspecies_f00_explicit_step::T1
private

◆ T2

double interspecies_f00_explicit_step::T2
private

◆ TMP

◆ tmpB

Field1D Ampere_1D::tmpB
private

Definition at line 163 of file vlasov.h.

Referenced by Ampere_1D::operator()().

◆ tmpE

Field1D Faraday_1D::tmpE
private

Definition at line 145 of file vlasov.h.

Referenced by Faraday_1D::operator()().

◆ U1 [1/4]

valarray<double> interspecies_f00_explicit_step::U1
private

◆ U1 [2/4]

valarray<double> self_f00_explicit_step::U1
private

◆ U1 [3/4]

valarray<double> interspecies_flm_implicit_step::U1
private

◆ U1 [4/4]

valarray<double> self_flm_implicit_step::U1
private

◆ U1m1 [1/4]

valarray<double> interspecies_f00_explicit_step::U1m1
private

◆ U1m1 [2/4]

valarray<double> self_f00_explicit_step::U1m1
private

◆ U1m1 [3/4]

valarray<double> interspecies_flm_implicit_step::U1m1
private

◆ U1m1 [4/4]

valarray<double> self_flm_implicit_step::U1m1
private

◆ U2 [1/4]

valarray<double> interspecies_f00_explicit_step::U2
private

◆ U2 [2/4]

valarray<double> self_f00_explicit_step::U2
private

◆ U2 [3/4]

valarray<double> interspecies_flm_implicit_step::U2
private

◆ U2 [4/4]

valarray<double> self_flm_implicit_step::U2
private

◆ U2m1 [1/4]

valarray<double> interspecies_f00_explicit_step::U2m1
private

◆ U2m1 [2/4]

valarray<double> self_f00_explicit_step::U2m1
private

◆ U2m1 [3/4]

valarray<double> interspecies_flm_implicit_step::U2m1
private

◆ U2m1 [4/4]

valarray<double> self_flm_implicit_step::U2m1
private

◆ U3 [1/2]

valarray<double> interspecies_f00_explicit_step::U3
private

◆ U3 [2/2]

valarray<double> self_f00_explicit_step::U3
private

◆ U4 [1/4]

valarray<double> interspecies_f00_explicit_step::U4
private

◆ U4 [2/4]

valarray<double> self_f00_explicit_step::U4
private

Various coefficients for the integrals.

Definition at line 132 of file collisions.h.

Referenced by self_f00_explicit_step::self_f00_explicit_step(), and self_f00_explicit_step::takestep().

◆ U4 [3/4]

valarray<double> interspecies_flm_implicit_step::U4
private

◆ U4 [4/4]

valarray<double> self_flm_implicit_step::U4
private

◆ U4m1 [1/4]

valarray<double> interspecies_f00_explicit_step::U4m1
private

◆ U4m1 [2/4]

valarray<double> self_f00_explicit_step::U4m1
private

◆ U4m1 [3/4]

valarray<double> interspecies_flm_implicit_step::U4m1
private

◆ U4m1 [4/4]

valarray<double> self_flm_implicit_step::U4m1
private

◆ vr [1/5]

◆ vr [2/5]

valarray< complex<double> > Spatial_Advection_1D::vr
private

◆ vr [3/5]

valarray<double> self_f00_explicit_step::vr
private

◆ vr [4/5]

◆ vr [5/5]

valarray<double> self_flm_implicit_step::vr
private

◆ vrh

valarray<double> self_f00_implicit_step::vrh
private

Definition at line 33 of file collisions.h.

Referenced by self_f00_implicit_step::self_f00_implicit_step().

◆ vw_coeff_cube

double self_f00_implicit_step::vw_coeff_cube
private

◆ xgrid

valarray<double> self_f00_implicit_collisions::xgrid
private

Definition at line 91 of file collisions.h.

Referenced by self_f00_implicit_collisions::loop().

◆ Yh

State1D collisions::Yh
private

Definition at line 372 of file collisions.h.

Referenced by collisions::advance().

◆ z1

double interspecies_f00_explicit_step::z1
private

◆ z2

double interspecies_f00_explicit_step::z2
private