From 7ab895400e6bca3420cf37fb0b6b29ff306a11e0 Mon Sep 17 00:00:00 2001 From: Sigfried Haering Date: Mon, 14 Oct 2024 22:47:37 -0700 Subject: [PATCH] adding _GPU_ ifdef for radiativeDecay in chemistry --- src/chemistry.cpp | 5 +++++ src/reaction.cpp | 35 ----------------------------------- 2 files changed, 5 insertions(+), 35 deletions(-) diff --git a/src/chemistry.cpp b/src/chemistry.cpp index 74c03472..1ef021e7 100644 --- a/src/chemistry.cpp +++ b/src/chemistry.cpp @@ -94,8 +94,13 @@ MFEM_HOST_DEVICE Chemistry::Chemistry(GasMixture *mixture, const ChemistryInput case RADIATIVE_DECAY: { assert(inputs.reactionInputs[r].modelParams != NULL); double R = inputs.reactionInputs[r].modelParams[0]; +#ifndef _GPU_ reactions_[r] = new RadiativeDecay(R, &inputs.speciesMapping, &inputs.speciesNames, &numSpecies_, &reactantStoich_[r * numSpecies_], &productStoich_[r * numSpecies_]); +#else + printf("Radiative decay not currently supported for GPU execution.") assert(false); + break; +#endif } break; default: printf("Unknown reactionModel."); diff --git a/src/reaction.cpp b/src/reaction.cpp index ee4d0afb..d119f58b 100644 --- a/src/reaction.cpp +++ b/src/reaction.cpp @@ -296,41 +296,6 @@ MFEM_HOST_DEVICE double RadiativeDecay::escapeFactCalc(const double &n_i, const } eta = min(eta, 1.0); - - return eta; -} - -#else -// Radiative decay portion: extracted from commit (de27f14) -MFEM_HOST_DEVICE RadiativeDecay::RadiativeDecay(const double _R, const std::map *_speciesMapping, - const std::vector *_speciesNames, const int *numSpecies, - const double *_reactantStoich, const double *_productStoich) { -// : Reaction(RADIATIVE_DECAY), Rcyl(_R) { - rank0_ = Mpi::Root(); - if (rank0_) { - printf("Radiative decay not supported on GPU yet!"); - } -} - -MFEM_HOST_DEVICE RadiativeDecay::~RadiativeDecay() {} - -MFEM_HOST_DEVICE double RadiativeDecay::computeRateCoefficient(const double &T_h, const double &T_e, - const int &dofindex, - [[maybe_unused]] const bool isElectronInvolved, - const double *nsp) { - double effAcoef = 0.0; - return effAcoef; -} - -MFEM_HOST_DEVICE void RadiativeDecay::GetNumDensityOfInteralLevels(const int NumOfInteral_lvl, const double &n_sp, - const double &T_e, double *n_sp_internal) {} - -MFEM_HOST_DEVICE void RadiativeDecay::GetEinsteinACoefficient(const double &T_h, const double &T_e, double *effAcoef) {} - -MFEM_HOST_DEVICE double RadiativeDecay::escapeFactCalc(const double &n_i, const double &E_j, const double &E_i, - const double &g_j, const double &g_i, const double &A_ji, - const double &T_g) { - double eta = 1.0; return eta; } #endif