From ad53e1353a1eddf110f5fda327c7a4ee0d6ee6c6 Mon Sep 17 00:00:00 2001 From: ChongChong He Date: Fri, 6 Sep 2024 09:28:33 +1000 Subject: [PATCH] cleanup --- src/radiation/radiation_system.cpp | 10 ---------- src/radiation/radiation_system.hpp | 14 +++++++------- src/radiation/source_terms_multi_group.hpp | 6 ++---- 3 files changed, 9 insertions(+), 21 deletions(-) delete mode 100644 src/radiation/radiation_system.cpp diff --git a/src/radiation/radiation_system.cpp b/src/radiation/radiation_system.cpp deleted file mode 100644 index 7fc1608df..000000000 --- a/src/radiation/radiation_system.cpp +++ /dev/null @@ -1,10 +0,0 @@ -//============================================================================== -// TwoMomentRad - a radiation transport library for patch-based AMR codes -// Copyright 2020 Benjamin Wibking. -// Released under the MIT license. See LICENSE file included in the GitHub repo. -//============================================================================== -/// \file radiation_system.cpp -/// \brief Implements methods for solving the (1d) radiation moment equations. -/// - -#include "radiation/radiation_system.hpp" // IWYU pragma: keep diff --git a/src/radiation/radiation_system.hpp b/src/radiation/radiation_system.hpp index 86bcdb94b..36101eecd 100644 --- a/src/radiation/radiation_system.hpp +++ b/src/radiation/radiation_system.hpp @@ -103,13 +103,13 @@ template struct NewtonIterationResult { // A struct to hold the results of ComputeJacobianForPureGas or ComputeJacobianForGasAndDust template struct JacobianResult { - double J00; - quokka::valarray::nGroups> J0g; - quokka::valarray::nGroups> Jg0; - quokka::valarray::nGroups> Jgg; - double F0; - quokka::valarray::nGroups> Fg; - double Fg_abs_sum; + double J00; // (0, 0) component of the Jacobian matrix + double F0; // (0) component of the residual + double Fg_abs_sum; // sum of the absolute values of the (g) components of the residual, g = 1, 2, ..., nGroups, and tau(g) > 0 + quokka::valarray::nGroups> J0g; // (0, g) components of the Jacobian matrix, g = 1, 2, ..., nGroups + quokka::valarray::nGroups> Jg0; // (g, 0) components of the Jacobian matrix, g = 1, 2, ..., nGroups + quokka::valarray::nGroups> Jgg; // (g, g) components of the Jacobian matrix, g = 1, 2, ..., nGroups + quokka::valarray::nGroups> Fg; // (g) components of the residual, g = 1, 2, ..., nGroups }; [[nodiscard]] AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE static auto minmod_func(double a, double b) -> double diff --git a/src/radiation/source_terms_multi_group.hpp b/src/radiation/source_terms_multi_group.hpp index 6aa811d62..127d4901e 100644 --- a/src/radiation/source_terms_multi_group.hpp +++ b/src/radiation/source_terms_multi_group.hpp @@ -534,8 +534,6 @@ void RadSystem::AddSourceTermsMultiGroup(array_t &consVar, arrayconst for (; ite < max_ite; ++ite) { quokka::valarray Rvec{}; quokka::valarray fourPiBoverC{}; - double T_gas = NAN; - double T_d = NAN; quokka::valarray kappaPVec{}; quokka::valarray kappaEVec{}; quokka::valarray kappaFVec{}; @@ -591,8 +589,8 @@ void RadSystem::AddSourceTermsMultiGroup(array_t &consVar, arrayconst } else { // not constexpr (gamma_ != 1.0) - T_gas = quokka::EOS::ComputeTgasFromEint(rho, Egas0, massScalars); - T_d = T_gas; + const double T_gas = quokka::EOS::ComputeTgasFromEint(rho, Egas0, massScalars); + const double T_d = T_gas; if constexpr (opacity_model_ == OpacityModel::piecewise_constant_opacity) { kappa_expo_and_lower_value = DefineOpacityExponentsAndLowerValues(radBoundaries_g_copy, rho, T_d); for (int g = 0; g < nGroups_; ++g) {