Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Brick.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Brick.cc
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 
16 #include <stdio.h>
17 #include <sys/stat.h>
18 
19 #include <cstring>
20 #include <cmath>
21 #include <iostream>
22 #include <MakeUniqueHelper.h>
23 
24 #include "JetScapeLogger.h"
25 #include "Brick.h"
26 
27 using namespace Jetscape;
28 
29 // Register the module with the base class
31 
33  // initialize the parameter reader
34  T_brick = 0.0; // GeV
35  start_time = 0.0;
36  bjorken_expansion_on = false;
37 
39  SetId("Brick");
40  VERBOSE(8);
41 }
42 
44 
46  // kind of stupid ... do pointer GetHydroXML() via XML instance ...
47 
48  JSDEBUG << "Initialize Brick (Test) ...";
49  VERBOSE(8);
50 
51  std::string s = GetXMLElementText({"Hydro", "Brick", "name"});
52  JSDEBUG << s << " to be initialized ...";
53 
54  T_brick = GetXMLElementDouble({"Hydro", "Brick", "T"});
55  JSDEBUG << s << " with T = " << T_brick;
56  VERBOSE(2) << "Brick Temperature T = " << T_brick;
57 
58  tinyxml2::XMLElement *brick = GetXMLElement({"Hydro", "Brick"});
59  if (brick->Attribute("bjorken_expansion_on", "true")) {
60  bjorken_expansion_on = true;
61  start_time = std::atof(brick->Attribute("start_time"));
62  } else {
63  if (brick->Attribute("start_time")){
64  start_time = std::atof(brick->Attribute("start_time"));
65  }
66  }
67 
69 
70  brick_L = GetXMLElementDouble({"Eloss", "Matter", "brick_length"});
71 
72  //Parameter parameter_list;
73  GetParameterList().hydro_input_filename = (char *)"dummy"; //*(argv+1);
74 }
75 
76 void Brick::InitializeHydro(Parameter parameter_list) {
78 }
79 
81  VERBOSE(8);
82  VERBOSE(2) << "size of sd = " << ini->GetEntropyDensityDistribution().size();
84 }
85 
88  // FluidCellInfo* fluid_cell_info_ptr) {
89  std::unique_ptr<FluidCellInfo> &fluid_cell_info_ptr) {
90  // create the unique FluidCellInfo here
91  fluid_cell_info_ptr = make_unique<FluidCellInfo>();
92 
93  // assign all the quantites to JETSCAPE output
94  // thermodyanmic quantities
95 
96  if (hydro_status == FINISHED) {
97  fluid_cell_info_ptr->energy_density = 0.0;
98  fluid_cell_info_ptr->entropy_density = 0.0;
99  if(t > brick_L){fluid_cell_info_ptr->temperature = 0.;}
100  else if (bjorken_expansion_on) {
101  fluid_cell_info_ptr->temperature =
102  T_brick * std::pow(start_time / t, 1.0 / 3.0);
103  } else {
104  fluid_cell_info_ptr->temperature = T_brick;
105  }
106  fluid_cell_info_ptr->pressure = 0.0;
107  // QGP fraction
108  fluid_cell_info_ptr->qgp_fraction = 1.0;
109  // chemical potentials
110  fluid_cell_info_ptr->mu_B = 0.0;
111  fluid_cell_info_ptr->mu_C = 0.0;
112  fluid_cell_info_ptr->mu_S = 0.0;
113  // dynamical quantites
114  fluid_cell_info_ptr->vx = 0.0;
115  fluid_cell_info_ptr->vy = 0.0;
116  fluid_cell_info_ptr->vz = 0.0;
117  for (int i = 0; i < 4; i++) {
118  for (int j = 0; j < 4; j++) {
119  fluid_cell_info_ptr->pi[i][j] = 0.0;
120  }
121  }
122  fluid_cell_info_ptr->bulk_Pi = 0.0;
123  } else {
124  JSWARN << "Hydro not run yet ...";
125  exit(-1);
126  }
127 }