From 2f764c481224f4063f7b40ec3a82fa422c70700e Mon Sep 17 00:00:00 2001 From: Christian Date: Mon, 6 May 2019 13:14:03 +0200 Subject: [PATCH] Reworked Logging class. Added Populations for individual Species. --- src/mc_electron/find_species.h | 50 +++ src/mc_electron/interaction_processor.cpp | 27 -- src/mc_electron/interaction_processor.hpp | 10 +- src/mc_electron/katrin.cpp | 7 - src/mc_electron/katrin.hpp | 41 --- src/mc_electron/katrin_fields.cpp | 9 + src/mc_electron/katrin_fields.hpp | 34 ++ src/mc_electron/katrin_geo.cpp | 64 ++++ src/mc_electron/katrin_geo.hpp | 41 +++ src/mc_electron/katrin_population_builder.cpp | 36 ++ src/mc_electron/katrin_population_builder.hpp | 40 +++ src/mc_electron/logger.cpp | 318 ------------------ src/mc_electron/logger.hpp | 150 --------- src/mc_electron/particle.hpp | 2 +- src/mc_electron/read_system.h | 40 +++ src/mc_electron/tritium_population.cpp | 28 ++ src/mc_electron/tritium_population.hpp | 35 ++ 17 files changed, 385 insertions(+), 547 deletions(-) create mode 100644 src/mc_electron/find_species.h create mode 100644 src/mc_electron/katrin_fields.cpp create mode 100644 src/mc_electron/katrin_fields.hpp create mode 100644 src/mc_electron/katrin_geo.cpp create mode 100644 src/mc_electron/katrin_geo.hpp create mode 100644 src/mc_electron/katrin_population_builder.cpp create mode 100644 src/mc_electron/katrin_population_builder.hpp delete mode 100644 src/mc_electron/logger.cpp delete mode 100644 src/mc_electron/logger.hpp create mode 100644 src/mc_electron/tritium_population.cpp create mode 100644 src/mc_electron/tritium_population.hpp diff --git a/src/mc_electron/find_species.h b/src/mc_electron/find_species.h new file mode 100644 index 0000000..aa76629 --- /dev/null +++ b/src/mc_electron/find_species.h @@ -0,0 +1,50 @@ +// +// find_species.h +// mc_electron +// +// Created by Christian Reiling on 03.05.19. +// Copyright © 2019 Christian Reiling. All rights reserved. +// + +#ifndef find_species_h +#define find_species_h + +#include +#include "particle.hpp" + + +template +inline typename std::vector::iterator find_SpeciesItr(std::vector Vec, species Species) { + typename std::vector::iterator Itr; + if (Vec.size() == 0) { + Itr = Vec.end(); + } else { + Itr = Vec.begin(); + while (Itr != Vec.end() ) { + if ((*Itr)->get_Species() == Species) { + break; + } + Itr++; + } + } + return (Itr); +} + +template +inline typename std::vector::const_iterator find_SpeciesConstItr(const std::vector Vec, species Species) { + typename std::vector::const_iterator Itr; + if (Vec.size() == 0) { + Itr = Vec.end(); + } else { + Itr = Vec.cbegin(); + while (Itr != Vec.cend() ) { + if ( (*Itr)->get_Species() == Species) { + break; + } + Itr++; + } + } + return (Itr); + } + +#endif /* find_species_h */ diff --git a/src/mc_electron/interaction_processor.cpp b/src/mc_electron/interaction_processor.cpp index 0f289f7..d03625f 100644 --- a/src/mc_electron/interaction_processor.cpp +++ b/src/mc_electron/interaction_processor.cpp @@ -45,31 +45,4 @@ void InteractionProcessor::add_ParticleInteraction(class ParticleInteractions* p ParticleInteractions.push_back(particleInteraction); } -ParticleInteractionsVec::const_iterator InteractionProcessor::find_ParticleInteraction (species findSpec) const { - ParticleInteractionsVec::const_iterator Itr; - if (empty()) { - Itr = ParticleInteractions.cend(); - } else { - Itr = ParticleInteractions.cbegin(); - while (Itr != ParticleInteractions.end()) { - if ((*Itr)->get_Species() == findSpec) { - break; - } - Itr++; - } - } - return (Itr); -} -ParticleInteractionsVec::iterator InteractionProcessor::find_ParticleInteraction (species findSpec) { - ParticleInteractionsVec::iterator Itr; - if (empty()) { - Itr = ParticleInteractions.end(); - } else { - Itr = ParticleInteractions.begin(); - while (Itr != ParticleInteractions.end() || (*Itr)->get_Species() == findSpec) { - Itr++; - } - } - return (Itr); -} diff --git a/src/mc_electron/interaction_processor.hpp b/src/mc_electron/interaction_processor.hpp index 38170ca..1535db9 100644 --- a/src/mc_electron/interaction_processor.hpp +++ b/src/mc_electron/interaction_processor.hpp @@ -10,7 +10,7 @@ #define interaction_processor_hpp #include "interaction_species.hpp" - +#include "find_species.h" typedef std::vector ParticleInteractionsVec; @@ -32,8 +32,12 @@ public: bool empty() const {return (ParticleInteractions.size()==0 ? true : false);} private: - ParticleInteractionsVec::const_iterator find_ParticleInteraction (species findSpec) const; - ParticleInteractionsVec::iterator find_ParticleInteraction (species findSpec); + ParticleInteractionsVec::const_iterator find_ParticleInteraction (species findSpec) const { + return (find_SpeciesConstItr(ParticleInteractions, findSpec)); + }; + ParticleInteractionsVec::iterator find_ParticleInteraction (species findSpec) { + return (find_SpeciesItr(ParticleInteractions, findSpec)); + }; }; #endif /* interaction_processor_hpp */ diff --git a/src/mc_electron/katrin.cpp b/src/mc_electron/katrin.cpp index 37eebf6..5c1b403 100644 --- a/src/mc_electron/katrin.cpp +++ b/src/mc_electron/katrin.cpp @@ -9,18 +9,11 @@ #include "katrin.hpp" - - #include "sstream" using namespace std; -const double Katrin::rearwallZ_m = getParameter("rearwallZ_m"); -const double Katrin::wgtsStartZ_m = getParameter("wgtsStartZ_m"); -const double Katrin::wgtsEndZ_m = getParameter("wgtsEndZ_m"); -const double Katrin::wgtsRadius_m = getParameter("wgtsRadius_m"); - const double Katrin::wgtsMagField_T = getParameter("wgtsMagField_T"); const double Katrin::wgtsT2MaxDensity_m3 = getParameter("wgtsT2MaxDensity_m3"); diff --git a/src/mc_electron/katrin.hpp b/src/mc_electron/katrin.hpp index 9db3872..0df70d5 100644 --- a/src/mc_electron/katrin.hpp +++ b/src/mc_electron/katrin.hpp @@ -27,47 +27,6 @@ public: private: void check_Properties(); - // Geometrics -public: - double get_z_RW_m() const {return(rearwallZ_m);}; - double get_z_WGTSstart_m() const {return(wgtsStartZ_m);}; - double get_z_WGTSend_m() const {return(wgtsEndZ_m);}; - double get_radius_m() const {return(wgtsRadius_m);}; - - bool outside(vec3 loc_m) const; -private: - double wgtsLength_m() const {return (get_z_WGTSend_m() - get_z_WGTSstart_m());}; - - static const double rearwallZ_m; - static const double wgtsStartZ_m; - static const double wgtsEndZ_m; - static const double wgtsRadius_m; - - - // EM-Fields -public: - vec3 getMagField_T(vec3 loc_m) const { return (vec3(0,0,wgtsMagField_T)); }; - vec3 getElField_Vm(vec3 loc_m) const {return (vec3(0,0,0));}; -private: - static const double wgtsMagField_T; - - - //Particle Densities -public: - double getTritiumDensity_m3(vec3 loc_m); - - // Maxwell Boltzmann Part -public: - vec3 roll_totEqSpeed_ms(vec3 loc_m); - vec3 get_flowEqSpeed_ms(vec3 loc_m); - vec3 roll_thermEqSpeed_ms(vec3 loc_m); -private: - static const double wgtsT2MaxDensity_m3; - static const double wgtsTemp_K; - static const double wgtsT2FlowSpeed_ms; - - - //Skalar_WGTS_Container Ion_Container = Skalar_WGTS_Container(0, wgtsLength_m, wgtsRadius_m, vec3(10,10,12)); }; diff --git a/src/mc_electron/katrin_fields.cpp b/src/mc_electron/katrin_fields.cpp new file mode 100644 index 0000000..34605cb --- /dev/null +++ b/src/mc_electron/katrin_fields.cpp @@ -0,0 +1,9 @@ +// +// katrin_fields.cpp +// mc_electron +// +// Created by Christian Reiling on 03.05.19. +// Copyright © 2019 Christian Reiling. All rights reserved. +// + +#include "katrin_fields.hpp" diff --git a/src/mc_electron/katrin_fields.hpp b/src/mc_electron/katrin_fields.hpp new file mode 100644 index 0000000..2dec81e --- /dev/null +++ b/src/mc_electron/katrin_fields.hpp @@ -0,0 +1,34 @@ +// +// katrin_fields.hpp +// mc_electron +// +// Created by Christian Reiling on 03.05.19. +// Copyright © 2019 Christian Reiling. All rights reserved. +// + +#ifndef katrin_fields_hpp +#define katrin_fields_hpp + +#include "katrin_geo.hpp" + + +class Katrin_Fields { + static const double wgtsMagField_T; + + Katrin_Geo *Kat_Geo; +public: + Katrin_Fields() {}; + + vec3 getMagField_T(vec3 loc_m) const { + Kat_Geo->check_inKatrin(loc_m); + return (vec3(0,0,wgtsMagField_T)); + } + vec3 getElField_Vm(vec3 loc_m) const { + Kat_Geo->check_inKatrin(loc_m); + return (vec3(0,0,0)); + } + +private: + +}; +#endif /* katrin_fields_hpp */ diff --git a/src/mc_electron/katrin_geo.cpp b/src/mc_electron/katrin_geo.cpp new file mode 100644 index 0000000..30843d3 --- /dev/null +++ b/src/mc_electron/katrin_geo.cpp @@ -0,0 +1,64 @@ +// +// katrin_geo.cpp +// mc_electron +// +// Created by Christian Reiling on 03.05.19. +// Copyright © 2019 Christian Reiling. All rights reserved. +// + +#include + +#include "error_types.h" +#include "katrin_geo.hpp" +#include "read_system.h" + + +const double Katrin_Geo::rearwallZ_m = getParameter("rearwallZ_m"); +const double Katrin_Geo::wgtsStartZ_m = getParameter("wgtsStartZ_m"); +const double Katrin_Geo::wgtsEndZ_m = getParameter("wgtsEndZ_m"); +const double Katrin_Geo::wgtsRadius_m = getParameter("wgtsRadius_m"); + +using namespace std; + +void Katrin_Geo::check_inWGTS(vec3 loc_m) { + if (inWGTS(loc_m)) { + stringstream ss; + ss<<"Katrin_Geo::check_inWGTS: Location not within WGTS\nLocation:\t"< wgtsEndZ_m) { + return (false); + } else if (r_m > wgtsRadius_m) { + return (false); + } else { + return (true); + } +} + +bool Katrin_Geo::inKatrin(vec3 loc_m) { + double z_m = loc_m[2]; + double r_m = sqrt(loc_m[0]*loc_m[0] + loc_m[1]*loc_m[1]); + if (z_m < rearwallZ_m) { + return (false); + } else if (z_m > wgtsEndZ_m) { + return (false); + } else if (r_m > wgtsRadius_m) { + return (false); + } else { + return (true); + } +} diff --git a/src/mc_electron/katrin_geo.hpp b/src/mc_electron/katrin_geo.hpp new file mode 100644 index 0000000..d1e3edb --- /dev/null +++ b/src/mc_electron/katrin_geo.hpp @@ -0,0 +1,41 @@ +// +// katrin_geo.hpp +// mc_electron +// +// Created by Christian Reiling on 03.05.19. +// Copyright © 2019 Christian Reiling. All rights reserved. +// + +#ifndef katrin_geo_hpp +#define katrin_geo_hpp + +#include + +typedef blitz::TinyVector vec3; + +class Katrin_Geo { + static const double rearwallZ_m; + static const double wgtsStartZ_m; + static const double wgtsEndZ_m; + static const double wgtsRadius_m; + +public: + Katrin_Geo() {}; + + static double get_z_RW_m() {return(rearwallZ_m);}; + static double get_z_WGTSstart_m() {return(wgtsStartZ_m);}; + static double get_z_WGTSend_m() {return(wgtsEndZ_m);}; + static double get_radius_m() {return(wgtsRadius_m);}; + + static void check_inWGTS(vec3 loc_m); + static void check_inKatrin(vec3 loc_m); + + static bool inWGTS(vec3 loc_m); + static bool inKatrin(vec3 loc_m); + +private: + static double wgtsLength_m() {return (get_z_WGTSend_m() - get_z_WGTSstart_m());}; +}; + + +#endif /* katrin_geo_hpp */ diff --git a/src/mc_electron/katrin_population_builder.cpp b/src/mc_electron/katrin_population_builder.cpp new file mode 100644 index 0000000..ea03382 --- /dev/null +++ b/src/mc_electron/katrin_population_builder.cpp @@ -0,0 +1,36 @@ +// +// katrin_population_builder.cpp +// mc_electron +// +// Created by Christian Reiling on 06.05.19. +// Copyright © 2019 Christian Reiling. All rights reserved. +// + +#include "katrin_population_builder.hpp" + + +const int InteractionBuilder::eT2elastic = getParameter("eT2elastic"); +const int InteractionBuilder::eT2ionization = getParameter("eT2ionization"); + +InteractionProcessor InteractionBuilder::build_InteractionProcessor() { + InteractionProcessor InterProcessor(Kat,rngUni,rngNormal); + InterProcessor.add_ParticleInteraction(build_eInteractions()); + return(InterProcessor); +} + +ParticleInteractions* InteractionBuilder::build_eInteractions() { + ParticleInteractions* eInteractions = new ParticleInteractions(Kat, rngUni, rngNormal, electron); + if (eT2elastic == 1) { + eInteractions->add_Interaction(new e_T2_elasticScattering(Kat, rngUni, rngNormal)); + } + if (eT2ionization == 1) { + eInteractions->add_Interaction(new e_T2_ionization(Kat, rngUni, rngNormal)); + } + return(eInteractions); +} + +/* + ParticleInteractions InteractionBuilder::build_T2Interactions() { + + } + */ diff --git a/src/mc_electron/katrin_population_builder.hpp b/src/mc_electron/katrin_population_builder.hpp new file mode 100644 index 0000000..ed103e8 --- /dev/null +++ b/src/mc_electron/katrin_population_builder.hpp @@ -0,0 +1,40 @@ +// +// katrin_population_builder.hpp +// mc_electron +// +// Created by Christian Reiling on 06.05.19. +// Copyright © 2019 Christian Reiling. All rights reserved. +// + +#ifndef katrin_population_builder_hpp +#define katrin_population_builder_hpp + +#include + + +class Katrin_Populations_Builder { + +}; + + +class InteractionBuilder : public RNG_Base { + Katrin *Kat; + + static const int eT2ionization; + static const int eT2elastic; + +public: + InteractionBuilder(Katrin *Kat, UniRNG *rngUni, NormalRNG *rngNormal) : RNG_Base(rngUni, rngNormal) { + this->Kat = Kat; + } + InteractionProcessor build_InteractionProcessor(); + + +private: + ParticleInteractions* build_eInteractions(); + //ParticleInteractions* build_T2Interactions(); + +}; + + +#endif /* katrin_population_builder_hpp */ diff --git a/src/mc_electron/logger.cpp b/src/mc_electron/logger.cpp deleted file mode 100644 index f4a46c9..0000000 --- a/src/mc_electron/logger.cpp +++ /dev/null @@ -1,318 +0,0 @@ -// -// logger.cpp -// mc_electron -// -// Created by Christian Reiling on 27.02.19. -// Copyright © 2019 Christian Reiling. All rights reserved. -// - -#include "logger.hpp" - -#include "hdf5.h" -#include "hdf5_hl.h" -#include - -#include -#include - -using namespace std; - - -const int Base_Logger::numberZBins = getParameter("numberZBins"); - -// Base_Logger -Base_Logger::Base_Logger(Katrin *Kat) { - this->Kat = Kat; - if (numberZBins == 0) { - cout<<"Logging turned off."<get_z_WGTSend_m()<get_z_WGTSend_m()); - } else { - double z_m; - double length_m = Kat->get_z_WGTSend_m() - Kat->get_z_RW_m(); - double stepLength_m = length_m/(numberZBins-1); - for (int i = 0;iget_z_RW_m() + stepLength_m*i; - zLogValues.push_back(z_m); - } - cout<<"Logging "< oldLoc_m) { - if (!logging) { - return; - } - if (logPart->get_Species() != electron) { - return; - } - - // Assumption: no change of sign in v_z - if (numberZBins == -1) { - outStream[0]<<*logPart<get_Location_m()[2]; - double zmin = min(zold,znew); - double zmax = max(zold,znew); - - for (int i=0;i=zmin && zLogValues[i]<=zmax) { - outStream[i]<<*logPart<=zmin && zLogValues[i]<=zmax) { - H5TBappend_records(particle_zH5G[i], speciesIdentifier.c_str(), 1, size, offset, sizes, &logParticle_buffer ); // Location wrong, because it s the new Location. - } - } - } - return; -} - -void ParticleLogger::check_Species(const Particle &logPart) { - if (logPart.get_Species() != Species) { - stringstream ss; - ss<<"ParticleLogger::check_Species: Wrong Species\nExpected:\t"<get_Species()<<"\n"; - throw MyException (ss.str()); - } - ParticleLoggers.push_back(addParticleLogger); -} - -ParticleLoggerVec::iterator H5_Logger::find_ParticleLogger (species findSpec) { - if (ParticleLoggers.size() == 0) { - return (ParticleLoggers.end()); - } - ParticleLoggerVec::iterator Itr; - Itr = ParticleLoggers.begin(); - while (Itr != ParticleLoggers.end()) { - if ((*Itr)->get_Species() == findSpec ) { - return (Itr); - } - Itr++; - } - return (Itr); -} - -void H5_Logger::log_Particle(const Particle &logPart, vec3 oldLoc_m) { - ParticleLoggerVec::iterator Itr; - Itr = find_ParticleLogger(logPart.get_Species()); - if (Itr!= ParticleLoggers.end()) { - (*Itr)->log_Particle(logPart, oldLoc_m); - } -} diff --git a/src/mc_electron/logger.hpp b/src/mc_electron/logger.hpp deleted file mode 100644 index 9e13747..0000000 --- a/src/mc_electron/logger.hpp +++ /dev/null @@ -1,150 +0,0 @@ -// -// logger.hpp -// mc_electron -// -// Created by Christian Reiling on 27.02.19. -// Copyright © 2019 Christian Reiling. All rights reserved. -// - -#ifndef logger_hpp -#define logger_hpp - -#include "particle.hpp" -#include "katrin.hpp" - -#include "hdf5.h" - -typedef struct logParticle { - unsigned int Id; - unsigned int parentId; - double x_m; - double y_m; - double z_m; - double vx_ms; - double vy_ms; - double vz_ms; -} logParticle; - - -// Base_Logger: Base_Class for all Logger: Reading Paramter and calculating z-Barrieres. -class Base_Logger { -public: - Base_Logger(Katrin *Kat); - -protected: - static const int numberZBins; - - bool logging; - std::vector zLogValues; - - void set_zLogValues(); - - std::string getparName(); - std::string remove_catEnding (std::string inString); - bool isFile(std::string fileName); - bool isDir(std::string dirPath); - - Katrin *Kat; -}; - - -// ASCI_Logger: Log to ASCI-File. Only Electron Logger. Not very efficient. -class ASCI_Logger : public Base_Logger { -public: - ASCI_Logger(Katrin *Kat); - - void log_Particle(Particle *inPart , vec3 oldLoc_m); -private: - std::string outdirName; - std::ofstream *outStream; - - void set_outdirName(); - void create_outdir(); - void set_outStream(); -}; - - -class ParticleH5TB_Properties { -public: - ParticleH5TB_Properties() {}; -protected: - static const size_t size; - static const char *fieldNames[8]; - static const size_t offset[8]; - static const hid_t fieldTypes[8]; - static const hsize_t chunkSize; - static const size_t sizes[8]; -}; - - -class ParticleLogger : ParticleH5TB_Properties{ -public: - ParticleLogger(species Species, hid_t *particle_zH5G, std::vector zLogValues) { - this->Species = Species; - this->particle_zH5G = particle_zH5G; - this->zLogValues = zLogValues; - numberZBins = zLogValues.size(); - singleFile = (numberZBins == 1) ? true : false; - stringstream ss; - ss< zLogValues; - hid_t *particle_H5TB; - species Species; - - int numberZBins; - bool singleFile; - std::string speciesIdentifier; -public: - void log_Particle(const Particle &logPart, const vec3 &oldLoc_m); -private: - logParticle transformTo_logParticle(const Particle &logPart); -public: - species get_Species() const {return(Species);}; -private: - void check_Species(const Particle &logPart); -}; - - -typedef std::vector ParticleLoggerVec; - -class H5_Logger : private Base_Logger { -public: - H5_Logger(Katrin *Kat) : Base_Logger(Kat) { - create_outH5F(); - create_particleH5G(); - create_particle_zH5G(); - add_ParticleLogger(new ParticleLogger(electron, particle_zH5G,zLogValues)); - }; - -private: - hid_t outH5F; - hid_t particleH5G; - hid_t *particle_zH5G; - - ParticleLoggerVec ParticleLoggers; - -private: - void create_outH5F(); - std::string get_outH5F_fullPath(); - void create_particleH5G(); - void create_particle_zH5G(); - -public: - void add_ParticleLogger(ParticleLogger* addParticleLogger); -private: - ParticleLoggerVec::iterator find_ParticleLogger (species findSpec); - -public: - void log_Particle(const Particle &logPart, vec3 oldLoc_m); -}; - - -#endif /* logger_hpp */ diff --git a/src/mc_electron/particle.hpp b/src/mc_electron/particle.hpp index f49a4aa..92fc3b2 100644 --- a/src/mc_electron/particle.hpp +++ b/src/mc_electron/particle.hpp @@ -17,7 +17,7 @@ #include "blitz/array.h" typedef blitz::TinyVector vec3; -typedef enum species{undef, electron, positron, proton, tritium, tritium2, helium, deuterium, DT}species; +typedef enum species{undef, electron, tritium, tritium2, helium, deuterium, DT}species; std::ostream& operator<<(std::ostream& os, const species& SpecOut); diff --git a/src/mc_electron/read_system.h b/src/mc_electron/read_system.h index 6792c42..357d058 100644 --- a/src/mc_electron/read_system.h +++ b/src/mc_electron/read_system.h @@ -166,4 +166,44 @@ inline std::string getHomebase() { inline std::string getDataPath() { return (getHomebase() + "src/mc_electron/data/"); } + + +inline std::string remove_catEnding (std::string inString) { + if ( inString.substr(inString.size()-4, 4) == ".cat" ){ + return (inString.substr(0, inString.size()-4) ); + } else { + return (inString); + } +} + +inline std::string getparName() { + string parpath = getenv("parpath"); + string parfile = remove_catEnding(getenv("parfile")); + return (parpath + "/" + parfile); +} + +inline bool isFile(std::string fileName) { + struct stat buffer; + return (stat (fileName.c_str(), &buffer) == 0); +} + +inline bool isDir(std::string dirPath) { + struct stat info; + if( stat( dirPath.c_str(), &info ) != 0 ) + return (false); + else if( info.st_mode & S_IFDIR ) // S_ISDIR() doesn't exist on my windows + return (true); + else + return (false); +} + + + + + + + + + + #endif /* read_system_h */ diff --git a/src/mc_electron/tritium_population.cpp b/src/mc_electron/tritium_population.cpp new file mode 100644 index 0000000..eeeb496 --- /dev/null +++ b/src/mc_electron/tritium_population.cpp @@ -0,0 +1,28 @@ +// +// tritium_population.cpp +// mc_electron +// +// Created by Christian Reiling on 06.05.19. +// Copyright © 2019 Christian Reiling. All rights reserved. +// + +#include "tritium_population.hpp" + + + +const double T2_Density::wgtsTemp_K = getParameter("wgtsTemp_K"); +const double T2_Density::wgtsT2MaxDensity_m3 = getParameter("wgtsT2MaxDensity_m3"); +const double T2_Density::wgtsT2FlowSpeed_ms = getParameter("wgtsT2FlowSpeed_ms"); + +double T2_Density::get_Density(vec3 loc_m) const { + Katrin_Geo::check_inKatrin(loc_m); + if (!Katrin_Geo::inWGTS(loc_m)) { + return (0); + } else { + + } +} + +double T2_Density::roll_Energy(vec3 loc_m, UniRNG *rngUni) const { + Katrin_Geo::check_inKatrin(loc_m); +} diff --git a/src/mc_electron/tritium_population.hpp b/src/mc_electron/tritium_population.hpp new file mode 100644 index 0000000..9492b83 --- /dev/null +++ b/src/mc_electron/tritium_population.hpp @@ -0,0 +1,35 @@ +// +// tritium_population.hpp +// mc_electron +// +// Created by Christian Reiling on 06.05.19. +// Copyright © 2019 Christian Reiling. All rights reserved. +// + +#ifndef tritium_population_hpp +#define tritium_population_hpp + +#include "population_base.h" + + +class T2_Density : public Population_Base { + static const double wgtsT2MaxDensity_m3; + static const double wgtsTemp_K; + static const double wgtsT2FlowSpeed_ms; + +public: + T2_Density() : Population_Base(tritium2) {}; + + double get_Density(vec3 loc_m) const ; + double roll_Energy(vec3 loc_m, UniRNG *rngUni) const ; + void up_Denisty(vec3 loc_m, double Ekin_eV) {Katrin_Geo::check_inKatrin(loc_m);}; + + + + + +}; + + + //Skalar_WGTS_Container Ion_Container = Skalar_WGTS_Container(0, wgtsLength_m, wgtsRadius_m, vec3(10,10,12)); +#endif /* tritium_population_hpp */