From 3edbebe3e325d45de8ad387054ad2e031625809c Mon Sep 17 00:00:00 2001 From: Michael Zingale Date: Tue, 14 May 2024 15:49:36 -0400 Subject: [PATCH] fix xrb_layered trailing whitespace (#452) --- Exec/science/xrb_layered/MaestroInitData.cpp | 20 +++---- Exec/science/xrb_layered/MaestroTagging.cpp | 2 +- .../create_initial_model/toy_atm/init_1d.H | 54 +++++++++---------- .../create_initial_model/toy_atm/main.cpp | 2 +- .../xrb_layered/plotfile_derive/main.cpp | 6 +-- .../science/xrb_layered/scripts/chainslurm.sh | 4 +- 6 files changed, 44 insertions(+), 44 deletions(-) diff --git a/Exec/science/xrb_layered/MaestroInitData.cpp b/Exec/science/xrb_layered/MaestroInitData.cpp index d8662ed80..7225eb1b3 100644 --- a/Exec/science/xrb_layered/MaestroInitData.cpp +++ b/Exec/science/xrb_layered/MaestroInitData.cpp @@ -39,7 +39,7 @@ void Maestro::InitLevelData(const int lev, [[maybe_unused]] const Real time, con const auto dx = geom[lev].CellSizeArray(); if (perturb_model) { - + // Generate random seed (or get from input), and RNG int seed = 0; if (problem_rp::pert_seed != -1) { @@ -49,14 +49,14 @@ void Maestro::InitLevelData(const int lev, [[maybe_unused]] const Real time, con seed = r(); } std::default_random_engine generator(seed); - + // Gaussian distribution std::normal_distribution noise(1.0, 0.001); // mean of 1, std dev 10^-3 - + // Loop through data and perturb const auto lo = amrex::lbound(tileBox); const auto hi = amrex::ubound(tileBox); - + // Why for and not parallelfor? // Because RNG's are not thread safe. so if we wanted to use ParallelFor, we would have to create a new RNG inside // every iteration, but that loses the ability to keep a fixed seed and be fully reproducible.. maybe that wouldn't be so bad @@ -66,28 +66,28 @@ void Maestro::InitLevelData(const int lev, [[maybe_unused]] const Real time, con for (int j = lo.y; j<= hi.y; j++) { for (int i = lo.x; i<= hi.x; i++) { int r = AMREX_SPACEDIM == 2 ? j : k; // j if 2D, k if 3D - + Real t0 = s0_arr(lev, r, Temp); - Real temp = t0 * noise(generator); + Real temp = t0 * noise(generator); Real dens = s0_arr(lev, r, Rho); // no change - + // Create new eos object based on these modified values eos_t eos_state; eos_state.T = temp; eos_state.p = p0_arr(lev, r); eos_state.rho = dens; for (auto comp = 0; comp < NumSpec; comp++) { - eos_state.xn[comp] = + eos_state.xn[comp] = s0_arr(lev, r, FirstSpec + comp) / s0_arr(lev, r, Rho); } - + auto eos_input_flag = eos_input_tp; // temperature & pressure eos eos(eos_input_flag, eos_state); scal(i, j, k, Rho) = eos_state.rho; scal(i, j, k, RhoH) = eos_state.rho * eos_state.h; // re-compute enthalpy scal(i, j, k, Temp) = eos_state.T; for (auto comp=0; comp < NumSpec; comp++) { - scal(i, j, k, FirstSpec + comp) = + scal(i, j, k, FirstSpec + comp) = eos_state.rho * eos_state.xn[comp]; } } diff --git a/Exec/science/xrb_layered/MaestroTagging.cpp b/Exec/science/xrb_layered/MaestroTagging.cpp index 6757df811..cfd433d1c 100644 --- a/Exec/science/xrb_layered/MaestroTagging.cpp +++ b/Exec/science/xrb_layered/MaestroTagging.cpp @@ -67,5 +67,5 @@ void Maestro::StateError(TagBoxArray& tags, const MultiFab& state_mf, tag_array_p[lev + max_lev * r] = TagBox::SET; } }); - } + } } diff --git a/Exec/science/xrb_layered/create_initial_model/toy_atm/init_1d.H b/Exec/science/xrb_layered/create_initial_model/toy_atm/init_1d.H index 0387ff225..bae52413e 100644 --- a/Exec/science/xrb_layered/create_initial_model/toy_atm/init_1d.H +++ b/Exec/science/xrb_layered/create_initial_model/toy_atm/init_1d.H @@ -6,8 +6,8 @@ // (T_star) representing the NS, a hyperbolic tangent rise to a // peak temperature (T_base) representing the base of an accreted // layer at r=H_star, an isentropic profile representing the convective -// region at ignition, then a radiative profile from r=H_rad. -// Below, three different power-laws set the temperature profile +// region at ignition, then a radiative profile from r=H_rad. +// Below, three different power-laws set the temperature profile // T = T0*(y/y0)^del // where y is the column depth (=pressure/gravity) and, del is the power-law // index, and T0 and y0 are the values at the beginning of a given region. @@ -15,7 +15,7 @@ // where helium is burning and generating convection, 2) a stable region // where nothing is burning, 3) a stable region with hot CNO burning. -// The composition transitions from pure ash, to helium and CNO, to a solar +// The composition transitions from pure ash, to helium and CNO, to a solar // mixture including hydrogen, with initial hydrogen fraction X0 and CNO fraction // Zcno (inputs file). The CNO is split between o14 and o15 with ratio // determined by their beta decay times (70.621/122.266). Because hot CNO burns @@ -40,7 +40,7 @@ // | . . +__ // | . . . `--- T ~ y^del_2 // | . . . `---+ -// | . . . .`- +// | . . . .`- // | . . . . `- T ~ y^del_3 // | . . . . `- // | . . . . `- @@ -48,15 +48,15 @@ // | \ / // | delta // |< H_star>| -// |---------| -// |-------------------| +// |---------| +// |-------------------| // // The composition profile is: // // X // ^ -// | star | reg 1 | reg 2 | region 3 -// 1.0 +--------*---------- +// | star | reg 1 | reg 2 | region 3 +// 1.0 +--------*---------- // | ash . \ // | . \ +--------- X0 (hydrogen) // | . \ / @@ -66,8 +66,8 @@ // | . / +--------- 1-X0-Zcno (helium) // | .----------/--------------- Zcno (o14/o15) // 0.0 +--------+---------+-----------------> r -// || -// |------------| +// || +// |------------| // | // // The transition from ash to fuel is a hyperbolic tangent, parametrized @@ -140,7 +140,7 @@ AMREX_INLINE void init_1d() } if (std::abs(sum) - 1.0_rt > NumSpec * smallx) { amrex::Error("ERROR: fuel mass fractions don't sum to 1"); - } + } @@ -196,7 +196,7 @@ AMREX_INLINE void init_1d() if (error < err_min) { err_min = error; n_best = n; - } + } } Real dens_base = (1.3 + n_best*0.001)*1.e6; @@ -217,10 +217,10 @@ AMREX_INLINE void init_1d() // Composition for (int n = 0; n < NumSpec; ++n) { - model_hse(i, ispec+n) = xn_star[n] + + model_hse(i, ispec+n) = xn_star[n] + 0.5_rt * (xn_base[n] - xn_star[n]) * - (1.0_rt + std::tanh((xzn_hse(i) - (problem_rp::xmin + problem_rp::H_star - problem_rp::delta) + problem_rp::delta) / problem_rp::delta)); - } + (1.0_rt + std::tanh((xzn_hse(i) - (problem_rp::xmin + problem_rp::H_star - problem_rp::delta) + problem_rp::delta) / problem_rp::delta)); + } // Temperature model_hse(i, itemp) = problem_rp::T_star + 0.5_rt * (problem_rp::T_base - problem_rp::T_star) * @@ -241,7 +241,7 @@ AMREX_INLINE void init_1d() for (int i = 0; i < problem_rp::nx; ++i) { if (model_hse(i, itemp) > 0.9995 * problem_rp::T_base) { index_base = i+1; - break; + break; } } } else { @@ -348,9 +348,9 @@ AMREX_INLINE void init_1d() // set to isothermal if hit threshold if (temp_zone < problem_rp::T_lo) { - temp_zone = problem_rp::T_lo; + temp_zone = problem_rp::T_lo; } - + // std::cout << "T=" << temp_zone << std::endl; } @@ -400,7 +400,7 @@ AMREX_INLINE void init_1d() // call the EOS one more time for this zone and then go on to the next // (t, rho) -> (p) - + eos_state.T = temp_zone; eos_state.rho = dens_zone; for (int n = 0; n < NumSpec; ++n) { @@ -447,7 +447,7 @@ AMREX_INLINE void init_1d() // integrate down -- using the temperature profile defined above - + for (int i = index_base-1; i >= 0; --i) { Real delx = xzn_hse(i+1) - xzn_hse(i); @@ -459,7 +459,7 @@ AMREX_INLINE void init_1d() } // use our previous initial guess for density - + dens_zone = model_hse(i+1, idens); @@ -477,7 +477,7 @@ AMREX_INLINE void init_1d() // find the density and pressure that are consistent // HSE differencing - + p_want = model_hse(i+1, ipres) - delx * 0.5_rt * (dens_zone + model_hse(i+1, idens)) * problem_rp::g_const; @@ -541,7 +541,7 @@ AMREX_INLINE void init_1d() } - + // auto deltastr = num_to_unitstring(delta); auto dxstr = num_to_unitstring(dCoord); @@ -576,7 +576,7 @@ AMREX_INLINE void init_1d() of.close(); - std::cout << "Saved model to " << outfile << std::endl; + std::cout << "Saved model to " << outfile << std::endl; // some metadata of << "# generated by toy_atm_layered" << std::endl; @@ -600,11 +600,11 @@ AMREX_INLINE void init_1d() of2 << std::setprecision(12) << std::setw(20) << xzn_hse(i) << std::endl; of2 << std::setprecision(12) << std::setw(20) << eos_state.s << std::endl; - of2 << std::setprecision(12) << std::setw(20) << eos_state.cs << std::endl; + of2 << std::setprecision(12) << std::setw(20) << eos_state.cs << std::endl; } // compute the maximum HSE error - + Real max_hse_error = -1.e30; for (int i = 1; i < problem_rp::nx-1; ++i) { @@ -620,5 +620,5 @@ AMREX_INLINE void init_1d() } std::cout << "maximum HSE error = " << max_hse_error << std::endl; - + } \ No newline at end of file diff --git a/Exec/science/xrb_layered/create_initial_model/toy_atm/main.cpp b/Exec/science/xrb_layered/create_initial_model/toy_atm/main.cpp index 37cc5388d..864ee4a6d 100644 --- a/Exec/science/xrb_layered/create_initial_model/toy_atm/main.cpp +++ b/Exec/science/xrb_layered/create_initial_model/toy_atm/main.cpp @@ -42,7 +42,7 @@ main (int argc, // std::cout << "inputs file is " << inputs_name << std::endl; } } else { - std::cout << "No input file. Using defaults" << inputs_name << std::endl; + std::cout << "No input file. Using defaults" << inputs_name << std::endl; } diff --git a/Exec/science/xrb_layered/plotfile_derive/main.cpp b/Exec/science/xrb_layered/plotfile_derive/main.cpp index 9cf53bc3b..d02069bac 100644 --- a/Exec/science/xrb_layered/plotfile_derive/main.cpp +++ b/Exec/science/xrb_layered/plotfile_derive/main.cpp @@ -94,7 +94,7 @@ void main_main() varnames = pf.varNames(); // find variable indices - // We want: + // We want: // density, temperature, pressure, species // vertical velocity, temperature perturbation // we will assume here that the species are contiguous, so we will find @@ -476,10 +476,10 @@ void main_main() // Fluxes // Convective heat flux : "Fconv_dT" - ga(i,j,k,4) = rho * cp * vely * delT; + ga(i,j,k,4) = rho * cp * vely * delT; // Alternate version that should be equivalent : "Fconv_T" - // because = = - T0 = (the vertical velocity averages to zero) + // because = = - T0 = (the vertical velocity averages to zero) ga(i,j,k,5) = rho * cp * vely * temp; // MLT heat flux in the efficient regime : "Fconv_mlt" diff --git a/Exec/science/xrb_layered/scripts/chainslurm.sh b/Exec/science/xrb_layered/scripts/chainslurm.sh index 5dbcf87db..1365061b7 100755 --- a/Exec/science/xrb_layered/scripts/chainslurm.sh +++ b/Exec/science/xrb_layered/scripts/chainslurm.sh @@ -31,9 +31,9 @@ fi firstcount=1 if [ $oldjob -eq "-1" ] -then +then echo chaining $numjobs jobs - + echo starting job 1 with no dependency aout=`sbatch --parsable ${script}` echo " " jobid: $aout