Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FluidCellInfo.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file FluidCellInfo.h
1 /*******************************************************************************
2  * Copyright (c) The JETSCAPE Collaboration, 2018
3  *
4  * Modular, task-based framework for simulating all aspects of heavy-ion collisions
5  *
6  * For the list of contributors see AUTHORS.
7  *
8  * Report issues at https://github.com/JETSCAPE/JETSCAPE/issues
9  *
10  * or via email to bugs.jetscape@gmail.com
11  *
12  * Distributed under the GNU General Public License 3.0 (GPLv3 or later).
13  * See COPYING for details.
14  ******************************************************************************/
15 // This is a general basic class for hydrodynamics
16 
17 #ifndef FLUIDCELLINFO_H
18 #define FLUIDCELLINFO_H
19 
20 #include "RealType.h"
21 
22 namespace Jetscape {
23 
25 public:
26  // data structure for outputing fluid cell information
39 
41  FluidCellInfo();
42 
45 
47  //void Print();
48 };
49 
50 //overload +-*/ for easier linear interpolation
55  a.temperature += b.temperature;
56  a.pressure += b.pressure;
58  a.mu_B += b.mu_B;
59  a.mu_C += b.mu_C;
60  a.mu_S += b.mu_S;
61  a.vx += b.vx;
62  a.vy += b.vy;
63  a.vz += b.vz;
64  for (int i = 0; i < 4; i++) {
65  for (int j = 0; j < 4; j++) {
66  a.pi[i][j] += b.pi[i][j];
67  }
68  }
69  a.bulk_Pi += b.bulk_Pi;
70  return a;
71 }
72 
73 // Multiply the fluid cell with a scalar factor
75  this->energy_density *= b;
76  this->entropy_density *= b;
77  this->temperature *= b;
78  this->pressure *= b;
79  this->qgp_fraction *= b;
80  this->mu_B *= b;
81  this->mu_C *= b;
82  this->mu_S *= b;
83  this->vx *= b;
84  this->vy *= b;
85  this->vz *= b;
86  for (int i = 0; i < 4; i++) {
87  for (int j = 0; j < 4; j++) {
88  this->pi[i][j] *= b;
89  }
90  }
91  this->bulk_Pi *= b;
92  return *this;
93 }
94 
97  b *= a;
98  return b;
99 }
100 
103  a *= b;
104  return a;
105 }
106 
109  a *= 1.0 / b;
110  return a;
111 }
112 
113 // print the fluid cell information for debuging
114 // this function has bugs
115 //std::ostream &operator<<(std::ostream &os, const FluidCellInfo &cell) {
116 // os << "energy_density=" << cell.energy_density << std::endl;
117 // os << "entropy_density=" << cell.entropy_density << std::endl;
118 // os << "temperature=" << cell.temperature << std::endl;
119 // os << "pressure=" << cell.pressure << std::endl;
120 // os << "qgp_fraction=" << cell.qgp_fraction << std::endl;
121 // os << "mu_B=" << cell.mu_B << std::endl;
122 // os << "mu_C=" << cell.mu_C << std::endl;
123 // os << "mu_S=" << cell.mu_S << std::endl;
124 // os << "vx=" << cell.vx << std::endl;
125 // os << "vy=" << cell.vy << std::endl;
126 // os << "vz=" << cell.vz << std::endl;
127 // os << "pi[mu][nu]=" << std::endl;
128 // for (int i = 0; i < 4; i++) {
129 // for (int j = 0; j < 4; j++) {
130 // os << cell.pi[i][j] << ' ';
131 // }
132 // os << std::endl;
133 // }
134 // os << "bulk_Pi=" << cell.bulk_Pi;
135 // return os << std::endl;
136 //}
137 
138 } // end namespace Jetscape
139 
140 #endif // FluidCellInfo