Version: SMASH-3.1
smash::ModusDefault Class Reference

#include <modusdefault.h>

Base class for Modus classes that provides default function implementations.

This is only a base class for actual Modus classes. Meaning there will never be objects, references, or pointers to ModusDefault. Therefore, it does not have - and will never need any virtual functions.

The rules for adding functions to this class are as follows:

  • This class is empty per default.
  • You can add a function if you have a function that is different in at least one subclass.
  • Code that is common to all goes into ExperimentImplementation.

    Todo:
    JB: many of these functions could/should be virtual (contradicts description given above, Vinzent says (in a nice way): does not make any sense whatsoever anyway)

Definition at line 43 of file modusdefault.h.

Inheritance diagram for smash::ModusDefault:
smash::BoxModus smash::ColliderModus smash::ListModus smash::SphereModus smash::ListBoxModus

Classes

struct  BadInput
 BadInput is an error to throw if the configuration options are invalid. More...
 
struct  InvalidEnergy
 Thrown when the requested energy is smaller than the masses of two particles. More...
 

Public Member Functions

int impose_boundary_conditions (Particles *, const OutputsList &={})
 Enforces sensible positions for the particles. More...
 
bool is_collider () const
 
bool is_box () const
 
bool is_list () const
 
bool is_sphere () const
 
double sqrt_s_NN () const
 
double impact_parameter () const
 
void sample_impact () const
 sample impact parameter for collider modus More...
 
double velocity_projectile () const
 
double velocity_target () const
 
FermiMotion fermi_motion () const
 
double max_timestep (double) const
 
double equilibration_time () const
 
double length () const
 
double radius () const
 
bool calculation_frame_is_fixed_target () const
 
double nuclei_passing_time () const
 Get the passing time of the two nuclei in a collision. More...
 
Grid< GridOptions::Normalcreate_grid (const Particles &particles, double min_cell_length, double timestep_duration, CollisionCriterion crit, const bool include_unformed_particles, CellSizeStrategy strategy=CellSizeStrategy::Optimal) const
 Creates the Grid with normal boundary conditions. More...
 
std::unique_ptr< GrandCanThermalizercreate_grandcan_thermalizer (Configuration &conf) const
 Creates GrandCanThermalizer. More...
 

Member Function Documentation

◆ impose_boundary_conditions()

int smash::ModusDefault::impose_boundary_conditions ( Particles ,
const OutputsList &  = {} 
)
inline

Enforces sensible positions for the particles.

Currently, this is only needed for BoxModus; the other Modi do nothing.

See also
BoxModus::impose_boundary_conditions

Definition at line 58 of file modusdefault.h.

59  {}) {
60  return 0;
61  }

◆ is_collider()

bool smash::ModusDefault::is_collider ( ) const
inline
Returns
Checks if modus is collider; overwritten in ColliderModus

Definition at line 64 of file modusdefault.h.

64 { return false; }

◆ is_box()

bool smash::ModusDefault::is_box ( ) const
inline
Returns
Checks if modus is a box; overwritten in BoxModus

Definition at line 66 of file modusdefault.h.

66 { return false; }

◆ is_list()

bool smash::ModusDefault::is_list ( ) const
inline
Returns
Checks if modus is list modus; overwritten in ListModus

Definition at line 68 of file modusdefault.h.

68 { return false; }

◆ is_sphere()

bool smash::ModusDefault::is_sphere ( ) const
inline
Returns
Checks if modus is sphere modus; overwritten in SphereModus

Definition at line 70 of file modusdefault.h.

70 { return false; }

◆ sqrt_s_NN()

double smash::ModusDefault::sqrt_s_NN ( ) const
inline
Returns
Center of mass energy per nucleon pair in ColliderModus

Definition at line 72 of file modusdefault.h.

72 { return 0.; }

◆ impact_parameter()

double smash::ModusDefault::impact_parameter ( ) const
inline
Returns
The impact parameter; overwritten in ColliderModus

Definition at line 74 of file modusdefault.h.

74 { return -1.; }

◆ sample_impact()

void smash::ModusDefault::sample_impact ( ) const
inline

sample impact parameter for collider modus

Definition at line 76 of file modusdefault.h.

76 {}

◆ velocity_projectile()

double smash::ModusDefault::velocity_projectile ( ) const
inline
Returns
The beam velocity of the projectile required in the Collider modus. In the other modus, return zero.

Definition at line 79 of file modusdefault.h.

79 { return 0.0; }

◆ velocity_target()

double smash::ModusDefault::velocity_target ( ) const
inline
Returns
The beam velocity of the target required in the Collider modus. In the other modus, return zero.

Definition at line 82 of file modusdefault.h.

82 { return 0.0; }

◆ fermi_motion()

FermiMotion smash::ModusDefault::fermi_motion ( ) const
inline
Returns
The type of Fermi motion required in the Collider modus. In the other modus, just return FermiMotion::Off.

Definition at line 85 of file modusdefault.h.

85 { return FermiMotion::Off; }
@ Off
Don't use fermi motion.

◆ max_timestep()

double smash::ModusDefault::max_timestep ( double  ) const
inline
Returns
Maximal timestep accepted by this modus. Negative means infinity.

Definition at line 87 of file modusdefault.h.

87 { return -1.; }

◆ equilibration_time()

double smash::ModusDefault::equilibration_time ( ) const
inline
Returns
equilibration time of the box; overwritten in BoxModus

Definition at line 89 of file modusdefault.h.

89 { return -1.; }

◆ length()

double smash::ModusDefault::length ( ) const
inline
Returns
length of the box; overwritten in BoxModus

Definition at line 91 of file modusdefault.h.

91 { return -1.; }

◆ radius()

double smash::ModusDefault::radius ( ) const
inline
Returns
radius of the sphere; overwritten in SphereModus

Definition at line 93 of file modusdefault.h.

93 { return -1.; }

◆ calculation_frame_is_fixed_target()

bool smash::ModusDefault::calculation_frame_is_fixed_target ( ) const
inline
Returns
Whether the calculation frame is fixed target; overwritten in ColliderModus

Definition at line 96 of file modusdefault.h.

96 { return false; }

◆ nuclei_passing_time()

double smash::ModusDefault::nuclei_passing_time ( ) const
inline

Get the passing time of the two nuclei in a collision.

This time corresponds to the moment when the nuclei have just passed entirely through each other and all primary collisions have occured. Formula taken from: Eq. (1) in Karpenko:2015xea [29]

Only used in ColliderModus for IC output.

Returns
passing_time

Definition at line 106 of file modusdefault.h.

106 { return 0.0; }

◆ create_grid()

Grid<GridOptions::Normal> smash::ModusDefault::create_grid ( const Particles particles,
double  min_cell_length,
double  timestep_duration,
CollisionCriterion  crit,
const bool  include_unformed_particles,
CellSizeStrategy  strategy = CellSizeStrategy::Optimal 
) const
inline

Creates the Grid with normal boundary conditions.

Parameters
[in]particlesThe Particles object containing all particles of the currently running Experiment.
[in]min_cell_lengthThe minimal length of the grid cells.
[in]timestep_durationDuration of the timestep. It is necessary for formation times treatment: if particle is fully or partially formed before the end of the timestep, it has to be on the grid.
[in]critCollision criterion (decides if cell number can be limited)
[in]include_unformed_particlesinclude unformed particles from the grid (worsens runtime, necessary for IC output)
[in]strategyThe strategy to determine the cell size
Returns
the Grid object
See also
Grid::Grid

Definition at line 126 of file modusdefault.h.

130  {
132  if (crit == CollisionCriterion::Stochastic) {
134  }
135  return {particles,
136  min_cell_length,
137  timestep_duration,
138  limit,
139  include_unformed_particles,
140  strategy};
141  }
@ Stochastic
Stochastic Criteiron.
CellNumberLimitation
Identifies whether the number of cells should be limited.
Definition: grid.h:55
@ ParticleNumber
Limit the number of cells to the number of particles.
@ None
No cell number limitation.

◆ create_grandcan_thermalizer()

std::unique_ptr<GrandCanThermalizer> smash::ModusDefault::create_grandcan_thermalizer ( Configuration conf) const
inline

Creates GrandCanThermalizer.

Parameters
[in]confconfiguration object
Returns
unique pointer to created thermalizer class

Definition at line 149 of file modusdefault.h.

150  {
151  /* Lattice is placed such that the center is 0,0,0.
152  If one wants to have a central cell with center at 0,0,0 then
153  number of cells should be odd (2k+1) in every direction.
154  */
155  const std::array<double, 3> l = conf.take({"Lattice_Sizes"});
156  const std::array<double, 3> origin = {-0.5 * l[0], -0.5 * l[1],
157  -0.5 * l[2]};
158  const bool periodicity = false;
159  return std::make_unique<GrandCanThermalizer>(conf, l, origin, periodicity);
160  }

The documentation for this class was generated from the following file: