TGrid Class Reference

Class to handle kinematics variables and the geometry of the galaxy. More...

#include <grid.h>

List of all members.

Public Member Functions

 TGrid ()
 TGrid (double, int, int, double)
vector< double > & GetR ()
vector< double > & GetZ ()
vector< double > & GetEk ()
vector< double > & GetBeta ()
vector< double > & GetGamma ()
vector< double > & GetMomentum ()
vector< double > & GetBetaEl ()
vector< double > & GetGammaEl ()
vector< double > & GetMomentumEl ()
const double GetDeltaR () const
const double GetDeltaZ () const
const double GetDeltaE () const
const int GetDimR () const
const int GetDimZ () const
const int GetDimE () const
int index (int ir, int iz)
 Compute linearized index for 2-D spatial matrices.
int index (int ir, int iz, int ip)
 Compute linearized index for 3-D momentum-spatial matrices.
 ~TGrid ()

Protected Attributes

int dimE
int dimr
int dimz
double zmax
double zmin
double Deltar
double Deltaz
double Ekin_factor
double DeltalogE
vector< double > r
vector< double > z
vector< double > Ek
vector< double > beta
vector< double > gamma
vector< double > momentum
vector< double > betael
vector< double > gammael
vector< double > momentumel

Detailed Description

Class to handle kinematics variables and the geometry of the galaxy.

Author:
Luca Maccione luca.maccione@desy.de

Definition at line 25 of file grid.h.


Constructor & Destructor Documentation

TGrid::TGrid (  )  [inline]

Default constructor.

Definition at line 28 of file grid.h.

TGrid::TGrid ( double  Ekfact,
int  numr,
int  numz,
double  zmax_ 
)

Constructor given some input.

Parameters:
Ekfact Delta E / E.
numr Dimension of the radial grid.
numz Dimension of the vertical grid.
zmax_ Height of the simulation box.

Definition at line 12 of file grid.cc.

References beta, betael, DeltalogE, Deltar, Deltaz, dimE, dimr, dimz, Ek, Ekin_factor, Ekmax, Ekmin, gamma, gammael, MeleGeV, momentum, momentumel, mp, r, Rmax, Rmin, z, zmax, and zmin.

00012                                                             {
00013 
00014   dimr = numr;
00015   dimz = numz;
00016   zmax = zmax_;
00017   zmin = -zmax;
00018   Deltar =(Rmax-Rmin)/(double)(dimr-1);
00019   Deltaz =(zmax-zmin)/(double)(dimz-1);
00020   Ekin_factor = Ekfact;
00021   DeltalogE = log(Ekin_factor);
00022   dimE = int(log(Ekmax/Ekmin)/DeltalogE + 1.9);
00023 
00024   for (int i = 0; i < dimE; ++i) {
00025     if (dimE == 1) Ek.push_back(Ekmin);
00026     else Ek.push_back(exp(log(Ekmin)+(double)i*log(Ekin_factor)));
00027 
00028     gamma.push_back(1.0+Ek.back()/mp);
00029     beta.push_back(sqrt(1.0-1.0/pow(gamma.back(),2)));  
00030     momentum.push_back(gamma.back()*mp*beta.back());
00031 
00032     gammael.push_back(1.0+Ek.back()/MeleGeV);
00033     betael.push_back(sqrt(1.0-1.0/pow(gammael.back(),2)));  
00034     momentumel.push_back(gammael.back()*MeleGeV*betael.back());
00035   }
00036   for (int i = 0; i < dimr; ++i) r.push_back(Rmin + (double)i*Deltar);
00037   for (int i = 0; i < dimz; ++i) z.push_back(zmin + (double)i*Deltaz);
00038 
00039 }

TGrid::~TGrid (  )  [inline]

Destructor.

Definition at line 89 of file grid.h.

References beta, betael, Ek, gamma, gammael, momentum, momentumel, r, and z.


Member Function Documentation

vector<double>& TGrid::GetBeta (  )  [inline]
vector<double>& TGrid::GetBetaEl (  )  [inline]
const double TGrid::GetDeltaE (  )  const [inline]

Returns log_{10}(Delta E/E).

Definition at line 61 of file grid.h.

References DeltalogE.

Referenced by TSpallationNetwork::TSpallationNetwork().

const double TGrid::GetDeltaR (  )  const [inline]
const double TGrid::GetDeltaZ (  )  const [inline]
const int TGrid::GetDimE (  )  const [inline]
const int TGrid::GetDimR (  )  const [inline]

Returns dimr.

Definition at line 64 of file grid.h.

References dimr.

Referenced by TCREvolutor::TCREvolutor(), TCREvolutorADI::TCREvolutorADI(), and TEnergyLoss::TEnergyLoss().

const int TGrid::GetDimZ (  )  const [inline]

Returns dimz.

Definition at line 66 of file grid.h.

References dimz.

Referenced by TCREvolutor::TCREvolutor(), TCREvolutorADI::TCREvolutorADI(), and TEnergyLoss::TEnergyLoss().

vector<double>& TGrid::GetEk (  )  [inline]
vector<double>& TGrid::GetGamma (  )  [inline]

Returns the boost factor grid.

Definition at line 45 of file grid.h.

References gamma.

Referenced by TParticle::ComputeSecondarySource(), TCREvolutorADI::Run(), TCREvolutor::Run(), TCoulombLoss::TCoulombLoss(), and TIonizationLoss::TIonizationLoss().

vector<double>& TGrid::GetGammaEl (  )  [inline]

Returns the boost factor grid for electrons.

Definition at line 52 of file grid.h.

References gammael.

Referenced by TBremsstrahlungLoss::TBremsstrahlungLoss(), TCoulombLoss::TCoulombLoss(), TIonizationLoss::TIonizationLoss(), TISRF::TISRF(), and TSynchrotronLoss::TSynchrotronLoss().

vector<double>& TGrid::GetMomentum (  )  [inline]
vector<double>& TGrid::GetMomentumEl (  )  [inline]

Returns the momentum grid for electrons.

Definition at line 54 of file grid.h.

References momentumel.

Referenced by Galaxy::Galaxy(), TCREvolutorADI::Run(), TCREvolutor::Run(), TDiffusionCoefficient::TDiffusionCoefficient(), and TSpectrum::TSpectrum().

vector<double>& TGrid::GetR (  )  [inline]
vector<double>& TGrid::GetZ (  )  [inline]
int TGrid::index ( int  ir,
int  iz,
int  ip 
) [inline]

Compute linearized index for 3-D momentum-spatial matrices.

Parameters:
ir radial index
iz vertical index
ip momentum index
Returns:
(ir*dimz+iz)*dimE+ip

Definition at line 79 of file grid.h.

References dimE, and dimz.

00079 { return (ir*dimz+iz)*dimE+ip; }

int TGrid::index ( int  ir,
int  iz 
) [inline]

Compute linearized index for 2-D spatial matrices.

Parameters:
ir radial index
iz vertical index
Returns:
ir*dimz+iz

Definition at line 71 of file grid.h.

References dimz.

Referenced by TParticle::ComputeSecondarySource(), TCREvolutorADI::Run(), TCREvolutor::Run(), TBremsstrahlungLoss::TBremsstrahlungLoss(), TCoulombLoss::TCoulombLoss(), and TIonizationLoss::TIonizationLoss().

00071 { return ir*dimz+iz; }


Member Data Documentation

vector<double> TGrid::beta [protected]

Array of points in the beta grid.

Definition at line 117 of file grid.h.

Referenced by GetBeta(), TGrid(), and ~TGrid().

vector<double> TGrid::betael [protected]

Array of points in the beta grid (electrons).

Definition at line 121 of file grid.h.

Referenced by GetBetaEl(), TGrid(), and ~TGrid().

double TGrid::DeltalogE [protected]

Radial grid spacing (logarithmic).

Definition at line 113 of file grid.h.

Referenced by GetDeltaE(), and TGrid().

double TGrid::Deltar [protected]

Radial grid spacing.

Definition at line 110 of file grid.h.

Referenced by GetDeltaR(), and TGrid().

double TGrid::Deltaz [protected]

Vertical grid spacing.

Definition at line 111 of file grid.h.

Referenced by GetDeltaZ(), and TGrid().

int TGrid::dimE [protected]

Dimension of energy grid.

Definition at line 105 of file grid.h.

Referenced by GetDimE(), index(), and TGrid().

int TGrid::dimr [protected]

Dimension of radial grid.

Definition at line 106 of file grid.h.

Referenced by GetDimR(), and TGrid().

int TGrid::dimz [protected]

Dimension of vertical grid.

Definition at line 107 of file grid.h.

Referenced by GetDimZ(), index(), and TGrid().

vector<double> TGrid::Ek [protected]

Array of points in the kinetic energy grid.

Definition at line 116 of file grid.h.

Referenced by GetEk(), TGrid(), and ~TGrid().

double TGrid::Ekin_factor [protected]

Energy grid spacing.

Definition at line 112 of file grid.h.

Referenced by TGrid().

vector<double> TGrid::gamma [protected]

Array of points in the boost grid.

Definition at line 118 of file grid.h.

Referenced by GetGamma(), TGrid(), and ~TGrid().

vector<double> TGrid::gammael [protected]

Array of points in the boost grid (electrons).

Definition at line 122 of file grid.h.

Referenced by GetGammaEl(), TGrid(), and ~TGrid().

vector<double> TGrid::momentum [protected]

Array of points in the momentum grid.

Definition at line 119 of file grid.h.

Referenced by GetMomentum(), TGrid(), and ~TGrid().

vector<double> TGrid::momentumel [protected]

Array of points in the momentum grid (electrons).

Definition at line 123 of file grid.h.

Referenced by GetMomentumEl(), TGrid(), and ~TGrid().

vector<double> TGrid::r [protected]

Array of points in the radial grid.

Definition at line 114 of file grid.h.

Referenced by GetR(), TGrid(), and ~TGrid().

vector<double> TGrid::z [protected]

Array of points in the vertical grid.

Definition at line 115 of file grid.h.

Referenced by GetZ(), TGrid(), and ~TGrid().

double TGrid::zmax [protected]

Vertical upper edge of simulation box.

Definition at line 108 of file grid.h.

Referenced by TGrid().

double TGrid::zmin [protected]

Vertical lower edge of simulation box.

Definition at line 109 of file grid.h.

Referenced by TGrid().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Enumerations Enumerator
Generated on Mon Sep 27 12:59:57 2010 for DRAGON by  doxygen 1.6.3