Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-03 08:20:02

0001 /*******************************************************************************
0002  * Copyright (c) The JETSCAPE Collaboration, 2018
0003  *
0004  * Modular, task-based framework for simulating all aspects of heavy-ion collisions
0005  *
0006  * For the list of contributors see AUTHORS.
0007  *
0008  * Report issues at https://github.com/JETSCAPE/JETSCAPE/issues
0009  *
0010  * or via email to bugs.jetscape@gmail.com
0011  *
0012  * Distributed under the GNU General Public License 3.0 (GPLv3 or later).
0013  * See COPYING for details.
0014  ******************************************************************************/
0015 
0016 #include <stdio.h>
0017 #include <sys/stat.h>
0018 
0019 #include <cstring>
0020 #include <cmath>
0021 #include <iostream>
0022 #include <MakeUniqueHelper.h>
0023 
0024 #include "JetScapeLogger.h"
0025 #include "Brick.h"
0026 
0027 using namespace Jetscape;
0028 
0029 // Register the module with the base class
0030 RegisterJetScapeModule<Brick> Brick::reg("Brick");
0031 
0032 Brick::Brick() : FluidDynamics() {
0033   // initialize the parameter reader
0034   T_brick = 0.0; // GeV
0035   start_time = 0.0;
0036   bjorken_expansion_on = false;
0037 
0038   hydro_status = NOT_START;
0039   SetId("Brick");
0040   VERBOSE(8);
0041 }
0042 
0043 Brick::~Brick() { VERBOSE(8); }
0044 
0045 void Brick::InitTask() {
0046   // kind of stupid ... do pointer GetHydroXML() via XML instance ...
0047 
0048   JSDEBUG << "Initialize Brick (Test) ...";
0049   VERBOSE(8);
0050 
0051   std::string s = GetXMLElementText({"Hydro", "Brick", "name"});
0052   JSDEBUG << s << " to be initialized ...";
0053 
0054   T_brick = GetXMLElementDouble({"Hydro", "Brick", "T"});
0055   JSDEBUG << s << " with T = " << T_brick;
0056   VERBOSE(2) << "Brick Temperature T = " << T_brick;
0057 
0058   tinyxml2::XMLElement *brick = GetXMLElement({"Hydro", "Brick"});
0059   if (brick->Attribute("bjorken_expansion_on", "true")) {
0060     bjorken_expansion_on = true;
0061     start_time = std::atof(brick->Attribute("start_time"));
0062   } else {
0063     if (brick->Attribute("start_time")){
0064       start_time = std::atof(brick->Attribute("start_time"));
0065     }
0066   }
0067 
0068   hydro_tau_0 = start_time;
0069 
0070   brick_L = GetXMLElementDouble({"Eloss", "Matter", "brick_length"});
0071 
0072   //Parameter parameter_list;
0073   GetParameterList().hydro_input_filename = (char *)"dummy"; //*(argv+1);
0074 }
0075 
0076 void Brick::InitializeHydro(Parameter parameter_list) {
0077   hydro_status = INITIALIZED;
0078 }
0079 
0080 void Brick::EvolveHydro() {
0081   VERBOSE(8);
0082   VERBOSE(2) << "size of sd = " << ini->GetEntropyDensityDistribution().size();
0083   hydro_status = FINISHED;
0084 }
0085 
0086 void Brick::GetHydroInfo(
0087     Jetscape::real t, Jetscape::real x, Jetscape::real y, Jetscape::real z,
0088     //                           FluidCellInfo* fluid_cell_info_ptr) {
0089     std::unique_ptr<FluidCellInfo> &fluid_cell_info_ptr) {
0090   // create the unique FluidCellInfo here
0091   fluid_cell_info_ptr = make_unique<FluidCellInfo>();
0092 
0093   // assign all the quantites to JETSCAPE output
0094   // thermodyanmic quantities
0095 
0096   if (hydro_status == FINISHED) {
0097     fluid_cell_info_ptr->energy_density = 0.0;
0098     fluid_cell_info_ptr->entropy_density = 0.0;
0099     if(t > brick_L){fluid_cell_info_ptr->temperature = 0.;}
0100     else if (bjorken_expansion_on) {
0101       fluid_cell_info_ptr->temperature =
0102           T_brick * std::pow(start_time / t, 1.0 / 3.0);
0103     } else {
0104       fluid_cell_info_ptr->temperature = T_brick;
0105     }
0106     fluid_cell_info_ptr->pressure = 0.0;
0107     // QGP fraction
0108     fluid_cell_info_ptr->qgp_fraction = 1.0;
0109     // chemical potentials
0110     fluid_cell_info_ptr->mu_B = 0.0;
0111     fluid_cell_info_ptr->mu_C = 0.0;
0112     fluid_cell_info_ptr->mu_S = 0.0;
0113     // dynamical quantites
0114     fluid_cell_info_ptr->vx = 0.0;
0115     fluid_cell_info_ptr->vy = 0.0;
0116     fluid_cell_info_ptr->vz = 0.0;
0117     for (int i = 0; i < 4; i++) {
0118       for (int j = 0; j < 4; j++) {
0119         fluid_cell_info_ptr->pi[i][j] = 0.0;
0120       }
0121     }
0122     fluid_cell_info_ptr->bulk_Pi = 0.0;
0123   } else {
0124     JSWARN << "Hydro not run yet ...";
0125     exit(-1);
0126   }
0127 }