Version: SMASH-3.4
actionfinderfactory.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright (c) 2014-2020,2025
4  * SMASH Team
5  *
6  * GNU General Public License (GPLv3 or later)
7  *
8  */
9 
10 #ifndef SRC_INCLUDE_SMASH_ACTIONFINDERFACTORY_H_
11 #define SRC_INCLUDE_SMASH_ACTIONFINDERFACTORY_H_
12 
13 #include <vector>
14 
15 #include "clock.h"
16 #include "forwarddeclarations.h"
17 #include "lattice.h"
18 #include "potentials.h"
19 
20 namespace smash {
21 
22 /**
23  * \ingroup action
24  * ActionFinderInterface is the abstract base class for all action finders,
25  * i.e. objects which create action lists.
26  */
28  public:
29  virtual ~ActionFinderInterface() = default;
30 
31  /**
32  * Abstract function for finding actions, given a list of particles.
33  *
34  * \param[in] search_list a list of particles where each pair needs to be
35  * tested for possible interaction
36  * \param[in] dt duration of the current time step [fm]
37  * \param[in] gcell_vol volume of searched grid cell [fm^3]
38  * \param[in] beam_momentum [GeV] List of beam momenta for each particle;
39  * only necessary for frozen Fermi motion
40  * \return The function returns a list (std::vector) of Action objects that
41  * could possibly be executed in this time step.
42  */
43  virtual ActionList find_actions_in_cell(
44  const ParticleList &search_list, double dt, const double gcell_vol,
45  const std::vector<FourVector> &beam_momentum) const = 0;
46  /**
47  * Abstract function for finding actions, given two lists of particles,
48  * a search list and a neighbors list.
49  *
50  * \param[in] search_list a list of particles where each particle needs to
51  * be tested for possible interactions with the neighbors
52  * \param[in] neighbors_list a list of particles that need to be tested
53  * against particles in search_list for possible interaction
54  * \param[in] dt duration of the current time step [fm]
55  * \param[in] beam_momentum [GeV] List of beam momenta for each particle;
56  * only necessary for frozen Fermi motion
57  * \return The function returns a list (std::vector) of Action objects that
58  * could possibly be executed in this time step.
59  */
60  virtual ActionList find_actions_with_neighbors(
61  const ParticleList &search_list, const ParticleList &neighbors_list,
62  double dt, const std::vector<FourVector> &beam_momentum) const = 0;
63 
64  /**
65  * Abstract function for finding actions between a list of particles and
66  * the surrounding particles.
67  *
68  * Note: The first list can be a subset of the second list.
69  *
70  * \param[in] search_list a list of particles where each particle needs to be
71  * tested for possible interactions with the surrounding particles
72  * \param[in] surrounding_list a list of particles that need to be tested
73  * against particles in search_list for possible interaction
74  * \param[in] dt duration of the current time step [fm]
75  * \param[in] beam_momentum [GeV] List of beam momenta for each particle;
76  * only necessary for frozen Fermi motion
77  * \return The function returns a list (std::vector) of Action objects that
78  * could possibly be executed in this time step.
79  */
81  const ParticleList &search_list, const Particles &surrounding_list,
82  double dt, const std::vector<FourVector> &beam_momentum) const = 0;
83 
84  /**
85  * This abstract function finds 'final' actions (for cleaning up at the end
86  * of the simulation, e.g. letting the remaining resonances decay).
87  * \param[in] search_list a list of particles where each particle needs to be
88  * tested for possible interactions with the surrounding particles
89  * \return The function returns a list (std::vector) of Action objects.
90  */
91  virtual ActionList find_final_actions(const Particles &search_list) const = 0;
92 };
93 
94 } // namespace smash
95 
96 #endif // SRC_INCLUDE_SMASH_ACTIONFINDERFACTORY_H_
ActionFinderInterface is the abstract base class for all action finders, i.e.
virtual ~ActionFinderInterface()=default
virtual ActionList find_final_actions(const Particles &search_list) const =0
This abstract function finds 'final' actions (for cleaning up at the end of the simulation,...
virtual ActionList find_actions_in_cell(const ParticleList &search_list, double dt, const double gcell_vol, const std::vector< FourVector > &beam_momentum) const =0
Abstract function for finding actions, given a list of particles.
virtual ActionList find_actions_with_neighbors(const ParticleList &search_list, const ParticleList &neighbors_list, double dt, const std::vector< FourVector > &beam_momentum) const =0
Abstract function for finding actions, given two lists of particles, a search list and a neighbors li...
virtual ActionList find_actions_with_surrounding_particles(const ParticleList &search_list, const Particles &surrounding_list, double dt, const std::vector< FourVector > &beam_momentum) const =0
Abstract function for finding actions between a list of particles and the surrounding particles.
The Particles class abstracts the storage and manipulation of particles.
Definition: particles.h:33
Definition: action.h:24