Version: SMASH-1.7
customnucleus.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014-2019
3  * SMASH Team
4  *
5  * GNU General Public License (GPLv3 or later)
6  */
7 #ifndef SRC_INCLUDE_CUSTOMNUCLEUS_H_
8 #define SRC_INCLUDE_CUSTOMNUCLEUS_H_
9 
10 #include <fstream>
11 #include <map>
12 #include <vector>
13 
14 #include "nucleus.h"
15 #include "pdgcode.h"
16 #include "threevector.h"
17 namespace smash {
18 
22 struct Nucleoncustom {
24  double x;
26  double y;
28  double z;
32  bool isospin;
33 };
34 
39 class CustomNucleus : public Nucleus {
40  public:
52  CustomNucleus(Configuration& config, int testparticles, bool same_file);
59  void fill_from_list(const std::vector<Nucleoncustom>& vec);
61  ThreeVector distribute_nucleon() override;
63  void arrange_nucleons() override;
72  std::vector<Nucleoncustom> readfile(std::ifstream& infile,
73  int particle_number) const;
79  std::string file_path(const std::string& file_directory,
80  const std::string& file_name);
86  void generate_fermi_momenta() override;
93  int number_of_nucleons_ = 0;
95  std::vector<Nucleoncustom> custom_nucleus_;
97  size_t index = 0;
98 
99  private:
104  /*
105  * The unique_ptr is only required to work around a bug in GCC 4.8, because it
106  * seems to be trying to use the non-existing copy-constructor of
107  * `std::ifstream`. Newer compilers don't require this unneccessary
108  * indirection.
109  */
110  static std::unique_ptr<std::ifstream> filestream_shared_;
115  std::unique_ptr<std::ifstream> filestream_;
117  std::unique_ptr<std::ifstream>* used_filestream_;
118 };
119 
120 } // namespace smash
121 
122 #endif // SRC_INCLUDE_CUSTOMNUCLEUS_H_
double x
x-coordinate
Definition: customnucleus.h:24
The ThreeVector class represents a physical three-vector with the components .
Definition: threevector.h:31
double y
y-coordinate
Definition: customnucleus.h:26
bool isospin
to differentiate between protons isospin=1 and neutrons isospin=0
Definition: customnucleus.h:32
std::vector< Nucleoncustom > custom_nucleus_
Vector contianing Data for one nucleus given in the particlelist.
Definition: customnucleus.h:95
A nucleus is a collection of particles that are initialized, before the beginning of the simulation a...
Definition: nucleus.h:27
std::unique_ptr< std::ifstream > filestream_
Filestream variable used if projectile and target are read in from different files and they therefore...
Interface to the SMASH configuration files.
Inheriting from Nucleus-Class using modified Nucleon configurations.
Definition: customnucleus.h:39
Contains data for one nucleon that is read in from the list.
Definition: customnucleus.h:22
static std::unique_ptr< std::ifstream > filestream_shared_
Filestream variable used if projectile and target are read in from the same file and they use the sam...
bool spinprojection
spinprojection of the nucleon
Definition: customnucleus.h:30
std::unique_ptr< std::ifstream > * used_filestream_
Pointer to the used filestream pointer.
Definition: action.h:24
double z
z-coordinate
Definition: customnucleus.h:28