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

#include <laser.h>

Collaboration diagram for InverseBremsstrahlung:

Public Member Functions

 InverseBremsstrahlung (double pmax, size_t nump, size_t numx, int tout_start, const valarray< double > &grid)
 
void loop (SHarmonic1D &f0, valarray< double > &Zarray, const double &tnew)
 
int IBSOURCE () const
 

Data Fields

valarray< double > U2
 
valarray< double > U2m1
 

Private Attributes

double t
 
double tout
 
valarray< double > fc
 
RK4_IB rk4_ib
 
valarray< double > vr
 
int InvBremsstrahlung
 
int Nbc
 
int szx
 
int szy
 
valarray< double > IL_xprofile
 
const double vos
 
const double omega_0
 
const double omega_p
 
const double w0overwp
 

Detailed Description

Definition at line 99 of file laser.h.

Constructor & Destructor Documentation

◆ InverseBremsstrahlung()

InverseBremsstrahlung::InverseBremsstrahlung ( double  pmax,
size_t  nump,
size_t  numx,
int  tout_start,
const valarray< double > &  grid 
)

Definition at line 297 of file laser.cpp.

References Input::Input_List::BoundaryCells, IL_xprofile, InvBremsstrahlung, Input::List(), Nbc, Input::Input_List::NxLocal, Setup_Y::parseprofile(), szx, U2, U2m1, and vr.

301  :t(static_cast<double>(tout_start) *
302  Input::List().t_stop / Input::List().n_outsteps), // Initialize time = tout_start * dt_out
303  tout(t + Input::List().t_stop / Input::List().n_outsteps), // Initialize tout = time + dt_out
304  fc(0.0, nump),
305  rk4_ib(fc, pmax, tout_start),
306  vr(Algorithms::MakeCAxis(0.0,pmax,nump)),
307 // vr(Algorithms::MakeAxis(pmax/(2.0*nump-1.0),pmax,nump)),
308 // ------------------------
309  InvBremsstrahlung(Input::List().inverse_bremsstrahlung),
310 // ------------------------
311  omega_0(3.0e+10*2.0*M_PI/(1.0e-4*Input::List().lambda_0)),
312  omega_p(5.64 * 1.0e+4*sqrt(Input::List().density_np)),
314 // -----
315 // -----
316  U2(0.0, nump),
317  U2m1(0.0, nump),
318 // -----
319  vos(Input::List().lambda_0 * sqrt(7.3e-19*Input::List().I_0)),
320  IL_xprofile(numx)
321 
322 {
323 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
324 // The intensity profile is: I0(t)*e^(-2*(r/w0)^2) and absorption takes place over
325 // depth L so that I0_r(t) ~ I0(t)*e^(-((x-x0)/L)^2). The idea is that if you
326 // integrate over x you get I0(t)
327 
328  // using Inputdata::IN;
330  szx = Input::List().NxLocal[0]; // size of useful x axis
331 
332  for (size_t i(1); i < U2.size(); ++i) {
333  U2[i] = 0.5 * vr[i]*vr[i] * (vr[i]-vr[i-1]);
334  U2m1[i] = 0.5 * vr[i-1]*vr[i-1] * (vr[i]-vr[i-1]);
335  }
336 
337  // Construct the intensity profile map
338  Setup_Y::parseprofile(grid, Input::List().intensity_profile_str, IL_xprofile);
339  if ( abs(InvBremsstrahlung) > 1 ) {
340  InvBremsstrahlung = 0;
341  }
342 
343 }
const double w0overwp
Definition: laser.h:154
valarray< double > fc
Definition: laser.h:127
const double vos
Definition: laser.h:154
std::vector< size_t > NxLocal
Definition: input.h:168
valarray< double > vr
Definition: laser.h:133
const double omega_0
Definition: laser.h:154
valarray< double > U2
Definition: laser.h:111
const double omega_p
Definition: laser.h:154
valarray< T > MakeCAxis(const T min, const T max, const size_t N)
Input_List & List()
Definition: input.cpp:1585
valarray< double > U2m1
Definition: laser.h:111
void parseprofile(const valarray< double > &grid, std::string &str_profile, valarray< double > &profile)
{ function_description }
Definition: setup.cpp:410
int BoundaryCells
Definition: input.h:50
valarray< double > IL_xprofile
Definition: laser.h:147
Here is the call graph for this function:

Member Function Documentation

◆ IBSOURCE()

int InverseBremsstrahlung::IBSOURCE ( ) const

Definition at line 347 of file laser.cpp.

References InvBremsstrahlung.

347 {return InvBremsstrahlung;}

◆ loop()

void InverseBremsstrahlung::loop ( SHarmonic1D f0,
valarray< double > &  Zarray,
const double &  tnew 
)

Definition at line 351 of file laser.cpp.

References RK4_IB::advance(), fc, IL_xprofile, Input::List(), Nbc, RK4_IB::numh(), SHarmonic1D::numx(), rk4_ib, Input::Input_List::smaller_dt, szx, t, RK4_IB::th(), RK4_IB::time(), RK4_IB::tout(), U2, U2m1, and vos.

351  {
352 //--------------------------------------------------------------
353 // Calculate the effect of the laser source
354 //--------------------------------------------------------------
355 
356  //cout << "omega_0 = " << omega_0 <<"\n";
357  //cout << "omega_p = " << omega_p <<"\n";
358  //cout << "np/nc = " << pow(omega_p / omega_0,2) <<"\n";
359  // cout << "vos = " << vos <<"\n";
360  // cout << "polarization = " << POL() <<"\n";
361 
362  // double dt = tnew -t;
363  // double Envelope_Value = t_Profile(tnew)/dt; // This is Envelope(t)*dt/dt = Envelope(t)
364  /*debug*/ // cout << "vos("<<tnew<<") = " << Envelope_Value << "\n";
365 
366  // debug: cout << "Envelope = " << Envelope_Value << /*", Carrier Signal = " << Carrier_Signal(tnew) <<*/"\n";
367 
368  /*switch (POL()) {
369  case 1: {
370  for (size_t i(0); i < Y.SH(0,0).numx(); ++i){
371  for (size_t j(0); j < Y.SH(0,0).numy(); ++j){
372  LaserFields.Ex()(i,j) = vos * IL_xprofile[i] * IL_yprofile[j]
373  * Envelope_Value * Carrier_Signal(tnew-xaxis(i));
374  }
375  }
376  break;
377  }
378  case 2: {
379  for (size_t i(0); i < Y.SH(0,0).numx(); ++i){
380  for (size_t j(0); j < Y.SH(0,0).numy(); ++j){
381  LaserFields.Ey()(i,j) = vos * IL_xprofile[i] * IL_yprofile[j]
382  * Envelope_Value * Carrier_Signal(tnew-xaxis(i));
383  }
384  }
385  break;
386  }
387  case 3: {
388  for (size_t i(0); i < Y.SH(0,0).numx(); ++i){
389  for (size_t j(0); j < Y.SH(0,0).numy(); ++j){
390  LaserFields.Ez()(i,j) = vos * IL_xprofile[i] * IL_yprofile[j]
391  * Envelope_Value * Carrier_Signal(tnew-xaxis(i));
392  }
393  }
394  break;
395  }
396  default:
397  break;
398  }*/
399 
400  // Array2D< double > Vos(Y.SH(0,0).numx(),Y.SH(0,0).numy());
401  valarray< double > Vos(0.0,f0.numx());//,Y.SH(0,0).numy());
402 
403  // for (size_t iy(0); iy < Y.SH(0,0).numy(); ++iy){
404  for (size_t ix(0); ix < f0.numx(); ++ix){
405  Vos[ix] = vos * sqrt(IL_xprofile[ix]);// * IL_yprofile[iy]);
406  }
407  // }
408 
409 // Initialization
410  rk4_ib.tout() = tnew;
411  rk4_ib.numh() = static_cast<size_t>(static_cast<int>((tnew-t)/(Input::List().smaller_dt)))+1;
412  rk4_ib.th() = (tnew-t)/static_cast<double>(rk4_ib.numh());
413 
414 
415  // for (size_t iy(0); iy < szy-2*Nbc; ++iy){
416  for (size_t ix(0); ix < szx-2*Nbc; ++ix){
417 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
418  // Copy data for a specific location in space to valarray
419  for (size_t ip(0); ip < fc.size(); ++ip){
420  // fc[ip] = (Y.SH(0,0)(ip,ix+Nbc,iy+Nbc)).real();
421  fc[ip] = f0(ip,ix+Nbc).real();
422  }
423  double I2_before(0.0);
424  for (int n(1); n < U2.size(); ++n) {
425  I2_before+= U2[n]*fc[n]+U2m1[n]*fc[n-1];
426  }
427 
428  // Time loop: Update the valarray
429  rk4_ib.time() = t;
430  for (size_t h_step(0); h_step < rk4_ib.numh(); ++h_step){
431  rk4_ib.advance(Vos[ix+Nbc], Zarray[ix+Nbc]);//,iy+Nbc));
432  /*debug*/ // cout << "Vos("<<ix<<","<<iy<<") = "<< Vos(ix+Nbc,iy+Nbc) << "\n";
433  }
434  double I2_after(0.0);
435  for (int n(1); n < U2.size(); ++n) {
436  I2_after += U2[n]*fc[n]+U2m1[n]*fc[n-1];
437  }
438  fc *= I2_before/I2_after;
439  // Return updated data to the harmonic
440  for (int ip(0); ip < fc.size(); ++ip){
441  // Y.SH(0,0)(ip,ix+Nbc,iy+Nbc) = fc[ip];
442  f0(ip,ix+Nbc) = fc[ip];
443  }
444 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
445  }
446  // }
447  t = tnew;
448 
449 }
valarray< double > fc
Definition: laser.h:127
const double vos
Definition: laser.h:154
double smaller_dt
Definition: input.h:77
double & time()
Definition: laser.cpp:239
double & tout()
Definition: laser.cpp:230
RK4_IB & advance(const double vosc, const double Zval)
Definition: laser.cpp:247
valarray< double > U2
Definition: laser.h:111
size_t numx() const
Definition: state.h:72
double & th()
Definition: laser.cpp:236
Input_List & List()
Definition: input.cpp:1585
valarray< double > U2m1
Definition: laser.h:111
size_t & numh()
Definition: laser.cpp:233
valarray< double > IL_xprofile
Definition: laser.h:147
Here is the call graph for this function:

Field Documentation

◆ fc

valarray<double> InverseBremsstrahlung::fc
private

Definition at line 127 of file laser.h.

Referenced by loop().

◆ IL_xprofile

valarray<double> InverseBremsstrahlung::IL_xprofile
private

Definition at line 147 of file laser.h.

Referenced by InverseBremsstrahlung(), and loop().

◆ InvBremsstrahlung

int InverseBremsstrahlung::InvBremsstrahlung
private

Definition at line 136 of file laser.h.

Referenced by IBSOURCE(), and InverseBremsstrahlung().

◆ Nbc

int InverseBremsstrahlung::Nbc
private

Definition at line 139 of file laser.h.

Referenced by InverseBremsstrahlung(), and loop().

◆ omega_0

const double InverseBremsstrahlung::omega_0
private

Definition at line 154 of file laser.h.

◆ omega_p

const double InverseBremsstrahlung::omega_p
private

Definition at line 154 of file laser.h.

◆ rk4_ib

RK4_IB InverseBremsstrahlung::rk4_ib
private

Definition at line 131 of file laser.h.

Referenced by loop().

◆ szx

int InverseBremsstrahlung::szx
private

Definition at line 139 of file laser.h.

Referenced by InverseBremsstrahlung(), and loop().

◆ szy

int InverseBremsstrahlung::szy
private

Definition at line 139 of file laser.h.

◆ t

double InverseBremsstrahlung::t
private

Definition at line 124 of file laser.h.

Referenced by loop().

◆ tout

double InverseBremsstrahlung::tout
private

Definition at line 124 of file laser.h.

◆ U2

valarray<double> InverseBremsstrahlung::U2

Definition at line 111 of file laser.h.

Referenced by InverseBremsstrahlung(), and loop().

◆ U2m1

valarray<double> InverseBremsstrahlung::U2m1

Definition at line 111 of file laser.h.

Referenced by InverseBremsstrahlung(), and loop().

◆ vos

const double InverseBremsstrahlung::vos
private

Definition at line 154 of file laser.h.

Referenced by loop().

◆ vr

valarray<double> InverseBremsstrahlung::vr
private

Definition at line 133 of file laser.h.

Referenced by InverseBremsstrahlung().

◆ w0overwp

const double InverseBremsstrahlung::w0overwp
private

Definition at line 154 of file laser.h.


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