Version: SMASH-2.0
modusdefault.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright (c) 2013-2020
4  * SMASH Team
5  *
6  * GNU General Public License (GPLv3 or later)
7  *
8  */
9 
10 #ifndef SRC_INCLUDE_SMASH_MODUSDEFAULT_H_
11 #define SRC_INCLUDE_SMASH_MODUSDEFAULT_H_
12 
13 #include <memory>
14 
15 #include "configuration.h"
16 #include "cxx14compat.h"
17 #include "forwarddeclarations.h"
18 #include "fourvector.h"
19 #include "grandcan_thermalizer.h"
20 #include "grid.h"
21 #include "outputinterface.h"
22 #include "potentials.h"
23 
24 namespace smash {
25 
44 class ModusDefault {
45  public:
46  // Never needs a virtual destructor.
47 
48  // Missing functions for concrete Modus implementations:
49  // \todo(JB): Why is the function below commented out?
50  // double initial_conditions(Particles *particles);
51 
60  const OutputsList& /*out_list*/ = {}) {
61  return 0;
62  }
63 
65  int total_N_number() const { return 0; }
67  int proj_N_number() const { return 0; }
69  bool cll_in_nucleus() const { return false; }
71  bool is_collider() const { return false; }
73  bool is_box() const { return false; }
75  bool is_list() const { return false; }
77  double sqrt_s_NN() const { return 0.; }
79  double impact_parameter() const { return 0.0; }
82  double velocity_projectile() const { return 0.0; }
85  double velocity_target() const { return 0.0; }
90  double max_timestep(double) const { return -1.; }
92  double equilibration_time() const { return -1.; }
93 
103  double nuclei_passing_time() const { return 0.0; }
104 
119  const Particles& particles, double min_cell_length,
120  double timestep_duration,
121  CellSizeStrategy strategy = CellSizeStrategy::Optimal) const {
122  return {particles, min_cell_length, timestep_duration, strategy};
123  }
124 
131  std::unique_ptr<GrandCanThermalizer> create_grandcan_thermalizer(
132  Configuration& conf) const {
133  /* Lattice is placed such that the center is 0,0,0.
134  If one wants to have a central cell with center at 0,0,0 then
135  number of cells should be odd (2k+1) in every direction.
136  */
137 
172  const std::array<double, 3> l = conf.take({"Lattice_Sizes"});
173  const std::array<double, 3> origin = {-0.5 * l[0], -0.5 * l[1],
174  -0.5 * l[2]};
175  const bool periodicity = false;
176  return make_unique<GrandCanThermalizer>(conf, l, origin, periodicity);
177  }
178 
183  struct BadInput : public std::invalid_argument {
184  using std::invalid_argument::invalid_argument;
185  };
191  struct InvalidEnergy : public BadInput {
192  using BadInput::BadInput;
193  };
194 };
195 
196 } // namespace smash
197 
198 #endif // SRC_INCLUDE_SMASH_MODUSDEFAULT_H_
smash::ModusDefault::impact_parameter
double impact_parameter() const
Definition: modusdefault.h:79
smash::ModusDefault::impose_boundary_conditions
int impose_boundary_conditions(Particles *, const OutputsList &={})
Enforces sensible positions for the particles.
Definition: modusdefault.h:59
smash
Definition: action.h:24
smash::ModusDefault::equilibration_time
double equilibration_time() const
Definition: modusdefault.h:92
smash::ModusDefault::cll_in_nucleus
bool cll_in_nucleus() const
Definition: modusdefault.h:69
smash::ModusDefault::create_grid
Grid< GridOptions::Normal > create_grid(const Particles &particles, double min_cell_length, double timestep_duration, CellSizeStrategy strategy=CellSizeStrategy::Optimal) const
Creates the Grid with normal boundary conditions.
Definition: modusdefault.h:118
smash::CellSizeStrategy::Optimal
Look for optimal cell size.
smash::ModusDefault::is_list
bool is_list() const
Definition: modusdefault.h:75
smash::ModusDefault::max_timestep
double max_timestep(double) const
Definition: modusdefault.h:90
smash::ModusDefault::total_N_number
int total_N_number() const
Definition: modusdefault.h:65
smash::ModusDefault::is_box
bool is_box() const
Definition: modusdefault.h:73
cxx14compat.h
FermiMotion::Off
Don't use fermi motion.
grid.h
smash::ModusDefault::velocity_target
double velocity_target() const
Definition: modusdefault.h:85
fourvector.h
smash::CellSizeStrategy
CellSizeStrategy
Indentifies the strategy of determining the cell size.
Definition: grid.h:33
smash::ModusDefault::BadInput
Definition: modusdefault.h:183
grandcan_thermalizer.h
smash::ModusDefault::sqrt_s_NN
double sqrt_s_NN() const
Definition: modusdefault.h:77
smash::Configuration
Interface to the SMASH configuration files.
Definition: configuration.h:464
forwarddeclarations.h
outputinterface.h
smash::Grid
Abstracts a list of cells that partition the particles in the experiment into regions of space that c...
Definition: grid.h:79
smash::ModusDefault::velocity_projectile
double velocity_projectile() const
Definition: modusdefault.h:82
smash::ModusDefault::is_collider
bool is_collider() const
Definition: modusdefault.h:71
smash::ModusDefault
Definition: modusdefault.h:44
smash::Particles
Definition: particles.h:33
configuration.h
smash::Configuration::take
Value take(std::initializer_list< const char * > keys)
The default interface for SMASH to read configuration values.
Definition: configuration.cc:140
smash::ModusDefault::nuclei_passing_time
double nuclei_passing_time() const
Get the passing time of the two nuclei in a collision.
Definition: modusdefault.h:103
smash::ModusDefault::proj_N_number
int proj_N_number() const
Definition: modusdefault.h:67
FermiMotion
FermiMotion
Option to use Fermi Motion.
Definition: forwarddeclarations.h:94
smash::ModusDefault::InvalidEnergy
Definition: modusdefault.h:191
smash::ModusDefault::fermi_motion
FermiMotion fermi_motion() const
Definition: modusdefault.h:88
potentials.h