Version: SMASH-1.5
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...
 
int total_N_number () const
 
int proj_N_number () const
 
bool cll_in_nucleus () const
 
bool is_collider () const
 
double impact_parameter () const
 
double velocity_projectile () const
 
double velocity_target () const
 
FermiMotion fermi_motion () const
 
double max_timestep (double) const
 
double length () const
 
Grid< GridOptions::Normalcreate_grid (const Particles &particles, double min_cell_length, 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  }

◆ total_N_number()

int smash::ModusDefault::total_N_number ( ) const
inline
Returns
Number of nucleons in both nuclei; only used in ColliderModus

Definition at line 65 of file modusdefault.h.

65 { return 0; }

◆ proj_N_number()

int smash::ModusDefault::proj_N_number ( ) const
inline
Returns
Number of nucleons in projectile; only used in ColliderModus

Definition at line 67 of file modusdefault.h.

67 { return 0; }

◆ cll_in_nucleus()

bool smash::ModusDefault::cll_in_nucleus ( ) const
inline
Returns
Whether to allow collisions in nuclei; only used in ColliderModus

Definition at line 69 of file modusdefault.h.

69 { return false; }

◆ is_collider()

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

Definition at line 71 of file modusdefault.h.

71 { return false; }

◆ impact_parameter()

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

Definition at line 73 of file modusdefault.h.

73 { return 0.0; }

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

76 { 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 79 of file modusdefault.h.

79 { 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 82 of file modusdefault.h.

82 { return FermiMotion::Off; }
Don&#39;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 84 of file modusdefault.h.

84 { return -1.; }

◆ length()

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

Definition at line 87 of file modusdefault.h.

87 { return -1.; }

◆ create_grid()

Grid<GridOptions::Normal> smash::ModusDefault::create_grid ( const Particles particles,
double  min_cell_length,
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]strategyThe strategy to determine the cell size
Returns
the Grid object
See also
Grid::Grid

Definition at line 100 of file modusdefault.h.

102  {
103  return {particles, min_cell_length, strategy};
104  }

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