1#ifndef G_MEDIUM_MAGBOLTZ_9
2#define G_MEDIUM_MAGBOLTZ_9
36 m_useAnisotropic =
true;
40 m_useAnisotropic =
false;
84 double& dx,
double& dy,
double& dz,
int& nion,
85 int& ndxc,
int& band);
87 return m_ionProducts.size();
90 double& energy)
const;
93 return m_dxcProducts.size();
96 int& type,
double& energy)
const;
100 double& ctheta,
int& nsec,
double& esec);
108 int& nAttachment,
int& nInelastic,
110 int& nSuperelastic)
const;
114 bool GetLevel(
const unsigned int i,
int& ngas,
int& type, std::string& descr,
125 int& nInelastic)
const;
127 void RunMagboltz(
const double e,
const double b,
const double btheta,
128 const int ncoll,
bool verbose,
double& vx,
double& vy,
129 double& vz,
double& dl,
double& dt,
130 double& alpha,
double& eta,
double& lor,
131 double& vxerr,
double& vyerr,
double& vzerr,
132 double& dlerr,
double& dterr,
133 double& alphaerr,
double& etaerr,
double& lorerr,
138 const bool verbose =
true);
150 static const int nEnergySteps = 20000;
151 static const int nEnergyStepsLog = 200;
152 static const int nEnergyStepsGamma = 5000;
153 static const int nMaxInelasticTerms = 250;
154 static const int nMaxLevels = 512;
155 static const int nCsTypes = 6;
156 static const int nCsTypesGamma = 4;
158 static const int DxcTypeRad;
159 static const int DxcTypeCollIon;
160 static const int DxcTypeCollNonIon;
163 double m_eFinal, m_eStep;
164 double m_eHigh, m_eHighLog;
166 bool m_useAutoAdjust;
171 unsigned int m_nTerms;
175 double m_wOpalBeaty[nMaxLevels];
184 double m_energyLoss[nMaxLevels];
186 int m_csType[nMaxLevels];
188 bool m_useAnisotropic;
189 double m_scatParameter[nEnergySteps][nMaxLevels];
190 double m_scatParameterLog[nEnergyStepsLog][nMaxLevels];
191 int m_scatModel[nMaxLevels];
192 double m_scatCut[nEnergySteps][nMaxLevels];
193 double m_scatCutLog[nEnergyStepsLog][nMaxLevels];
196 char m_description[nMaxLevels][50];
199 double m_cfTot[nEnergySteps];
200 double m_cfTotLog[nEnergyStepsLog];
204 double m_cf[nEnergySteps][nMaxLevels];
205 double m_cfLog[nEnergyStepsLog][nMaxLevels];
214 unsigned int m_nCollisions[nCsTypes];
216 std::vector<unsigned int> m_nCollisionsDetailed;
220 double m_rPenning[nMaxLevels];
222 double m_lambdaPenning[nMaxLevels];
224 unsigned int m_nPenning;
228 bool m_useDeexcitation;
233 struct deexcitation {
245 std::vector<double> p;
247 std::vector<int>
final;
249 std::vector<int> type;
263 std::vector<deexcitation> m_deexcitations;
265 int m_iDeexcitation[nMaxLevels];
272 std::vector<ionProd> m_ionProducts;
275 int nDeexcitationProducts;
286 std::vector<dxcProd> m_dxcProducts;
297 bool m_useGreenSawada;
300 double m_eFinalGamma, m_eStepGamma;
304 std::vector<double> m_cfTotGamma;
306 std::vector<std::vector<double> > m_cfGamma;
307 std::vector<int> csTypeGamma;
313 int m_nPhotonCollisions[nCsTypesGamma];
315 bool GetGasNumberMagboltz(
const std::string& input,
int& number)
const;
316 bool Mixer(
const bool verbose =
false);
317 void SetupGreenSawada();
318 void ComputeAngularCut(
const double parIn,
double& cut,
double& parOut)
const;
319 void ComputeDeexcitationTable(
const bool verbose);
320 void ComputeDeexcitationInternal(
int iLevel,
int& fLevel);
321 bool ComputePhotonCollisionTable(
const bool verbose);
Base class for gas media.
static const unsigned int m_nMaxGases
void SetSplittingFunctionGreenSawada()
int GetNumberOfPhotonCollisions() const
void SetExcitationScalingFactor(const double r, std::string gasname)
bool GetLevel(const unsigned int i, int &ngas, int &type, std::string &descr, double &e)
virtual ~MediumMagboltz()
void ResetCollisionCounters()
void EnableRadiationTrapping()
unsigned int GetNumberOfElectronCollisions() const
bool GetIonisationProduct(const unsigned int i, int &type, double &energy) const
void EnablePenningTransfer(const double r, const double lambda)
void ComputeDeexcitation(int iLevel, int &fLevel)
void SetSplittingFunctionOpalBeaty()
void EnableCrossSectionOutput()
unsigned int GetNumberOfDeexcitationProducts() const
void GenerateGasTable(const int numCollisions=10, const bool verbose=true)
double GetMaxElectronEnergy() const
void DisableCrossSectionOutput()
void SetSplittingFunctionFlat()
void RunMagboltz(const double e, const double b, const double btheta, const int ncoll, bool verbose, double &vx, double &vy, double &vz, double &dl, double &dt, double &alpha, double &eta, double &lor, double &vxerr, double &vyerr, double &vzerr, double &dlerr, double &dterr, double &alphaerr, double &etaerr, double &lorerr, double &alphatof)
double GetMaxPhotonEnergy() const
bool SetMaxPhotonEnergy(const double e)
bool GetElectronCollision(const double e, int &type, int &level, double &e1, double &dx, double &dy, double &dz, int &nion, int &ndxc, int &band)
unsigned int GetNumberOfIonisationProducts() const
void DisableDeexcitation()
void DisableAnisotropicScattering()
void DisableRadiationTrapping()
double GetElectronNullCollisionRate(const int band)
int GetNumberOfPenningTransfers() const
bool Initialise(const bool verbose=false)
bool GetDeexcitationProduct(const unsigned int i, double &t, double &s, int &type, double &energy) const
double GetPhotonCollisionRate(const double e)
void EnableEnergyRangeAdjustment()
bool SetMaxElectronEnergy(const double e)
void DisableEnergyRangeAdjustment()
double GetElectronCollisionRate(const double e, const int band)
void EnableDeexcitation()
void EnableAnisotropicScattering()
void DisablePenningTransfer()
bool GetPhotonCollision(const double e, int &type, int &level, double &e1, double &ctheta, int &nsec, double &esec)