Version: SMASH-3.3
fluidizationaction.cc
Go to the documentation of this file.
1 /*
2  *
3  * Copyright (c) 2022-2025
4  * SMASH Team
5  *
6  * GNU General Public License (GPLv3 or later)
7  *
8  */
9 
11 
12 #include "smash/logging.h"
13 #include "smash/quantumnumbers.h"
14 
15 namespace smash {
16 static constexpr int LFluidization = LogArea::HyperSurfaceCrossing::id;
17 
19  logg[LFluidization].debug("Process: Fluidization. ");
20 
21  // check that there is only 1 incoming particle
22  assert(incoming_particles_.size() == 1);
23 
24  if (remove_particle_) {
25  // Return empty list because we want to remove the incoming particle
27  } else {
29  outgoing_particles_[0].fluidize();
30  }
31 }
32 
34  [[maybe_unused]] const uint32_t id_process) const {
35  if (remove_particle_) {
36  if (unlikely(outgoing_particles_.size() != 0)) {
37  throw std::runtime_error(
38  "Particle was not removed successfully in fluidization action.");
39  }
40  } else {
43  if (unlikely(before != after)) {
44  throw std::runtime_error(
45  "Conservation laws not obeyed during fluidization, but they should "
46  "since supposedly no removal was done.");
47  }
48  if (unlikely(outgoing_particles_.size() == 0)) {
49  throw std::runtime_error(
50  "Particle was removed in a FluidizationNoRemoval process.");
51  }
52  }
53 
54  return 0.;
55 }
56 
57 } // namespace smash
ParticleList outgoing_particles_
Initially this stores only the PDG codes of final-state particles.
Definition: action.h:372
ParticleList incoming_particles_
List with data of incoming particles.
Definition: action.h:364
static bool remove_particle_
Whether fluidization actions remove the particle from the evolution.
void generate_final_state() override
Generate the final state of particles to be fluidized and removes them from the evolution.
double check_conservation(const uint32_t id_process) const override
Conservation laws should not be obeyed, since particles are being removed.
A container for storing conserved values.
std::array< einhard::Logger<>, std::tuple_size< LogArea::AreaTuple >::value > logg
An array that stores all pre-configured Logger objects.
Definition: logging.cc:40
#define unlikely(x)
Tell the branch predictor that this expression is likely false.
Definition: macros.h:16
Definition: action.h:24
static constexpr int LFluidization