Version: SMASH-3.1
smash::WallCrossActionsFinder Class Reference

#include <wallcrossingaction.h>

Finder for wall crossing actions, when using peridic boundary conditons.

Loops through all particles and checks if they cross the box wall during the next timestep.

Definition at line 52 of file wallcrossingaction.h.

Inheritance diagram for smash::WallCrossActionsFinder:
smash::ActionFinderInterface

Public Member Functions

 WallCrossActionsFinder (double l)
 Construct wallcrossing actionfinder. More...
 
ActionList find_actions_in_cell (const ParticleList &plist, double t_max, const double, const std::vector< FourVector > &) const override
 Find the next wall crossings for every particle before time t_max. More...
 
ActionList find_actions_with_neighbors (const ParticleList &, const ParticleList &, double, const std::vector< FourVector > &) const override
 Ignore the neighbor searches for wall crossing. More...
 
ActionList find_actions_with_surrounding_particles (const ParticleList &, const Particles &, double, const std::vector< FourVector > &) const override
 Ignore the surrounding searches for wall crossing. More...
 
ActionList find_final_actions (const Particles &, bool) const override
 No final actions for wall crossing. More...
 
- Public Member Functions inherited from smash::ActionFinderInterface
virtual ~ActionFinderInterface ()=default
 

Private Attributes

const std::array< double, 3 > l_
 Periods in x,y,z directions in fm. More...
 

Constructor & Destructor Documentation

◆ WallCrossActionsFinder()

smash::WallCrossActionsFinder::WallCrossActionsFinder ( double  l)
inlineexplicit

Construct wallcrossing actionfinder.

Parameters
[in]lBox edge length. Box is assumbed to be a cube. [fm]

Definition at line 58 of file wallcrossingaction.h.

58 : l_{l, l, l} {};
const std::array< double, 3 > l_
Periods in x,y,z directions in fm.

Member Function Documentation

◆ find_actions_in_cell()

ActionList smash::WallCrossActionsFinder::find_actions_in_cell ( const ParticleList &  plist,
double  t_max,
const double  ,
const std::vector< FourVector > &   
) const
overridevirtual

Find the next wall crossings for every particle before time t_max.

Parameters
[in]plistList of all particles.
[in]t_maxTime until crossing can appear. [fm]
Returns
List of all found wall crossings.

Implements smash::ActionFinderInterface.

Definition at line 14 of file wallcrossingaction.cc.

16  {
17  std::vector<ActionPtr> actions;
18  for (const ParticleData& p : plist) {
19  const ThreeVector& r = p.position().threevec();
20  const ThreeVector& v = p.velocity();
21  double time_until_crossing = t_max;
22  int i_cross = -1;
23  for (int i = 0; i < 3; i++) {
24  double t = t_max + 1.;
25  if (v[i] > really_small) {
26  t = (l_[i] - r[i]) / v[i];
27  } else if (v[i] < -really_small) {
28  t = -r[i] / v[i];
29  }
30  if (t < time_until_crossing) {
31  time_until_crossing = t;
32  i_cross = i;
33  }
34  }
35  // No crossing
36  if (i_cross == -1) {
37  continue;
38  }
39  FourVector crossing_point(p.position().x0() + time_until_crossing,
40  r + v * time_until_crossing);
41  crossing_point[i_cross + 1] = ((v[i_cross] > 0.0) ? 0.0 : l_[i_cross]);
42 
43  ParticleData outgoing_particle(p);
44  outgoing_particle.set_4position(crossing_point);
45  ActionPtr action = std::make_unique<WallcrossingAction>(
46  p, outgoing_particle, time_until_crossing);
47  actions.emplace_back(std::move(action));
48  }
49  return actions;
50 }
constexpr int p
Proton.
constexpr double really_small
Numerical error tolerance.
Definition: constants.h:37

◆ find_actions_with_neighbors()

ActionList smash::WallCrossActionsFinder::find_actions_with_neighbors ( const ParticleList &  ,
const ParticleList &  ,
double  ,
const std::vector< FourVector > &   
) const
inlineoverridevirtual

Ignore the neighbor searches for wall crossing.

Implements smash::ActionFinderInterface.

Definition at line 71 of file wallcrossingaction.h.

73  {
74  return {};
75  }

◆ find_actions_with_surrounding_particles()

ActionList smash::WallCrossActionsFinder::find_actions_with_surrounding_particles ( const ParticleList &  ,
const Particles ,
double  ,
const std::vector< FourVector > &   
) const
inlineoverridevirtual

Ignore the surrounding searches for wall crossing.

Implements smash::ActionFinderInterface.

Definition at line 78 of file wallcrossingaction.h.

80  {
81  return {};
82  }

◆ find_final_actions()

ActionList smash::WallCrossActionsFinder::find_final_actions ( const Particles ,
bool   
) const
inlineoverridevirtual

No final actions for wall crossing.

Implements smash::ActionFinderInterface.

Definition at line 85 of file wallcrossingaction.h.

85  {
86  return {};
87  }

Member Data Documentation

◆ l_

const std::array<double, 3> smash::WallCrossActionsFinder::l_
private

Periods in x,y,z directions in fm.

Definition at line 91 of file wallcrossingaction.h.


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