Version: SMASH-2.2
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 44 of file modusdefault.h.

Inheritance diagram for smash::ModusDefault:
[legend]

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...
 

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 59 of file modusdefault.h.

60  {}) {
61  return 0;
62  }

◆ is_collider()

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

Definition at line 65 of file modusdefault.h.

65 { return false; }

◆ is_box()

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

Definition at line 67 of file modusdefault.h.

67 { return false; }

◆ is_list()

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

Definition at line 69 of file modusdefault.h.

69 { return false; }

◆ is_sphere()

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

Definition at line 71 of file modusdefault.h.

71 { 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 73 of file modusdefault.h.

73 { return 0.; }

◆ impact_parameter()

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

Definition at line 75 of file modusdefault.h.

75 { return -1.; }

◆ sample_impact()

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

sample impact parameter for collider modus

Definition at line 77 of file modusdefault.h.

77 {}

◆ 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 80 of file modusdefault.h.

80 { 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 83 of file modusdefault.h.

83 { 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 86 of file modusdefault.h.

86 { 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 88 of file modusdefault.h.

88 { return -1.; }

◆ equilibration_time()

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

Definition at line 90 of file modusdefault.h.

90 { return -1.; }

◆ length()

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

Definition at line 92 of file modusdefault.h.

92 { return -1.; }

◆ radius()

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

Definition at line 94 of file modusdefault.h.

94 { 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 97 of file modusdefault.h.

97 { 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 [26]

Only used in ColliderModus for IC output.

Returns
passing_time

Definition at line 107 of file modusdefault.h.

107 { 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 127 of file modusdefault.h.

131  {
133  if (crit == CollisionCriterion::Stochastic) {
135  }
136  return {particles,
137  min_cell_length,
138  timestep_duration,
139  limit,
140  include_unformed_particles,
141  strategy};
142  }
@ 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.

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