OSHUN  beta
Arbitrary Order Spherical-Harmonic 1D-3P Vlasov-Fokker-Planck-Maxwell code
RK4_IB Class Reference

#include <laser.h>

Collaboration diagram for RK4_IB:

Public Member Functions

 RK4_IB (valarray< double > &fin, double pmax, int tout_start)
 
RK4_IBadvance (const double vosc, const double Zval)
 
double & tout ()
 
double & time ()
 
size_t & numh ()
 
double & th ()
 

Private Member Functions

valarray< double > & F (const valarray< double > &fin, const double vosc, const double Zval)
 

Private Attributes

valarray< double > f0
 
valarray< double > f1
 
valarray< double > fh
 
valarray< double > & f
 
IB_f00 Inversebremsstrahlung
 
size_t num_h
 
double h
 
double t
 
double Tout
 

Detailed Description

Definition at line 63 of file laser.h.

Constructor & Destructor Documentation

◆ RK4_IB()

RK4_IB::RK4_IB ( valarray< double > &  fin,
double  pmax,
int  tout_start 
)

Definition at line 213 of file laser.cpp.

217  :t(static_cast<double>(tout_start) *
218  Input::List().t_stop / Input::List().n_outsteps), // Initialize time = 0
219  Tout(t + Input::List().t_stop / Input::List().n_outsteps), // The next output time
220  fh(0.0,fin.size()),
221  f0(0.0,fin.size()),
222  f1(0.0,fin.size()), // 3 local "State" Variables
223  f(fin), // Initialize a reference to "State" Y
224  Inversebremsstrahlung(fh, pmax){ // Initialize "Actions"
225 
226 }
valarray< double > f1
Definition: laser.h:85
valarray< double > f0
Definition: laser.h:85
double Tout
Definition: laser.h:92
valarray< double > & f
Definition: laser.h:86
IB_f00 Inversebremsstrahlung
Definition: laser.h:89
Input_List & List()
Definition: input.cpp:1585
double t
Definition: laser.h:92
valarray< double > fh
Definition: laser.h:85

Member Function Documentation

◆ advance()

RK4_IB & RK4_IB::advance ( const double  vosc,
const double  Zval 
)

Definition at line 247 of file laser.cpp.

References F(), f, f0, f1, fh, h, and t.

Referenced by InverseBremsstrahlung::loop().

247  {
248 //--------------------------------------------------------------
249 // Take a step using RK4
250 //--------------------------------------------------------------
251 
252 // Initialization
253  f0 = f; f1 = f;
254 
255 // Step 1
256  F(f1,vosc,Zval); // fh = F(f1)
257  fh *= (0.5*h); f1 += fh; // f1 = f1 + (h/2)*fh
258  fh *= (1.0/3.0); f += fh; // f = f + (h/6)*fh
259 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
260 
261 // Step 2
262  F(f1,vosc,Zval); f1 = f0; // fh = F(f1)
263  fh *= (0.5*h); f1 += fh; // f1 = f0 + (h/2)*fh
264  fh *= (2.0/3.0); f += fh; // f = f + (h/3)*fh
265 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
266 
267 // Step 3
268  F(f1,vosc,Zval); // fh = F(f1)
269  fh *= h; f0 += fh; // f1 = f0 + h*Yh
270  fh *= (1.0/3.0); f += fh; // f = f + (h/3)*fh
271 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
272 
273 // Step 4
274  F(f0,vosc,Zval); // fh = F(f0)
275  fh *= (h/6.0); f += fh; // f = f + (h/6)*Yh
276 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
277 
278  t += h;
279 
280  return *this;
281 
282 }
valarray< double > & F(const valarray< double > &fin, const double vosc, const double Zval)
Definition: laser.cpp:242
valarray< double > f1
Definition: laser.h:85
valarray< double > f0
Definition: laser.h:85
valarray< double > & f
Definition: laser.h:86
double h
Definition: laser.h:92
double t
Definition: laser.h:92
valarray< double > fh
Definition: laser.h:85
Here is the call graph for this function:
Here is the caller graph for this function:

◆ F()

valarray< double > & RK4_IB::F ( const valarray< double > &  fin,
const double  vosc,
const double  Zval 
)
private

Definition at line 242 of file laser.cpp.

References IB_f00::Getslope(), and Inversebremsstrahlung.

Referenced by advance().

242  {
243  return Inversebremsstrahlung.Getslope(fin,vosc,Zval);
244 }
IB_f00 Inversebremsstrahlung
Definition: laser.h:89
valarray< double > & Getslope(const valarray< double > &fin, const double vos, const double Zval)
Definition: laser.cpp:119
Here is the call graph for this function:
Here is the caller graph for this function:

◆ numh()

size_t & RK4_IB::numh ( )

Definition at line 233 of file laser.cpp.

References num_h.

Referenced by InverseBremsstrahlung::loop().

233 {return num_h;}
size_t num_h
Definition: laser.h:91
Here is the caller graph for this function:

◆ th()

double & RK4_IB::th ( )

Definition at line 236 of file laser.cpp.

References h.

Referenced by InverseBremsstrahlung::loop().

236 {return h;}
double h
Definition: laser.h:92
Here is the caller graph for this function:

◆ time()

double & RK4_IB::time ( )

Definition at line 239 of file laser.cpp.

References t.

Referenced by InverseBremsstrahlung::loop().

239 {return t;}
double t
Definition: laser.h:92
Here is the caller graph for this function:

◆ tout()

double & RK4_IB::tout ( )

Definition at line 230 of file laser.cpp.

References Tout.

Referenced by InverseBremsstrahlung::loop().

230 {return Tout;}
double Tout
Definition: laser.h:92
Here is the caller graph for this function:

Field Documentation

◆ f

valarray<double>& RK4_IB::f
private

Definition at line 86 of file laser.h.

Referenced by advance().

◆ f0

valarray<double> RK4_IB::f0
private

Definition at line 85 of file laser.h.

Referenced by advance().

◆ f1

valarray<double> RK4_IB::f1
private

Definition at line 85 of file laser.h.

Referenced by advance().

◆ fh

valarray<double> RK4_IB::fh
private

Definition at line 85 of file laser.h.

Referenced by advance().

◆ h

double RK4_IB::h
private

Definition at line 92 of file laser.h.

Referenced by advance(), and th().

◆ Inversebremsstrahlung

IB_f00 RK4_IB::Inversebremsstrahlung
private

Definition at line 89 of file laser.h.

Referenced by F().

◆ num_h

size_t RK4_IB::num_h
private

Definition at line 91 of file laser.h.

Referenced by numh().

◆ t

double RK4_IB::t
private

Definition at line 92 of file laser.h.

Referenced by advance(), and time().

◆ Tout

double RK4_IB::Tout
private

Definition at line 92 of file laser.h.

Referenced by tout().


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