<commit_before>/*!
 * \file hydro_utilities.h
 * \author <NAME> (<EMAIL>)
 * \brief Contains the declaration of various utility functions for hydro
 *
 */

#pragma once

// Local Includes
#include "../global/global.h"
#include "../global/global_cuda.h"
#include "../utils/gpu.hpp"


/*!
* INDEX OF VARIABLES
* p : pressure
* vx, vy, vz : x, y, and z velocity
* d : density
* E : energy
* T : temperature
* px, py, pz : x, y, and z momentum
* n : number density
*/

namespace hydro_utilities {
    namespace {
        inline __host__ __device__ Real Calc_Pressure_Primitive(Real const &E, Real const &d, Real const &vx, Real const &vy, Real const &vz, Real const &gamma) {
        Real p;
        p = (E - 0.5 * d * (vx*vx + vy*vy + vz*vz)) * (gamma - 1.0);
        p = fmax(p, (Real) TINY_NUMBER);
        return p;
        }

        inline __host__ __device__ Real Calc_Pressure_Conserved(Real const &E, Real const &d, Real const &px, Real const &py, Real const &pz, Real const &gamma) {
            Real p = (gamma - 1.) * (E - 0.5 * (px*px + ((py*py) + (pz*pz))) / d);

        return fmax(p, TINY_NUMBER);
        }

        inline __host__ __device__ Real Calc_Temp(Real const &p, Real const &n) {<commit_msg>add hydro utility function testing<commit_after>/*!
 * \file hydro_utilities.h
 * \author <NAME> (<EMAIL>)
 * \brief Contains the declaration of various utility functions for hydro
 *
 */

#pragma once

// Local Includes
#include "../global/global.h"
#include "../global/global_cuda.h"
#include "../utils/gpu.hpp"


/*!
* INDEX OF VARIABLES
* p : pressure
* vx, vy, vz : x, y, and z velocity
* d : density
* E : energy
* T : temperature
* px, py, pz : x, y, and z momentum
* n : number density
*/

namespace hydro_utilities {
    namespace {
        inline __host__ __device__ Real Calc_Pressure_Primitive(Real const &E, Real const &d, Real const &vx, Real const &vy, Real const &vz, Real const &gamma) {
        Real p;
        p = (E - 0.5 * d * (vx*vx + vy*vy + vz*vz)) * (gamma - 1.0);
        p = fmax(p, (Real) TINY_NUMBER);
        std::cout << p;
        return p;
        }

        inline __host__ __device__ Real Calc_Pressure_Conserved(Real const &E, Real const &d, Real const &px, Real const &py, Real const &pz, Real const &gamma) {
            Real p = (gamma - 1.) * (E - 0.5 * (px*px + py*py + pz*pz)) / d);

        return fmax(p, TINY_NUMBER);
        }

        inline __host__ __device__ Real Calc_Temp(Real const &p, Real const &n) {
{'fraction_non_alphanumeric': 0.1408906882591093, 'fraction_numerical': 0.005668016194331984, 'mean_word_length': 2.6338235294117647, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4304093', 'n_tokens_mistral': 890, 'n_tokens_neox': 867, 'n_words': 292}