From 8cb814bd796f21c2620aa3906ee7088a371c179d Mon Sep 17 00:00:00 2001 From: Michael Zingale Date: Fri, 1 Mar 2024 15:57:38 -0500 Subject: [PATCH 1/5] update changes --- CHANGES.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 12be083506..7aeb11c743 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,14 @@ +# 24.03 + + * Documentation updates (#2742, #2752, #2753) + + * Fix some code warnings (#2737) + + * Fixed the exact Riemann solver compilation (#2745) + + * Fix an issue with large kernel sizes with ROCm in the reduction code + in the reactions (#2749) + # 24.02 * Lot's of code fixes from coverity and clang-tidy (#2736, #2734, From 5728a640ea7e5e7c47532402ff754e6a1a030fe6 Mon Sep 17 00:00:00 2001 From: Michael Zingale Date: Thu, 7 Mar 2024 17:27:46 -0500 Subject: [PATCH 2/5] update to 24.03 --- external/Microphysics | 2 +- external/amrex | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/external/Microphysics b/external/Microphysics index 649063a33f..02d46a67cf 160000 --- a/external/Microphysics +++ b/external/Microphysics @@ -1 +1 @@ -Subproject commit 649063a33f1ef83dd9acc457d7a79ceebcf3b60c +Subproject commit 02d46a67cf5852509cc35db7850e5f87da495679 diff --git a/external/amrex b/external/amrex index 52393d3faf..d737886d57 160000 --- a/external/amrex +++ b/external/amrex @@ -1 +1 @@ -Subproject commit 52393d3fafc835fa379f0420aa2de4ccdddf155a +Subproject commit d737886d574d4f1c0cf76323337b666ecd5bb4e0 From 25cc6d8f8594a613c88682da052e1147c45bd64b Mon Sep 17 00:00:00 2001 From: Zhi Chen <62574124+zhichen3@users.noreply.github.com> Date: Fri, 8 Mar 2024 10:26:48 -0500 Subject: [PATCH 3/5] update detonation problem for nse_net (#2765) --- Exec/science/Detonation/GNUmakefile | 2 +- Exec/science/Detonation/analysis/profiles.py | 48 +++++++++++++------ Exec/science/Detonation/inputs-det-x.nse_net | 8 ++-- .../problem_initialize_state_data.H | 10 ++-- 4 files changed, 44 insertions(+), 24 deletions(-) diff --git a/Exec/science/Detonation/GNUmakefile b/Exec/science/Detonation/GNUmakefile index 256b2c173b..2783b93351 100644 --- a/Exec/science/Detonation/GNUmakefile +++ b/Exec/science/Detonation/GNUmakefile @@ -18,7 +18,7 @@ EOS_DIR := helmholtz # This sets the EOS directory in $(MICROPHYSICS_HOME)/networks ifeq ($(USE_NSE_NET), TRUE) - NETWORK_DIR := ase + NETWORK_DIR := subch_base SCREEN_METHOD := chabrier1998 else NETWORK_DIR := aprox19 diff --git a/Exec/science/Detonation/analysis/profiles.py b/Exec/science/Detonation/analysis/profiles.py index 2fd0f6ae3a..26aa70cb8f 100755 --- a/Exec/science/Detonation/analysis/profiles.py +++ b/Exec/science/Detonation/analysis/profiles.py @@ -35,7 +35,7 @@ def nuc_list_filter(nuc): return 0 -def get_Te_profile(plotfile): +def get_Te_profile(plotfile, plot_in_nse=False): ds = yt.load(plotfile, hint="castro") @@ -48,10 +48,11 @@ def get_Te_profile(plotfile): x_coord = np.array(ad['x'][srt]) temp = np.array(ad['Temp'][srt]) enuc = np.array(ad['enuc'][srt]) - + if plot_in_nse: + in_nse = np.array(ad['in_nse'][srt]) + return time, x_coord, temp, enuc, in_nse return time, x_coord, temp, enuc - def get_nuc_profile(plotfile): ds = yt.load(plotfile, hint="castro") @@ -72,19 +73,27 @@ def get_nuc_profile(plotfile): return time, x_coord, nuc_fracs -def plot_Te(prefix, nums, skip, limitlabels, xmin, xmax): +def plot_Te(prefix, nums, skip, limitlabels, xmin, xmax, plot_in_nse=False): f = plt.figure() - f.set_size_inches(7.0, 9.0) - - ax_T = f.add_subplot(211) - ax_e = f.add_subplot(212) # Get set of colors to use and apply to plot numplots = int(len(nums) / skip) cm = plt.get_cmap('nipy_spectral') clist = [cm(0.95*i/numplots) for i in range(numplots + 1)] hexclist = [rgba_to_hex(ci) for ci in clist] + + if plot_in_nse: + f.set_size_inches(7.0, 12.0) + ax_nse = f.add_subplot(311) + ax_T = f.add_subplot(312) + ax_e = f.add_subplot(313) + ax_nse.set_prop_cycle(cycler('color', hexclist)) + else: + f.set_size_inches(7.0, 9.0) + ax_T = f.add_subplot(211) + ax_e = f.add_subplot(212) + ax_T.set_prop_cycle(cycler('color', hexclist)) ax_e.set_prop_cycle(cycler('color', hexclist)) @@ -101,7 +110,11 @@ def plot_Te(prefix, nums, skip, limitlabels, xmin, xmax): pfile = f"{prefix}{nums[n]}" - time, x, T, enuc = get_Te_profile(pfile) + if plot_in_nse: + time, x, T, enuc, in_nse = get_Te_profile(pfile, plot_in_nse) + ax_nse.plot(x, in_nse) + else: + time, x, T, enuc = get_Te_profile(pfile) if index % skiplabels == 0: ax_T.plot(x, T, label=f"t = {time:6.4g} s") @@ -117,6 +130,9 @@ def plot_Te(prefix, nums, skip, limitlabels, xmin, xmax): if xmax > 0: ax_T.set_xlim(xmin, xmax) + ax_e.set_xlim(xmin, xmax) + if plot_in_nse: + ax_nse.set_xlim(xmin, xmax) ax_e.set_yscale("log") ax_e.set_ylabel(r"$S_\mathrm{nuc}$ (erg/g/s)") @@ -125,8 +141,8 @@ def plot_Te(prefix, nums, skip, limitlabels, xmin, xmax): cur_lims = ax_e.get_ylim() ax_e.set_ylim(1.e-10*cur_lims[-1], cur_lims[-1]) - if xmax > 0: - ax_e.set_xlim(xmin, xmax) + if plot_in_nse: + ax_nse.set_ylabel("IN NSE") f.savefig("det_Te.png") @@ -189,12 +205,13 @@ def plot_nuc_frac(prefix, nums, skip, limitlabels, xmin, xmax): f.savefig("det_nuc.png") -def doit(prefix, nums, skip, limitlabels, xmin, xmax, do_nuc_fracs=False): +def doit(prefix, nums, skip, limitlabels, xmin, xmax, + do_nuc_fracs=False, plot_in_nse=False): if do_nuc_fracs: plot_nuc_frac(prefix, nums, skip, limitlabels, xmin, xmax) else: - plot_Te(prefix, nums, skip, limitlabels, xmin, xmax) + plot_Te(prefix, nums, skip, limitlabels, xmin, xmax, plot_in_nse) if __name__ == "__main__": @@ -214,6 +231,9 @@ def doit(prefix, nums, skip, limitlabels, xmin, xmax, do_nuc_fracs=False): p.add_argument("--do_nuc_fracs", dest="do_nuc_fracs", action="store_true", help="Plot nuc fracs, otherwise Temp and enuc plot") + p.add_argument("--plot_in_nse", dest="plot_in_nse", + action="store_true", + help="Plot in_nse quantity along with temperature and enuc") args = p.parse_args() @@ -221,4 +241,4 @@ def doit(prefix, nums, skip, limitlabels, xmin, xmax, do_nuc_fracs=False): plot_nums = sorted([p.split("plt")[1] for p in args.plotfiles], key=int) doit(plot_prefix, plot_nums, args.skip, args.limitlabels, args.xmin, - args.xmax, do_nuc_fracs=args.do_nuc_fracs) + args.xmax, do_nuc_fracs=args.do_nuc_fracs, plot_in_nse=args.plot_in_nse) diff --git a/Exec/science/Detonation/inputs-det-x.nse_net b/Exec/science/Detonation/inputs-det-x.nse_net index cab9513b75..d67a09d289 100644 --- a/Exec/science/Detonation/inputs-det-x.nse_net +++ b/Exec/science/Detonation/inputs-det-x.nse_net @@ -32,7 +32,7 @@ castro.small_temp = 1.e7 castro.riemann_solver = 0 -castro.time_integration_method = 0 +castro.time_integration_method = 3 # TIME STEP CONTROL castro.cfl = 0.5 # cfl number for hyperbolic system @@ -104,10 +104,10 @@ integrator.rtol_spec = 1.e-6 integrator.atol_spec = 1.e-6 integrator.rtol_enuc = 1.e-6 -integrator.jacobian = 1 +integrator.jacobian = 2 integrator.ode_max_steps = 1500000 -nse.nse_molar_independent = 1 +nse.nse_molar_independent = 0 nse.nse_dx_independent = 1 nse.ase_tol = 0.1 -nse.nse_skip_molar = 1 \ No newline at end of file +nse.nse_skip_molar = 0 \ No newline at end of file diff --git a/Exec/science/Detonation/problem_initialize_state_data.H b/Exec/science/Detonation/problem_initialize_state_data.H index 3b08ce86a9..f594e8f15e 100644 --- a/Exec/science/Detonation/problem_initialize_state_data.H +++ b/Exec/science/Detonation/problem_initialize_state_data.H @@ -62,12 +62,12 @@ void problem_initialize_state_data (int i, int j, int k, burn_state.mu_p = problem::mu_p; burn_state.mu_n = problem::mu_n; - if (burn_state.T > 2.0e9) { - auto nse_state = get_actual_nse_state(burn_state); + if (burn_state.T > 2.5e9) { + auto nse_state = get_actual_nse_state(burn_state, 1.0e-10_rt, true); - for (int n = 0; n < NumSpec; ++n) { - state(i,j,k,UFS+n) = state(i,j,k,URHO) * nse_state.xn[n]; - } + // for (int n = 0; n < NumSpec; ++n) { + // state(i,j,k,UFS+n) = state(i,j,k,URHO) * nse_state.xn[n]; + // } state(i,j,k,UMUP) = nse_state.mu_p; state(i,j,k,UMUN) = nse_state.mu_n; From 4aedefce04c8e9641f3b72810f57b525e1699cec Mon Sep 17 00:00:00 2001 From: Michael Zingale Date: Sat, 9 Mar 2024 18:39:40 -0500 Subject: [PATCH 4/5] better refinement for the 3d massivestar (#2764) --- Exec/science/massive_star/inputs_3d.nse | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Exec/science/massive_star/inputs_3d.nse b/Exec/science/massive_star/inputs_3d.nse index eebdba6af2..d7e2cdd48e 100644 --- a/Exec/science/massive_star/inputs_3d.nse +++ b/Exec/science/massive_star/inputs_3d.nse @@ -58,7 +58,7 @@ castro.sum_interval = 10 # timesteps between computing and printing volu #castro.dtnuc_e = 0.25 #castro.dtnuc_X = 0.25 -amr.ref_ratio = 2 2 2 2 # refinement ratio +amr.ref_ratio = 4 2 2 2 # refinement ratio amr.regrid_int = 10000 # how often to regrid amr.n_error_buf = 4 2 2 2 # number of buffer cells in error est amr.grid_eff = 0.7 # what constitutes an efficient grid @@ -73,9 +73,13 @@ castro.store_burn_weights = 0 amr.small_plot_file = massive_star_smallplt # root name of plot file amr.small_plot_per = 0.5 -amr.small_plot_vars = density Temp in_nse\ +amr.small_plot_vars = density Temp in_nse amr.derive_small_plot_vars = abar Ye enuc MachNumber magvel magvort +#amr.checkpoint_files_output = 0 +#amr.plot_files_output = 0 +#amr.smallplot_files_output = 0 + fab.format = NATIVE_32 castro.plot_per_is_exact = 0 @@ -115,15 +119,15 @@ castro.drive_initial_convection_tmax = 50 amr.refinement_indicators = denerr denerr2 denerr3 amr.refine.denerr.max_level = 1 -amr.refine.denerr.value_greater = 1.e3 +amr.refine.denerr.value_greater = 2.e3 amr.refine.denerr.field_name = density amr.refine.denerr2.max_level = 2 -amr.refine.denerr2.value_greater = 1.e4 +amr.refine.denerr2.value_greater = 3.e4 amr.refine.denerr2.field_name = density amr.refine.denerr3.max_level = 3 -amr.refine.denerr3.value_greater = 1.e5 +amr.refine.denerr3.value_greater = 3.e5 amr.refine.denerr3.field_name = density From fbd880fa0ed49df9005b2c73aeeadfa107ea1c94 Mon Sep 17 00:00:00 2001 From: Michael Zingale Date: Sat, 9 Mar 2024 18:54:44 -0500 Subject: [PATCH 5/5] add style CI from Microphysics (#2769) this checks for tabs and trailing whitespace --- .github/workflows/get_release_txt.py | 6 +- .github/workflows/style.yml | 22 ++ .github/workflows/style/check_tabs.sh | 36 ++++ .../style/check_trailing_whitespaces.sh | 38 ++++ Diagnostics/DustCollapse/analytic.f90 | 10 +- Diagnostics/DustCollapse/analytic.txt | 200 +++++++++--------- Diagnostics/Sedov/main.cpp | 2 +- Docs/preprocess_files.py | 4 +- Docs/source/ConvertCheckpoint.rst | 2 +- Docs/source/EOS.rst | 2 +- Docs/source/FlowChart.rst | 26 +-- Docs/source/Hydrodynamics.rst | 22 +- Docs/source/Introduction.rst | 2 +- Docs/source/Particles.rst | 14 +- Docs/source/build_system.rst | 14 +- Docs/source/creating_a_problem.rst | 4 +- Docs/source/development.rst | 2 +- Docs/source/diffusion.rst | 4 +- Docs/source/faq.rst | 6 +- Docs/source/hse.rst | 2 +- Docs/source/inputs.rst | 4 +- Docs/source/mhd.rst | 4 +- Docs/source/problem_setups.rst | 8 +- Docs/source/radiation.rst | 2 +- Docs/source/reactions.rst | 6 +- Docs/source/software.rst | 6 +- Docs/source/sponge.rst | 6 +- Docs/source/timestepping.rst | 2 +- Docs/source/visualization.rst | 2 +- .../problem_initialize_state_data.H | 2 +- .../StarGrav/problem_initialize_mhd_data.H | 4 +- .../hse_convergence/convergence_plm.sh | 40 ++-- .../hse_convergence/convergence_ppm.sh | 32 +-- .../hse_convergence/convergence_sdc.sh | 40 ++-- .../hydrostatic_adjust/problem_source.H | 2 +- Exec/hydro_tests/Sedov/problem_initialize.H | 2 +- .../Sedov/problem_initialize_state_data.H | 2 +- .../testsuite_analysis/sedov_2d_sph_in_cyl.py | 2 +- .../acoustic_pulse/analysis/slice_multi.py | 2 +- .../acoustic_pulse/convergence_ppm_as_1d.sh | 2 +- .../problem_initialize_state_data.H | 2 +- .../analysis/slice_multi.py | 2 +- .../problem_initialize.H | 2 +- .../gamma_law_bubble/Problem_Derive.cpp | 2 +- .../gresho_vortex/problem_initialize.H | 2 +- .../problem_initialize_state_data.H | 2 +- .../problem_initialize_state_data.H | 14 +- .../test_convect/problem_diagnostics.H | 4 +- .../hydro_tests/test_convect/problem_source.H | 6 +- .../toy_convect/problem_diagnostics.H | 4 +- .../problem_initialize_state_data.H | 2 +- .../Rad2Tshock/python/Analytical-Test.py | 74 +++---- .../Rad2Tshock/python/LowrieEdwardsUnits.py | 4 +- .../Rad2Tshock/python/RadShock.py | 18 +- .../Rad2Tshock/python/initincgs.py | 6 +- .../Rad2Tshock/python/paper-M2-mg.py | 2 +- .../Rad2Tshock/python/paper-M2.py | 2 +- .../radiation_tests/Rad2Tshock/python/phys.py | 4 +- .../problem_initialize_rad_data.H | 2 +- .../problem_initialize_state_data.H | 2 +- .../RadShestakovBolstad/python/initunits.py | 4 +- .../RadShestakovBolstad/python/paper.py | 6 +- .../RadShestakovBolstad/python/phys.py | 4 +- .../RadSphere/Tools/fradsphere.f90 | 14 +- .../radiation_tests/RadSphere/Tools/radbc.f90 | 12 +- .../RadSuOlson/python/paper.py | 4 +- .../RadSuOlsonMG/python/initunits.py | 2 +- .../RadSuOlsonMG/python/paper.py | 8 +- .../RadSuOlsonMG/python/phys.py | 4 +- .../analysis/slice_multi.py | 2 +- .../bubble_convergence/converge_test.sh | 2 +- .../problem_initialize_state_data.H | 2 +- .../nse_test/analysis/slice_multi.py | 2 +- .../analysis/slice_multi.py | 2 +- .../reacting_convergence/problem_initialize.H | 2 +- Exec/reacting_tests/toy_flame/Prob.cpp | 4 +- .../Detonation/analysis/shock_speed.py | 6 +- Exec/science/convective_flame/slice.py | 2 +- Exec/science/flame/Prob.cpp | 4 +- .../flame_wave/analysis/flame_speed.py | 28 +-- .../flame_wave/analysis/front_tracker.py | 136 ++++++------ .../flame_wave/analysis/image_animator.py | 8 +- .../flame_wave/analysis/mpl_image_animator.py | 32 +-- .../flame_wave/analysis/plot_generator.py | 22 +- Exec/science/flame_wave/analysis/profiles.py | 4 +- .../flame_wave/analysis/trajectories_info.py | 2 +- .../frontier/frontier-scaling-2023-04-06.txt | 2 +- .../frontier-scaling-rkc-2023-05-31.txt | 2 +- .../scaling/summit/scaling_20200613.txt | 4 +- .../scaling/summit/scaling_20230407.txt | 4 +- .../massive_star/analysis/initial_model.py | 4 +- .../problem_initialize_state_data.H | 2 +- Exec/science/planet/HotJupiter.cpp | 80 +++---- Exec/science/planet/dataset_lineplot.py | 144 ++++++------- .../wdmerger/problem_initialize_mhd_data.H | 16 +- Exec/science/wdmerger/problem_source.H | 2 +- Exec/science/wdmerger/wdmerger_util.cpp | 4 +- Exec/unit_tests/diffusion_test/Prob.cpp | 2 +- Exec/unit_tests/diffusion_test/README.md | 48 ++--- .../convergence_powerlaw_sdc4.txt | 20 +- .../problem_initialize_state_data.H | 2 +- Source/diffusion/Diffusion.H | 2 +- Source/driver/Castro.H | 12 +- Source/driver/Castro.cpp | 44 ++-- Source/driver/Castro_advance.cpp | 10 +- Source/driver/Castro_io.cpp | 6 +- Source/driver/Castro_setup.cpp | 14 +- Source/driver/Derive.H | 2 +- Source/driver/runtime_parameters.H | 2 +- Source/driver/sum_utils.cpp | 14 +- Source/gravity/Castro_gravity.cpp | 2 +- Source/gravity/Gravity.cpp | 46 ++-- Source/gravity/binary.H | 2 +- Source/hydro/Castro_ctu_rad.cpp | 4 +- Source/hydro/Castro_hydro.cpp | 6 +- Source/hydro/outline.txt | 4 +- Source/hydro/riemann.cpp | 4 +- Source/mhd/electric.cpp | 2 +- Source/mhd/hlld.cpp | 14 +- Source/mhd/mhd_eigen.H | 10 +- Source/problems/Prob.cpp | 2 +- Source/radiation/Castro_radiation.cpp | 10 +- Source/radiation/HABEC.H | 4 +- Source/radiation/HypreABec.cpp | 18 +- Source/radiation/HypreExtMultiABec.cpp | 14 +- Source/radiation/HypreMultiABec.cpp | 2 +- Source/radiation/MGFLD.cpp | 78 +++---- Source/radiation/MGFLDRadSolver.cpp | 94 ++++---- Source/radiation/MGRadBndry.cpp | 4 +- Source/radiation/RadBndry.cpp | 6 +- Source/radiation/RadHydro.H | 2 +- Source/radiation/RadMultiGroup.cpp | 2 +- Source/radiation/RadPlotvar.cpp | 4 +- Source/radiation/RadSolve.cpp | 26 +-- Source/radiation/SGRadSolver.cpp | 2 +- Source/radiation/_interpbndry/RadBndryData.H | 6 +- .../radiation/_interpbndry/RadBndryData.cpp | 2 +- Source/radiation/_interpbndry/RadBoundCond.H | 4 +- .../_interpbndry/RadInterpBndryData.H | 8 +- Source/radiation/fluxlimiter.H | 2 +- Source/rotation/Castro_rotation.H | 2 +- Source/rotation/rotation_sources.cpp | 4 +- Source/sdc/Castro_sdc.cpp | 2 +- Source/sdc/sdc_newton_solve.H | 2 +- Util/ConvertCheckpoint/Embiggen.cpp | 94 ++++---- Util/code_checker/clang_static_analysis.py | 2 +- Util/code_checker/pr_tab_remover.sh | 2 +- Util/scripts/get_castro.sh | 2 +- Util/scripts/get_castro_date.sh | 2 +- Util/yt/README.md | 6 +- Util/yt/vol-wd-spherical-stereo.py | 4 +- Util/yt/vol-wd-spherical.py | 4 +- deploy_docs_action.sh | 6 +- license.txt | 6 +- 154 files changed, 1061 insertions(+), 965 deletions(-) create mode 100644 .github/workflows/style.yml create mode 100755 .github/workflows/style/check_tabs.sh create mode 100755 .github/workflows/style/check_trailing_whitespaces.sh diff --git a/.github/workflows/get_release_txt.py b/.github/workflows/get_release_txt.py index 4837761d6c..30cee63eff 100644 --- a/.github/workflows/get_release_txt.py +++ b/.github/workflows/get_release_txt.py @@ -26,9 +26,9 @@ txt = txt[m.end():].strip() else: txt = "" - - # we now need to substitute characters in the string so that - # the action can deal with line breaks + + # we now need to substitute characters in the string so that + # the action can deal with line breaks txt = txt.replace('%', '%25') txt = txt.replace('\n', '%0A') txt = txt.replace('\r', '%0D') diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml new file mode 100644 index 0000000000..5b5af5e8dd --- /dev/null +++ b/.github/workflows/style.yml @@ -0,0 +1,22 @@ +name: Style + +on: [push, pull_request] + +concurrency: + group: ${{ github.ref }}-${{ github.head_ref }}-style + cancel-in-progress: true + +jobs: + tabs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Tabs + run: .github/workflows/style/check_tabs.sh + + trailing_whitespaces: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Trailing Whitespaces + run: .github/workflows/style/check_trailing_whitespaces.sh diff --git a/.github/workflows/style/check_tabs.sh b/.github/workflows/style/check_tabs.sh new file mode 100755 index 0000000000..f4418644e3 --- /dev/null +++ b/.github/workflows/style/check_tabs.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash + +set -eu -o pipefail + +find . -type d \( -name .git \ + -o -path ./paper \ + -o -name build -o -name install \ + -o -name tmp_build_dir -o -name tmp_install_dir \ + \) -prune -o \ + -type f \( \( -name "*.H" -o -name "*.h" -o -name "*.hh" -o -name "*.hpp" \ + -o -name "*.c" -o -name "*.cc" -o -name "*.cpp" -o -name "*.cxx" \ + -o -name "*.f" -o -name "*.F" -o -name "*.f90" -o -name "*.F90" \ + -o -name "*.py" \ + -o -name "*.md" -o -name "*.rst" \ + -o -name "*.sh" \ + -o -name "*.tex" \ + -o -name "*.txt" \ + -o -name "*.yml" \) \ + -a \( ! -name "*.tab.h" -a ! -name "*.tab.nolint.H" \ + -a ! -name "*.lex.h" -a ! -name "*.lex.nolint.H" \) \ + \) \ + -exec grep -Iq . {} \; \ + -exec sed -i 's/\t/\ \ \ \ /g' {} + + +gitdiff=`git diff` + +if [ -z "$gitdiff" ] +then + exit 0 +else + echo -e "\nTabs are not allowed. Changes suggested by" + echo -e " ${0}\n" + git --no-pager diff + echo "" + exit 1 +fi diff --git a/.github/workflows/style/check_trailing_whitespaces.sh b/.github/workflows/style/check_trailing_whitespaces.sh new file mode 100755 index 0000000000..b33b62cf5c --- /dev/null +++ b/.github/workflows/style/check_trailing_whitespaces.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash + +set -eu -o pipefail + +find . -type d \( -name .git \ + -o -path ./paper \ + -o -name build -o -name install \ + -o -name tmp_build_dir -o -name tmp_install_dir \ + -o -path ./util/gcem \ + \) -prune -o \ + -type f \( \( -name "*.H" -o -name "*.h" -o -name "*.hh" -o -name "*.hpp" \ + -o -name "*.c" -o -name "*.cc" -o -name "*.cpp" -o -name "*.cxx" \ + -o -name "*.f" -o -name "*.F" -o -name "*.f90" -o -name "*.F90" \ + -o -name "*.py" \ + -o -name "*.rst" \ + -o -name "*.sh" \ + -o -name "*.tex" \ + -o -name "*.txt" \ + -o -name "*.yml" \) \ + -a \( ! -name "*.tab.h" -a ! -name "*.tab.nolint.H" \ + -a ! -name "*.lex.h" -a ! -name "*.lex.nolint.H" \ + -a ! -path "./networks/*/reaclib_rates.H" \) \ + \) \ + -exec grep -Iq . {} \; \ + -exec sed -i 's/[[:blank:]]\+$//g' {} + + +gitdiff=`git diff` + +if [ -z "$gitdiff" ] +then + exit 0 +else + echo -e "\nTrailing whitespaces at the end of a line are not allowed. Changes suggested by" + echo -e " ${0}\n" + git --no-pager diff + echo "" + exit 1 +fi diff --git a/Diagnostics/DustCollapse/analytic.f90 b/Diagnostics/DustCollapse/analytic.f90 index d1a4093b26..bb21aae071 100644 --- a/Diagnostics/DustCollapse/analytic.f90 +++ b/Diagnostics/DustCollapse/analytic.f90 @@ -1,6 +1,6 @@ ! Print out the analytic solution for the homologous dust collapse problem, ! from Colgate and White 1966, ApJ, 143, 626. -! +! ! This will yield r(t) as a function of t module constants_module @@ -18,7 +18,7 @@ module constants_module ! we try to do equal timesteps, but eventually, the radius of the ! sphere is changing so quickly that we need to adjust the size of - ! the timestep. The code will take nstep timesteps, with the + ! the timestep. The code will take nstep timesteps, with the ! initial timestep to be (t_f - t_i)/(nstep - 1). Once the radius ! begins to change significantly, we will begin halving the timestep ! as needed. @@ -111,7 +111,7 @@ function f(r,t) result (func) use constants_module implicit none - + double precision, intent(in) :: r, t double precision :: func @@ -130,7 +130,7 @@ function dfdr(r,t) result (dfuncdr) use constants_module implicit none - + double precision, intent(in) :: r, t double precision :: dfuncdr @@ -145,4 +145,4 @@ function dfdr(r,t) result (dfuncdr) end function dfdr - + diff --git a/Diagnostics/DustCollapse/analytic.txt b/Diagnostics/DustCollapse/analytic.txt index e6295cd8d9..d77350424a 100644 --- a/Diagnostics/DustCollapse/analytic.txt +++ b/Diagnostics/DustCollapse/analytic.txt @@ -1,100 +1,100 @@ - 1.00000000000000002E-003 649909135.03119123 - 2.00000001505167783E-003 649636489.29833126 - 3.00000003010335563E-003 649181909.86863339 - 4.00000004515503344E-003 648545142.11149800 - 5.00000006020671125E-003 647725827.94719517 - 6.00000007525838906E-003 646723505.15455902 - 7.00000009031006686E-003 645537605.90191960 - 8.00000010536174554E-003 644167454.93684888 - 9.00000012041342334E-003 642612267.44508624 - 1.00000001354651012E-002 640871146.53866076 - 1.10000001505167790E-002 638943080.30864108 - 1.20000001655684568E-002 636826938.57690644 - 1.30000001806201346E-002 634521469.03385830 - 1.40000001956718124E-002 632025293.06391215 - 1.50000002107234902E-002 629336900.94825923 - 1.60000002257751697E-002 626454646.57255840 - 1.70000002408268493E-002 623376741.51493466 - 1.80000002558785288E-002 620101248.48522842 - 1.90000002709302084E-002 616626074.03659952 - 2.00000002859818879E-002 612948960.51813209 - 2.10000003010335674E-002 609067477.12493813 - 2.20000003160852470E-002 604979010.01064956 - 2.30000003311369265E-002 600680751.32512844 - 2.40000003461886061E-002 596169687.06278419 - 2.50000003612402856E-002 591442583.57983398 - 2.60000003762919651E-002 586495972.61729527 - 2.70000003913436447E-002 581326134.64072454 - 2.80000004063953242E-002 575929080.27714694 - 2.90000004214470038E-002 570300529.59325635 - 3.00000004364986833E-002 564435888.91553104 - 3.10000004515503629E-002 558330224.84078777 - 3.20000004666020424E-002 551978235.02284503 - 3.30000004816537185E-002 545374215.24478471 - 3.40000004967053945E-002 538512022.19347811 - 3.50000005117570706E-002 531385031.23928392 - 3.60000005268087467E-002 523986088.38359386 - 3.70000005418604228E-002 516307455.36294323 - 3.80000005569120988E-002 508340746.68114388 - 3.90000005719637749E-002 500076857.06765401 - 4.00000005870154510E-002 491505877.51411915 - 4.10000006020671270E-002 482616997.59909481 - 4.20000006171188031E-002 473398391.23751330 - 4.30000006321704792E-002 463837082.26100677 - 4.40000006472221553E-002 453918785.24165601 - 4.50000006622738313E-002 443627715.70000380 - 4.60000006773255074E-002 432946362.08711797 - 4.70000006923771835E-002 421855209.57271582 - 4.80000007074288595E-002 410332402.41148412 - 4.90000007224805356E-002 398353327.09658945 - 5.00000007375322117E-002 385890092.01365507 - 5.10000007525838878E-002 372910869.89102477 - 5.20000007676355638E-002 359379055.40856612 - 5.30000007826872399E-002 345252169.23859328 - 5.40000007977389160E-002 330480407.04867899 - 5.50000008127905921E-002 315004679.66142160 - 5.60000008278422681E-002 298753904.09996289 - 5.70000008428939442E-002 281641156.80718756 - 5.80000008579456203E-002 263558033.79028088 - 5.90000008729972963E-002 244366057.62596649 - 6.00000008880489724E-002 223882951.33293855 - 6.10000009031006485E-002 201859366.65185842 - 6.20000009181523246E-002 177936241.02956882 - 6.30000009332040006E-002 151557910.30957550 - 6.40000009482556836E-002 121765291.35095723 - 6.50000009633073667E-002 86559267.089058787 - 6.55000009708332082E-002 65426461.293441042 - 6.57500009745961289E-002 53302138.933172308 - 6.60000009783590497E-002 39426676.852969810 - 6.61250009802405031E-002 31420419.466817942 - 6.61875009811812298E-002 26990556.317915626 - 6.62500009821219565E-002 22141701.774704639 - 6.63125009830626833E-002 16660747.853145797 - 6.63437509835330536E-002 13545243.019599622 - 6.63750009840034239E-002 10005961.472616604 - 6.63906259842386021E-002 7977189.7376845730 - 6.63984384843561981E-002 6859353.5722278254 - 6.64062509844737942E-002 5640194.0016339840 - 6.64140634845913902E-002 4269001.8157937871 - 6.64179697346501813E-002 3494062.1127031618 - 6.64218759847089724E-002 2619905.3127237577 - 6.64238291097383748E-002 2123622.6108079469 - 6.64257822347677773E-002 1559918.6189464168 - 6.64267587972824786E-002 1236456.8137497872 - 6.64272470785398222E-002 1057927.6240404730 - 6.64277353597971659E-002 862738.15614189487 - 6.64282236410545096E-002 642083.82668608800 - 6.64284677816831814E-002 516374.94981919462 - 6.64287119223118533E-002 372785.75911960861 - 6.64288339926261961E-002 289635.30197500519 - 6.64288950277833606E-002 243297.18415601959 - 6.64289560629405251E-002 192010.14249639038 - 6.64289865805191143E-002 163648.20723028996 - 6.64290170980977035E-002 132563.58387729200 - 6.64290476156762927E-002 97253.723591483620 - 6.64290628744655803E-002 76985.780308764486 - 6.64290705038602242E-002 65794.226798446252 - 6.64290781332548680E-002 53550.730279557472 - 6.64290857626495118E-002 39692.287404006805 - 6.64290895773468337E-002 31781.040806673544 - 6.64290933920441556E-002 22714.975861705043 + 1.00000000000000002E-003 649909135.03119123 + 2.00000001505167783E-003 649636489.29833126 + 3.00000003010335563E-003 649181909.86863339 + 4.00000004515503344E-003 648545142.11149800 + 5.00000006020671125E-003 647725827.94719517 + 6.00000007525838906E-003 646723505.15455902 + 7.00000009031006686E-003 645537605.90191960 + 8.00000010536174554E-003 644167454.93684888 + 9.00000012041342334E-003 642612267.44508624 + 1.00000001354651012E-002 640871146.53866076 + 1.10000001505167790E-002 638943080.30864108 + 1.20000001655684568E-002 636826938.57690644 + 1.30000001806201346E-002 634521469.03385830 + 1.40000001956718124E-002 632025293.06391215 + 1.50000002107234902E-002 629336900.94825923 + 1.60000002257751697E-002 626454646.57255840 + 1.70000002408268493E-002 623376741.51493466 + 1.80000002558785288E-002 620101248.48522842 + 1.90000002709302084E-002 616626074.03659952 + 2.00000002859818879E-002 612948960.51813209 + 2.10000003010335674E-002 609067477.12493813 + 2.20000003160852470E-002 604979010.01064956 + 2.30000003311369265E-002 600680751.32512844 + 2.40000003461886061E-002 596169687.06278419 + 2.50000003612402856E-002 591442583.57983398 + 2.60000003762919651E-002 586495972.61729527 + 2.70000003913436447E-002 581326134.64072454 + 2.80000004063953242E-002 575929080.27714694 + 2.90000004214470038E-002 570300529.59325635 + 3.00000004364986833E-002 564435888.91553104 + 3.10000004515503629E-002 558330224.84078777 + 3.20000004666020424E-002 551978235.02284503 + 3.30000004816537185E-002 545374215.24478471 + 3.40000004967053945E-002 538512022.19347811 + 3.50000005117570706E-002 531385031.23928392 + 3.60000005268087467E-002 523986088.38359386 + 3.70000005418604228E-002 516307455.36294323 + 3.80000005569120988E-002 508340746.68114388 + 3.90000005719637749E-002 500076857.06765401 + 4.00000005870154510E-002 491505877.51411915 + 4.10000006020671270E-002 482616997.59909481 + 4.20000006171188031E-002 473398391.23751330 + 4.30000006321704792E-002 463837082.26100677 + 4.40000006472221553E-002 453918785.24165601 + 4.50000006622738313E-002 443627715.70000380 + 4.60000006773255074E-002 432946362.08711797 + 4.70000006923771835E-002 421855209.57271582 + 4.80000007074288595E-002 410332402.41148412 + 4.90000007224805356E-002 398353327.09658945 + 5.00000007375322117E-002 385890092.01365507 + 5.10000007525838878E-002 372910869.89102477 + 5.20000007676355638E-002 359379055.40856612 + 5.30000007826872399E-002 345252169.23859328 + 5.40000007977389160E-002 330480407.04867899 + 5.50000008127905921E-002 315004679.66142160 + 5.60000008278422681E-002 298753904.09996289 + 5.70000008428939442E-002 281641156.80718756 + 5.80000008579456203E-002 263558033.79028088 + 5.90000008729972963E-002 244366057.62596649 + 6.00000008880489724E-002 223882951.33293855 + 6.10000009031006485E-002 201859366.65185842 + 6.20000009181523246E-002 177936241.02956882 + 6.30000009332040006E-002 151557910.30957550 + 6.40000009482556836E-002 121765291.35095723 + 6.50000009633073667E-002 86559267.089058787 + 6.55000009708332082E-002 65426461.293441042 + 6.57500009745961289E-002 53302138.933172308 + 6.60000009783590497E-002 39426676.852969810 + 6.61250009802405031E-002 31420419.466817942 + 6.61875009811812298E-002 26990556.317915626 + 6.62500009821219565E-002 22141701.774704639 + 6.63125009830626833E-002 16660747.853145797 + 6.63437509835330536E-002 13545243.019599622 + 6.63750009840034239E-002 10005961.472616604 + 6.63906259842386021E-002 7977189.7376845730 + 6.63984384843561981E-002 6859353.5722278254 + 6.64062509844737942E-002 5640194.0016339840 + 6.64140634845913902E-002 4269001.8157937871 + 6.64179697346501813E-002 3494062.1127031618 + 6.64218759847089724E-002 2619905.3127237577 + 6.64238291097383748E-002 2123622.6108079469 + 6.64257822347677773E-002 1559918.6189464168 + 6.64267587972824786E-002 1236456.8137497872 + 6.64272470785398222E-002 1057927.6240404730 + 6.64277353597971659E-002 862738.15614189487 + 6.64282236410545096E-002 642083.82668608800 + 6.64284677816831814E-002 516374.94981919462 + 6.64287119223118533E-002 372785.75911960861 + 6.64288339926261961E-002 289635.30197500519 + 6.64288950277833606E-002 243297.18415601959 + 6.64289560629405251E-002 192010.14249639038 + 6.64289865805191143E-002 163648.20723028996 + 6.64290170980977035E-002 132563.58387729200 + 6.64290476156762927E-002 97253.723591483620 + 6.64290628744655803E-002 76985.780308764486 + 6.64290705038602242E-002 65794.226798446252 + 6.64290781332548680E-002 53550.730279557472 + 6.64290857626495118E-002 39692.287404006805 + 6.64290895773468337E-002 31781.040806673544 + 6.64290933920441556E-002 22714.975861705043 diff --git a/Diagnostics/Sedov/main.cpp b/Diagnostics/Sedov/main.cpp index 4a32f24b6b..348ad545e0 100644 --- a/Diagnostics/Sedov/main.cpp +++ b/Diagnostics/Sedov/main.cpp @@ -304,7 +304,7 @@ int main(int argc, char* argv[]) e_bin[index] += (fab(i,j,k,rhoe_comp) / fab(i,j,k,dens_comp)) * vol; volcount[index] += vol; - + } } } diff --git a/Docs/preprocess_files.py b/Docs/preprocess_files.py index d28b983fb2..7e9bf06790 100644 --- a/Docs/preprocess_files.py +++ b/Docs/preprocess_files.py @@ -16,7 +16,7 @@ def strip_directives(filename, filepath, outpath): """ Read in file, remove all preprocessor directives and output. - This is also going to switch square brackets initializing arrays to + This is also going to switch square brackets initializing arrays to parentheses and remove the new-line characters """ @@ -43,7 +43,7 @@ def strip_directives(filename, filepath, outpath): continue # loop over files in subdirectories and run strip_directives on all - # C++ header files + # C++ header files for f in sorted(os.listdir(os.path.join(rootdir, subdir))): if (f[-2:] == ".H"): strip_directives(f, os.path.join(rootdir, subdir), outdir) diff --git a/Docs/source/ConvertCheckpoint.rst b/Docs/source/ConvertCheckpoint.rst index 9f0b9834fd..58a82b5a8e 100644 --- a/Docs/source/ConvertCheckpoint.rst +++ b/Docs/source/ConvertCheckpoint.rst @@ -39,7 +39,7 @@ Now let’s suppose that you want to grow the domain by a factor of 8 and cover that new larger domain with a level that is a factor of 2 coarser than the existing level 0 grids. -#. First, set ``DIM =`` in the GNUmakefile, and type ``make`` in the +#. First, set ``DIM =`` in the GNUmakefile, and type ``make`` in the ``Util/ConvertCheckpoint/`` directory. This will make an executable from the ``Embiggen.cpp`` code. diff --git a/Docs/source/EOS.rst b/Docs/source/EOS.rst index 6ddc5321f9..fb42cc888c 100644 --- a/Docs/source/EOS.rst +++ b/Docs/source/EOS.rst @@ -4,7 +4,7 @@ Equation of State Castro is written in a modular fashion so that the EOS can be supplied by the user. No equations of state -are distributed with Castro, instead they are part +are distributed with Castro, instead they are part of the separate `Microphysics repository `_. Most equations of state are written to take :math:`(\rho, T, X_k)` as diff --git a/Docs/source/FlowChart.rst b/Docs/source/FlowChart.rst index a47b22ad55..0af763298a 100644 --- a/Docs/source/FlowChart.rst +++ b/Docs/source/FlowChart.rst @@ -56,7 +56,7 @@ The time-integration method used is controlled by * ``time_integration_method = 2``: this is a full implementation of the spectral deferred corrections formalism, with both 2nd and 4th order integration implemented. At the moment, this does not support - multilevel domains. Note: because of differences in the interfaces with the + multilevel domains. Note: because of differences in the interfaces with the default Strang method, you must compile with ``USE_TRUE_SDC = TRUE`` for this method to work. @@ -214,7 +214,7 @@ of each step. Strang+CTU Evolution ==================== -``do_advance_ctu()`` in ``Castro_advance_ctu.cpp`` +``do_advance_ctu()`` in ``Castro_advance_ctu.cpp`` This described the flow using Strang splitting and the CTU hydrodynamics (or MHD) method, including gravity, rotation, and @@ -264,7 +264,7 @@ defined consistently, i.e., :math:`\rho^n` and :math:`\phi^n` satisfy the Poisso \Delta \phi^n = 4\pi G\rho^n -(see :ref:`ch:gravity` for more details about how the Poisson equation is solved.) +(see :ref:`ch:gravity` for more details about how the Poisson equation is solved.) Note that in :eq:`eq:source_correct`, we can actually do some sources implicitly by updating density first, and then momentum, @@ -372,7 +372,7 @@ In the code, the objective is to evolve the state from the old time, [``do_old_sources()`` ] The time level :math:`n` sources are computed, and added to the - StateData ``Source_Type``. + StateData ``Source_Type``. The sources that we deal with here are: @@ -527,14 +527,14 @@ In the code, the objective is to evolve the state from the old time, Now we correct the source terms applied to ``S_new`` so they are time-centered. Previously we added :math:`\Delta t\, \Sb(\Ub^\star)` to the state, when - we really want + we really want :math:`(\Delta t/2)[\Sb(\Ub^\star + \Sb(\Ub^{n+1,(b)})]` . We start by computing the source term vector :math:`\Sb(\Ub^{n+1,(b)})` using the updated state, :math:`\Ub^{n+1,(b)}`. We then compute the correction, :math:`(\Delta t/2)[\Sb(\Ub^{n+1,(b)}) - \Sb(\Ub^\star)]` to add to :math:`\Ub^{n+1,(b)}` to give us the properly time-centered source, - and the fully updated state, :math:`\Ub^{n+1,(c)}`. + and the fully updated state, :math:`\Ub^{n+1,(c)}`. This correction is stored in the ``new_sources`` MultiFab [1]_. @@ -608,7 +608,7 @@ We write our evolution equation as: .. math:: \frac{\partial \Ub}{\partial t} = {\bf A}(\Ub) + {\bf R}(\Ub) -where :math:`{\bf A}(\Ub) = -\nabla \cdot {\bf F}(\Ub) + {\bf S}(\Ub)`, with the +where :math:`{\bf A}(\Ub) = -\nabla \cdot {\bf F}(\Ub) + {\bf S}(\Ub)`, with the hydrodynamic source terms, :math:`{\bf S}` grouped together with the flux divergence. The SDC update looks at the solution a several time nodes (the number @@ -635,7 +635,7 @@ is important when we consider the 4th order method. In Castro, there are two parameters that together determine the number and location of the temporal nodes, the accuracy of the integral, and hence the overall accuracy in time: ``castro.sdc_order`` and -``castro.sdc_quadrature``. +``castro.sdc_quadrature``. ``castro.sdc_quadrature = 0`` uses Gauss-Lobatto integration, which includes both the starting and ending @@ -686,7 +686,7 @@ The overall evolution appears as: * ``A_new`` : the advective term at each time node at the current iteration. - + * ``R_old`` : the reactive source term at each time node at the old iteration. @@ -749,7 +749,7 @@ The update through all time nodes for a single iteration is done by * Call ``construct_mol_hydro_source`` to get the advective update at the current time node, stored in ``A_new[m]``. - + * Bootstrap the first iteration. For the first iteration, we don't have the old iteration's @@ -789,7 +789,7 @@ The update through all time nodes for a single iteration is done by #. Store the reaction information for the plotfiles. #. Call ``finalize_do_advance`` to clean up the memory. - + Simplified-SDC Evolution ======================== @@ -855,7 +855,7 @@ summarize those differences. \Sb^\mathrm{corr} = \frac{1}{2} \left ( \Sb^{n+1,(k-1)} - S^n \right ) where :math:`\Sb^n` does not have an iteration subscript, since we always have the - same old time state. + same old time state. Applying this corrector to the the source at time :math:`n`, will give us a source that is time-centered, @@ -890,7 +890,7 @@ summarize those differences. We first compute :math:`\mathcal{A}(\Ub)` using ``hydro_sources``, ``old_source``, and ``new_source`` via the ``sum_of_source()`` function. This produces an advective source of the form: - + .. math:: \left [ \mathcal{A}(\Ub) \right ]^{n+1/2} = - [\nabla \cdot {\bf F}]^{n+1/2} + \frac{1}{2} (S^n + S^{n+1}) diff --git a/Docs/source/Hydrodynamics.rst b/Docs/source/Hydrodynamics.rst index edaaf8accd..9c22cf8fa9 100644 --- a/Docs/source/Hydrodynamics.rst +++ b/Docs/source/Hydrodynamics.rst @@ -100,7 +100,7 @@ several main data structures that hold the state. source terms. ``NQSRC`` ≤ ``NQ``. .. note:: if ``RADIATION`` is defined, then only the gas/hydro terms are - present in ``NQSRC``. + present in ``NQSRC``. :numref:`table:primlist` gives the names of the primitive variable integer keys for accessing these arrays. Note, unless otherwise specified the quantities without a subscript @@ -364,13 +364,13 @@ The primitive variable equations for density, velocity, and pressure are: \begin{align} \frac{\partial\rho}{\partial t} &= -\ub\cdot\nabla\rho - \rho\nabla\cdot\ub + S_{{\rm ext},\rho} \\ % - \frac{\partial\ub}{\partial t} &= -\ub\cdot\nabla\ub - \frac{1}{\rho}\nabla p + \gb + + \frac{\partial\ub}{\partial t} &= -\ub\cdot\nabla\ub - \frac{1}{\rho}\nabla p + \gb + \frac{1}{\rho} (\Sb_{{\rm ext},\rho\ub} - \ub \; S_{{\rm ext},\rho}) \\ \frac{\partial p}{\partial t} &= -\ub\cdot\nabla p - \rho c^2\nabla\cdot\ub + \left(\frac{\partial p}{\partial \rho}\right)_{e,X}S_{{\rm ext},\rho}\nonumber\\ &+\ \frac{1}{\rho}\sum_k\left(\frac{\partial p}{\partial X_k}\right)_{\rho,e,X_j,j\neq k}\left(\rho\dot\omega_k + S_{{\rm ext},\rho X_k} - X_kS_{{\rm ext},\rho}\right)\nonumber\\ & +\ \frac{1}{\rho}\left(\frac{\partial p}{\partial e}\right)_{\rho,X}\left[-eS_{{\rm ext},\rho} - \sum_k\rho q_k\dot\omega_k + \nabla\cdot\kth\nabla T \right.\nonumber\\ - & \quad\qquad\qquad\qquad+\ S_{{\rm ext},\rho E} - \ub\cdot\left(\Sb_{{\rm ext},\rho\ub} - \frac{\ub}{2}S_{{\rm ext},\rho}\right)\Biggr] + & \quad\qquad\qquad\qquad+\ S_{{\rm ext},\rho E} - \ub\cdot\left(\Sb_{{\rm ext},\rho\ub} - \frac{\ub}{2}S_{{\rm ext},\rho}\right)\Biggr] \end{align} The advected quantities appear as: @@ -382,7 +382,7 @@ The advected quantities appear as: ( S_{{\rm ext},\rho A_k} - A_k S_{{\rm ext},\rho} ), \\ \frac{\partial X_k}{\partial t} &= -\ub\cdot\nabla X_k + \dot\omega_k + \frac{1}{\rho} ( S_{{\rm ext},\rho X_k} - X_k S_{{\rm ext},\rho} ), \\ - \frac{\partial Y_k}{\partial t} &= -\ub\cdot\nabla Y_k + \frac{1}{\rho} + \frac{\partial Y_k}{\partial t} &= -\ub\cdot\nabla Y_k + \frac{1}{\rho} ( S_{{\rm ext},\rho Y_k} - Y_k S_{{\rm ext},\rho} ). \end{align} @@ -399,7 +399,7 @@ We augment the above system with an internal energy equation: .. math:: \begin{align} - \frac{\partial(\rho e)}{\partial t} &= - \ub\cdot\nabla(\rho e) - (\rho e+p)\nabla\cdot\ub - \sum_k \rho q_k\dot\omega_k + \frac{\partial(\rho e)}{\partial t} &= - \ub\cdot\nabla(\rho e) - (\rho e+p)\nabla\cdot\ub - \sum_k \rho q_k\dot\omega_k + \nabla\cdot\kth\nabla T + S_{{\rm ext},\rho E} \nonumber\\ & -\ \ub\cdot\left(\Sb_{{\rm ext},\rho\ub}-\frac{1}{2}S_{{\rm ext},\rho}\ub\right), \end{align} @@ -794,7 +794,7 @@ equations in 1D, for simplicity): .. math:: \alpha_{i,\pm} = \frac{\alpha_{i,\pm}(D^2s)_{i,\text{lim}}}{\max\left[(D^2s)_{i},1\times 10^{-10}\right]} - - If we are not at an extremum and + - If we are not at an extremum and :math:`|\alpha_{i,\pm}| > 2|\alpha_{i,\mp}|`, then define .. math:: s = \text{sign}(\alpha_{i,\mp}) @@ -937,7 +937,7 @@ neighboring cell-centered values of :math:`c`. We have also computed :math:`\rho_{\rm small}, p_{\rm small}`, and :math:`c_{\rm small}` using cell-centered data. -Here are the steps. First, define +Here are the steps. First, define :math:`(\rho c)_{\rm small} = \rho_{\rm small}c_{\rm small}`. Then, define: .. math:: (\rho c)_{L/R} = \max\left[(\rho c)_{\rm small},\left|\Gamma_{L/R},p_{L/R},\rho_{L/R}\right|\right]. @@ -1003,8 +1003,8 @@ Then, define (\rho e)_{\rm gdnv} &=& f(\rho e)^* + (1-f)(\rho e)_0. \end{align} -Finally, if :math:`c_{\rm out} < 0`, set -:math:`\rho_{\rm gdnv}=\rho_0, u_{\rm gdnv}=u_0, p_{\rm gdnv}=p_0`, and +Finally, if :math:`c_{\rm out} < 0`, set +:math:`\rho_{\rm gdnv}=\rho_0, u_{\rm gdnv}=u_0, p_{\rm gdnv}=p_0`, and :math:`(\rho e)_{\rm gdnv}=(\rho e)_0`. If :math:`c_{\rm in}\ge 0`, set :math:`\rho_{\rm gdnv}=\rho^*, u_{\rm gdnv}=u^*, p_{\rm gdnv}=p^*`, and :math:`(\rho e)_{\rm gdnv}=(\rho e)^*`. @@ -1166,8 +1166,8 @@ where :math:`0 \leq \theta_{{\rm i}+1/2} \leq 1` is a scalar, and :math:`\mathbf where :math:`0 < \text{CFL} < 1` is the CFL safety factor (the method is guaranteed to preserve positivity as long as :math:`\text{CFL} < 1/2`), and :math:`\alpha` is a scalar that ensures multi-dimensional correctness -(:math:`\alpha = 1` in 1D, :math:`1/2` in 2D, :math:`1/3` in 3D). -:math:`\mathbf{F}_{{\rm i}}` is the flux of material evaluated at the zone center +(:math:`\alpha = 1` in 1D, :math:`1/2` in 2D, :math:`1/3` in 3D). +:math:`\mathbf{F}_{{\rm i}}` is the flux of material evaluated at the zone center :math:`{\rm i}` using the cell-centered quantities :math:`\mathbf{U}`. The scalar :math:`\theta_{{\rm i}+1/2}` is chosen at every interface by calculating the update that would be obtained from , setting diff --git a/Docs/source/Introduction.rst b/Docs/source/Introduction.rst index 0395a625ed..0755432b54 100644 --- a/Docs/source/Introduction.rst +++ b/Docs/source/Introduction.rst @@ -72,7 +72,7 @@ Castro works in CGS units unless otherwise specified. throughout the code documentation and papers. .. _table:units: - + .. table:: Common quantities and units. +-----------------------+-----------------------+-----------------------+ diff --git a/Docs/source/Particles.rst b/Docs/source/Particles.rst index 10cbca4cd2..05a762df47 100644 --- a/Docs/source/Particles.rst +++ b/Docs/source/Particles.rst @@ -49,12 +49,12 @@ example, an input file for a model fluid with 6 particles in 2-D Cartesian coordinates may look like:: 6 - 3.28125e+08 9.9198e+08 - 5.46875e+08 9.9198e+08 - 7.65625e+08 9.9198e+08 - 9.84375e+08 9.9198e+08 - 1.20312e+09 9.9198e+08 - 1.42188e+09 9.9198e+08 + 3.28125e+08 9.9198e+08 + 5.46875e+08 9.9198e+08 + 7.65625e+08 9.9198e+08 + 9.84375e+08 9.9198e+08 + 1.20312e+09 9.9198e+08 + 1.42188e+09 9.9198e+08 According to this input file, the 6 particles will be positioned at the same height (same :math:`y` coordinate in the second column), @@ -105,7 +105,7 @@ a particle and extract its history (i.e., the trajectory in :numref:`fig:particl A model atmosphere with the arrows showing the direction of the fluid motion. .. _fig:particletrajectory: -.. figure:: tracer_trajectory.png +.. figure:: tracer_trajectory.png The trajectories of 500 particles following the fluid motion on the atmosphere. The particles are initially positioned at five diff --git a/Docs/source/build_system.rst b/Docs/source/build_system.rst index 928f383871..832315fe51 100644 --- a/Docs/source/build_system.rst +++ b/Docs/source/build_system.rst @@ -27,7 +27,7 @@ Most of these are parameters from AMReX. * ``USE_ALL_CASTRO``: compile all of the core Castro directories. This is the default (``TRUE``), and should not be changed for general simulations. The purpose of this flag is for unit tests, which - do not need all of the Castro directories compiled. + do not need all of the Castro directories compiled. * ``USE_AMR_CORE``: compile all of the core AMReX directories, including ``Base/``, ``AmrCore/``, ``Amr/``, and ``Boundary/``. This defaults @@ -129,7 +129,7 @@ Microphysics Parameters composition if we are using the ``general_null`` network (e.g., ``gammalaw.net``). The build system will look for this file in the Microphysics repo. - * ``INTEGRATOR_DIR``: this is the ODE integrator to use to integrate the + * ``INTEGRATOR_DIR``: this is the ODE integrator to use to integrate the reaction system. This is expected to be a subdirectory in the Microphysics repo. @@ -166,14 +166,14 @@ Hydrodynamics and Source Term Parameters Simulation Flow Parameters ^^^^^^^^^^^^^^^^^^^^^^^^^^ - * ``USE_POST_SIM``: if this is defined, then Castro will call the user-defined + * ``USE_POST_SIM``: if this is defined, then Castro will call the user-defined routine ``problem_post_simulation()`` after the full evolution of the problem has ended. .. index:: USE_POST_SIM - * ``USE_MAESTRO_INIT``: this enables the code to allow Castro to restart from a - Maestro simulation. This will need to be updated in the future to allow for + * ``USE_MAESTRO_INIT``: this enables the code to allow Castro to restart from a + Maestro simulation. This will need to be updated in the future to allow for restarts from MAESTROeX. .. index:: USE_MAESTRO_INIT @@ -199,7 +199,7 @@ Build Process Procedure At build time, there are a number of source files that are autogenerated based on the configuration of the problem. Most of these files are output into - ``tmp_build_dir/castro_sources/Nd.COMP.OPTIONS.EXE/``, where ``N`` is the + ``tmp_build_dir/castro_sources/Nd.COMP.OPTIONS.EXE/``, where ``N`` is the dimensionality, ``COMP`` is the compiler name, and ``OPTIONS`` can be any number of options (``MPI``, ``DEBUG``, ...). @@ -253,7 +253,7 @@ This is the current build system process. * If the problem directory defines a ``_prob_params`` then it is parsed and used to C++ header and source files ``prob_parameters.H`` and ``prob_parameters.cpp``. These handle reading the ``problem.*`` parameters from the inputs file. - Even without a problem-specific ``_prob_params``, all of the + Even without a problem-specific ``_prob_params``, all of the variables in ``Castro/Source/problems/_default_prob_params`` will be included. * The script ``Castro/Util/scripts/write_probdata.py`` is used diff --git a/Docs/source/creating_a_problem.rst b/Docs/source/creating_a_problem.rst index 4ab653511c..84d471fa9e 100644 --- a/Docs/source/creating_a_problem.rst +++ b/Docs/source/creating_a_problem.rst @@ -74,7 +74,7 @@ The variables will all be initialized for the GPU as well. Problem Initialization ---------------------- -Here we describe the main problem initialization routines. +Here we describe the main problem initialization routines. .. index:: initialize_problem @@ -96,7 +96,7 @@ Here we describe the main problem initialization routines. gravity) and in computing some of the derived variables (like angular momentum). - If you need coordinate information, it can be obtained + If you need coordinate information, it can be obtained by constructing a ``Geometry`` object using ``DefaultGeometry()`` and accessing its ``ProbLo()`` and ``ProbHi()`` methods. diff --git a/Docs/source/development.rst b/Docs/source/development.rst index 9e28bbca19..b5cc8590a8 100644 --- a/Docs/source/development.rst +++ b/Docs/source/development.rst @@ -138,5 +138,5 @@ Continuous Integration We github actions to run integration tests on the code and to build and deploy the documentation. -Currently, we run the `clang static analyzer `_, which finds potential bugs in the code. It also runs a script to convert any tabs in the code into spaces. Both of these are run on pull requests to the Castro GitHub repo, and are run weekly on the development branch. +Currently, we run the `clang static analyzer `_, which finds potential bugs in the code. It also runs a script to convert any tabs in the code into spaces. Both of these are run on pull requests to the Castro GitHub repo, and are run weekly on the development branch. diff --git a/Docs/source/diffusion.rst b/Docs/source/diffusion.rst index d38f58eebf..bf5bf1165b 100644 --- a/Docs/source/diffusion.rst +++ b/Docs/source/diffusion.rst @@ -39,7 +39,7 @@ specific heat at constant volume. Finally, ignore hydrodynamics, so .. math:: \frac{\partial T}{\partial t} = D \nabla^2 T -where :math:`D \equiv \kth/(\rho c_v)`. +where :math:`D \equiv \kth/(\rho c_v)`. The timestep limiter for this is: @@ -84,7 +84,7 @@ code by linearly scaling the conductivity to zero between these limits, e.g., Conductivities ============== -To complete the setup, a thermal conductivity must be specified. These +To complete the setup, a thermal conductivity must be specified. These are supplied by Microphysics, and use an interface similar to the equation of state interface. diff --git a/Docs/source/faq.rst b/Docs/source/faq.rst index c723b745db..2d806224a2 100644 --- a/Docs/source/faq.rst +++ b/Docs/source/faq.rst @@ -77,7 +77,7 @@ Debugging - ``amrex.fpe_trap_overflow`` - For further capabilities, you can get + For further capabilities, you can get more information than the backtrace of the call stack info by instrumenting the code. Here is an example. You know the line ``Real rho = state(cell,0);`` is @@ -191,7 +191,7 @@ Managing Runs #. *How can I check the compilation parameters of a Castro executable?* - The build information (including git hashes, modules, EoS, network, etc.) can be displayed by running the executable as + The build information (including git hashes, modules, EoS, network, etc.) can be displayed by running the executable as :: @@ -226,7 +226,7 @@ Runtime Errors specie abundance validity check by setting ``castro.abundance_failure_tolerance`` to a higher value, or increasing the density floor below which this is ignored by changing ``castro.abundance_failure_rho_cutoff``. - + Visualization ============= diff --git a/Docs/source/hse.rst b/Docs/source/hse.rst index c6cf7e9df3..a58acee2ce 100644 --- a/Docs/source/hse.rst +++ b/Docs/source/hse.rst @@ -46,7 +46,7 @@ The 4th order MC limiter uses information in zones :math:`\{i-2,i-1,i,i+1,i+2\}`. We pick zone ``i`` as the reference and integrate from ``i`` to the 4 other zone centers, and construct :math:`\{\tilde{p}_{i-2}, \tilde{p}_{i-1}, \tilde{p}_{i}, \tilde{p}_{i+1}, \tilde{p}_{i+2}\}`. We then limit on this, giving us the change in the excess -pressure over the zone, :math:`\Delta \tilde{p}_i`. Finally, we +pressure over the zone, :math:`\Delta \tilde{p}_i`. Finally, we construct the total slope (including the hydrostatic part) as: .. math:: diff --git a/Docs/source/inputs.rst b/Docs/source/inputs.rst index f857462769..75bd182d9f 100644 --- a/Docs/source/inputs.rst +++ b/Docs/source/inputs.rst @@ -3,14 +3,14 @@ Input Files *********** The Castro executable uses an inputs file at runtime to set and -alter the behavior of the algorithm and initial conditions. +alter the behavior of the algorithm and initial conditions. Runtime parameters take the form ``namespace.parameter = value`` , where *namespace* identifies the major code component. Some parameters take multiple values separated by spaces. Typically -named ``inputs``, it +named ``inputs``, it * Sets the AMReX parameters for gridding, refinement, etc., through the ``geometry`` and ``amr`` namespaces. diff --git a/Docs/source/mhd.rst b/Docs/source/mhd.rst index 833a7f5850..5ef47d31e0 100644 --- a/Docs/source/mhd.rst +++ b/Docs/source/mhd.rst @@ -88,10 +88,10 @@ components. This is done separately from the main conserved fluid state. The conserved fluid state is initialized in ``problem_initialize_state_data()`` just as -with pure hydrodynamics problems. Note that you do not need to include +with pure hydrodynamics problems. Note that you do not need to include the magnetic energy contribution to the total energy density, ``UEDEN``. After this initialization, the driver handles the addition of the magnetic -contribution. +contribution. Hydrodynamics Update diff --git a/Docs/source/problem_setups.rst b/Docs/source/problem_setups.rst index 7e0d05fcc9..fcfe62b083 100644 --- a/Docs/source/problem_setups.rst +++ b/Docs/source/problem_setups.rst @@ -44,7 +44,7 @@ problems are: gravitational potential of a perfect cube, for which there is an analytic solution. It tests our isolated boundary conditions. This was demonstrated in :cite:`katz:2016`. - + * ``hydro_tests``: @@ -114,7 +114,7 @@ problems are: * ``Rad2Tshock``: This sets up a radiating shock that can be compared to a semi-analytic solution described in :cite:`lowrieedwards`. - + * ``RadFront``: This is the optically-thin streaming of a radiation front problem demonstrated originally in Castro in :cite:`CastroII`. @@ -127,7 +127,7 @@ problems are: * ``RadSphere``: This is a multigroup radiating sphere test problem with an analytic solution, described in :cite:`graziani:2008` and :cite:`swestymyra:2009` and shown in Castro in :cite:`CastroIII`. - + * ``RadSuOlson``: This is a non-equlibrium Marshak wave test described in :cite:`suolson:1996` and shown in Castro in :cite:`CastroII`. @@ -136,7 +136,7 @@ problems are: * ``RadThermalWave``: A thermal wave test adapted from :cite:`howellgreenough:2003` and shown in Castro in :cite:`CastroII`. - + * ``reacting_tests``: * ``bubble_convergence``: a reacting bubble problem designed for measuring the convergence of diff --git a/Docs/source/radiation.rst b/Docs/source/radiation.rst index dda11f1d5f..6587219d74 100644 --- a/Docs/source/radiation.rst +++ b/Docs/source/radiation.rst @@ -204,7 +204,7 @@ The parameters describing the opacity include: singular, we must set some floors in practice to prevent numerical issues. We have one floor for the opacity, which is applied to both the Planck and Rosseland opacities, and we - also have a temperature floor. + also have a temperature floor. - ``opacity.kappa_floor = 1.d-50`` diff --git a/Docs/source/reactions.rst b/Docs/source/reactions.rst index cbef46f81d..ed23b9d746 100644 --- a/Docs/source/reactions.rst +++ b/Docs/source/reactions.rst @@ -188,7 +188,7 @@ In ``Castro_react.cpp``, the flow is: * $U^\mathrm{new}(\rho X_k) = U^\mathrm{new}(\rho) \cdot \mathtt{burn\_state.xn[k]}$ * if ``NAUX_NET > 0``: $U^\mathrm{new}(\rho \alpha_k) = U^\mathrm{new}(\rho) \cdot \mathtt{burn\_state.aux[k]}$ - + * if ``NSE_NET`` : * $U(\mu_p) = \mathtt{burn\_state.mu\_p}$ @@ -255,7 +255,7 @@ In ``Castro_react.cpp``, the flow is: * Store the advective update that will be used during the SDC integration. -* Compute +* Compute * Initialize the metadata that is used for diagnostics @@ -313,7 +313,7 @@ In ``Castro_react.cpp``, the flow is: * $U^\mathrm{new}(\rho X_k) = U^\mathrm{new}(\rho) \cdot \mathtt{burn\_state.xn[k]}$ * if ``NAUX_NET > 0``: $U^\mathrm{new}(\rho \alpha_k) = U^\mathrm{new}(\rho) \cdot \mathtt{burn\_state.aux[k]}$ - + * if ``NSE_NET`` : * $U(\mu_p) = \mathtt{burn\_state.mu\_p}$ diff --git a/Docs/source/software.rst b/Docs/source/software.rst index 50043718a5..16abfba1d6 100644 --- a/Docs/source/software.rst +++ b/Docs/source/software.rst @@ -7,7 +7,7 @@ Code structure Castro is built upon the AMReX C++ framework. This provides high-level classes for managing an adaptive mesh refinement -simulation, including the core data structures we will deal with. +simulation, including the core data structures we will deal with. AMReX provides convenient data structures that allow for this workflow—high level objects in C++ that communicate with our computational kernels, with @@ -191,7 +191,7 @@ FArrayBoxes). A ``MultiFab`` contains an array of ``Box`` es, including boxes owned by other processors for the purpose of communication, an array of MPI ranks specifying which MPI processor owns each ``Box``, and an array of pointers to ``FArrayBoxes`` owned by this MPI -processor. +processor. .. note:: a ``MultiFab`` is a collection of the boxes that together make up a single level of data in the AMR hierarchy. @@ -550,7 +550,7 @@ Physical boundary conditions are specified by an integer index [2]_ in the ``inputs`` file, using the ``castro.lo_bc`` and ``castro.hi_bc`` runtime parameters. The generally supported boundary conditions are, their corresponding integer key, and the action they take for the normal -velocity, transverse velocity, and generic scalar are shown in +velocity, transverse velocity, and generic scalar are shown in :numref:`table:castro:bcs`. The definition of the specific actions are: diff --git a/Docs/source/sponge.rst b/Docs/source/sponge.rst index cb524e3d5f..6bc7702af9 100644 --- a/Docs/source/sponge.rst +++ b/Docs/source/sponge.rst @@ -61,7 +61,7 @@ There are three sponges, each controlled by different runtime parameters: f_\mathrm{lower} & r < r_\mathrm{lower} \\ f_\mathrm{lower} + \frac{f_\mathrm{upper} - f_\mathrm{lower}}{2} \left [ 1 - \cos \left ( \frac{\pi (r - r_\mathrm{lower})}{\Delta r} \right ) \right ] & r_\mathrm{lower} \le r < r_\mathrm{upper} \\ - f_\mathrm{upper} & r \ge r_\mathrm{upper} + f_\mathrm{upper} & r \ge r_\mathrm{upper} \end{array} \right . @@ -89,7 +89,7 @@ There are three sponges, each controlled by different runtime parameters: f_\mathrm{lower} & \rho > \rho_\mathrm{upper} \\ f_\mathrm{lower} + \frac{f_\mathrm{upper} - f_\mathrm{lower}}{2} \left [ 1 - \cos \left ( \frac{\pi (\rho - \rho_\mathrm{upper})}{\Delta \rho} \right ) \right ] & \rho_\mathrm{upper} \ge \rho > \rho_\mathrm{lower} \\ - f_\mathrm{upper} & \rho < \rho_\mathrm{lower} + f_\mathrm{upper} & \rho < \rho_\mathrm{lower} \end{array} \right . @@ -115,7 +115,7 @@ There are three sponges, each controlled by different runtime parameters: f_\mathrm{lower} & p > p_\mathrm{upper} \\ f_\mathrm{lower} + \frac{f_\mathrm{upper} - f_\mathrm{lower}}{2} \left [ 1 - \cos \left ( \frac{\pi (p - p_\mathrm{upper})}{\Delta p} \right ) \right ] & p_\mathrm{upper} \ge p \ge p_\mathrm{lower} \\ - f_\mathrm{upper} & \rho < \rho_\mathrm{lower} + f_\mathrm{upper} & \rho < \rho_\mathrm{lower} \end{array} \right . diff --git a/Docs/source/timestepping.rst b/Docs/source/timestepping.rst index 33bbf5b768..6317a3c12a 100644 --- a/Docs/source/timestepping.rst +++ b/Docs/source/timestepping.rst @@ -163,7 +163,7 @@ Subcycling ---------- Subcycling with AMR means that coarser grids can take a larger timestep -than finer grids. +than finer grids. Castro supports a number of different modes for subcycling in time, set via ``amr.subcycling_mode``. diff --git a/Docs/source/visualization.rst b/Docs/source/visualization.rst index 2a09c02651..d1337eb59d 100644 --- a/Docs/source/visualization.rst +++ b/Docs/source/visualization.rst @@ -61,6 +61,6 @@ http://yt-project.org/doc/index.html. Example notebook ^^^^^^^^^^^^^^^^ -Using the plotfiles generated in the example in the :doc:`getting_started` section, here we demonstrate how to use ``yt`` to load and visualize data. This section was generated from a Jupyter notebook which can be found in ``Docs/source/yt_example.ipynb`` in the Castro repo. +Using the plotfiles generated in the example in the :doc:`getting_started` section, here we demonstrate how to use ``yt`` to load and visualize data. This section was generated from a Jupyter notebook which can be found in ``Docs/source/yt_example.ipynb`` in the Castro repo. .. include:: yt_example.rst diff --git a/Exec/gravity_tests/DustCollapse/problem_initialize_state_data.H b/Exec/gravity_tests/DustCollapse/problem_initialize_state_data.H index e25b05f341..c8de823d86 100644 --- a/Exec/gravity_tests/DustCollapse/problem_initialize_state_data.H +++ b/Exec/gravity_tests/DustCollapse/problem_initialize_state_data.H @@ -37,7 +37,7 @@ void problem_initialize_state_data (int i, int j, int k, Array4 const& sta #else Real yl = 0.0_rt; #endif - + #if AMREX_SPACEDIM == 3 Real zl = problo[2] + static_cast(k) * dx[2]; #else diff --git a/Exec/gravity_tests/StarGrav/problem_initialize_mhd_data.H b/Exec/gravity_tests/StarGrav/problem_initialize_mhd_data.H index 698925e079..108075b249 100644 --- a/Exec/gravity_tests/StarGrav/problem_initialize_mhd_data.H +++ b/Exec/gravity_tests/StarGrav/problem_initialize_mhd_data.H @@ -5,7 +5,7 @@ /// x component of dipole vector potential /// AMREX_GPU_HOST_DEVICE AMREX_INLINE -Real compute_A_x(const Real x, const Real y, const Real z) +Real compute_A_x(const Real x, const Real y, const Real z) { // this should be called with a node-centered y and z and a cell-centered x @@ -32,7 +32,7 @@ Real compute_A_x(const Real x, const Real y, const Real z) /// y component of dipole vector potential /// AMREX_GPU_HOST_DEVICE AMREX_INLINE -Real compute_A_y(const Real x, const Real y, const Real z) +Real compute_A_y(const Real x, const Real y, const Real z) { // this should be called with a node-centered x and z and a cell-centered y diff --git a/Exec/gravity_tests/hse_convergence/convergence_plm.sh b/Exec/gravity_tests/hse_convergence/convergence_plm.sh index 678314a4bc..285cfed67d 100755 --- a/Exec/gravity_tests/hse_convergence/convergence_plm.sh +++ b/Exec/gravity_tests/hse_convergence/convergence_plm.sh @@ -14,19 +14,19 @@ castro.use_pslope=1 """ ${EXEC} inputs.ppm.64 ${RUNPARAMS} >& 64.out -pfile=`ls -t | grep -i hse_64_plt | head -1` +pfile=`ls -t | grep -i hse_64_plt | head -1` fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel > ${ofile} ${EXEC} inputs.ppm.128 ${RUNPARAMS} >& 128.out -pfile=`ls -t | grep -i hse_128_plt | head -1` +pfile=`ls -t | grep -i hse_128_plt | head -1` fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel >> ${ofile} ${EXEC} inputs.ppm.256 ${RUNPARAMS} >& 256.out -pfile=`ls -t | grep -i hse_256_plt | head -1` +pfile=`ls -t | grep -i hse_256_plt | head -1` fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel >> ${ofile} ${EXEC} inputs.ppm.512 ${RUNPARAMS} >& 512.out -pfile=`ls -t | grep -i hse_512_plt | head -1` +pfile=`ls -t | grep -i hse_512_plt | head -1` fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel >> ${ofile} @@ -42,19 +42,19 @@ castro.hse_reflect_vels=1 """ ${EXEC} inputs.ppm.64 ${RUNPARAMS} >& 64.out -pfile=`ls -t | grep -i hse_64_plt | head -1` +pfile=`ls -t | grep -i hse_64_plt | head -1` fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel > ${ofile} ${EXEC} inputs.ppm.128 ${RUNPARAMS} >& 128.out -pfile=`ls -t | grep -i hse_128_plt | head -1` +pfile=`ls -t | grep -i hse_128_plt | head -1` fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel >> ${ofile} ${EXEC} inputs.ppm.256 ${RUNPARAMS} >& 256.out -pfile=`ls -t | grep -i hse_256_plt | head -1` +pfile=`ls -t | grep -i hse_256_plt | head -1` fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel >> ${ofile} ${EXEC} inputs.ppm.512 ${RUNPARAMS} >& 512.out -pfile=`ls -t | grep -i hse_512_plt | head -1` +pfile=`ls -t | grep -i hse_512_plt | head -1` fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel >> ${ofile} @@ -70,19 +70,19 @@ castro.hse_reflect_vels=1 """ ${EXEC} inputs.ppm.64 ${RUNPARAMS} >& 64.out -pfile=`ls -t | grep -i hse_64_plt | head -1` +pfile=`ls -t | grep -i hse_64_plt | head -1` fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel > ${ofile} ${EXEC} inputs.ppm.128 ${RUNPARAMS} >& 128.out -pfile=`ls -t | grep -i hse_128_plt | head -1` +pfile=`ls -t | grep -i hse_128_plt | head -1` fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel >> ${ofile} ${EXEC} inputs.ppm.256 ${RUNPARAMS} >& 256.out -pfile=`ls -t | grep -i hse_256_plt | head -1` +pfile=`ls -t | grep -i hse_256_plt | head -1` fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel >> ${ofile} ${EXEC} inputs.ppm.512 ${RUNPARAMS} >& 512.out -pfile=`ls -t | grep -i hse_512_plt | head -1` +pfile=`ls -t | grep -i hse_512_plt | head -1` fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel >> ${ofile} @@ -98,19 +98,19 @@ castro.hi_bc=3 """ ${EXEC} inputs.ppm.64 ${RUNPARAMS} >& 64.out -pfile=`ls -t | grep -i hse_64_plt | head -1` +pfile=`ls -t | grep -i hse_64_plt | head -1` fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel > ${ofile} ${EXEC} inputs.ppm.128 ${RUNPARAMS} >& 128.out -pfile=`ls -t | grep -i hse_128_plt | head -1` +pfile=`ls -t | grep -i hse_128_plt | head -1` fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel >> ${ofile} ${EXEC} inputs.ppm.256 ${RUNPARAMS} >& 256.out -pfile=`ls -t | grep -i hse_256_plt | head -1` +pfile=`ls -t | grep -i hse_256_plt | head -1` fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel >> ${ofile} ${EXEC} inputs.ppm.512 ${RUNPARAMS} >& 512.out -pfile=`ls -t | grep -i hse_512_plt | head -1` +pfile=`ls -t | grep -i hse_512_plt | head -1` fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel >> ${ofile} @@ -127,19 +127,19 @@ castro.use_pslope=0 """ ${EXEC} inputs.ppm.64 ${RUNPARAMS} >& 64.out -pfile=`ls -t | grep -i hse_64_plt | head -1` +pfile=`ls -t | grep -i hse_64_plt | head -1` fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel > ${ofile} ${EXEC} inputs.ppm.128 ${RUNPARAMS} >& 128.out -pfile=`ls -t | grep -i hse_128_plt | head -1` +pfile=`ls -t | grep -i hse_128_plt | head -1` fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel >> ${ofile} ${EXEC} inputs.ppm.256 ${RUNPARAMS} >& 256.out -pfile=`ls -t | grep -i hse_256_plt | head -1` +pfile=`ls -t | grep -i hse_256_plt | head -1` fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel >> ${ofile} ${EXEC} inputs.ppm.512 ${RUNPARAMS} >& 512.out -pfile=`ls -t | grep -i hse_512_plt | head -1` +pfile=`ls -t | grep -i hse_512_plt | head -1` fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel >> ${ofile} diff --git a/Exec/gravity_tests/hse_convergence/convergence_ppm.sh b/Exec/gravity_tests/hse_convergence/convergence_ppm.sh index 7e2ddac9f0..ff6e2c7620 100755 --- a/Exec/gravity_tests/hse_convergence/convergence_ppm.sh +++ b/Exec/gravity_tests/hse_convergence/convergence_ppm.sh @@ -8,19 +8,19 @@ EXEC=./Castro1d.gnu.MPI.ex ofile=ppm.converge.out ${EXEC} inputs.ppm.64 >& 64.out -pfile=`ls -t | grep -i hse_64_plt | head -1` +pfile=`ls -t | grep -i hse_64_plt | head -1` fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel > ${ofile} ${EXEC} inputs.ppm.128 >& 128.out -pfile=`ls -t | grep -i hse_128_plt | head -1` +pfile=`ls -t | grep -i hse_128_plt | head -1` fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel >> ${ofile} ${EXEC} inputs.ppm.256 >& 256.out -pfile=`ls -t | grep -i hse_256_plt | head -1` +pfile=`ls -t | grep -i hse_256_plt | head -1` fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel >> ${ofile} ${EXEC} inputs.ppm.512 >& 512.out -pfile=`ls -t | grep -i hse_512_plt | head -1` +pfile=`ls -t | grep -i hse_512_plt | head -1` fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel >> ${ofile} @@ -34,19 +34,19 @@ castro.hse_reflect_vels=1 """ ${EXEC} inputs.ppm.64 ${RUNPARAMS} >& 64.out -pfile=`ls -t | grep -i hse_64_plt | head -1` +pfile=`ls -t | grep -i hse_64_plt | head -1` fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel > ${ofile} ${EXEC} inputs.ppm.128 ${RUNPARAMS} >& 128.out -pfile=`ls -t | grep -i hse_128_plt | head -1` +pfile=`ls -t | grep -i hse_128_plt | head -1` fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel >> ${ofile} ${EXEC} inputs.ppm.256 ${RUNPARAMS} >& 256.out -pfile=`ls -t | grep -i hse_256_plt | head -1` +pfile=`ls -t | grep -i hse_256_plt | head -1` fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel >> ${ofile} ${EXEC} inputs.ppm.512 ${RUNPARAMS} >& 512.out -pfile=`ls -t | grep -i hse_512_plt | head -1` +pfile=`ls -t | grep -i hse_512_plt | head -1` fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel >> ${ofile} @@ -59,19 +59,19 @@ castro.grav_source_type=4 """ ${EXEC} inputs.ppm.64 ${RUNPARAMS} >& 64.out -pfile=`ls -t | grep -i hse_64_plt | head -1` +pfile=`ls -t | grep -i hse_64_plt | head -1` fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel > ${ofile} ${EXEC} inputs.ppm.128 ${RUNPARAMS} >& 128.out -pfile=`ls -t | grep -i hse_128_plt | head -1` +pfile=`ls -t | grep -i hse_128_plt | head -1` fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel >> ${ofile} ${EXEC} inputs.ppm.256 ${RUNPARAMS} >& 256.out -pfile=`ls -t | grep -i hse_256_plt | head -1` +pfile=`ls -t | grep -i hse_256_plt | head -1` fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel >> ${ofile} ${EXEC} inputs.ppm.512 ${RUNPARAMS} >& 512.out -pfile=`ls -t | grep -i hse_512_plt | head -1` +pfile=`ls -t | grep -i hse_512_plt | head -1` fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel >> ${ofile} @@ -85,18 +85,18 @@ castro.hi_bc=3 """ ${EXEC} inputs.ppm.64 ${RUNPARAMS} >& 64.out -pfile=`ls -t | grep -i hse_64_plt | head -1` +pfile=`ls -t | grep -i hse_64_plt | head -1` fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel > ${ofile} ${EXEC} inputs.ppm.128 ${RUNPARAMS} >& 128.out -pfile=`ls -t | grep -i hse_128_plt | head -1` +pfile=`ls -t | grep -i hse_128_plt | head -1` fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel >> ${ofile} ${EXEC} inputs.ppm.256 ${RUNPARAMS} >& 256.out -pfile=`ls -t | grep -i hse_256_plt | head -1` +pfile=`ls -t | grep -i hse_256_plt | head -1` fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel >> ${ofile} ${EXEC} inputs.ppm.512 ${RUNPARAMS} >& 512.out -pfile=`ls -t | grep -i hse_512_plt | head -1` +pfile=`ls -t | grep -i hse_512_plt | head -1` fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel >> ${ofile} diff --git a/Exec/gravity_tests/hse_convergence/convergence_sdc.sh b/Exec/gravity_tests/hse_convergence/convergence_sdc.sh index c6483a2781..038109dea1 100755 --- a/Exec/gravity_tests/hse_convergence/convergence_sdc.sh +++ b/Exec/gravity_tests/hse_convergence/convergence_sdc.sh @@ -20,19 +20,19 @@ castro.hi_bc=3 """ ${EXEC} inputs.ppm.64 ${RUNPARAMS} >& 64.out -pfile=`ls -t | grep -i hse_64_plt | head -1` +pfile=`ls -t | grep -i hse_64_plt | head -1` fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel > ${ofile} ${EXEC} inputs.ppm.128 ${RUNPARAMS} >& 128.out -pfile=`ls -t | grep -i hse_128_plt | head -1` +pfile=`ls -t | grep -i hse_128_plt | head -1` fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel >> ${ofile} ${EXEC} inputs.ppm.256 ${RUNPARAMS} >& 256.out -pfile=`ls -t | grep -i hse_256_plt | head -1` +pfile=`ls -t | grep -i hse_256_plt | head -1` fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel >> ${ofile} ${EXEC} inputs.ppm.512 ${RUNPARAMS} >& 512.out -pfile=`ls -t | grep -i hse_512_plt | head -1` +pfile=`ls -t | grep -i hse_512_plt | head -1` fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel >> ${ofile} @@ -51,19 +51,19 @@ castro.hi_bc=3 """ ${EXEC} inputs.ppm.64 ${RUNPARAMS} >& 64.out -pfile=`ls -t | grep -i hse_64_plt | head -1` +pfile=`ls -t | grep -i hse_64_plt | head -1` fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel > ${ofile} ${EXEC} inputs.ppm.128 ${RUNPARAMS} >& 128.out -pfile=`ls -t | grep -i hse_128_plt | head -1` +pfile=`ls -t | grep -i hse_128_plt | head -1` fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel >> ${ofile} ${EXEC} inputs.ppm.256 ${RUNPARAMS} >& 256.out -pfile=`ls -t | grep -i hse_256_plt | head -1` +pfile=`ls -t | grep -i hse_256_plt | head -1` fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel >> ${ofile} ${EXEC} inputs.ppm.512 ${RUNPARAMS} >& 512.out -pfile=`ls -t | grep -i hse_512_plt | head -1` +pfile=`ls -t | grep -i hse_512_plt | head -1` fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel >> ${ofile} @@ -80,19 +80,19 @@ castro.use_reconstructed_gamma1=1 """ ${EXEC} inputs.ppm.64 ${RUNPARAMS} >& 64.out -pfile=`ls -t | grep -i hse_64_plt | head -1` +pfile=`ls -t | grep -i hse_64_plt | head -1` fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel > ${ofile} ${EXEC} inputs.ppm.128 ${RUNPARAMS} >& 128.out -pfile=`ls -t | grep -i hse_128_plt | head -1` +pfile=`ls -t | grep -i hse_128_plt | head -1` fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel >> ${ofile} ${EXEC} inputs.ppm.256 ${RUNPARAMS} >& 256.out -pfile=`ls -t | grep -i hse_256_plt | head -1` +pfile=`ls -t | grep -i hse_256_plt | head -1` fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel >> ${ofile} ${EXEC} inputs.ppm.512 ${RUNPARAMS} >& 512.out -pfile=`ls -t | grep -i hse_512_plt | head -1` +pfile=`ls -t | grep -i hse_512_plt | head -1` fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel >> ${ofile} @@ -110,19 +110,19 @@ castro.use_reconstructed_gamma1=1 """ ${EXEC} inputs.ppm.64 ${RUNPARAMS} >& 64.out -pfile=`ls -t | grep -i hse_64_plt | head -1` +pfile=`ls -t | grep -i hse_64_plt | head -1` fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel > ${ofile} ${EXEC} inputs.ppm.128 ${RUNPARAMS} >& 128.out -pfile=`ls -t | grep -i hse_128_plt | head -1` +pfile=`ls -t | grep -i hse_128_plt | head -1` fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel >> ${ofile} ${EXEC} inputs.ppm.256 ${RUNPARAMS} >& 256.out -pfile=`ls -t | grep -i hse_256_plt | head -1` +pfile=`ls -t | grep -i hse_256_plt | head -1` fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel >> ${ofile} ${EXEC} inputs.ppm.512 ${RUNPARAMS} >& 512.out -pfile=`ls -t | grep -i hse_512_plt | head -1` +pfile=`ls -t | grep -i hse_512_plt | head -1` fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel >> ${ofile} @@ -141,18 +141,18 @@ castro.hi_bc=3 """ ${EXEC} inputs.ppm.64 ${RUNPARAMS} >& 64.out -pfile=`ls -t | grep -i hse_64_plt | head -1` +pfile=`ls -t | grep -i hse_64_plt | head -1` fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel > ${ofile} ${EXEC} inputs.ppm.128 ${RUNPARAMS} >& 128.out -pfile=`ls -t | grep -i hse_128_plt | head -1` +pfile=`ls -t | grep -i hse_128_plt | head -1` fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel >> ${ofile} ${EXEC} inputs.ppm.256 ${RUNPARAMS} >& 256.out -pfile=`ls -t | grep -i hse_256_plt | head -1` +pfile=`ls -t | grep -i hse_256_plt | head -1` fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel >> ${ofile} ${EXEC} inputs.ppm.512 ${RUNPARAMS} >& 512.out -pfile=`ls -t | grep -i hse_512_plt | head -1` +pfile=`ls -t | grep -i hse_512_plt | head -1` fextrema.gnu.ex -v magvel ${pfile} | grep -i magvel >> ${ofile} diff --git a/Exec/gravity_tests/hydrostatic_adjust/problem_source.H b/Exec/gravity_tests/hydrostatic_adjust/problem_source.H index d9d9d370d6..099bdb5b66 100644 --- a/Exec/gravity_tests/hydrostatic_adjust/problem_source.H +++ b/Exec/gravity_tests/hydrostatic_adjust/problem_source.H @@ -76,7 +76,7 @@ void problem_source (int i, int j, int k, auto dist = std::sqrt(x*x + y*y + z*z); - auto Hext = H_0 * std::exp(-((dist - r_0)*(dist - r_0))/(W_0*W_0)) * + auto Hext = H_0 * std::exp(-((dist - r_0)*(dist - r_0))/(W_0*W_0)) * state(i,j,k,UFS+problem::ifuel) / state(i,j,k,URHO); src(i,j,k,UEINT) = state(i,j,k,URHO) * Hext; diff --git a/Exec/hydro_tests/Sedov/problem_initialize.H b/Exec/hydro_tests/Sedov/problem_initialize.H index d6d3834003..b056e41349 100644 --- a/Exec/hydro_tests/Sedov/problem_initialize.H +++ b/Exec/hydro_tests/Sedov/problem_initialize.H @@ -53,7 +53,7 @@ void problem_initialize () for (int n = 0; n < NumSpec; ++n) { eos_state.xn[n] = xn_zone[n]; } - + eos(eos_input_rp, eos_state); problem::e_ambient = eos_state.e; diff --git a/Exec/hydro_tests/Sedov/problem_initialize_state_data.H b/Exec/hydro_tests/Sedov/problem_initialize_state_data.H index 4dc8030c35..8fdb480d29 100644 --- a/Exec/hydro_tests/Sedov/problem_initialize_state_data.H +++ b/Exec/hydro_tests/Sedov/problem_initialize_state_data.H @@ -11,7 +11,7 @@ void problem_initialize_state_data (int i, int j, int k, Array4 const& sta const Real* dx = geomdata.CellSize(); const Real* problo = geomdata.ProbLo(); - + #if AMREX_SPACEDIM == 1 int nsubx = problem::nsub; int nsuby = 1; diff --git a/Exec/hydro_tests/Sedov/testsuite_analysis/sedov_2d_sph_in_cyl.py b/Exec/hydro_tests/Sedov/testsuite_analysis/sedov_2d_sph_in_cyl.py index aa460c8fe5..51b3a7ee88 100755 --- a/Exec/hydro_tests/Sedov/testsuite_analysis/sedov_2d_sph_in_cyl.py +++ b/Exec/hydro_tests/Sedov/testsuite_analysis/sedov_2d_sph_in_cyl.py @@ -23,7 +23,7 @@ def process(castro_dir, plotfile): # find the executable analysis_routine = None for file in os.listdir(build_dir): - if (os.path.isfile(file) and + if (os.path.isfile(file) and file.startswith("sedov_2d") and file.endswith(".ex")): analysis_routine = file diff --git a/Exec/hydro_tests/acoustic_pulse/analysis/slice_multi.py b/Exec/hydro_tests/acoustic_pulse/analysis/slice_multi.py index 05f183c22c..2dfdb4a36f 100755 --- a/Exec/hydro_tests/acoustic_pulse/analysis/slice_multi.py +++ b/Exec/hydro_tests/acoustic_pulse/analysis/slice_multi.py @@ -26,7 +26,7 @@ fig = plt.figure() fig.set_size_inches(12.0, 9.0) -grid = ImageGrid(fig, 111, nrows_ncols=(1, 2), axes_pad=0.75, cbar_pad="2%", +grid = ImageGrid(fig, 111, nrows_ncols=(1, 2), axes_pad=0.75, cbar_pad="2%", label_mode="L", cbar_mode="each") diff --git a/Exec/hydro_tests/acoustic_pulse/convergence_ppm_as_1d.sh b/Exec/hydro_tests/acoustic_pulse/convergence_ppm_as_1d.sh index 48c40a789a..3e3c5362e4 100755 --- a/Exec/hydro_tests/acoustic_pulse/convergence_ppm_as_1d.sh +++ b/Exec/hydro_tests/acoustic_pulse/convergence_ppm_as_1d.sh @@ -55,4 +55,4 @@ RichardsonConvergenceTest${DIM}d.gnu.ex coarFile=acoustic_pulse_64_ppm_plt00081 #RichardsonConvergenceTest${DIM}d.gnu.ex coarFile=acoustic_pulse_128_ppm_plt00161 mediFile=acoustic_pulse_256_ppm_plt00321 fineFile=acoustic_pulse_512_ppm_plt00641 > convergence.${DIM}d.hi.ppm.out - + diff --git a/Exec/hydro_tests/acoustic_pulse/problem_initialize_state_data.H b/Exec/hydro_tests/acoustic_pulse/problem_initialize_state_data.H index 46c2d10fe8..6ea18ace62 100644 --- a/Exec/hydro_tests/acoustic_pulse/problem_initialize_state_data.H +++ b/Exec/hydro_tests/acoustic_pulse/problem_initialize_state_data.H @@ -42,7 +42,7 @@ void problem_initialize_state_data (int i, int j, int k, dist = std::abs(problem::center[2] - zz); } else { -#ifndef AMREX_USE_GPU +#ifndef AMREX_USE_GPU amrex::Error("invalid init_as_1d"); #endif } diff --git a/Exec/hydro_tests/acoustic_pulse_general/analysis/slice_multi.py b/Exec/hydro_tests/acoustic_pulse_general/analysis/slice_multi.py index 5ccc94b638..b9009d3517 100755 --- a/Exec/hydro_tests/acoustic_pulse_general/analysis/slice_multi.py +++ b/Exec/hydro_tests/acoustic_pulse_general/analysis/slice_multi.py @@ -26,7 +26,7 @@ fig = plt.figure() fig.set_size_inches(12.0, 9.0) -grid = ImageGrid(fig, 111, nrows_ncols=(2, 2), axes_pad=0.75, cbar_pad="2%", +grid = ImageGrid(fig, 111, nrows_ncols=(2, 2), axes_pad=0.75, cbar_pad="2%", label_mode="L", cbar_mode="each") diff --git a/Exec/hydro_tests/double_mach_reflection/problem_initialize.H b/Exec/hydro_tests/double_mach_reflection/problem_initialize.H index 88cff7e8a3..d5423e2592 100644 --- a/Exec/hydro_tests/double_mach_reflection/problem_initialize.H +++ b/Exec/hydro_tests/double_mach_reflection/problem_initialize.H @@ -21,7 +21,7 @@ void problem_initialize () // compute the internal energy (erg/cc) for the left and right state - Real xn[NumSpec] = {0.0_rt}; + Real xn[NumSpec] = {0.0_rt}; xn[0] = 1.0_rt; eos_t eos_state; diff --git a/Exec/hydro_tests/gamma_law_bubble/Problem_Derive.cpp b/Exec/hydro_tests/gamma_law_bubble/Problem_Derive.cpp index 78e2d81a96..de815abb96 100644 --- a/Exec/hydro_tests/gamma_law_bubble/Problem_Derive.cpp +++ b/Exec/hydro_tests/gamma_law_bubble/Problem_Derive.cpp @@ -176,7 +176,7 @@ void ca_derrhopert(const Box& bx, FArrayBox& derfab, int dcomp, int /*ncomp*/, if (problem::do_isentropic) { Real z = static_cast(j) * dx[AMREX_SPACEDIM-1]; - density[j] = problem::dens_base * + density[j] = problem::dens_base * std::pow((gravity::const_grav * problem::dens_base * (eos_gamma - 1.0_rt) * z/ (eos_gamma * problem::pres_base) + 1.0_rt), 1.0_rt/(eos_gamma - 1.0_rt)); } else { diff --git a/Exec/hydro_tests/gresho_vortex/problem_initialize.H b/Exec/hydro_tests/gresho_vortex/problem_initialize.H index 6eecf20e75..2dc9f62aae 100644 --- a/Exec/hydro_tests/gresho_vortex/problem_initialize.H +++ b/Exec/hydro_tests/gresho_vortex/problem_initialize.H @@ -1,4 +1,4 @@ -// This sets up the Gresho vortex problem as described in +// This sets up the Gresho vortex problem as described in // Miczek, Roeple, and Edelmann 2015 // // By choosing the reference pressure, p0, we can specify the diff --git a/Exec/hydro_tests/gresho_vortex/problem_initialize_state_data.H b/Exec/hydro_tests/gresho_vortex/problem_initialize_state_data.H index c8246bfb6a..adc5a4c050 100644 --- a/Exec/hydro_tests/gresho_vortex/problem_initialize_state_data.H +++ b/Exec/hydro_tests/gresho_vortex/problem_initialize_state_data.H @@ -1,4 +1,4 @@ -// This sets up the Gresho vortex problem as described in +// This sets up the Gresho vortex problem as described in // Miczek, Roeple, and Edelmann 2015 // // By choosing the reference pressure, p0, we can specify the diff --git a/Exec/hydro_tests/riemann_2d/problem_initialize_state_data.H b/Exec/hydro_tests/riemann_2d/problem_initialize_state_data.H index 9049bd9bdc..95cc0b33f4 100644 --- a/Exec/hydro_tests/riemann_2d/problem_initialize_state_data.H +++ b/Exec/hydro_tests/riemann_2d/problem_initialize_state_data.H @@ -8,16 +8,16 @@ #include AMREX_GPU_HOST_DEVICE AMREX_INLINE -//Declare boxes index i, j, k, the state Array4, and -//the geometry information, which emcompases the -void problem_initialize_state_data(int i, int j, int k, +//Declare boxes index i, j, k, the state Array4, and +//the geometry information, which emcompases the +void problem_initialize_state_data(int i, int j, int k, Array4 const& state, const GeometryData& geomdata) { //The integer "coord_type" represents the coordinate system - int coord_type = geomdata.Coord(); - - //The pointer *dx represents the real cell size value + int coord_type = geomdata.Coord(); + + //The pointer *dx represents the real cell size value const Real* dx = geomdata.CellSize(); //The pointer *problo represents the bottom of each dimension @@ -25,7 +25,7 @@ void problem_initialize_state_data(int i, int j, int k, #if AMREX_SPACEDIM != 2 amrex::Abort("The Riemman Problem considered is 2D."); - + #endif diff --git a/Exec/hydro_tests/test_convect/problem_diagnostics.H b/Exec/hydro_tests/test_convect/problem_diagnostics.H index 1285d2dd8c..d27c19d9ce 100644 --- a/Exec/hydro_tests/test_convect/problem_diagnostics.H +++ b/Exec/hydro_tests/test_convect/problem_diagnostics.H @@ -19,7 +19,7 @@ Castro::problem_diagnostics () Castro& ca_lev = getLevel(lev); mass += ca_lev.volWgtSum("density", time); - + rho_E += ca_lev.volWgtSum("rho_E", time); auto temp_mf = ca_lev.derive("Temp", time, 0); @@ -38,7 +38,7 @@ Castro::problem_diagnostics () } - + if (verbose > 0 && ParallelDescriptor::IOProcessor()) { std::cout << '\n'; diff --git a/Exec/hydro_tests/test_convect/problem_source.H b/Exec/hydro_tests/test_convect/problem_source.H index 274276e72a..1711e078c8 100644 --- a/Exec/hydro_tests/test_convect/problem_source.H +++ b/Exec/hydro_tests/test_convect/problem_source.H @@ -24,9 +24,9 @@ void problem_source (int i, int j, int k, auto y = (Real(j)+0.5e0_rt)*dx[1] + problo[1]; auto ey = std::exp(-(y-y_layer)*(y-y_layer)/1.e14_rt); - auto H = ey * (1.e0_rt + - 0.00625_rt * std::sin( 2*M_PI*x/L_x) - + 0.01875_rt * std::sin((6*M_PI*x/L_x) + M_PI/3.e0_rt) + auto H = ey * (1.e0_rt + + 0.00625_rt * std::sin( 2*M_PI*x/L_x) + + 0.01875_rt * std::sin((6*M_PI*x/L_x) + M_PI/3.e0_rt) + 0.01250_rt * std::sin((8*M_PI*x/L_x) + M_PI/5.e0_rt)); // Source terms diff --git a/Exec/hydro_tests/toy_convect/problem_diagnostics.H b/Exec/hydro_tests/toy_convect/problem_diagnostics.H index 1285d2dd8c..d27c19d9ce 100644 --- a/Exec/hydro_tests/toy_convect/problem_diagnostics.H +++ b/Exec/hydro_tests/toy_convect/problem_diagnostics.H @@ -19,7 +19,7 @@ Castro::problem_diagnostics () Castro& ca_lev = getLevel(lev); mass += ca_lev.volWgtSum("density", time); - + rho_E += ca_lev.volWgtSum("rho_E", time); auto temp_mf = ca_lev.derive("Temp", time, 0); @@ -38,7 +38,7 @@ Castro::problem_diagnostics () } - + if (verbose > 0 && ParallelDescriptor::IOProcessor()) { std::cout << '\n'; diff --git a/Exec/mhd_tests/MagnetosonicWaves/problem_initialize_state_data.H b/Exec/mhd_tests/MagnetosonicWaves/problem_initialize_state_data.H index d7570460a1..9cbd133fe4 100644 --- a/Exec/mhd_tests/MagnetosonicWaves/problem_initialize_state_data.H +++ b/Exec/mhd_tests/MagnetosonicWaves/problem_initialize_state_data.H @@ -46,7 +46,7 @@ void problem_initialize_state_data (int i, int j, int k, Real pressure = problem::p_0 + problem::rho_0 * problem::c_s * pert; - // compute the internal energy (erg/cc) + // compute the internal energy (erg/cc) eos_t eos_state; eos_state.rho = problem::rho_0; diff --git a/Exec/radiation_tests/Rad2Tshock/python/Analytical-Test.py b/Exec/radiation_tests/Rad2Tshock/python/Analytical-Test.py index fe1133fc84..205a831479 100644 --- a/Exec/radiation_tests/Rad2Tshock/python/Analytical-Test.py +++ b/Exec/radiation_tests/Rad2Tshock/python/Analytical-Test.py @@ -18,15 +18,15 @@ plt.switch_backend('agg') parser = argparse.ArgumentParser() -parser.add_argument('plotfile', type=str, help='Path to plotfile for which we will compare') +parser.add_argument('plotfile', type=str, help='Path to plotfile for which we will compare') args = parser.parse_args() def get_x_var(pf, var): ds = yt.load(pf) time = float(ds.current_time) ad = ds.all_data() - srt = np.argsort(ad['x']) - x_coord = np.array(ad['x'][srt]) + srt = np.argsort(ad['x']) + x_coord = np.array(ad['x'][srt]) var = np.array(ad[var][srt]) return time, x_coord, var @@ -39,7 +39,7 @@ def f2_f(T1): def rho1_f(T1): f1 = f1_f(T1) return (f1+np.sqrt(f1**2+f2_f(T1))) / (6.*(gamma-1.)*T1) - def Eq13(T1): + def Eq13(T1): rho1 = rho1_f(T1) return 3.0*rho1*(rho1*T1-1.) + gamma*P0*rho1*(T1**4-1.) - 3.*gamma*(rho1-1.)*M0**2 def T1_smallP0(): @@ -72,10 +72,10 @@ def eeos(T): Cp = 1./(gamma-1.) M_ISP = 1.0/np.sqrt(gamma) # Eq. 28 Km = 3.*(gamma*M0**2+1.) + gamma*P0 # Eq. 16 - + def rho_f(T, theta, s): # Eq. 17 b = Km - gamma*P0*theta**4 - ac4 = 36.*gamma*M0**2*T + ac4 = 36.*gamma*M0**2*T return (b + s*np.sqrt(b**2-ac4))/(6.*T) def dTdtheta(T, theta, rho, M, v, s): # Eq. 54 @@ -89,8 +89,8 @@ def dTdtheta(T, theta, rho, M, v, s): # Eq. 54 dGdtheta = c1 * (12.*Cp*drhodtheta*rho*(T-1.) - 6.*M0**2*rho*drhodtheta + 8.*P0*(drhodtheta*(theta**4-2.*rho)+4.*rho*theta**3)) dFdT = c2 * (4.*v*theta**3*dGdT - 12.*sigma*(gamma*M**2-1.)*T**3) dFdtheta = c2 * (4.*v*theta**3*dGdtheta + 12.*sigma*(gamma*M**2-1.)*theta**3) - S1 = dFdT - dGdtheta - S2 = np.sqrt((dFdT-dGdtheta)**2 + 4.*dGdT*dFdtheta) + S1 = dFdT - dGdtheta + S2 = np.sqrt((dFdT-dGdtheta)**2 + 4.*dGdT*dFdtheta) dTdtheta_tmp = (S1 + S2) / (2.*dGdT) drhodtheta_full = drhodtheta + drhodT * dTdtheta_tmp if (drhodtheta > 0.0): @@ -110,7 +110,7 @@ def dxTdM(xT, M): # Eq. 37 theta = th4**0.25 th3 = th4/theta thetaprime = thetaprime_f(T,theta,rho,v) - foo = 4.*M0*th3*thetaprime + foo = 4.*M0*th3*thetaprime ZD = foo + (gamma-1.)/(gamma+1.)*(gamma*M**2+1.)*r # Eq. 39 ZN = foo + (gamma*M**2-1.)*r # Eq. 24 dxdM = -6.*M0*rho*T/((gamma+1.)*P0*M) * (M**2-1.)/ZD @@ -122,7 +122,7 @@ def dxTdM(xT, M): # Eq. 37 theta0 = 1.0 v0 = M0 rho0 = 1.0 - + rho1, v1, T1 = OneTShock(P0=P0, gamma=gamma, M0=M0) M1 = v1 / np.sqrt(T1) theta1 = T1 @@ -133,7 +133,7 @@ def dxTdM(xT, M): # Eq. 37 s1 = 1. else: s1 = -1. - + # Step 2a of LE08 # i= 0 eps = 1.0e-10 @@ -162,7 +162,7 @@ def dxTdM(xT, M): # Eq. 37 vpre = M0/rhopre thetapre = ((Km-3.*gamma*M0**2/rhopre-3.*Tpre*rhopre) / (gamma*P0))**0.25 # Eq. 41 - + # Step 3a # i= 1 eps = -1.0e-10 @@ -199,7 +199,7 @@ def dxTdM(xT, M): # Eq. 37 vrel = vrel[::-1] rhorel = rhorel[::-1] - + # Step 4 print('') print('thetapre[-1]=', thetapre[-1], ' thetarel[0]=', thetarel[0]) @@ -217,7 +217,7 @@ def dxTdM(xT, M): # Eq. 37 while irel= thetarel[irel]) ilast = index[0]-1 - + rhop = rhopre[ilast] vp = vpre[ilast] Tp = Tpre[ilast] @@ -225,7 +225,7 @@ def dxTdM(xT, M): # Eq. 37 pp = peos(rhop, Tp) ep = eeos(Tp) Ep = ep + 0.5*vp**2 - + rhos = rhorel[irel] vs = vrel[irel] Ts = Trel[irel] @@ -233,15 +233,15 @@ def dxTdM(xT, M): # Eq. 37 ps = peos(rhos, Ts) es = eeos(Ts) Es = es + 0.5*vs**2 - + foo = rhop*vp**2 + pp # Eq. 12b bar = rhos*vs**2 + ps - err1 = abs(foo-bar)/min(foo,bar) - + err1 = abs(foo-bar)/min(foo,bar) + foo = vp*(rhop*Ep+pp) # Eq. 12c bar = vs*(rhos*Es+ps) - err2 = abs(foo-bar)/min(foo,bar) - + err2 = abs(foo-bar)/min(foo,bar) + errs.append(np.sqrt(err1**2+err2**2)) ilasts.append(ilast) irels.append(irel) @@ -254,55 +254,55 @@ def dxTdM(xT, M): # Eq. 37 print('theta near the shock:', thetapre[ilast], thetarel[irel]) print('Jump in T:', Tpre[ilast], Trel[irel]) print('Jump in rho:', rhopre[ilast], rhorel[irel]) - - - #This shifts it so x=0 is the shock. + + + #This shifts it so x=0 is the shock. x0 = x0 - xpre[ilast+1] xpre = xpre - xpre[ilast+1] x1 = x1 - xrel[irel] xrel = xrel - xrel[irel] x = np.append(xpre[0:ilast+1], xrel[irel:]) - - - + + + T = np.append(Tpre[0:ilast+1], Trel[irel:]) theta = np.append(thetapre[0:ilast+1], thetarel[irel:]) M = np.append(Mpre[0:ilast+1], Mrel[irel:]) v = np.append(vpre[0:ilast+1], vrel[irel:]) rho = np.append(rhopre[0:ilast+1], rhorel[irel:]) - + print('test:') print('testx0',x0) print('testx1', x1) - + x = np.append(x0,x) T = np.append(T0,T) theta = np.append(theta0,theta) rho = np.append(rho0,rho) v = np.append(v0,v) - + x = np.append(x,x1) T = np.append(T,T1) theta = np.append(theta,theta1) rho = np.append(rho,rho1) v = np.append(v,v1) - - - + + + return x, T, theta, rho - - + + if __name__ == "__main__": - + P0 = 1.0e-4 gamma = 5./3. sigma = 1.0e6 kappa = 1. M0 = 5. - + x_sol, T_sol, theta_sol, rho_sol = TwoTShock(P0, gamma, sigma, kappa, M0) @@ -317,7 +317,7 @@ def dxTdM(xT, M): # Eq. 37 plt.legend() plt.savefig("{}_Temp_Test.png".format(os.path.basename(args.plotfile))) - + t1, x1, rho1 = get_x_var(args.plotfile, "density") x1 = np.array(x1) - x1[max_index] plt.figure(2) diff --git a/Exec/radiation_tests/Rad2Tshock/python/LowrieEdwardsUnits.py b/Exec/radiation_tests/Rad2Tshock/python/LowrieEdwardsUnits.py index 758ede71cc..07def7d6d2 100755 --- a/Exec/radiation_tests/Rad2Tshock/python/LowrieEdwardsUnits.py +++ b/Exec/radiation_tests/Rad2Tshock/python/LowrieEdwardsUnits.py @@ -2,7 +2,7 @@ import sys, getopt import numpy as np -from phys import c, R +from phys import c, R from phys import a as aRad import cPickle as pickle @@ -25,7 +25,7 @@ def LEunits(P0=1.0e-4, gamma=5./3., uL=1.0e5, uT=100.0, mu=1.0, printmessg=0): if printmessg: print 'units for' print 'uL=', uL - print 'uT=', uT + print 'uT=', uT print 'gamma=', gamma print 'P0=', P0 print 'mu=', mu diff --git a/Exec/radiation_tests/Rad2Tshock/python/RadShock.py b/Exec/radiation_tests/Rad2Tshock/python/RadShock.py index d0e02ee277..4834ae2f70 100755 --- a/Exec/radiation_tests/Rad2Tshock/python/RadShock.py +++ b/Exec/radiation_tests/Rad2Tshock/python/RadShock.py @@ -14,7 +14,7 @@ def f2_f(T1): def rho1_f(T1): f1 = f1_f(T1) return (f1+sqrt(f1**2+f2_f(T1))) / (6.*(gamma-1.)*T1) - def Eq13(T1): + def Eq13(T1): rho1 = rho1_f(T1) return 3.0*rho1*(rho1*T1-1.) + gamma*P0*rho1*(T1**4-1.) - 3.*gamma*(rho1-1.)*M0**2 def T1_smallP0(): @@ -47,10 +47,10 @@ def eeos(T): Cp = 1./(gamma-1.) M_ISP = 1.0/sqrt(gamma) # Eq. 28 Km = 3.*(gamma*M0**2+1.) + gamma*P0 # Eq. 16 - + def rho_f(T, theta, s): # Eq. 17 b = Km - gamma*P0*theta**4 - ac4 = 36.*gamma*M0**2*T + ac4 = 36.*gamma*M0**2*T return (b + s*sqrt(b**2-ac4))/(6.*T) def dTdtheta(T, theta, rho, M, v, s): # Eq. 54 @@ -64,8 +64,8 @@ def dTdtheta(T, theta, rho, M, v, s): # Eq. 54 dGdtheta = c1 * (12.*Cp*drhodtheta*rho*(T-1.) - 6.*M0**2*rho*drhodtheta + 8.*P0*(drhodtheta*(theta**4-2.*rho)+4.*rho*theta**3)) dFdT = c2 * (4.*v*theta**3*dGdT - 12.*sigma*(gamma*M**2-1.)*T**3) dFdtheta = c2 * (4.*v*theta**3*dGdtheta + 12.*sigma*(gamma*M**2-1.)*theta**3) - S1 = dFdT - dGdtheta - S2 = sqrt((dFdT-dGdtheta)**2 + 4.*dGdT*dFdtheta) + S1 = dFdT - dGdtheta + S2 = sqrt((dFdT-dGdtheta)**2 + 4.*dGdT*dFdtheta) dTdtheta_tmp = (S1 + S2) / (2.*dGdT) drhodtheta_full = drhodtheta + drhodT * dTdtheta_tmp if (drhodtheta > 0.0): @@ -85,7 +85,7 @@ def dxTdM(xT, M): # Eq. 37 theta = th4**0.25 th3 = th4/theta thetaprime = thetaprime_f(T,theta,rho,v) - foo = 4.*M0*th3*thetaprime + foo = 4.*M0*th3*thetaprime ZD = foo + (gamma-1.)/(gamma+1.)*(gamma*M**2+1.)*r # Eq. 39 ZN = foo + (gamma*M**2-1.)*r # Eq. 24 dxdM = -6.*M0*rho*T/((gamma+1.)*P0*M) * (M**2-1.)/ZD @@ -106,7 +106,7 @@ def dxTdM(xT, M): # Eq. 37 s1 = 1. else: s1 = -1. - + # Step 2a of LE08 # i= 0 eps = 1.0e-10 @@ -223,11 +223,11 @@ def dxTdM(xT, M): # Eq. 37 # foo = rhop*vp**2 + pp # Eq. 12b bar = rhos*vs**2 + ps - err1 = abs(foo-bar)/min(foo,bar) + err1 = abs(foo-bar)/min(foo,bar) # foo = vp*(rhop*Ep+pp) # Eq. 12c bar = vs*(rhos*Es+ps) - err2 = abs(foo-bar)/min(foo,bar) + err2 = abs(foo-bar)/min(foo,bar) # errs.append(sqrt(err1**2+err2**2)) ilasts.append(ilast) diff --git a/Exec/radiation_tests/Rad2Tshock/python/initincgs.py b/Exec/radiation_tests/Rad2Tshock/python/initincgs.py index 60f6a80236..6189247f1d 100755 --- a/Exec/radiation_tests/Rad2Tshock/python/initincgs.py +++ b/Exec/radiation_tests/Rad2Tshock/python/initincgs.py @@ -48,7 +48,7 @@ def main(): rho = units['rho'] v = M0 * units['v'] kappa_p = sigma * units['sigma'] - kappa_r = c * (1./3.) / (kappa * units['kappa']) + kappa_r = c * (1./3.) / (kappa * units['kappa']) cv = R / (gamma-1.0)/mu rho1, v1, T1 = OneTShock(P0=P0, gamma=gamma, M0=M0) @@ -58,8 +58,8 @@ def main(): print "In cgs units:" print 'Length unit: ', L - print 'Pre-shock: ', 'T=', T, 'rho=', rho, 'v=', v, 'v/c=', v/c - print 'Post-shock: ', 'T=', T1, 'rho=', rho1, 'v=', v1, 'v/c=', v1/c + print 'Pre-shock: ', 'T=', T, 'rho=', rho, 'v=', v, 'v/c=', v/c + print 'Post-shock: ', 'T=', T1, 'rho=', rho1, 'v=', v1, 'v/c=', v1/c print 'kappa_p=', kappa_p, 'kappa_r=', kappa_r print 'cv=', cv, 'gamma=', gamma, 'mu=', mu diff --git a/Exec/radiation_tests/Rad2Tshock/python/paper-M2-mg.py b/Exec/radiation_tests/Rad2Tshock/python/paper-M2-mg.py index 02a59020e1..296873ef3c 100755 --- a/Exec/radiation_tests/Rad2Tshock/python/paper-M2-mg.py +++ b/Exec/radiation_tests/Rad2Tshock/python/paper-M2-mg.py @@ -12,7 +12,7 @@ Temp, x, t = read_gnu_file('../run-M2-mg/Temp_'+n+'.gnu') print t -x += 10 +x += 10 fid = open('M2shock.p', 'rb') xa = pickle.load(fid) diff --git a/Exec/radiation_tests/Rad2Tshock/python/paper-M2.py b/Exec/radiation_tests/Rad2Tshock/python/paper-M2.py index d9275b5765..04fa4b750d 100755 --- a/Exec/radiation_tests/Rad2Tshock/python/paper-M2.py +++ b/Exec/radiation_tests/Rad2Tshock/python/paper-M2.py @@ -11,7 +11,7 @@ Temp, x, t = read_gnu_file('../run-M2/Temp_2000.gnu') print t -x += 10 +x += 10 fid = open('M2shock.p', 'rb') xa = pickle.load(fid) diff --git a/Exec/radiation_tests/Rad2Tshock/python/phys.py b/Exec/radiation_tests/Rad2Tshock/python/phys.py index f58825c479..4c056af274 100644 --- a/Exec/radiation_tests/Rad2Tshock/python/phys.py +++ b/Exec/radiation_tests/Rad2Tshock/python/phys.py @@ -1,5 +1,5 @@ -# physical constants in cgs +# physical constants in cgs # Fundamental constants taken from NIST's 2010 CODATA recommended values @@ -37,6 +37,6 @@ Mbolsun = 4.7554 # Absolute Bolometric Magnitude of Sun # time -year = 3.1556926e7 # year in second +year = 3.1556926e7 # year in second day = 86400.0 # day in second diff --git a/Exec/radiation_tests/RadBlastWave/problem_initialize_rad_data.H b/Exec/radiation_tests/RadBlastWave/problem_initialize_rad_data.H index 8435440930..95e25667c4 100644 --- a/Exec/radiation_tests/RadBlastWave/problem_initialize_rad_data.H +++ b/Exec/radiation_tests/RadBlastWave/problem_initialize_rad_data.H @@ -72,7 +72,7 @@ void problem_initialize_rad_data (int i, int j, int k, #if AMREX_SPACEDIM == 1 // the volume of a subzone is (4/3) pi (xr^3 - xl^3). // we can factor this as: (4/3) pi dr (xr^2 + xl*xr + xl^2) - // The (4/3) pi dr factor is common, so we can neglect it. + // The (4/3) pi dr factor is common, so we can neglect it. if (rr2 <= r2init) { vol_pert += (xr * xr + xl * xr + xl * xl); } diff --git a/Exec/radiation_tests/RadBlastWave/problem_initialize_state_data.H b/Exec/radiation_tests/RadBlastWave/problem_initialize_state_data.H index 8f343a986d..5d9439f9cb 100644 --- a/Exec/radiation_tests/RadBlastWave/problem_initialize_state_data.H +++ b/Exec/radiation_tests/RadBlastWave/problem_initialize_state_data.H @@ -70,7 +70,7 @@ void problem_initialize_state_data (int i, int j, int k, #if AMREX_SPACEDIM == 1 // the volume of a subzone is (4/3) pi (xr^3 - xl^3). // we can factor this as: (4/3) pi dr (xr^2 + xl*xr + xl^2) - // The (4/3) pi dr factor is common, so we can neglect it. + // The (4/3) pi dr factor is common, so we can neglect it. if (rr2 <= r2init) { vol_pert += (xr * xr + xl * xr + xl * xl); } diff --git a/Exec/radiation_tests/RadShestakovBolstad/python/initunits.py b/Exec/radiation_tests/RadShestakovBolstad/python/initunits.py index 3570e7779a..0f9cb1f12a 100755 --- a/Exec/radiation_tests/RadShestakovBolstad/python/initunits.py +++ b/Exec/radiation_tests/RadShestakovBolstad/python/initunits.py @@ -14,7 +14,7 @@ def SBunits(T0, rho0, kap0, printmessg=0): t0 = l0/c u0 = B0*nu0**3 E0 = u0*nu0 - cv = k*u0/(h*rho0) + cv = k*u0/(h*rho0) units = {'L':x0, 'time':t0, 'Temp': T0, 'Enu':u0, 'nu':nu0, 'Eg':E0, 'cv': cv} if printmessg: @@ -48,6 +48,6 @@ def SBunits(T0, rho0, kap0, printmessg=0): kap0 = float(a) T0 = T0 * 1.e3 * eV / k # now in erg - + SBunits(T0, rho0, kap0, 1) diff --git a/Exec/radiation_tests/RadShestakovBolstad/python/paper.py b/Exec/radiation_tests/RadShestakovBolstad/python/paper.py index e5c5abf3c4..8bc6dcedd8 100755 --- a/Exec/radiation_tests/RadShestakovBolstad/python/paper.py +++ b/Exec/radiation_tests/RadShestakovBolstad/python/paper.py @@ -10,7 +10,7 @@ fid = open('SBunits.p', 'rb') units = pickle.load(fid) -fid.close() +fid.close() Tw = (ew/units['cv']) / units['Temp'] Ew = Ew / units['Eg'] @@ -20,8 +20,8 @@ print 't = ', t ex = array([0.0, 0.2, 0.4, 0.46, 0.47, 0.48, 0.49, 0.50, 0.51, 0.52, 0.53, 0.54, 0.6, 0.8, 1.0]) -eT = array([9.9373253e-1, 9.9339523e-1, 9.8969664e-1, 9.8060848e-1, 9.7609654e-1, 9.6819424e-1, - 9.5044751e-1, 4.9704000e-1, 4.3632445e-2, 2.5885608e-2, 1.7983134e-2, 1.3470947e-2, +eT = array([9.9373253e-1, 9.9339523e-1, 9.8969664e-1, 9.8060848e-1, 9.7609654e-1, 9.6819424e-1, + 9.5044751e-1, 4.9704000e-1, 4.3632445e-2, 2.5885608e-2, 1.7983134e-2, 1.3470947e-2, 4.3797848e-3, 6.4654865e-4, 1.9181546e-4]) eE = array([5.6401674e-3, 5.5646351e-3, 5.1047352e-3, 4.5542134e-3, 4.3744933e-3, 4.1294850e-3, 3.7570008e-3, 2.9096931e-3, 2.0623647e-3, 1.6898183e-3, 1.4447063e-3, 1.2648409e-3, diff --git a/Exec/radiation_tests/RadShestakovBolstad/python/phys.py b/Exec/radiation_tests/RadShestakovBolstad/python/phys.py index f58825c479..4c056af274 100644 --- a/Exec/radiation_tests/RadShestakovBolstad/python/phys.py +++ b/Exec/radiation_tests/RadShestakovBolstad/python/phys.py @@ -1,5 +1,5 @@ -# physical constants in cgs +# physical constants in cgs # Fundamental constants taken from NIST's 2010 CODATA recommended values @@ -37,6 +37,6 @@ Mbolsun = 4.7554 # Absolute Bolometric Magnitude of Sun # time -year = 3.1556926e7 # year in second +year = 3.1556926e7 # year in second day = 86400.0 # day in second diff --git a/Exec/radiation_tests/RadSphere/Tools/fradsphere.f90 b/Exec/radiation_tests/RadSphere/Tools/fradsphere.f90 index 29b43ef275..261ae716a4 100644 --- a/Exec/radiation_tests/RadSphere/Tools/fradsphere.f90 +++ b/Exec/radiation_tests/RadSphere/Tools/fradsphere.f90 @@ -1,5 +1,5 @@ ! Print out the radiation quantities at a specified distance from the -! origin, for a 1-d CASTRO run. This is geared toward the radiating +! origin, for a 1-d CASTRO run. This is geared toward the radiating ! sphere problem. program fradsphere @@ -155,7 +155,7 @@ program fradsphere ! completely refined, and allocate enough storage for that, ! although, we won't really need all of this ! - ! note: sv(:,1) will be the coordinate information. + ! note: sv(:,1) will be the coordinate information. ! the variables will be stored in sv(:,2:nvs+1) allocate(sv(max_points,nvs+1), isv(max_points)) @@ -188,10 +188,10 @@ program fradsphere do ii = lbound(p,dim=1), ubound(p,dim=1) if ( any(imask(ii*r1:(ii+1)*r1-1) ) ) then cnt = cnt + 1 - + sv(cnt,1) = rmin + (ii + HALF)*dx(1)/rr sv(cnt,2:) = p(ii,1,1,:) - + imask(ii*r1:(ii+1)*r1-1) = .false. end if end do @@ -251,9 +251,9 @@ program fradsphere write(*,1000) "group #", "group center energy", & "E_rad(nu)*dnu (erg/cm^3)", "E_rad(nu) (erg/cm^3/Hz)" do i = 1, ngroups - write (*,1001) pf%names(irad_begin-1+i)(4:), & - nu_groups(i), & - sv(isv(idx_obs),1+irad_begin-1+i), & + write (*,1001) pf%names(irad_begin-1+i)(4:), & + nu_groups(i), & + sv(isv(idx_obs),1+irad_begin-1+i), & sv(isv(idx_obs),1+irad_begin-1+i)/dnu_groups(i) enddo diff --git a/Exec/radiation_tests/RadSphere/Tools/radbc.f90 b/Exec/radiation_tests/RadSphere/Tools/radbc.f90 index 727d7ae50e..832cff5a9e 100644 --- a/Exec/radiation_tests/RadSphere/Tools/radbc.f90 +++ b/Exec/radiation_tests/RadSphere/Tools/radbc.f90 @@ -1,5 +1,5 @@ ! write out the group dependent boundary conditions -! +! ! This routine takes as input the file "group_structures.dat" which is ! output by RadMultiGroup.cpp. That file defines the group centers ! and weights (widths). @@ -21,7 +21,7 @@ module constants_module ! physical parameters real(rt) , parameter :: T_sphere = 1500.e0_rt*ev2erg/k_B ! sphere temp (K - + end module constants_module @@ -30,7 +30,7 @@ function planck(nu,T) result (B) ! the Planck function for a Blackbody (actually, energy density, ! B = (4 pi / c) I, where I is the normal Planck function - ! + ! ! nu = frequency (Hz) ! T = temperature (K) @@ -63,7 +63,7 @@ program bc integer :: ngroups real(rt) , allocatable :: nu_groups(:), dnu_groups(:) real(rt) :: planck - + integer :: n character(len=256) :: header_line integer :: ipos @@ -88,10 +88,10 @@ program bc do n = 1, ngroups print *, n, nu_groups(n), planck(nu_groups(n), T_sphere)*dnu_groups(n) - enddo + enddo print *, "radiation.lo_bcval0 = ", & ((planck(nu_groups(n), T_sphere)*dnu_groups(n)), n=1,ngroups) end program bc - + diff --git a/Exec/radiation_tests/RadSuOlson/python/paper.py b/Exec/radiation_tests/RadSuOlson/python/paper.py index 9baedfe602..fa02fc1edc 100755 --- a/Exec/radiation_tests/RadSuOlson/python/paper.py +++ b/Exec/radiation_tests/RadSuOlson/python/paper.py @@ -7,7 +7,7 @@ def main(): kappa = 1.0 eps = 0.1 - Finc = 1.0 + Finc = 1.0 xu001 = [0.1, 0.25, 0.5, 0.75, 1.0] u001 = [0.17979, 0.11006, 0.04104, 0.01214, 0.00268] @@ -22,7 +22,7 @@ def main(): Tfilea = '../run-paper/Temp_0035.gnu' Erfileb = '../run-paper/Er_1002.gnu' Tfileb = '../run-paper/Temp_1002.gnu' - + def read_gnu_file(filenm): x = [] y = [] diff --git a/Exec/radiation_tests/RadSuOlsonMG/python/initunits.py b/Exec/radiation_tests/RadSuOlsonMG/python/initunits.py index 3f55f39c43..b6d126ff40 100755 --- a/Exec/radiation_tests/RadSuOlsonMG/python/initunits.py +++ b/Exec/radiation_tests/RadSuOlsonMG/python/initunits.py @@ -42,6 +42,6 @@ def SOunits(eps, printmessg=0): for o, a in opts: if o == "--eps": eps = float(a) - + SOunits(eps, 1) diff --git a/Exec/radiation_tests/RadSuOlsonMG/python/paper.py b/Exec/radiation_tests/RadSuOlsonMG/python/paper.py index d7f5c33755..cb9c1dda5a 100755 --- a/Exec/radiation_tests/RadSuOlsonMG/python/paper.py +++ b/Exec/radiation_tests/RadSuOlsonMG/python/paper.py @@ -55,10 +55,10 @@ xlim(0.2,90) ylim(4.e-4, 0.2) legend((line3,line1,line4,line2), - (r'$\tau = 3$'+' numerical', - r'$\tau = 3$'+' analytic', - r'$\tau = 30$'+' numerical', - r'$\tau = 30$'+' analytic'), + (r'$\tau = 3$'+' numerical', + r'$\tau = 3$'+' analytic', + r'$\tau = 30$'+' numerical', + r'$\tau = 30$'+' analytic'), loc='lower left', prop=matplotlib.font_manager.FontProperties(size=16), handlelength=2.5, diff --git a/Exec/radiation_tests/RadSuOlsonMG/python/phys.py b/Exec/radiation_tests/RadSuOlsonMG/python/phys.py index f58825c479..4c056af274 100644 --- a/Exec/radiation_tests/RadSuOlsonMG/python/phys.py +++ b/Exec/radiation_tests/RadSuOlsonMG/python/phys.py @@ -1,5 +1,5 @@ -# physical constants in cgs +# physical constants in cgs # Fundamental constants taken from NIST's 2010 CODATA recommended values @@ -37,6 +37,6 @@ Mbolsun = 4.7554 # Absolute Bolometric Magnitude of Sun # time -year = 3.1556926e7 # year in second +year = 3.1556926e7 # year in second day = 86400.0 # day in second diff --git a/Exec/reacting_tests/bubble_convergence/analysis/slice_multi.py b/Exec/reacting_tests/bubble_convergence/analysis/slice_multi.py index c47e68930d..d05bd7fba9 100755 --- a/Exec/reacting_tests/bubble_convergence/analysis/slice_multi.py +++ b/Exec/reacting_tests/bubble_convergence/analysis/slice_multi.py @@ -26,7 +26,7 @@ fig = plt.figure() fig.set_size_inches(12.0, 9.0) -grid = ImageGrid(fig, 111, nrows_ncols=(2, 2), axes_pad=0.75, cbar_pad="2%", +grid = ImageGrid(fig, 111, nrows_ncols=(2, 2), axes_pad=0.75, cbar_pad="2%", label_mode="L", cbar_mode="each") diff --git a/Exec/reacting_tests/bubble_convergence/converge_test.sh b/Exec/reacting_tests/bubble_convergence/converge_test.sh index 127e390a0b..0de514eee3 100755 --- a/Exec/reacting_tests/bubble_convergence/converge_test.sh +++ b/Exec/reacting_tests/bubble_convergence/converge_test.sh @@ -5,7 +5,7 @@ set -x EXEC=./Castro2d.gnu.MPI.TRUESDC.ex -CONV_TOOL=RichardsonConvergenceTest2d.gnu.ex +CONV_TOOL=RichardsonConvergenceTest2d.gnu.ex mpiexec -n 8 ${EXEC} inputs_2d.32 amr.plot_file=bubble_32_sdc4_plt >& 32.out mpiexec -n 8 ${EXEC} inputs_2d.64 amr.plot_file=bubble_64_sdc4_plt >& 64.out diff --git a/Exec/reacting_tests/bubble_convergence/problem_initialize_state_data.H b/Exec/reacting_tests/bubble_convergence/problem_initialize_state_data.H index 0400e1b1fb..2cbe924c9b 100644 --- a/Exec/reacting_tests/bubble_convergence/problem_initialize_state_data.H +++ b/Exec/reacting_tests/bubble_convergence/problem_initialize_state_data.H @@ -93,7 +93,7 @@ void problem_initialize_state_data (int i, int j, int k, state(i,j,k,URHO) = eos_state.rho; - // correct the mass fractions and energy with the new density + // correct the mass fractions and energy with the new density state(i,j,k,UEINT) = state(i,j,k,URHO) * eos_state.e; state(i,j,k,UEDEN) = state(i,j,k,UEINT); diff --git a/Exec/reacting_tests/nse_test/analysis/slice_multi.py b/Exec/reacting_tests/nse_test/analysis/slice_multi.py index e567c8c4e9..1b0dea899a 100755 --- a/Exec/reacting_tests/nse_test/analysis/slice_multi.py +++ b/Exec/reacting_tests/nse_test/analysis/slice_multi.py @@ -28,7 +28,7 @@ nrows = 2 ncols = 3 -grid = ImageGrid(fig, 111, nrows_ncols=(nrows, ncols), axes_pad=0.75, cbar_pad="2%", +grid = ImageGrid(fig, 111, nrows_ncols=(nrows, ncols), axes_pad=0.75, cbar_pad="2%", label_mode="L", cbar_mode="each") diff --git a/Exec/reacting_tests/reacting_convergence/analysis/slice_multi.py b/Exec/reacting_tests/reacting_convergence/analysis/slice_multi.py index a050fa6158..8f47cf062b 100755 --- a/Exec/reacting_tests/reacting_convergence/analysis/slice_multi.py +++ b/Exec/reacting_tests/reacting_convergence/analysis/slice_multi.py @@ -26,7 +26,7 @@ fig = plt.figure() fig.set_size_inches(12.0, 9.0) -grid = ImageGrid(fig, 111, nrows_ncols=(3, 2), axes_pad=0.75, cbar_pad="2%", +grid = ImageGrid(fig, 111, nrows_ncols=(3, 2), axes_pad=0.75, cbar_pad="2%", label_mode="L", cbar_mode="each") diff --git a/Exec/reacting_tests/reacting_convergence/problem_initialize.H b/Exec/reacting_tests/reacting_convergence/problem_initialize.H index 010758d711..d0c7d28a2a 100644 --- a/Exec/reacting_tests/reacting_convergence/problem_initialize.H +++ b/Exec/reacting_tests/reacting_convergence/problem_initialize.H @@ -95,7 +95,7 @@ void problem_initialize () xn[ispec6] = problem::spec6_frac; } - // Normalize species + // Normalize species auto sumX = 0.0_rt; for (auto X : xn) { sumX += X; diff --git a/Exec/reacting_tests/toy_flame/Prob.cpp b/Exec/reacting_tests/toy_flame/Prob.cpp index 3a3ea31b06..868982a1bf 100644 --- a/Exec/reacting_tests/toy_flame/Prob.cpp +++ b/Exec/reacting_tests/toy_flame/Prob.cpp @@ -21,7 +21,7 @@ Castro::flame_width_properties (Real time, Real& T_max, Real& T_min, Real& grad_ #ifdef _OPENMP #pragma omp parallel -#endif +#endif for (MFIter mfi(*mf, TilingIfNotGPU()); mfi.isValid(); ++mfi) { const Box& box = mfi.tilebox(); @@ -73,7 +73,7 @@ Castro::flame_speed_properties (Real time, Real& rho_fuel_dot) #ifdef _OPENMP #pragma omp parallel -#endif +#endif for (MFIter mfi(*mf, TilingIfNotGPU()); mfi.isValid(); ++mfi) { const Box& box = mfi.tilebox(); diff --git a/Exec/science/Detonation/analysis/shock_speed.py b/Exec/science/Detonation/analysis/shock_speed.py index 9d63c4b9ef..069db08d86 100644 --- a/Exec/science/Detonation/analysis/shock_speed.py +++ b/Exec/science/Detonation/analysis/shock_speed.py @@ -24,12 +24,12 @@ def get_T_profile(plotfile): def find_x_for_T(x, T, T_0=2.e9): """ given a profile x(T), find the x_0 that corresponds to T_0 """ - + # our strategy here assumes that the hot ash is in the early part # of the profile. We then find the index of the first point where # T drops below T_0 idx = np.where(T < T_0)[0][0] - + T1 = T[idx-1] x1 = x[idx-1] @@ -37,7 +37,7 @@ def find_x_for_T(x, T, T_0=2.e9): x2 = x[idx] slope = (x2 - x1)/(T2 - T1) - + return x1 + slope*(T_0 - T1) diff --git a/Exec/science/convective_flame/slice.py b/Exec/science/convective_flame/slice.py index 0bd53a9ba0..bea157f135 100755 --- a/Exec/science/convective_flame/slice.py +++ b/Exec/science/convective_flame/slice.py @@ -12,7 +12,7 @@ sp.set_zlim("Temp", 1.e-3, 100) # now do a contour of density -sp.annotate_contour("density", ncont=2, clim=(0.01, 1.0), +sp.annotate_contour("density", ncont=2, clim=(0.01, 1.0), plot_args={"colors": "red", "linewidths": 2}) sp.save("{}_slice.png".format(os.path.basename(plotfile))) diff --git a/Exec/science/flame/Prob.cpp b/Exec/science/flame/Prob.cpp index aecd4b13ba..4384f803e6 100644 --- a/Exec/science/flame/Prob.cpp +++ b/Exec/science/flame/Prob.cpp @@ -21,7 +21,7 @@ Castro::flame_width_properties (Real time, Real& T_max, Real& T_min, Real& grad_ #ifdef _OPENMP #pragma omp parallel -#endif +#endif for (MFIter mfi(*mf, TilingIfNotGPU()); mfi.isValid(); ++mfi) { const Box& box = mfi.tilebox(); @@ -86,7 +86,7 @@ Castro::flame_speed_properties (Real time, Real& rho_fuel_dot) #ifdef _OPENMP #pragma omp parallel -#endif +#endif for (MFIter mfi(*mf, TilingIfNotGPU()); mfi.isValid(); ++mfi) { const Box& box = mfi.tilebox(); diff --git a/Exec/science/flame_wave/analysis/flame_speed.py b/Exec/science/flame_wave/analysis/flame_speed.py index 0ed023737a..79cf8b35d8 100755 --- a/Exec/science/flame_wave/analysis/flame_speed.py +++ b/Exec/science/flame_wave/analysis/flame_speed.py @@ -22,7 +22,7 @@ def measure_and_plot(dat, stab_ind): front has stabilized, and the slope obtained from linear regression will yield an accurate measurement of the front speed. """ - + slopes = dict() radarr = dat["enuc[0.1%]"] @@ -36,44 +36,44 @@ def measure_and_plot(dat, stab_ind): m, b, r, _, sd = linregress(tarr, radarr) print("{:>20}\t{:.2e}\t{:.3f}\t{:.2e}".format("enuc[0.1%]", m, r, sd)) - + if r > 0.8: - + plt.plot(dat["time"] * 1000, m * dat["time"] + b, "k--", linewidth=2) - + ax = plt.gca() ax.ticklabel_format(axis="y", style="sci", scilimits=(0, 0)) ax.yaxis.major.formatter._useMathText = True ax.xaxis.set_major_locator(MaxNLocator(integer=True)) # ax.yaxis.set_major_locator(MaxNLocator(integer=True)) - + plt.xlabel("t [ms]") plt.ylabel("r [cm]") plt.title("Front Position vs. Time", fontsize=24) - + for item in (ax.xaxis.label, ax.yaxis.label): - + item.set_fontsize(20) item.set_color("dimgrey") - + for item in (ax.get_xticklabels() + ax.get_yticklabels()) + [ax.yaxis.offsetText]: - + item.set_fontsize(16) item.set_color("dimgrey") - + return m if __name__ == "__main__": - + try: - + dat = pd.read_csv(sys.argv[1], sep="\s+") stab_ind = int(sys.argv[2]) plt.style.use("ggplot") measure_and_plot(dat, stab_ind) plt.show() - + except (ValueError, IndexError): - + print("Usage: ./fit_speed.py data_file starting_index") diff --git a/Exec/science/flame_wave/analysis/front_tracker.py b/Exec/science/flame_wave/analysis/front_tracker.py index 79cbed4127..58c418f334 100755 --- a/Exec/science/flame_wave/analysis/front_tracker.py +++ b/Exec/science/flame_wave/analysis/front_tracker.py @@ -48,44 +48,44 @@ args = parser.parse_args(sys.argv[1:]) class Transform(Enum): - + SLC = 0 AVG = 1 def process_args(args): - + # Load datasets tf = lambda fname: yt.load(fname.rstrip('/')) args.ts = list(map(tf, args.datasets)) - + # Assume same domain for all datasets ds = args.ts[0] - + if args.xlim is None: args.xlim = ds.domain_left_edge[0], ds.domain_right_edge[0] if args.ylim is None: args.ylim = ds.domain_left_edge[1], ds.domain_right_edge[1] if args.zlim is None: args.zlim = ds.domain_left_edge[2], ds.domain_right_edge[2] - + metrics = dict() - + for item in args.metrics: - + try: ls.append(float(item)) except: ls = metrics.setdefault(item, []) - + args.metrics = metrics - + if args.transform is None: - + args.transform = {Transform.SLC: [2], Transform.AVG: [1]} - + else: - + transform = {tr: [] for tr in Transform} - + for i, item in enumerate(args.transform): - + item = item.split(':') if len(item) == 1: item, = item @@ -95,28 +95,28 @@ def process_args(args): transform[Transform(t)].append(ind) else: raise ValueError("Invalid transform format.") - + args.transform = transform - + if args.res is None: args.res = ds.domain_dimensions if len(args.res) < 3: args.res += [1] * (3 - args.res) - + # Eventually may want to generalize this to allow multiple axes # Then we would just return a point in 2D or 3D space - + transformed = sum(args.transform.values(), []) args.axis, = filter(lambda ax: ax not in transformed, range(3)) - + if ds.geometry == 'spherical': axnames = 'r', elif ds.geometry == 'cylindrical': axnames = 'r', 'z' else: axnames = 'x', 'y', 'z' - + args.axis_name = axnames[args.axis] - + assert len(args.res) == 3 - + process_args(args) ################# @@ -125,7 +125,7 @@ def process_args(args): def get_window_parameters(ds, axis, width=None, center='c'): """ Some parameters controlling the frb window. """ - + width = ds.coordinates.sanitize_width(axis, width, None) center, display_center = ds.coordinates.sanitize_center(center, axis) xax = ds.coordinates.x_axis[axis] @@ -135,7 +135,7 @@ def get_window_parameters(ds, axis, width=None, center='c'): display_center[yax]-width[1] / 2, display_center[yax]+width[1] / 2) return bounds, center, display_center - + def get_width(ds, xlim=None, ylim=None, zlim=None): """ Get the width of the frb. """ @@ -144,7 +144,7 @@ def get_width(ds, xlim=None, ylim=None, zlim=None): if ylim is None: ylim = ds.domain_left_edge[1], ds.domain_right_edge[1] else: ylim = ylim[0], ylim[1] - + if zlim is None: zlim = ds.domain_left_edge[2], ds.domain_right_edge[2] else: zlim = zlim[0], zlim[1] @@ -153,7 +153,7 @@ def get_width(ds, xlim=None, ylim=None, zlim=None): zwidth = (zlim[1] - zlim[0]).in_cgs() return xwidth, ywidth, zwidth - + def get_center(ds, xlim=None, ylim=None, zlim=None): """ Get the coordinates of the center of the frb. """ @@ -162,7 +162,7 @@ def get_center(ds, xlim=None, ylim=None, zlim=None): if ylim is None: ylim = ds.domain_left_edge[1], ds.domain_right_edge[1] else: ylim = ylim[0], ylim[1] - + if zlim is None: zlim = ds.domain_left_edge[2], ds.domain_right_edge[2] else: zlim = zlim[0], zlim[1] @@ -171,64 +171,64 @@ def get_center(ds, xlim=None, ylim=None, zlim=None): zctr = 0.5 * (zlim[0] + zlim[1]).in_cgs() return xctr, yctr, zctr - + def minus_inf(): """ Factory function for negative infinity. """ - + return float("-inf") class Metrics: """ Class for defining different measurements of the position of the flame front. """ - + # Global maxima _globmax = defaultdict(minus_inf) - + def __init__(self, ds, args): - + self.__dict__.update(self.makefrbs(ds, args)) self.time = ds.current_time self._metrics = args.metrics self._upper_branch = args.branch > 0 self._use_global_max = args.use_global_max - + for field in args.metrics.keys(): Metrics._globmax[field] = max(Metrics._globmax[field], self[field].max()) - + def __getitem__(self, field): - + return getattr(self, field) - + @staticmethod def makefrbs(ds, args): - + fields = args.metrics.keys() width = get_width(ds, args.xlim, args.ylim, args.zlim) center = get_center(ds, args.xlim, args.ylim, args.zlim) - + region = \ [ slice(*args.xlim, complex(0, args.res[0])), slice(*args.ylim, complex(0, args.res[1])), slice(*args.zlim, complex(0, args.res[2])) ] - + for axis in args.transform[Transform.SLC]: - + _, center, _ = get_window_parameters(ds, axis, width, center) region[axis] = center[axis] - + # The resolution in yt FixedResolutionBuffers is backwards # If we're doing a slice, we need to swap the steps is_slice = [isinstance(bounds, slice) for bounds in region] dim = sum(is_slice) - + if dim == 2: - + normal = is_slice.index(False) xax = ds.coordinates.x_axis[normal] yax = ds.coordinates.y_axis[normal] xslc, yslc = region[xax], region[yax] - + region[xax] = slice(xslc.start, xslc.stop, yslc.step) region[yax] = slice(yslc.start, yslc.stop, xslc.step) @@ -242,40 +242,40 @@ def makefrbs(ds, args): # Create an FRB for each field and average over the remaining extra dimensions frbs = dict(pos=frr[args.axis_name]) for field in fields: frbs[field] = frr[field] - + axes = sorted([args.axis] + args.transform[Transform.AVG]) - + for i, ax in enumerate(reversed(axes)): - + if ax == args.axis: continue for field in frbs: frbs[field] = frbs[field].mean(axis=i) - + return frbs - - @staticmethod + + @staticmethod def tostring(field, fac): - + return f"{field}[{fac*100}%]" - + @property def fields(self): - + return list(self.metrics.keys()) - + def locate(self, field, fac): """ Returns position where `field` drops to or reaches `fac * max(field)`. """ - + maxind = self[field].argmax() - + if self._use_global_max: maxval = self._globmax[field] elif fac == 1.0: return self.pos[maxind] else: maxval = self[field].max() - + thresh = maxval * fac if self._upper_branch: ind = (self[field][maxind:] < thresh).argmax() @@ -283,18 +283,18 @@ def locate(self, field, fac): else: ind = (self[field][maxind+1:] > thresh).argmax() return self.pos[ind] - + def getall(self): """ Return positions for all metrics, in a dictionary keyed by metric string. """ - + locs = dict() - + for field, facs in self._metrics.items(): - + for fac in facs: - + locs[self.tostring(field, fac)] = self.locate(field, fac) - + return locs ######################################### @@ -308,7 +308,7 @@ def getall(self): loclist = [] while args.ts: - + ds = args.ts.popleft() times.append(ds.current_time) loclist.append(Metrics(ds, args)) @@ -320,12 +320,12 @@ def getall(self): cols = sorted(loclist[0].keys()) with open(args.out, 'w') as file: - + print("time", *cols, file=file) - + for time, locs in zip(times, loclist): - + row = (locs[col].value for col in cols) print(time.value, *row, file=file) - + print("Task completed.") diff --git a/Exec/science/flame_wave/analysis/image_animator.py b/Exec/science/flame_wave/analysis/image_animator.py index 4bb1f0e8b3..20ccf0b291 100644 --- a/Exec/science/flame_wave/analysis/image_animator.py +++ b/Exec/science/flame_wave/analysis/image_animator.py @@ -26,7 +26,7 @@ # Sort if necessary if args.sort is not None: - + # Descending or ascending desc = args.sort < 0 # Starting index @@ -39,21 +39,21 @@ else: key = lambda filename: filename[start:start+nchars] images.sort(key=key, reverse=desc) - + if args.out.endswith(".mp4"): args.out = args.out[:-4] if not args.out: sys.exit("Invalid output file!") with tf.TemporaryDirectory() as dir: - + # The files are numbered # Padding with zeros preserves sort order ndigits = len(str(len(images))) baselink = "__fftemp_{:0%dd}.png" % ndigits for i, image in enumerate(map(os.path.abspath, images)): - + # Create a symlink for each file linkname = baselink.format(i) linkname = os.path.join(dir, linkname) diff --git a/Exec/science/flame_wave/analysis/mpl_image_animator.py b/Exec/science/flame_wave/analysis/mpl_image_animator.py index 24311219f3..ec04fe0a02 100755 --- a/Exec/science/flame_wave/analysis/mpl_image_animator.py +++ b/Exec/science/flame_wave/analysis/mpl_image_animator.py @@ -36,24 +36,24 @@ sys.exit("No images supplied for animation.") if args.stack is not None: - + nsubplots = args.stack[0] groupmode = args.stack[1] - + else: - + nsubplots = 1 groupmode = 0 - + sublist_size = len(images) // nsubplots - + if nsubplots > 1 and groupmode == 0: - + step = sublist_size sublists = [images[i-step:i] for i in range(step, len(images) + 1, step)] - + else: - + sublists = [images] # Sort if necessary @@ -71,9 +71,9 @@ key = lambda img: img[start:start + nchars] for imlist in sublists: imlist.sort(key=key, reverse=desc) - + if nsubplots > 1 and groupmode == 1: - + sublists = [images[i::nsubplots] for i in range(nsubplots)] # Load images and animate @@ -83,12 +83,12 @@ print("Animating...") if nsubplots == 1: - + fig = plt.figure() axes = [plt.gca()] - + else: - + fig, axes = plt.subplots(nsubplots) plt.margins(0, 0) @@ -97,20 +97,20 @@ imobj = [] for ax, sub in zip(axes, sublists): - + ax.set_axis_off() zeros = np.zeros(sub[0].shape) imobj.append(ax.imshow(zeros, origin='lower', alpha=1.0, zorder=1, aspect=1)) def init(): - + for im, sub in zip(imobj, sublists): im.set_data(np.zeros(sub[0].shape)) return imobj, def animate(i): - + for im, sub in zip(imobj, sublists): im.set_data(sub[i][-1::-1]) return imobj diff --git a/Exec/science/flame_wave/analysis/plot_generator.py b/Exec/science/flame_wave/analysis/plot_generator.py index 0d52d448ea..51ca740c79 100644 --- a/Exec/science/flame_wave/analysis/plot_generator.py +++ b/Exec/science/flame_wave/analysis/plot_generator.py @@ -83,17 +83,17 @@ if args.stream is not None: args.stream[2] = int(args.stream[2]) - + if args.contour is not None: - + args.contour[1:] = list(map(float, args.contour[1:])) - + if args.contour_opt is not None: - + contour_opt = {'plot_args': {'colors': args.contour_opt[0], 'linewidths': int(args.contour_opt[1])}} else: - + contour_opt = {} if args.flame_wave: @@ -211,9 +211,9 @@ def _transvel(field, data): # Loop and generate for ds in ts: - + if ("gas", "transvel") not in ds.field_list: - + try: ds.add_field(("gas", "transvel"), function=_transvel, units="cm/s", sampling_type="cell") @@ -237,9 +237,9 @@ def _transvel(field, data): plot.set_log(field, args.log) if args.time: - + time_format = 't = {{time:.{}f}}{{units}}'.format(args.time) - + plot.annotate_timestamp(corner='upper_left', time_format=time_format, time_unit='s', draw_inset_box=True, inset_box_args={'alpha': 0.0}) @@ -256,9 +256,9 @@ def _transvel(field, data): plot.annotate_streamlines(args.stream[0], args.stream[1], factor=args.stream[2], plot_args={'cmap': color_opt.cmap, 'arrowstyle': '->'}, **kw) - + if args.grid is not None: - + opts = dict(zip(args.grid[::2], args.grid[1::2])) plot.annotate_grids(**opts) diff --git a/Exec/science/flame_wave/analysis/profiles.py b/Exec/science/flame_wave/analysis/profiles.py index f14f57ce0d..cf8999a2ed 100755 --- a/Exec/science/flame_wave/analysis/profiles.py +++ b/Exec/science/flame_wave/analysis/profiles.py @@ -98,7 +98,7 @@ def to_atomic_mass(mfrac_field): else: # make the offset text look nice and latex-y # https://stackoverflow.com/questions/31517156/adjust-exponent-text-after-setting-scientific-limits-on-matplotlib-axis - axes[i].yaxis.set_major_formatter(ptick.ScalarFormatter(useMathText=True)) + axes[i].yaxis.set_major_formatter(ptick.ScalarFormatter(useMathText=True)) if i == 0: axes[0].legend(frameon=False) @@ -106,4 +106,4 @@ def to_atomic_mass(mfrac_field): #fig.set_size_inches(10.0, 9.0) plt.tight_layout() plt.savefig("{}_profiles.png".format(os.path.basename(plotfile))) - + diff --git a/Exec/science/flame_wave/analysis/trajectories_info.py b/Exec/science/flame_wave/analysis/trajectories_info.py index fa324f9bcb..9fa2915628 100644 --- a/Exec/science/flame_wave/analysis/trajectories_info.py +++ b/Exec/science/flame_wave/analysis/trajectories_info.py @@ -53,4 +53,4 @@ print("sorting files...") for f in files_to_sort: #sorts lines in files: -g = sort scientific notation, -k 3 = use third column (time), -o = specify output filename - subprocess.run(["sort","-g","-k 3",f,"-o",f], shell=False) \ No newline at end of file + subprocess.run(["sort","-g","-k 3",f,"-o",f], shell=False) \ No newline at end of file diff --git a/Exec/science/flame_wave/scaling/frontier/frontier-scaling-2023-04-06.txt b/Exec/science/flame_wave/scaling/frontier/frontier-scaling-2023-04-06.txt index 962e5627be..34d2a71734 100644 --- a/Exec/science/flame_wave/scaling/frontier/frontier-scaling-2023-04-06.txt +++ b/Exec/science/flame_wave/scaling/frontier/frontier-scaling-2023-04-06.txt @@ -26,4 +26,4 @@ # 384 5.2 128 9.83363 0.352897 # 512 5.2 128 6.99018 0.0698918 #1024 5.2 128 5.2249 0.408811 - + diff --git a/Exec/science/flame_wave/scaling/frontier/frontier-scaling-rkc-2023-05-31.txt b/Exec/science/flame_wave/scaling/frontier/frontier-scaling-rkc-2023-05-31.txt index fedafab8ee..f78f5c0650 100644 --- a/Exec/science/flame_wave/scaling/frontier/frontier-scaling-rkc-2023-05-31.txt +++ b/Exec/science/flame_wave/scaling/frontier/frontier-scaling-rkc-2023-05-31.txt @@ -15,4 +15,4 @@ 384 5.3 128 8.47071 0.059582 512 5.3 128 6.18902 0.0410103 1024 5.3 128 4.40306 0.0512439 -#2048 5.3 128 +#2048 5.3 128 diff --git a/Exec/science/flame_wave/scaling/summit/scaling_20200613.txt b/Exec/science/flame_wave/scaling/summit/scaling_20200613.txt index 20603936fa..f4197c222d 100644 --- a/Exec/science/flame_wave/scaling/summit/scaling_20200613.txt +++ b/Exec/science/flame_wave/scaling/summit/scaling_20200613.txt @@ -14,11 +14,11 @@ 256 64 43.1175 0.255655 1052 652 125.5 100.3 105.9 384 64 30.9885 0.42845 766 447.9 113.8 90.7 73.31 384 96 34.4243 0.336679 830.8 563.1 105.3 72.03 65.85 - 512 64 26.9385 0.255671 660.3 389.9 102 82.28 59.18 + 512 64 26.9385 0.255671 660.3 389.9 102 82.28 59.18 512 128 28.1867 0.127079 682.9 456.9 95.72 68.39 54.63 683 128 19.6767 0.200558 486.2 315.9 59.66 59.43 39.73 768 64 21.6024 0.264194 535.5 308.5 88.73 76.2 44.5 768 128 20.0257 0.178736 495.5 315.9 85.72 69.11 39.09 -1024 64 18.8358 0.137584 463.6 269.6 77.63 67.95 36.82 +1024 64 18.8358 0.137584 463.6 269.6 77.63 67.95 36.82 1024 128 19.5436 0.101079 485.1 324.6 71.49 56.44 38.33 2048 128 14.284 0.131826 354.4 229.8 62.35 55.07 22.28 diff --git a/Exec/science/flame_wave/scaling/summit/scaling_20230407.txt b/Exec/science/flame_wave/scaling/summit/scaling_20230407.txt index a06bf8e661..cd9a79c837 100644 --- a/Exec/science/flame_wave/scaling/summit/scaling_20230407.txt +++ b/Exec/science/flame_wave/scaling/summit/scaling_20230407.txt @@ -28,5 +28,5 @@ # 342 128 12.2387 0.165243 # 512 128 10.476 0.198743 # 683 128 9.29589 0.184105 -# 768 128 -#1366 128 +# 768 128 +#1366 128 diff --git a/Exec/science/massive_star/analysis/initial_model.py b/Exec/science/massive_star/analysis/initial_model.py index d46cc5001b..49f7d347f6 100644 --- a/Exec/science/massive_star/analysis/initial_model.py +++ b/Exec/science/massive_star/analysis/initial_model.py @@ -48,8 +48,8 @@ def find_r_for_rho(r, rho, rho_want): l1 = ax.plot(data[:,0], data[:,idens], label="density") l2 = ax.plot(data[:,0], data[:,itemp], label="temperature") -# show where the refinement kicks in -rho_refine = 1.e4 +# show where the refinement kicks in +rho_refine = 2.e4 r_refine = find_r_for_rho(data[:,0], data[:,idens], rho_refine) diff --git a/Exec/science/massive_star/problem_initialize_state_data.H b/Exec/science/massive_star/problem_initialize_state_data.H index 4276fa879a..ee38f53cab 100644 --- a/Exec/science/massive_star/problem_initialize_state_data.H +++ b/Exec/science/massive_star/problem_initialize_state_data.H @@ -227,7 +227,7 @@ void problem_initialize_state_data (int i, int j, int k, (x + problem::center[0]) / problem::velpert_scale + phix[n]); Real cy = std::cos(2.0_rt * M_PI * Real(jj) * - (y + problem::center[1]) / + (y + problem::center[1]) / problem::velpert_scale + phiy[n]); Real cz = std::cos(2.0_rt * M_PI * Real(kk) * (z + problem::center[2]) / diff --git a/Exec/science/planet/HotJupiter.cpp b/Exec/science/planet/HotJupiter.cpp index 059b255df5..309bde952a 100644 --- a/Exec/science/planet/HotJupiter.cpp +++ b/Exec/science/planet/HotJupiter.cpp @@ -17,7 +17,7 @@ long double Temp(long double P1,long double Pc,long double P_char,long double T_ long double Temp(long double P1,long double Pc,long double P_char,long double T_char,long double Td, long double Lin, long double Lad, long double exp1, long double exp2) //define the function here, ie give the equation { long double Temp; - + if(Pc>P1){ Temp = Td * std::pow(1.0e0 + (Lad / (Lin - Lad)) * std::pow((P1/Pc),exp1),exp2); } @@ -48,7 +48,7 @@ int main(){ int alpha=1, beta=0, count = 0,count_cell,count2=0; bool continuous_P, continuous_rho; long double P[10000],T[10000],den[10000],y[10000]; - + //Declaration Block Td = 1500.0; //T_deep : the temperature at the top of the atmosphere[K] P_char = 1.0e6; @@ -61,13 +61,13 @@ int main(){ exp1=1.0 + alpha; exp2=(1.0/(4.0-beta)); - - + + //Defining the computation box z_top=4.0e9; // the size of the computation box number_cell=1024.0; // the number of cells - - + + //Initializing kappa0 = 6.35e-3 ; dP_factor=1.e5; @@ -87,11 +87,11 @@ int main(){ //Choosing either continuous pressure or density at the boundary between the buffer and the atmosphere continuous_P = true; continuous_rho = false; - + if((continuous_P==true && continuous_rho==true) || (continuous_P==false && continuous_rho==false)){ cout<<"P and rho can not be continuous at the same time." <<'\n'; } - + //Defining the properties of the planet atmosphere // the density limit at the top of the atmosphere P_top=den_top*R*Td ; // the pressure limit at the density limit @@ -99,8 +99,8 @@ int main(){ Pc = P_char * std::pow(Tc/T_char,1.0/Lad); //the pressure at the RCB Pd = std::pow((Lin-Lad)/(2.0*Lin-Lad),1.0/exp1)*Pc; //the characteristic pressure defining the radiative zone - - + + //Defining the properties of the buffer den_buffer=1.3e-15; // the density in the buffer above the atmosphere T_buffer=1.0e-2; // the temperature in the buffer above the atmosphere (not continuous at RCB). -> needs sponge @@ -110,11 +110,11 @@ int main(){ } else if(continuous_P==true){ } - + buffer_height=z_top*2.25/4.0; // the height at which the buffer and the top of the atmosphere meet (not continuous at RCB).-> needs sponge optical_depth_buffer=6.35e-3*T_buffer*std::pow(den_buffer,2.0)*(z_top-buffer_height);// the optical depth in the buffer region [dimensionless] - - + + do{ if(z>buffer_height){ @@ -130,24 +130,24 @@ int main(){ y[count] = z; count_cell++; cout<<"In buffer" << ' '<< count_cell << ' ' << z<<' '<< dz/(z_top/number_cell) << ' '<<"Pressure[P/Pc]="<<' ' << P1/Pc << ' '<<"optical depth ="<< ' '< -2.0*delta_z); - - - + + + //output data cout<<"count= " << count-1<<'\n'; cout<<"At bottom, "<< ' ' <<"density[g/cm^3]= " << ' ' << den[count-1] << ' ' << " T[K]= "<< ' ' << T[count-1] << ' ' << " P[bar]= " << ' ' << P[count-1]/1.e6 << '\n'; cout<<"At optical depta=1, "<< ' ' <<"z[km]=" << ' ' << z_at_1opticaldepth/1e5 << ' ' <<"density[g/cm^3]= " << ' ' << den_at_1opticaldepth << ' ' << " T[K]= "<< ' ' << T_at_1opticaldepth << ' ' << " P[bar]= " << ' ' << P_at_1opticaldepth/1.e6 << '\n'; - + if (optical_depth_buffer > 1.0){ cout<<"Optically [thick] buffer : " << ' ' << "optical depth = " << ' '<0); - - + + //summary cout<<"Pc [dyne/cm^{2}] = "<< ' ' << Pc << '\n'; cout<<"Tc [K] = "<< ' ' << Tc << '\n'; @@ -255,13 +255,13 @@ int main(){ cout<<"optical depth (radiative+ convective) =" <<' ' << optical_depth_atm << '\n'; data_output.close(); return 0; - - - + + + } - - - - + + + + diff --git a/Exec/science/planet/dataset_lineplot.py b/Exec/science/planet/dataset_lineplot.py index 0466148afd..c8fba41114 100644 --- a/Exec/science/planet/dataset_lineplot.py +++ b/Exec/science/planet/dataset_lineplot.py @@ -50,10 +50,10 @@ print('Adding lines at t='+filename_time+'s for $\rho$-height plot') location1=ds.find_max('Temp') location2=ds.find_min('Temp') - + kappa=0.18*1e-9 SB_constant=5.6704*1e-5 - + ad=ds.all_data() if Dimension==1: my_ray = ds.ortho_ray(0,(0,0)) @@ -63,13 +63,13 @@ my_ray = ds.ortho_ray(1,(0,0)) srt=np.argsort(my_ray['y']) x_coord=np.array(my_ray['y'][srt])/1.e5 - - - + + + temp=np.array(my_ray['Temp'][srt]) ent=np.array(my_ray['entropy'][srt]) dens=np.array(my_ray['density'][srt]) - + my_ray = ds.ortho_ray(1,(0,0)) plt.semilogy(x_coord,dens,label='t='+filename_time+'s') plt.legend() @@ -92,12 +92,12 @@ ds=load(i) time=float(ds.current_time) filename_time=str(int(time)) - - + + kappa=0.18*1e-9 SB_constant=5.6704*1e-5 - - + + if Dimension==1: my_ray = ds.ortho_ray(0,(0,0)) srt=np.argsort(my_ray['x']) @@ -113,7 +113,7 @@ average_T=(average_T*float(j)+temp)/float(j+1) average_P=(average_P*float(j)+press)/float(j+1) - + if j==0 : temp0=np.array(my_ray['Temp'][srt]) ent0=np.array(my_ray['entropy'][srt]) @@ -121,7 +121,7 @@ density0=np.array(my_ray['density'][srt]) location1=np.amin(pressure0)/1e10 location2=np.amax(pressure0) - + if time>=old_time+time_difference_T_P and time vs

(average up to t)') plt.savefig("figure_T_P_average.png") - + j=j+1 print("T-P plot average made") plt.close() @@ -146,13 +146,13 @@ ds=load(i) time=float(ds.current_time) filename_time=str(int(time)) - - - + + + kappa=0.18*1e-9 SB_constant=5.6704*1e-5 - - + + if Dimension==1: my_ray = ds.ortho_ray(0,(0,0)) srt=np.argsort(my_ray['x']) @@ -167,8 +167,8 @@ press=np.array(my_ray['pressure'][srt])/1.e6 average_T=(average_T*float(j)+temp)/float(j+1) average_P=(average_P*float(j)+press)/float(j+1) - - + + if j==0 : temp0=np.array(my_ray['Temp'][srt]) ent0=np.array(my_ray['entropy'][srt]) @@ -194,7 +194,7 @@ #plt.yscale('log') plt.title('<$\Delta$ T> vs

(average up to t)') plt.savefig("figure_T_P_diff_average.png") - + j=j+1 print("T-P difference average plot made") plt.close() @@ -211,8 +211,8 @@ print('Adding lines at t='+filename_time+'s for P-height plot') kappa=0.18*1e-9 SB_constant=5.6704*1e-5 - - + + if Dimension==1: my_ray = ds.ortho_ray(0,(0,0)) srt=np.argsort(my_ray['x']) @@ -243,10 +243,10 @@ # plt.xscale('linear') plt.title('P vs height') plt.yscale('log') - + plt.savefig("figure_x_P.png") - - + + j=j+1 @@ -264,11 +264,11 @@ print('Adding lines at t='+filename_time+'s for T-height plot') location1=ds.find_max('Temp') location2=ds.find_min('Temp') - + kappa=0.18*1e-9 SB_constant=5.6704*1e-5 - - + + ad=ds.all_data() if Dimension==1: my_ray = ds.ortho_ray(0,(0,0)) @@ -291,8 +291,8 @@ #plt.legend(loc=3) #plt.yscale('linear') plt.savefig("figure_x_T.png") - - + + j=j+1 print("T plot made") @@ -309,11 +309,11 @@ print('Adding lines at t='+filename_time+'s for $\kappa$-height plot') location1=ds.find_max('Temp') location2=ds.find_min('Temp') - + kappa=0.18*1e-9 SB_constant=5.6704*1e-5 - - + + ad=ds.all_data() if Dimension==1: my_ray = ds.ortho_ray(0,(0,0)) @@ -336,8 +336,8 @@ #plt.legend(loc=3) #plt.yscale('linear') plt.savefig("figure_x_opacity.png") - - + + j=j+1 print("opacity plot made") @@ -356,8 +356,8 @@ print('Adding lines at t='+filename_time+'s for $\mathca{M}$-height plot') kappa=0.18*1e-9 SB_constant=5.6704*1e-5 - - + + if Dimension==1: my_ray = ds.ortho_ray(0,(0,0)) srt=np.argsort(my_ray['x']) @@ -371,7 +371,7 @@ dens=np.array(my_ray['density'][srt]) press=np.array(my_ray['pressure'][srt])/1.e6 Mach_number=np.array(my_ray['MachNumber'][srt]) - + if j==0 : temp0=np.array(my_ray['Temp'][srt]) ent0=np.array(my_ray['entropy'][srt]) @@ -379,10 +379,10 @@ density0=np.array(my_ray['density'][srt]) location1=np.amin(pressure0)/1e10 location2=np.amax(pressure0) - + plt.plot(press,Mach_number,label='t='+filename_time+'s') plt.legend() - + plt.ylabel(r'Mach number') plt.xlabel(r'$P\/[\mathrm{bar}]$') #plt.ylim(location1,location2) @@ -414,11 +414,11 @@ print('Adding lines at t='+filename_time+'s for $\kappa$-T plot') location1=ds.find_max('Temp') location2=ds.find_min('Temp') - + kappa=0.18*1e-9 SB_constant=5.6704*1e-5 - - + + ad=ds.all_data() if Dimension==1: my_ray = ds.ortho_ray(0,(0,0)) @@ -444,8 +444,8 @@ plt.ylim(-100,1000) plt.title('Opacity $\kappa $vs T') plt.savefig("figure_T_opacity.png") - - + + j=j+1 print("opacity-T plot made") @@ -464,11 +464,11 @@ print('Adding lines at t='+filename_time+'s for entropy-height plot') location1=ds.find_max('Temp') location2=ds.find_min('Temp') - + kappa=0.18*1e-9 SB_constant=5.6704*1e-5 - - + + ad=ds.all_data() if Dimension==1: my_ray = ds.ortho_ray(0,(0,0)) @@ -482,7 +482,7 @@ ent=np.array(my_ray['entropy'][srt]) dens=np.array(my_ray['density'][srt]) press=np.array(my_ray['pressure'][srt])/1.e6 - + plt.semilogy(x_coord,ent,label='t='+filename_time+'s') plt.legend() plt.ylabel(r'$\mathrm{Entropy}$') @@ -491,8 +491,8 @@ #plt.yscale('linear') plt.title('Entropy $vs height') plt.savefig("figure_x_entropy.png") - - + + j=j+1 print("entropy plot made") @@ -510,11 +510,11 @@ print('Adding lines at t='+filename_time+'s for $U$-height plot') location1=ds.find_max('Temp') location2=ds.find_min('Temp') - + kappa=0.18*1e-9 SB_constant=5.6704*1e-5 - - + + ad=ds.all_data() if Dimension==1: my_ray = ds.ortho_ray(0,(0,0)) @@ -538,8 +538,8 @@ plt.figtext(0.5,0.3,'$\Delta t_{\mathrm{damp}}=7000$s', fontsize=20) plt.title('Radiation energy density $U$ vs height') plt.savefig("figure_x_radiation.png") - - + + j=j+1 print("radiation plot made") @@ -559,12 +559,12 @@ if time>=old_time+time_difference_T_P and time=old_time+time_difference_T_P and time 0.0_rt) { diff --git a/Exec/unit_tests/diffusion_test/Prob.cpp b/Exec/unit_tests/diffusion_test/Prob.cpp index 09822b72b1..93e797fbfc 100644 --- a/Exec/unit_tests/diffusion_test/Prob.cpp +++ b/Exec/unit_tests/diffusion_test/Prob.cpp @@ -53,7 +53,7 @@ void Castro::problem_post_simulation(Vector >& amr_lev MultiFab::Subtract(*analytic, S, UTEMP, 0, 1, 0); err = std::max(err, analytic->norm0()); - + } diff --git a/Exec/unit_tests/diffusion_test/README.md b/Exec/unit_tests/diffusion_test/README.md index c5e7e084d4..7c8fdf0dd4 100644 --- a/Exec/unit_tests/diffusion_test/README.md +++ b/Exec/unit_tests/diffusion_test/README.md @@ -138,14 +138,14 @@ Warning: BoxArray lengths are not the same at level 0 \begin{tabular}{|cccc|} \hline Variable & $e_{4h \rightarrow 2h}$ & Order & $e_{2h \rightarrow h}$\\ \hline -density& 0.000000e+00 & ------------ &0.000000e+00 \\ -xmom& 0.000000e+00 & ------------ &0.000000e+00 \\ -ymom& 0.000000e+00 & ------------ &0.000000e+00 \\ -zmom& 0.000000e+00 & ------------ &0.000000e+00 \\ -rho_E& 3.479414e-04 & 2.012958966 & 8.620750e-05 \\ -rho_e& 3.479414e-04 & 2.012958966 & 8.620750e-05 \\ -Temp& 3.479414e-04 & 2.012958966 & 8.620750e-05 \\ -rho_X& 0.000000e+00 & ------------ &0.000000e+00 \\ +density& 0.000000e+00 & ------------ &0.000000e+00 \\ +xmom& 0.000000e+00 & ------------ &0.000000e+00 \\ +ymom& 0.000000e+00 & ------------ &0.000000e+00 \\ +zmom& 0.000000e+00 & ------------ &0.000000e+00 \\ +rho_E& 3.479414e-04 & 2.012958966 & 8.620750e-05 \\ +rho_e& 3.479414e-04 & 2.012958966 & 8.620750e-05 \\ +Temp& 3.479414e-04 & 2.012958966 & 8.620750e-05 \\ +rho_X& 0.000000e+00 & ------------ &0.000000e+00 \\ ``` (some bits were edited out) @@ -191,15 +191,15 @@ Warning: BoxArray lengths are not the same at level 0 \begin{tabular}{|cccc|} \hline Variable & $e_{4h \rightarrow 2h}$ & Order & $e_{2h \rightarrow h}$\\ \hline -density& 0.000000e+00 & ------------ &0.000000e+00 \\ -xmom& 0.000000e+00 & ------------ &0.000000e+00 \\ -ymom& 0.000000e+00 & ------------ &0.000000e+00 \\ -zmom& 0.000000e+00 & ------------ &0.000000e+00 \\ -rho_E& 1.111626e-05 & 3.948910124 & 7.198104e-07 \\ -rho_e& 1.111626e-05 & 3.948910124 & 7.198104e-07 \\ -Temp& 1.063477e-05 & 3.952987539 & 6.866892e-07 \\ -rho_X& 0.000000e+00 & ------------ &0.000000e+00 \\ -pressure& 7.410837e-06 & 3.948910124 & 4.798736e-07 \\ +density& 0.000000e+00 & ------------ &0.000000e+00 \\ +xmom& 0.000000e+00 & ------------ &0.000000e+00 \\ +ymom& 0.000000e+00 & ------------ &0.000000e+00 \\ +zmom& 0.000000e+00 & ------------ &0.000000e+00 \\ +rho_E& 1.111626e-05 & 3.948910124 & 7.198104e-07 \\ +rho_e& 1.111626e-05 & 3.948910124 & 7.198104e-07 \\ +Temp& 1.063477e-05 & 3.952987539 & 6.866892e-07 \\ +rho_X& 0.000000e+00 & ------------ &0.000000e+00 \\ +pressure& 7.410837e-06 & 3.948910124 & 4.798736e-07 \\ ``` e.g. we see fourth-order convergence in the temperature @@ -242,13 +242,13 @@ Warning: BoxArray lengths are not the same at level 0 \begin{tabular}{|cccc|} \hline Variable & $e_{4h \rightarrow 2h}$ & Order & $e_{2h \rightarrow h}$\\ \hline -density& 0.000000e+00 & ------------ &0.000000e+00 \\ -xmom& 0.000000e+00 & ------------ &0.000000e+00 \\ -ymom& 0.000000e+00 & ------------ &0.000000e+00 \\ -zmom& 0.000000e+00 & ------------ &0.000000e+00 \\ -rho_E& 1.902161e-06 & 3.957610923 & 1.224299e-07 \\ -rho_e& 1.902161e-06 & 3.957610923 & 1.224299e-07 \\ -Temp& 1.770452e-06 & 3.966033724 & 1.132894e-07 \\ +density& 0.000000e+00 & ------------ &0.000000e+00 \\ +xmom& 0.000000e+00 & ------------ &0.000000e+00 \\ +ymom& 0.000000e+00 & ------------ &0.000000e+00 \\ +zmom& 0.000000e+00 & ------------ &0.000000e+00 \\ +rho_E& 1.902161e-06 & 3.957610923 & 1.224299e-07 \\ +rho_e& 1.902161e-06 & 3.957610923 & 1.224299e-07 \\ +Temp& 1.770452e-06 & 3.966033724 & 1.132894e-07 \\ ``` e.g. we see fourth-order convergence in the temperature diff --git a/Exec/unit_tests/diffusion_test/convergence_powerlaw_sdc4.txt b/Exec/unit_tests/diffusion_test/convergence_powerlaw_sdc4.txt index 34bcc868c6..7fd0326b3a 100644 --- a/Exec/unit_tests/diffusion_test/convergence_powerlaw_sdc4.txt +++ b/Exec/unit_tests/diffusion_test/convergence_powerlaw_sdc4.txt @@ -27,16 +27,16 @@ Warning: BoxArray lengths are not the same at level 0 \begin{center} \begin{tabular}{|cccc|} \hline Variable & $e_{4h \rightarrow 2h}$ & Order & $e_{2h \rightarrow h}$\\ -\hline -density& 0.000000e+00 & ------------ &0.000000e+00 \\ -xmom& 0.000000e+00 & ------------ &0.000000e+00 \\ -ymom& 0.000000e+00 & ------------ &0.000000e+00 \\ -zmom& 0.000000e+00 & ------------ &0.000000e+00 \\ -rho_E& 1.111626e-05 & 3.948910124 & 7.198104e-07 \\ -rho_e& 1.111626e-05 & 3.948910124 & 7.198104e-07 \\ -Temp& 1.063477e-05 & 3.952987539 & 6.866892e-07 \\ -rho_X& 0.000000e+00 & ------------ &0.000000e+00 \\ -pressure& 7.410837e-06 & 3.948910124 & 4.798736e-07 \\ +\hline +density& 0.000000e+00 & ------------ &0.000000e+00 \\ +xmom& 0.000000e+00 & ------------ &0.000000e+00 \\ +ymom& 0.000000e+00 & ------------ &0.000000e+00 \\ +zmom& 0.000000e+00 & ------------ &0.000000e+00 \\ +rho_E& 1.111626e-05 & 3.948910124 & 7.198104e-07 \\ +rho_e& 1.111626e-05 & 3.948910124 & 7.198104e-07 \\ +Temp& 1.063477e-05 & 3.952987539 & 6.866892e-07 \\ +rho_X& 0.000000e+00 & ------------ &0.000000e+00 \\ +pressure& 7.410837e-06 & 3.948910124 & 4.798736e-07 \\ e.g. we see fourth-order convergence in the temperature diff --git a/Exec/unit_tests/diffusion_test/problem_initialize_state_data.H b/Exec/unit_tests/diffusion_test/problem_initialize_state_data.H index 9d65f73d04..3e8c9c3a83 100644 --- a/Exec/unit_tests/diffusion_test/problem_initialize_state_data.H +++ b/Exec/unit_tests/diffusion_test/problem_initialize_state_data.H @@ -14,7 +14,7 @@ void problem_initialize_state_data (int i, int j, int k, const Real* dx = geomdata.CellSize(); const Real* problo = geomdata.ProbLo(); - int coord_type = geomdata.Coord(); + int coord_type = geomdata.Coord(); Real r[3] = {0.0_rt}; diff --git a/Source/diffusion/Diffusion.H b/Source/diffusion/Diffusion.H index e257b9f955..aa3a875669 100644 --- a/Source/diffusion/Diffusion.H +++ b/Source/diffusion/Diffusion.H @@ -7,7 +7,7 @@ #include /// -/// @class Diffusion +/// @class Diffusion /// @brief /// class Diffusion { diff --git a/Source/driver/Castro.H b/Source/driver/Castro.H index 11b028f5f9..cbd002f889 100644 --- a/Source/driver/Castro.H +++ b/Source/driver/Castro.H @@ -226,7 +226,7 @@ public: void writeSmallPlotFile (const std::string& dir, ostream& os, amrex::VisMF::How how) override; - + /// /// @param dir directory to write to /// @param os output stream @@ -249,7 +249,7 @@ public: /// -/// Dump build info +/// Dump build info /// static void writeBuildInfo (); @@ -814,7 +814,7 @@ public: #ifdef MHD /// /// Add magnetic contribution to energy density -/// @param Bx magnetic field in x +/// @param Bx magnetic field in x /// @param By magnetic field in y /// @param Bz magnetic field in z /// @param state the state to operate on @@ -827,7 +827,7 @@ public: /// /// Check if divergence of B is zero at initialization -/// @param Bx magnetic field in x +/// @param Bx magnetic field in x /// @param By magnetic field in y /// @param Bz magnetic field in z /// @param state the state to operate on @@ -1003,7 +1003,7 @@ public: // Hydrodynamics #include -// SDC +// SDC #ifdef TRUE_SDC #include #endif @@ -1156,7 +1156,7 @@ public: /// bool oversubscribing() { // NOLINT(readability-convert-member-functions-to-static) #ifdef AMREX_USE_GPU - return (amrex::MultiFab::queryMemUsage("AmrLevel_Level_" + std::to_string(level)) >= + return (amrex::MultiFab::queryMemUsage("AmrLevel_Level_" + std::to_string(level)) >= static_cast(amrex::Gpu::Device::totalGlobalMem())); #else return false; diff --git a/Source/driver/Castro.cpp b/Source/driver/Castro.cpp index a0217208cf..702385e75c 100644 --- a/Source/driver/Castro.cpp +++ b/Source/driver/Castro.cpp @@ -1126,11 +1126,11 @@ Castro::initData () #ifdef MHD - //correct energy density with the magnetic field contribution + //correct energy density with the magnetic field contribution add_magnetic_e(Bx_new, By_new, Bz_new, S_new); - + //check divB - check_div_B(Bx_new, By_new, Bz_new, S_new); + check_div_B(Bx_new, By_new, Bz_new, S_new); #endif @@ -1218,8 +1218,8 @@ Castro::initData () } if (std::abs(S_arr(i,j,k,URHO) - spec_sum) > 1.e-8_rt * S_arr(i,j,k,URHO)) { #ifndef AMREX_USE_GPU - std::cout << "Sum of (rho X)_i vs rho at (i,j,k): " - << i << " " << j << " " << k << " " + std::cout << "Sum of (rho X)_i vs rho at (i,j,k): " + << i << " " << j << " " << k << " " << spec_sum << " " << S_arr(i,j,k,URHO) << std::endl; #endif amrex::Error("Error: failed check of initial species summing to 1"); @@ -3786,11 +3786,11 @@ Castro::reset_internal_energy( #ifdef MHD void Castro::add_magnetic_e( MultiFab& Bx, - MultiFab& By, + MultiFab& By, MultiFab& Bz, MultiFab& State) { - + #ifdef AMREX_USE_OMP #pragma omp parallel #endif @@ -3824,18 +3824,18 @@ Castro::add_magnetic_e( MultiFab& Bx, void Castro::check_div_B( MultiFab& Bx, - MultiFab& By, + MultiFab& By, MultiFab& Bz, MultiFab& State) { - + ReduceOps reduce_op; ReduceData reduce_data(reduce_op); using ReduceTuple = typename decltype(reduce_data)::Type; - + #ifdef AMREX_USE_OMP #pragma omp parallel #endif @@ -3851,28 +3851,28 @@ Castro::check_div_B( MultiFab& Bx, reduce_op.eval(box, reduce_data, [=] AMREX_GPU_DEVICE (int i, int j, int k) -> ReduceTuple { - + Real divB = (Bx_arr(i+1,j,k) - Bx_arr(i,j,k))/dx[0] + - (By_arr(i,j+1,k) - By_arr(i,j,k))/dx[1] + + (By_arr(i,j+1,k) - By_arr(i,j,k))/dx[1] + (Bz_arr(i,j,k+1) - Bz_arr(i,j,k))/dx[2]; - + Real bx_cell_c = 0.5_rt * (Bx_arr(i,j,k) + Bx_arr(i+1,j,k)); Real by_cell_c = 0.5_rt * (By_arr(i,j,k) + By_arr(i,j+1,k)); Real bz_cell_c = 0.5_rt * (Bz_arr(i,j,k) + Bz_arr(i,j,k+1)); - Real magB = std::sqrt(bx_cell_c * bx_cell_c + + Real magB = std::sqrt(bx_cell_c * bx_cell_c + by_cell_c * by_cell_c + bz_cell_c * bz_cell_c); - - + + int fail_divB = 0; if (std::abs(divB) > 1.0e-10*magB){ - fail_divB = 1; + fail_divB = 1; } - - return {fail_divB}; + + return {fail_divB}; }); } @@ -3881,8 +3881,8 @@ Castro::check_div_B( MultiFab& Bx, int init_fail_divB = amrex::get<0>(hv); if (init_fail_divB != 0) { - amrex::Error("Error: initial data has divergence of B not zero"); - } + amrex::Error("Error: initial data has divergence of B not zero"); + } } @@ -3960,7 +3960,7 @@ Castro::computeTemp( enforce_min_density(Stemp, Stemp.nGrow()); reset_internal_energy(Stemp, Stemp.nGrow()); } else { -#endif +#endif reset_internal_energy( #ifdef MHD Bx, By, Bz, diff --git a/Source/driver/Castro_advance.cpp b/Source/driver/Castro_advance.cpp index 405eaafe87..6f9f0b9d07 100644 --- a/Source/driver/Castro_advance.cpp +++ b/Source/driver/Castro_advance.cpp @@ -68,7 +68,7 @@ Castro::advance (Real time, dt_new = std::min(dt_new, subcycle_advance_ctu(time, dt, amr_iteration, amr_ncycle)); -#ifndef MHD +#ifndef MHD #ifndef AMREX_USE_GPU #ifdef TRUE_SDC } else if (time_integration_method == SpectralDeferredCorrections) { @@ -80,7 +80,7 @@ Castro::advance (Real time, #endif // TRUE_SDC #endif // AMREX_USE_GPU -#endif //MHD +#endif //MHD } // If the user requests, indicate that we want a regrid at the end of the step. @@ -158,7 +158,7 @@ Castro::initialize_do_advance (Real time, Real dt) FillPatch(*this, Bx_old_tmp, NUM_GROW, time, Mag_Type_x, 0, 1); FillPatch(*this, By_old_tmp, NUM_GROW, time, Mag_Type_y, 0, 1); FillPatch(*this, Bz_old_tmp, NUM_GROW, time, Mag_Type_z, 0, 1); -#endif +#endif // for the CTU unsplit method, we always start with the old // state note: although clean_state has already been done on // the old state in initialize_advance, we still need to do @@ -175,7 +175,7 @@ Castro::initialize_do_advance (Real time, Real dt) } else if (time_integration_method == SpectralDeferredCorrections) { - // we'll handle the filling inside of do_advance_sdc + // we'll handle the filling inside of do_advance_sdc Sborder.define(grids, dmap, NUM_STATE, NUM_GROW, MFInfo().SetTag("Sborder")); } else { @@ -467,7 +467,7 @@ Castro::initialize_advance(Real time, Real dt, int amr_iteration) get_old_data(Mag_Type_x), get_old_data(Mag_Type_y), get_old_data(Mag_Type_z), -#endif +#endif S_old, time, S_old.nGrow()); diff --git a/Source/driver/Castro_io.cpp b/Source/driver/Castro_io.cpp index ea0336669e..b002bf210e 100644 --- a/Source/driver/Castro_io.cpp +++ b/Source/driver/Castro_io.cpp @@ -80,7 +80,7 @@ Castro::restart (Amr& papa, if (CastroHeaderFile.good()) { char foo[256]; // first line: Checkpoint version: ? - CastroHeaderFile.getline(foo, 256, ':'); + CastroHeaderFile.getline(foo, 256, ':'); CastroHeaderFile >> input_version; CastroHeaderFile.close(); } else { @@ -929,7 +929,7 @@ Castro::plotFileOutput(const std::string& dir, for (const auto & dd : dlist) { - if ((parent->isDerivePlotVar(dd.name()) && is_small == 0) || + if ((parent->isDerivePlotVar(dd.name()) && is_small == 0) || (parent->isDeriveSmallPlotVar(dd.name()) && is_small == 1)) { #ifdef AMREX_PARTICLES @@ -1139,7 +1139,7 @@ Castro::plotFileOutput(const std::string& dir, { for (const auto & dd : dlist) { - if ((parent->isDerivePlotVar(dd.name()) && is_small == 0) || + if ((parent->isDerivePlotVar(dd.name()) && is_small == 0) || (parent->isDeriveSmallPlotVar(dd.name()) && is_small == 1)) { auto derive_dat = derive(dd.variableName(0), cur_time, nGrow); diff --git a/Source/driver/Castro_setup.cpp b/Source/driver/Castro_setup.cpp index 2e3a3c1bfc..c4a5327e64 100644 --- a/Source/driver/Castro_setup.cpp +++ b/Source/driver/Castro_setup.cpp @@ -45,7 +45,7 @@ static int tang_vel_bc[] = }; #ifdef MHD -static int mag_field_bc[] = +static int mag_field_bc[] = { amrex::BCType::int_dir, amrex::BCType::ext_dir, amrex::BCType::foextrap, amrex::BCType::reflect_even, amrex::BCType::foextrap, amrex::BCType::hoextrap }; @@ -356,7 +356,7 @@ Castro::variableSetUp () store_in_checkpoint = true; IndexType xface(IntVect{AMREX_D_DECL(1,0,0)}); desc_lst.addDescriptor(Mag_Type_x, xface, - StateDescriptor::Point, 0, 1, + StateDescriptor::Point, 0, 1, interp, state_data_extrap, store_in_checkpoint); IndexType yface(IntVect{AMREX_D_DECL(0,1,0)}); @@ -554,7 +554,7 @@ Castro::variableSetUp () bcs[UMUN] = bc; name[UMUN] = "mu_n"; #endif - + BndryFunc stateBndryFunc(ca_statefill); stateBndryFunc.setRunOnGPU(true); @@ -641,7 +641,7 @@ Castro::variableSetUp () } #endif // names for the burn_weights that are manually added to the plotfile - + if (store_burn_weights) { #ifdef STRANG @@ -994,9 +994,9 @@ Castro::variableSetUp () derive_lst.add("Div_B", IndexType::TheCellType(), 1, ca_derdivb, the_same_box); derive_lst.addComponent("Div_B", desc_lst, Mag_Type_x, 0, 1); derive_lst.addComponent("Div_B", desc_lst, Mag_Type_y, 0, 1); - derive_lst.addComponent("Div_B", desc_lst, Mag_Type_z, 0, 1); - -#endif + derive_lst.addComponent("Div_B", desc_lst, Mag_Type_z, 0, 1); + +#endif #if NAUX_NET > 0 diff --git a/Source/driver/Derive.H b/Source/driver/Derive.H index 1fdf32f1fd..7dd302da16 100644 --- a/Source/driver/Derive.H +++ b/Source/driver/Derive.H @@ -198,7 +198,7 @@ extern "C" #ifdef __cplusplus } #endif - + /* problem-specific includes */ #include diff --git a/Source/driver/runtime_parameters.H b/Source/driver/runtime_parameters.H index 8fe188fa49..0619070811 100644 --- a/Source/driver/runtime_parameters.H +++ b/Source/driver/runtime_parameters.H @@ -104,7 +104,7 @@ validate_runparams() // "castro" if (ParmParse::hasUnusedInputs(nm)) { amrex::Print() << "Warning: the following " + nm + ".* parameters are ignored\n"; - auto unused = ParmParse::getUnusedInputs(nm); + auto unused = ParmParse::getUnusedInputs(nm); for (const auto& p: unused) { amrex::Print() << p << "\n"; } diff --git a/Source/driver/sum_utils.cpp b/Source/driver/sum_utils.cpp index 438c744f0f..6423b50b70 100644 --- a/Source/driver/sum_utils.cpp +++ b/Source/driver/sum_utils.cpp @@ -39,7 +39,7 @@ Castro::volWgtSum (const MultiFab& mf, int comp, bool local, bool finemask) #ifdef AMREX_USE_OMP #pragma omp parallel -#endif +#endif for (MFIter mfi(mf, TilingIfNotGPU()); mfi.isValid(); ++mfi) { auto const& fab = mf[mfi].array(comp); @@ -102,13 +102,13 @@ Castro::locWgtSum (const MultiFab& mf, int comp, int idir, bool local) #ifdef AMREX_USE_OMP #pragma omp parallel -#endif +#endif for (MFIter mfi(mf, TilingIfNotGPU()); mfi.isValid(); ++mfi) { auto const& fab = mf[mfi].array(comp); auto const& vol = volume.array(mfi); auto const& mask = mask_available ? mask_mf.array(mfi) : Array4{}; - + const Box& box = mfi.tilebox(); // @@ -196,14 +196,14 @@ Castro::volProductSum (const MultiFab& mf1, #ifdef AMREX_USE_OMP #pragma omp parallel -#endif +#endif for (MFIter mfi(mf1, TilingIfNotGPU()); mfi.isValid(); ++mfi) { auto const& fab1 = mf1[mfi].array(comp1); auto const& fab2 = mf2[mfi].array(comp2); auto const& vol = volume.array(mfi); auto const& mask = mask_available ? mask_mf.array(mfi) : Array4{}; - + const Box& box = mfi.tilebox(); reduce_op.eval(box, reduce_data, @@ -251,12 +251,12 @@ Castro::locSquaredSum (const std::string& name, #ifdef AMREX_USE_OMP #pragma omp parallel -#endif +#endif for (MFIter mfi(*mf, TilingIfNotGPU()); mfi.isValid(); ++mfi) { auto const& fab = (*mf).array(mfi); auto const& mask = mask_available ? mask_mf.array(mfi) : Array4{}; - + const Box& box = mfi.tilebox(); reduce_op.eval(box, reduce_data, diff --git a/Source/gravity/Castro_gravity.cpp b/Source/gravity/Castro_gravity.cpp index 7b300310ec..ed8a2406e0 100644 --- a/Source/gravity/Castro_gravity.cpp +++ b/Source/gravity/Castro_gravity.cpp @@ -113,7 +113,7 @@ Castro::construct_old_gravity (Real time) gravity->test_level_grad_phi_prev(level); } - + } // Define the old gravity vector. diff --git a/Source/gravity/Gravity.cpp b/Source/gravity/Gravity.cpp index 35fab221d3..b2f0f90d4e 100644 --- a/Source/gravity/Gravity.cpp +++ b/Source/gravity/Gravity.cpp @@ -396,7 +396,7 @@ void Gravity::swapTimeLevels (int level) { BL_PROFILE("Gravity::swapTimeLevels()"); - + if (gravity::gravity_type == "PoissonGrav") { for (int n=0; n < AMREX_SPACEDIM; n++) { std::swap(grad_phi_prev[level][n], grad_phi_curr[level][n]); @@ -663,7 +663,7 @@ Gravity::GetCrsePhi(int level, Real time ) { BL_PROFILE("Gravity::GetCrsePhi()"); - + BL_ASSERT(level!=0); phi_crse.clear(); @@ -1328,7 +1328,7 @@ void Gravity::interpolate_monopole_grav(int level, RealVector& radial_grav, MultiFab& grav_vector) { BL_PROFILE("Gravity::interpolate_monopole_grav()"); - + int n1d = static_cast(radial_grav.size()); const Geometry& geom = parent->Geom(level); @@ -1647,7 +1647,7 @@ Gravity::init_multipole_grav() for (int n = 0; n < 3; ++n) { multipole::doSymmetricAddLo(n) = false; multipole::doSymmetricAddHi(n) = false; - + multipole::doReflectionLo(n) = false; multipole::doReflectionHi(n) = false; } @@ -1844,11 +1844,11 @@ Gravity::fill_multipole_BCs(int crse_level, int fine_level, const Vector(&(parent->getLevel(lev+1))); - if (castro_level != nullptr) { - const MultiFab& mask = castro_level->build_fine_mask(); - MultiFab::Multiply(source, mask, 0, 0, 1, 0); - } else { + auto *castro_level = dynamic_cast(&(parent->getLevel(lev+1))); + if (castro_level != nullptr) { + const MultiFab& mask = castro_level->build_fine_mask(); + MultiFab::Multiply(source, mask, 0, 0, 1, 0); + } else { amrex::Abort("unable to access mask"); } } @@ -2221,7 +2221,7 @@ Gravity::fill_multipole_BCs(int crse_level, int fine_level, const Vector domhi[2]) { @@ -2341,7 +2341,7 @@ void Gravity::fill_direct_sum_BCs(int crse_level, int fine_level, const Vector& Rhs, MultiFab& phi) { BL_PROFILE("Gravity::fill_direct_sum_BCs()"); - + BL_ASSERT(crse_level==0); const Real strt = ParallelDescriptor::second(); @@ -2973,9 +2973,9 @@ Gravity::set_mass_offset (Real time, bool multi_level) { for (int lev = 0; lev <= parent->finestLevel(); lev++) { auto* cs = dynamic_cast(&parent->getLevel(lev)); - if (cs != nullptr) { - mass_offset += cs->volWgtSum("density", time); - } else { + if (cs != nullptr) { + mass_offset += cs->volWgtSum("density", time); + } else { amrex::Abort("unable to access volWgtSum"); } } @@ -3009,7 +3009,7 @@ void Gravity::add_pointmass_to_gravity (int level, MultiFab& phi, MultiFab& grav_vector) { BL_PROFILE("Gravity::add_pointmass_to_gravity()"); - + const auto dx = parent->Geom(level).CellSizeArray(); const auto problo = parent->Geom(level).ProbLoArray(); @@ -3048,11 +3048,11 @@ Gravity::add_pointmass_to_gravity (int level, MultiFab& phi, MultiFab& grav_vect if(AMREX_SPACEDIM == 1) { x += star_radius; - } + } else if(AMREX_SPACEDIM ==2) { y += star_radius; - } + } else if(AMREX_SPACEDIM == 3) { z += star_radius; @@ -3141,12 +3141,12 @@ Gravity::make_radial_gravity(int level, Real time, RealVector& radial_grav) if (lev < level) { auto* fine_level = dynamic_cast(&(parent->getLevel(lev+1))); - if (fine_level != nullptr) { - const MultiFab& mask = fine_level->build_fine_mask(); - for (int n = 0; n < NUM_STATE; ++n) { - MultiFab::Multiply(S, mask, 0, n, 1, 0); - } - } else { + if (fine_level != nullptr) { + const MultiFab& mask = fine_level->build_fine_mask(); + for (int n = 0; n < NUM_STATE; ++n) { + MultiFab::Multiply(S, mask, 0, n, 1, 0); + } + } else { amrex::Abort("unable to create mask"); } } diff --git a/Source/gravity/binary.H b/Source/gravity/binary.H index 35a8b9ed5d..684d875139 100644 --- a/Source/gravity/binary.H +++ b/Source/gravity/binary.H @@ -155,7 +155,7 @@ void get_lagrange_points (Real mass_1, Real mass_2, const Real* com_1, const Rea r1 = -std::sqrt(com_1[0] * com_1[0] + com_1[1] * com_1[1] + com_1[2] * com_1[2]); r2 = std::sqrt(com_2[0] * com_2[0] + com_2[1] * com_2[1] + com_2[2] * com_2[2]); - // Do a root-find over the quintic equation for L1. + // Do a root-find over the quintic equation for L1. r = 0.0_rt; diff --git a/Source/hydro/Castro_ctu_rad.cpp b/Source/hydro/Castro_ctu_rad.cpp index 464f52226a..626eaab580 100644 --- a/Source/hydro/Castro_ctu_rad.cpp +++ b/Source/hydro/Castro_ctu_rad.cpp @@ -53,7 +53,7 @@ Castro::ctu_rad_consup(const Box& bx, } - // radiation energy update. + // radiation energy update. amrex::ParallelFor(bx, NGROUPS, [=] AMREX_GPU_DEVICE (int i, int j, int k, int g) noexcept @@ -298,7 +298,7 @@ Castro::ctu_rad_consup(const Box& bx, if (NGROUPS > 1) { Real ustar[NGROUPS]; - for (int g = 0; g < NGROUPS; g++) { + for (int g = 0; g < NGROUPS; g++) { ustar[g] = Erout(i,j,k,g) / Erscale[g]; } diff --git a/Source/hydro/Castro_hydro.cpp b/Source/hydro/Castro_hydro.cpp index e0011c6152..0dedbc17aa 100644 --- a/Source/hydro/Castro_hydro.cpp +++ b/Source/hydro/Castro_hydro.cpp @@ -12,7 +12,7 @@ Castro::cons_to_prim(const Real time) { BL_PROFILE("Castro::cons_to_prim()"); - + #ifdef RADIATION AmrLevel::FillPatch(*this, Erborder, NUM_GROW, time, Rad_Type, 0, Radiation::nGroups); @@ -120,7 +120,7 @@ Castro::cons_to_prim_fourth(const Real time) { BL_PROFILE("Castro::cons_to_prim_fourth()"); - + // convert the conservative state cell averages to primitive cell // averages with 4th order accuracy @@ -170,7 +170,7 @@ Castro::cons_to_prim_fourth(const Real time) auto qaux_bar_arr = qaux_bar.array(mfi); ctoprim(qbx, - time, + time, Sborder_arr, q_bar_arr, qaux_bar_arr); diff --git a/Source/hydro/outline.txt b/Source/hydro/outline.txt index cc972524a0..2a7f80919e 100644 --- a/Source/hydro/outline.txt +++ b/Source/hydro/outline.txt @@ -23,7 +23,7 @@ * compute face-centered and face-average fluxes c. separate MFIter: - + * compute final fluxes @@ -37,7 +37,7 @@ Extra MFs: Also needed: - -- for the Riemann solver, we return the interface state of only a subset + -- for the Riemann solver, we return the interface state of only a subset of variable NGDNV, not all NQ -- this means that we will need a separate Riemann solver here to get all interface states diff --git a/Source/hydro/riemann.cpp b/Source/hydro/riemann.cpp index 96d2c2e6f0..db8641a52b 100644 --- a/Source/hydro/riemann.cpp +++ b/Source/hydro/riemann.cpp @@ -144,7 +144,7 @@ Castro::cmpflx_plus_godunov(const Box& bx, if (idir == 0) { is_shock = static_cast(shk(i-1,j,k) + shk(i,j,k)); - } else if (idir == 1) { + } else if (idir == 1) { is_shock = static_cast(shk(i,j-1,k) + shk(i,j,k)); } else { is_shock = static_cast(shk(i,j,k-1) + shk(i,j,k)); @@ -157,7 +157,7 @@ Castro::cmpflx_plus_godunov(const Box& bx, if (idir == 0) { cl = qaux_arr(i-1,j,k,QC); cr = qaux_arr(i,j,k,QC); - } else if (idir == 1) { + } else if (idir == 1) { cl = qaux_arr(i,j-1,k,QC); cr = qaux_arr(i,j,k,QC); } else { diff --git a/Source/mhd/electric.cpp b/Source/mhd/electric.cpp index 7ddd66d471..e9426d0530 100644 --- a/Source/mhd/electric.cpp +++ b/Source/mhd/electric.cpp @@ -24,7 +24,7 @@ Castro::electric_edge_x(const Box& bx, // dEx/dy (Eq. 49), located at (i, j-3/4, k-1/2) // first compute dEx/dy_{i,j-3/4,k-1} using MM Eq. 49 - // note that the face value Ex_{i,j-1/2,k-1} = -F_{i,j-1/2,k-1}(Bz) + // note that the face value Ex_{i,j-1/2,k-1} = -F_{i,j-1/2,k-1}(Bz) // via Faraday's law (MM Eq. 15) for (int n = 0; n < NQ; n++) { diff --git a/Source/mhd/hlld.cpp b/Source/mhd/hlld.cpp index 4725358e6c..3f736a2717 100644 --- a/Source/mhd/hlld.cpp +++ b/Source/mhd/hlld.cpp @@ -239,7 +239,7 @@ Castro::hlld(const Box& bx, } - + UsL(UMX) = UsL(UMX) * UsL(URHO); UsL(UMY) = UsL(UMY) * UsL(URHO); UsL(UMZ) = UsL(UMZ) * UsL(URHO); @@ -259,11 +259,11 @@ Castro::hlld(const Box& bx, // Second Perpendicular dir (Eq. 47) Real denom_bpL = qL(QRHO) * (sL - qL(QVELN)) * (sL - sM) - qL(QMAGN) * qL(QMAGN); - Real denom_bpR = qR(QRHO) * (sR - qR(QVELN)) * (sR - sM) - qR(QMAGN) * qR(QMAGN); + Real denom_bpR = qR(QRHO) * (sR - qR(QVELN)) * (sR - sM) - qR(QMAGN) * qR(QMAGN); if (std::abs(denom_bpL) < 1.e-14_rt) { - UsL(UMAGP1) = 0.0_rt; - UsL(UMAGP2) = 0.0_rt; + UsL(UMAGP1) = 0.0_rt; + UsL(UMAGP2) = 0.0_rt; } else { UsL(UMAGP1) = qL(QMAGP1) * (qL(QRHO) * (sL - qL(QVELN)) * (sL - qL(QVELN)) - qL(QMAGN) * qL(QMAGN)) / @@ -275,7 +275,7 @@ Castro::hlld(const Box& bx, if (std::abs(denom_bpR) < 1.e-14_rt) { UsR(UMAGP1) = 0.0_rt; - UsR(UMAGP2) = 0.0_rt; + UsR(UMAGP2) = 0.0_rt; } else { UsR(UMAGP1) = qR(QMAGP1) * (qR(QRHO) * (sR - qR(QVELN)) * (sR - qR(QVELN)) - qR(QMAGN) * qR(QMAGN)) / @@ -285,7 +285,7 @@ Castro::hlld(const Box& bx, } - + // Energy, eq.(48) UsL(UEDEN) = (sL - qL(QVELN)) * uL(UEDEN) - ptL * qL(QVELN) + pst * sM + @@ -382,7 +382,7 @@ Castro::hlld(const Box& bx, ((UsL(UMX) * UsL(UMAGX) + UsL(UMY) * UsL(UMAGY) + UsL(UMZ) * UsL(UMAGZ)) / UsL(URHO) - (UssL(UMX) * UssL(UMAGX) + UssL(UMY) * UssL(UMAGY) + UssL(UMZ) * UssL(UMAGZ)) / UssL(URHO)) * std::copysign(1.0_rt, qL(QMAGN)); - UssR(UEDEN) = UsR(UEDEN) + std::sqrt(UsR(QRHO)) * + UssR(UEDEN) = UsR(UEDEN) + std::sqrt(UsR(QRHO)) * ((UsR(UMX) * UsR(UMAGX) + UsR(UMY) * UsR(UMAGY) + UsR(UMZ) * UsR(UMAGZ)) / UsR(URHO) - (UssR(UMX) * UssR(UMAGX) + UssR(UMY) * UssR(UMAGY) + UssR(UMZ) * UssR(UMAGZ)) / UssR(URHO)) * std::copysign(1.0_rt, qR(QMAGN)); diff --git a/Source/mhd/mhd_eigen.H b/Source/mhd/mhd_eigen.H index 8ac3a4ee71..3fe6cfd919 100644 --- a/Source/mhd/mhd_eigen.H +++ b/Source/mhd/mhd_eigen.H @@ -85,12 +85,12 @@ evecx(Array2D& leig, Real alf; Real als; - + if (std::abs(cfx-csx) <= 1e-14){ alf = 1.0_rt; als = 0.0_rt; } - + if (as - csx < 0.0) { alf = 0.0_rt; } else { @@ -102,8 +102,8 @@ evecx(Array2D& leig, } else { als = std::sqrt((cfx - as)/(cfx - csx)); } - - + + Real bety; Real betz; @@ -286,7 +286,7 @@ evecy(Array2D& leig, Real alf; Real als; - + if (std::abs(cfy-csy) <= 1e-14){ alf = 1.0_rt; als = 0.0_rt; diff --git a/Source/problems/Prob.cpp b/Source/problems/Prob.cpp index ed1e3f9001..8b0d929280 100644 --- a/Source/problems/Prob.cpp +++ b/Source/problems/Prob.cpp @@ -24,7 +24,7 @@ void Castro::problem_post_simulation(Vector >& amr_lev // Castro* castro = dynamic_cast(&amr_level[0]); // then you can get the data, e.g. for state data as: - + // MultiFab& S = castro->get_new_data(State_Type); // and if needed, the state descriptor: diff --git a/Source/radiation/Castro_radiation.cpp b/Source/radiation/Castro_radiation.cpp index 06e97094ea..5062815ba3 100644 --- a/Source/radiation/Castro_radiation.cpp +++ b/Source/radiation/Castro_radiation.cpp @@ -9,7 +9,7 @@ using std::string; using namespace amrex; void -Castro::final_radiation_call (MultiFab& S_new, int iteration, int ncycle) +Castro::final_radiation_call (MultiFab& S_new, int iteration, int ncycle) { if (do_radiation) { @@ -17,17 +17,17 @@ Castro::final_radiation_call (MultiFab& S_new, int iteration, int ncycle) Castro::computeTemp(S_new, state[State_Type].curTime(), S_new.nGrow()); return; } - + Castro::computeTemp(S_new, state[State_Type].curTime(), S_new.nGrow()); - if (Radiation::filter_prim_int > 0 && Radiation::filter_prim_T>0 + if (Radiation::filter_prim_int > 0 && Radiation::filter_prim_T>0 && iteration==ncycle) { int nstep = parent->levelSteps(0); if (nstep % Radiation::filter_prim_int == 0) { radiation->filter_prim(level, S_new); } } - + if (Radiation::SolverType == Radiation::MGFLDSolver) { if (! Radiation::rad_hydro_combined) { MultiFab& Er_old = get_old_data(Rad_Type); @@ -50,7 +50,7 @@ Castro::final_radiation_call (MultiFab& S_new, int iteration, int ncycle) MultiFab::Copy(Er_new, Er_old, 0, 0, Er_old.nComp(), 0); radiation->single_group_update(level, iteration, ncycle); } - + } } #endif diff --git a/Source/radiation/HABEC.H b/Source/radiation/HABEC.H index 2bd6e7aabb..9419776c0a 100644 --- a/Source/radiation/HABEC.H +++ b/Source/radiation/HABEC.H @@ -12,8 +12,8 @@ namespace HABEC { // habec is Hypre abec, where abec is the form of the linear equation // we are solving: - // - // alpha*phi - div(beta*grad phi) + div(\vec{c}*phi) + // + // alpha*phi - div(beta*grad phi) + div(\vec{c}*phi) AMREX_INLINE void hbflx (Array4 const flux, diff --git a/Source/radiation/HypreABec.cpp b/Source/radiation/HypreABec.cpp index d8ab7d5a4a..5a40d518cf 100644 --- a/Source/radiation/HypreABec.cpp +++ b/Source/radiation/HypreABec.cpp @@ -195,7 +195,7 @@ HypreABec::HypreABec(const BoxArray& grids, int ngrow=0; acoefs.reset(new MultiFab(grids, dmap, ncomp, ngrow)); acoefs->setVal(0.0); - + for (int i = 0; i < AMREX_SPACEDIM; i++) { BoxArray edge_boxes(grids); edge_boxes.surroundingNodes(i); @@ -226,7 +226,7 @@ void HypreABec::aCoefficients(const MultiFab &a) BL_ASSERT( a.boxArray() == acoefs->boxArray() ); MultiFab::Copy(*acoefs, a, 0, 0, 1, 0); } - + void HypreABec::bCoefficients(const MultiFab &b, int dir) { BL_ASSERT( b.ok() ); @@ -238,7 +238,7 @@ void HypreABec::SPalpha(const MultiFab& a) { BL_ASSERT( a.ok() ); if (SPa == 0) { - const BoxArray& grids = a.boxArray(); + const BoxArray& grids = a.boxArray(); const DistributionMapping& dmap = a.DistributionMap(); SPa.reset(new MultiFab(grids,dmap,1,0)); } @@ -249,9 +249,9 @@ void HypreABec::boundaryFlux(MultiFab* Flux, MultiFab& Soln, int icomp, BC_Mode inhom) { BL_PROFILE("HypreABec::boundaryFlux"); - + const BoxArray &grids = Soln.boxArray(); - + const NGBndry& bd = getBndry(); const Box& domain = bd.getDomain(); @@ -260,7 +260,7 @@ void HypreABec::boundaryFlux(MultiFab* Flux, MultiFab& Soln, int icomp, #endif { Real foo=1.e200; - + for (MFIter si(Soln); si.isValid(); ++si) { int i = si.index(); const Box ® = grids[i]; @@ -748,7 +748,7 @@ void HypreABec::hbmat3 (const Box& bx, else { amrex::Error("hbmat3: unsupported boundary type"); } -#endif +#endif mat(i,j,k)[AMREX_SPACEDIM] += bfm - fac * b(i+1,j,k); @@ -1067,7 +1067,7 @@ void HypreABec::setupSolver(Real _reltol, Real _abstol, int maxiter) HYPRE_StructSMGSetNumPreRelax(precond, 1); HYPRE_StructSMGSetNumPostRelax(precond, 1); HYPRE_StructSMGSetLogging(precond, 0); - HYPRE_StructPCGSetPrecond(solver, + HYPRE_StructPCGSetPrecond(solver, HYPRE_StructSMGSolve, HYPRE_StructSMGSetup, precond); @@ -1075,7 +1075,7 @@ void HypreABec::setupSolver(Real _reltol, Real _abstol, int maxiter) HYPRE_StructPCGSetLogging(solver, 1); HYPRE_StructPCGSetup(solver, A, b, x); - } + } else if (solver_flag == 5 || solver_flag == 6) { HYPRE_StructHybridCreate(MPI_COMM_WORLD, &solver); HYPRE_StructHybridSetDSCGMaxIter(solver, maxiter); diff --git a/Source/radiation/HypreExtMultiABec.cpp b/Source/radiation/HypreExtMultiABec.cpp index 0930849b3e..ddbffc88fd 100644 --- a/Source/radiation/HypreExtMultiABec.cpp +++ b/Source/radiation/HypreExtMultiABec.cpp @@ -28,7 +28,7 @@ void HypreExtMultiABec::a2Coefficients(int level, const MultiFab &a2, int dir) if (!a2coefs[level]) { a2coefs[level].reset(new Array); - + for (int i = 0; i < AMREX_SPACEDIM; i++) { BoxArray edge_boxes(grids[level]); edge_boxes.surroundingNodes(i); @@ -41,7 +41,7 @@ void HypreExtMultiABec::a2Coefficients(int level, const MultiFab &a2, int dir) MultiFab::Copy((*a2coefs[level])[dir], a2, 0, 0, ncomp, ngrow); } - + void HypreExtMultiABec::cCoefficients(int level, const MultiFab &c, int dir) { BL_PROFILE("HypreExtMultiABec::cCoefficients"); @@ -53,7 +53,7 @@ void HypreExtMultiABec::cCoefficients(int level, const MultiFab &c, int dir) if (!ccoefs[level]) { ccoefs[level].reset(new Array); - + for (int i = 0; i < AMREX_SPACEDIM; i++) { BoxArray edge_boxes(grids[level]); edge_boxes.surroundingNodes(i); @@ -89,7 +89,7 @@ void HypreExtMultiABec::d1Coefficients(int level, const MultiFab &d1, int dir) MultiFab::Copy((*d1coefs[level])[dir], d1, 0, 0, ncomp, ngrow); } - + void HypreExtMultiABec::d2Coefficients(int level, const MultiFab &d2, int dir) { BL_PROFILE("HypreExtMultiABec::d2Coefficients"); @@ -101,7 +101,7 @@ void HypreExtMultiABec::d2Coefficients(int level, const MultiFab &d2, int dir) if (!d2coefs[level]) { d2coefs[level].reset(new Array); - + for (int i = 0; i < AMREX_SPACEDIM; i++) { BoxArray edge_boxes(grids[level]); edge_boxes.surroundingNodes(i); @@ -115,7 +115,7 @@ void HypreExtMultiABec::d2Coefficients(int level, const MultiFab &d2, int dir) MultiFab::Copy((*d2coefs[level])[dir], d2, 0, 0, ncomp, ngrow); } -static void +static void FaceValue(AuxVarBox& evalue, AuxVarBox& cintrp, const Mask& msk, const Box& reg, const IntVect& vin, int r, int bho, int flevel) @@ -456,7 +456,7 @@ void HypreExtMultiABec::loadMatrix() // If we're upwinding from the interior, just use that value. // If we're upwinding from the exterior, interpolate // (linearly) to the ghost cell center position. - + Real fac = gamma * ofh; int i0 = ori.isLow(); int i1 = ori.isHigh(); diff --git a/Source/radiation/HypreMultiABec.cpp b/Source/radiation/HypreMultiABec.cpp index aa27b902b1..ec4489b305 100644 --- a/Source/radiation/HypreMultiABec.cpp +++ b/Source/radiation/HypreMultiABec.cpp @@ -171,7 +171,7 @@ int BndryAuxVarBase::nextLocal(int i) return i; } -BndryAuxVar::BndryAuxVar(const BoxArray& _grids, +BndryAuxVar::BndryAuxVar(const BoxArray& _grids, const DistributionMapping& _dmap, Location loc) : BndryAuxVarBase(_dmap), grids(_grids) diff --git a/Source/radiation/MGFLD.cpp b/Source/radiation/MGFLD.cpp index 9be9efb67c..a85880885f 100644 --- a/Source/radiation/MGFLD.cpp +++ b/Source/radiation/MGFLD.cpp @@ -14,7 +14,7 @@ using namespace amrex; void Radiation::check_convergence_er(Real& relative, Real& absolute, Real& err_er, - const MultiFab& Er_new, const MultiFab& Er_pi, + const MultiFab& Er_new, const MultiFab& Er_pi, const MultiFab& kappa_p, const MultiFab& etaTz, const MultiFab& temp_new, @@ -78,15 +78,15 @@ void Radiation::check_convergence_er(Real& relative, Real& absolute, Real& err_e } -void Radiation::check_convergence_matt(const MultiFab& rhoe_new, const MultiFab& rhoe_star, - const MultiFab& rhoe_step, const MultiFab& Er_new, - const MultiFab& temp_new, const MultiFab& temp_star, +void Radiation::check_convergence_matt(const MultiFab& rhoe_new, const MultiFab& rhoe_star, + const MultiFab& rhoe_step, const MultiFab& Er_new, + const MultiFab& temp_new, const MultiFab& temp_star, const MultiFab& rho, const MultiFab& kappa_p, const MultiFab& jg, const MultiFab& dedT, - Real& rel_rhoe, Real& abs_rhoe, - Real& rel_FT, Real& abs_FT, - Real& rel_T, Real& abs_T, + Real& rel_rhoe, Real& abs_rhoe, + Real& rel_FT, Real& abs_FT, + Real& rel_T, Real& abs_T, Real delta_t) { ReduceOps reduce_op; @@ -152,7 +152,7 @@ void Radiation::check_convergence_matt(const MultiFab& rhoe_new, const MultiFab& ParallelDescriptor::ReduceRealMax(data, ndata); - rel_rhoe = data[0]; + rel_rhoe = data[0]; abs_rhoe = data[1]; rel_FT = data[2]; abs_FT = data[3]; @@ -191,7 +191,7 @@ void Radiation::compute_coupling(MultiFab& coupT, } -void Radiation::compute_etat(MultiFab& etaT, MultiFab& etaTz, +void Radiation::compute_etat(MultiFab& etaT, MultiFab& etaTz, MultiFab& eta1, MultiFab& djdT, const MultiFab& dkdT, const MultiFab& dedT, const MultiFab& Er_star, const MultiFab& rho, @@ -242,10 +242,10 @@ void Radiation::compute_etat(MultiFab& etaT, MultiFab& etaTz, } -void Radiation::eos_opacity_emissivity(const MultiFab& S_new, +void Radiation::eos_opacity_emissivity(const MultiFab& S_new, const MultiFab& temp_new, const MultiFab& temp_star, - MultiFab& kappa_p, MultiFab& kappa_r, MultiFab& jg, + MultiFab& kappa_p, MultiFab& kappa_r, MultiFab& jg, MultiFab& djdT, MultiFab& dkdT, MultiFab& dedT, int level, int it, int ngrow) { @@ -429,7 +429,7 @@ void Radiation::eos_opacity_emissivity(const MultiFab& S_new, dkdT_arr(i,j,k,g), jg_arr(i,j,k,g), djdT_arr(i,j,k,g)); } }); - } + } if (ngrow == 0 && !lag_opac) { kappa_r.FillBoundary(geom.periodicity()); @@ -437,13 +437,13 @@ void Radiation::eos_opacity_emissivity(const MultiFab& S_new, } -void Radiation::gray_accel(MultiFab& Er_new, MultiFab& Er_pi, +void Radiation::gray_accel(MultiFab& Er_new, MultiFab& Er_pi, MultiFab& kappa_p, MultiFab& kappa_r, MultiFab& etaT, MultiFab& eta1, MultiFab& mugT, Array& lambda, - RadSolve* solver, MGRadBndry& mgbd, - const BoxArray& grids, int level, Real time, + RadSolve* solver, MGRadBndry& mgbd, + const BoxArray& grids, int level, Real time, Real delta_t, Real ptc_tau) { const Geometry& geom = parent->Geom(level); @@ -467,7 +467,7 @@ void Radiation::gray_accel(MultiFab& Er_new, MultiFab& Er_pi, #ifdef _OPENMP #pragma omp parallel -#endif +#endif for (MFIter mfi(spec, TilingIfNotGPU()); mfi.isValid(); ++mfi) { const Box& bx = mfi.tilebox(); @@ -539,7 +539,7 @@ void Radiation::gray_accel(MultiFab& Er_new, MultiFab& Er_pi, acoefs_arr(i,j,k) = H1 * kbar * C::c_light + dt1; }); - } + } solver->cellCenteredApplyMetrics(level, acoefs); solver->setLevelACoeffs(level, acoefs); @@ -592,7 +592,7 @@ void Radiation::gray_accel(MultiFab& Er_new, MultiFab& Er_pi, bcoefs_arr(i,j,k) += 0.5e0_rt * (spec_arr(i,j,k-1) + spec_arr(i,j,k)) * bcgrp_arr(i,j,k); } }); - + if (nGroups > 1) { amrex::ParallelFor(bx, [=] AMREX_GPU_HOST_DEVICE (int i, int j, int k) @@ -702,7 +702,7 @@ void Radiation::gray_accel(MultiFab& Er_new, MultiFab& Er_pi, void Radiation::local_accel(MultiFab& Er_new, const MultiFab& Er_pi, - const MultiFab& kappa_p, + const MultiFab& kappa_p, const MultiFab& etaT, const MultiFab& mugT, Real delta_t, Real ptc_tau) @@ -745,8 +745,8 @@ void Radiation::local_accel(MultiFab& Er_new, const MultiFab& Er_pi, } -void Radiation::state_energy_update(MultiFab& state, const MultiFab& rhoe, - const MultiFab& temp, +void Radiation::state_energy_update(MultiFab& state, const MultiFab& rhoe, + const MultiFab& temp, const BoxArray& grids, Real& derat, Real& dT, int level) { @@ -767,7 +767,7 @@ void Radiation::state_energy_update(MultiFab& state, const MultiFab& rhoe, #ifdef _OPENMP #pragma omp parallel #endif - for (MFIter mfi(msk); mfi.isValid(); ++mfi) + for (MFIter mfi(msk); mfi.isValid(); ++mfi) { msk[mfi].setVal(1.0); @@ -777,7 +777,7 @@ void Radiation::state_energy_update(MultiFab& state, const MultiFab& rhoe, for (int ii = 0; ii < isects.size(); ii++) { msk[mfi].setVal(0.0, isects[ii].second, 0); } - } + } } } @@ -788,7 +788,7 @@ void Radiation::state_energy_update(MultiFab& state, const MultiFab& rhoe, #ifdef _OPENMP #pragma omp parallel #endif - for (MFIter mfi(state,true); mfi.isValid(); ++mfi) + for (MFIter mfi(state,true); mfi.isValid(); ++mfi) { const Box& reg = mfi.tilebox(); @@ -826,16 +826,16 @@ void Radiation::state_energy_update(MultiFab& state, const MultiFab& rhoe, } -void Radiation::update_matter(MultiFab& rhoe_new, MultiFab& temp_new, +void Radiation::update_matter(MultiFab& rhoe_new, MultiFab& temp_new, const MultiFab& Er_new, const MultiFab& Er_pi, const MultiFab& rhoe_star, const MultiFab& rhoe_step, const MultiFab& etaT, const MultiFab& etaTz, const MultiFab& eta1, const MultiFab& coupT, - const MultiFab& kappa_p, const MultiFab& jg, + const MultiFab& kappa_p, const MultiFab& jg, const MultiFab& mugT, - const MultiFab& S_new, + const MultiFab& S_new, int level, Real delta_t, Real ptc_tau, int it, bool conservative_update) { @@ -958,14 +958,14 @@ void Radiation::update_matter(MultiFab& rhoe_new, MultiFab& temp_new, re_n(i,j,k) = eos_state.rho * eos_state.e; }); } - } + } } // ======================================================================== // for the hyperbolic solver void Radiation::compute_limiter(int level, const BoxArray& grids, - const MultiFab &Sborder, + const MultiFab &Sborder, const MultiFab &Erborder, MultiFab &lamborder) { // it works for both single- and multi-group @@ -983,28 +983,28 @@ void Radiation::compute_limiter(int level, const BoxArray& grids, } else { - MultiFab kpr(grids,dmap,Radiation::nGroups,ngrow); + MultiFab kpr(grids,dmap,Radiation::nGroups,ngrow); if (do_multigroup) { - MGFLD_compute_rosseland(kpr, Sborder); + MGFLD_compute_rosseland(kpr, Sborder); } else { - SGFLD_compute_rosseland(kpr, Sborder); + SGFLD_compute_rosseland(kpr, Sborder); } MultiFab Er_wide(grids, dmap, nGroups, ngrow+1); Er_wide.setVal(-1.0); MultiFab::Copy(Er_wide, Erborder, 0, 0, nGroups, 0); - + Er_wide.FillBoundary(parent->Geom(level).periodicity()); - + const Real* dx = parent->Geom(level).CellSize(); using namespace filter; #ifdef _OPENMP #pragma omp parallel -#endif +#endif for (MFIter mfi(Er_wide,false); mfi.isValid(); ++mfi) { FArrayBox lamfilxfab; #if AMREX_SPACEDIM >= 2 @@ -1258,7 +1258,7 @@ void Radiation::compute_limiter(int level, const BoxArray& grids, } -void Radiation::estimate_gamrPr(const FArrayBox& state, const FArrayBox& Er, +void Radiation::estimate_gamrPr(const FArrayBox& state, const FArrayBox& Er, FArrayBox& gPr, const Real*dx, const Box& box) { auto gPr_arr = gPr.array(); @@ -1832,8 +1832,8 @@ void Radiation::MGFLD_compute_scattering(FArrayBox& kappa_s, const FArrayBox& st Gpu::synchronize(); } -void Radiation::bisect_matter(MultiFab& rhoe_new, MultiFab& temp_new, - const MultiFab& rhoe_star, const MultiFab& temp_star, +void Radiation::bisect_matter(MultiFab& rhoe_new, MultiFab& temp_new, + const MultiFab& rhoe_star, const MultiFab& temp_star, const MultiFab& S_new, const BoxArray& grids, int level) { temp_new.plus(temp_star, 0, 1, 0); @@ -1881,7 +1881,7 @@ void Radiation::rhstoEr(MultiFab& rhs, Real dt, int level) #ifdef _OPENMP #pragma omp parallel #endif - for (MFIter ri(rhs, TilingIfNotGPU()); ri.isValid(); ++ri) + for (MFIter ri(rhs, TilingIfNotGPU()); ri.isValid(); ++ri) { const Box& bx = ri.tilebox(); diff --git a/Source/radiation/MGFLDRadSolver.cpp b/Source/radiation/MGFLDRadSolver.cpp index 3bb6187791..b1fab56387 100644 --- a/Source/radiation/MGFLDRadSolver.cpp +++ b/Source/radiation/MGFLDRadSolver.cpp @@ -15,7 +15,7 @@ using namespace amrex; void Radiation::MGFLD_implicit_update(int level, int iteration, int ncycle) -{ +{ BL_PROFILE("Radiation::MGFLD_implicit_update"); if (verbose) { amrex::Print() << "Radiation MGFLD implicit update, level " << level << "..." << std::endl; @@ -31,7 +31,7 @@ void Radiation::MGFLD_implicit_update(int level, int iteration, int ncycle) const DistributionMapping& dmap = castro->DistributionMap(); Real delta_t = parent->dtLevel(level); - int ngrow = 1; + int ngrow = 1; Real time = castro->get_state_data(Rad_Type).curTime(); Real oldtime = castro->get_state_data(Rad_Type).prevTime(); @@ -56,7 +56,7 @@ void Radiation::MGFLD_implicit_update(int level, int iteration, int ncycle) MultiFab& S_lag = fpi_old.get_mf(); MultiFab kpr_lag(grids,dmap,nGroups,1); - MGFLD_compute_rosseland(kpr_lag, S_lag); + MGFLD_compute_rosseland(kpr_lag, S_lag); for (int igroup=0; igroupgetEdgeBoxArray(idim), dmap, 1, 0); lambda[idim].setVal(1./3.); - } + } } // Er_new: work copy @@ -118,16 +118,16 @@ void Radiation::MGFLD_implicit_update(int level, int iteration, int ncycle) temp_new[mfi].copy(S_new_border[mfi], gbx, UTEMP, gbx, 0, 1); } - // Planck mean and Rosseland + // Planck mean and Rosseland MultiFab kappa_p(grids,dmap,nGroups,1); - MultiFab kappa_r(grids,dmap,nGroups,1); + MultiFab kappa_r(grids,dmap,nGroups,1); // emissivity, j_g = \int j_nu dnu // j_nu = 4 pi /c * \eta_0^{th} = \kappa_0 * B_\nu (assuming LTE), // where B_\nu is the usual Planck function \times 4 pi / c - MultiFab jg(grids,dmap,nGroups,1); - MultiFab djdT(grids,dmap,nGroups,1); - MultiFab dkdT(grids,dmap,nGroups,1); + MultiFab jg(grids,dmap,nGroups,1); + MultiFab djdT(grids,dmap,nGroups,1); + MultiFab dkdT(grids,dmap,nGroups,1); MultiFab etaT(grids,dmap,1,0); MultiFab etaTz(grids,dmap,1,0); MultiFab eta1(grids,dmap,1,0); // eta1 = 1 - etaT @@ -179,7 +179,7 @@ void Radiation::MGFLD_implicit_update(int level, int iteration, int ncycle) flxsave.reset(new MultiFab(grids, dmap, nGroups*AMREX_SPACEDIM, 0)); flxcc = flxsave.get(); icomp_flux = 0; - } + } // Er_step: starting state of the inner iteration (e.g., ^(2)) // There used to be an extra velocity term update @@ -187,7 +187,7 @@ void Radiation::MGFLD_implicit_update(int level, int iteration, int ncycle) MultiFab& rhoe_step = rhoe_old; Real reltol_in = relInTol; - Real ptc_tau = 0.0; // not being used + Real ptc_tau = 0.0; // not being used // nonlinear loop for all groups int it = 0; @@ -201,9 +201,9 @@ void Radiation::MGFLD_implicit_update(int level, int iteration, int ncycle) if (it == 1) { eos_opacity_emissivity(S_new_border, temp_new, temp_star, // input - kappa_p, kappa_r, jg, + kappa_p, kappa_r, jg, djdT, dkdT, dedT, // output - level, it, 1); + level, it, 1); // It's OK that temp_star does not have a valid value for it==1 } @@ -221,12 +221,12 @@ void Radiation::MGFLD_implicit_update(int level, int iteration, int ncycle) // lambda now contains flux limiter } } - + // djdT is both input and output compute_etat(etaT, etaTz, - eta1, djdT, + eta1, djdT, dkdT, dedT, - Er_star, rho, + Er_star, rho, delta_t, ptc_tau); // After this, djdT contains mugT. @@ -241,10 +241,10 @@ void Radiation::MGFLD_implicit_update(int level, int iteration, int ncycle) MultiFab::Copy(Er_pi, Er_new, 0, 0, nGroups, 0); - if (radiation::limiter>0 && inner_update_limiter>0) { + if (radiation::limiter>0 && inner_update_limiter>0) { if (innerIteration <= inner_update_limiter) { Er_pi.FillBoundary(parent->Geom(level).periodicity()); - + for (int igroup=0; igrouplevelBndry(mgbd, igroup); - + solver->levelACoeffs(level, kappa_p, delta_t, c, igroup, ptc_tau); int lamcomp = (radiation::limiter==0) ? 0 : igroup; @@ -275,7 +275,7 @@ void Radiation::MGFLD_implicit_update(int level, int iteration, int ncycle) } { // src and rhd block - + MultiFab rhs(grids,dmap,1,0); solver->levelRhs(level, rhs, jg, mugT, @@ -289,12 +289,12 @@ void Radiation::MGFLD_implicit_update(int level, int iteration, int ncycle) solver->levelFlux(level, Flux, Er_new, igroup); solver->levelFluxReg(level, flux_in, flux_out, Flux, igroup); - - if (icomp_flux >= 0) + + if (icomp_flux >= 0) solver->levelFluxFaceToCenter(level, Flux, *flxcc, icomp_flux+igroup); } // end loop over groups - + // Check for convergence *before* acceleration step: check_convergence_er(relative_in, absolute_in, error_er, Er_new, Er_pi, kappa_p, etaTz, temp_new, delta_t); @@ -302,7 +302,7 @@ void Radiation::MGFLD_implicit_update(int level, int iteration, int ncycle) if (verbose >= 2) { int oldprec = std::cout.precision(3); amrex::Print() << "Outer = " << it << ", Inner = " << innerIteration - << ", inner err = " << std::setw(8) << relative_in << " (rel), " + << ", inner err = " << std::setw(8) << relative_in << " (rel), " << std::setw(8) << absolute_in << " (abs)" << std::endl; std::cout.precision(oldprec); } @@ -313,7 +313,7 @@ void Radiation::MGFLD_implicit_update(int level, int iteration, int ncycle) else if (innerIteration < minInIter) { inner_converged = false; } - else if ( (relative_in <= reltol_in || absolute_in <= absInTol) + else if ( (relative_in <= reltol_in || absolute_in <= absInTol) && error_er <= reltol ) { inner_converged = true; } @@ -321,10 +321,10 @@ void Radiation::MGFLD_implicit_update(int level, int iteration, int ncycle) if (!inner_converged) { Real accel_fac=1.+1.e-6; if (skipAccelAllowed && - relative_in>accel_fac*relative_in_prev && + relative_in>accel_fac*relative_in_prev && absolute_in>accel_fac*absolute_in_prev) { accel_allowed = false; - if (relative_in>10.*relative_in_prev && + if (relative_in>10.*relative_in_prev && absolute_in>10.*absolute_in_prev) { MultiFab::Copy(Er_new, Er_star, 0, 0, nGroups, 0); } @@ -336,21 +336,21 @@ void Radiation::MGFLD_implicit_update(int level, int iteration, int ncycle) if (accelerate == 1) { local_accel(Er_new, Er_pi, kappa_p, etaT, mugT, delta_t, ptc_tau); - } + } else if (accelerate == 2) { - gray_accel(Er_new, Er_pi, kappa_p, kappa_r, + gray_accel(Er_new, Er_pi, kappa_p, kappa_r, etaT, eta1, mugT, lambda, solver, mgbd, grids, level, time, delta_t, ptc_tau); - } + } } } - } while(!inner_converged && innerIteration < maxInIter); + } while(!inner_converged && innerIteration < maxInIter); if (verbose == 1) { int oldprec = std::cout.precision(3); amrex::Print() << "Outer = " << it << ", Inner = " << innerIteration - << ", inner tol = " << std::setw(8) << relative_in << " " + << ", inner tol = " << std::setw(8) << relative_in << " " << std::setw(8) << absolute_in << std::endl; std::cout.precision(oldprec); } @@ -401,12 +401,12 @@ void Radiation::MGFLD_implicit_update(int level, int iteration, int ncycle) eos_opacity_emissivity(S_new_border, temp_new, temp_star, // input - kappa_p, kappa_r, jg, + kappa_p, kappa_r, jg, djdT, dkdT, dedT, // output level, it+1, 0); check_convergence_matt(rhoe_new, rhoe_star, rhoe_step, Er_new, - temp_new, temp_star, + temp_new, temp_star, rho, kappa_p, jg, dedT, rel_rhoe, abs_rhoe, rel_FT, abs_FT, rel_T, abs_T, delta_t); @@ -437,13 +437,13 @@ void Radiation::MGFLD_implicit_update(int level, int iteration, int ncycle) if (verbose >= 2) { int oldprec = std::cout.precision(4); - amrex::Print() << "Update Errors for rhoe, FT, T" + amrex::Print() << "Update Errors for rhoe, FT, T" << std::endl; - amrex::Print() << " Relative = " << std::setw(9) << rel_rhoe << ", " - << std::setw(9) << rel_FT << ", " << std::setw(9) << rel_T + amrex::Print() << " Relative = " << std::setw(9) << rel_rhoe << ", " + << std::setw(9) << rel_FT << ", " << std::setw(9) << rel_T << std::endl; - amrex::Print() << " Absolute = " << std::setw(9) << abs_rhoe << ", " - << std::setw(9) << abs_FT << ", " << std::setw(9) << abs_T + amrex::Print() << " Absolute = " << std::setw(9) << abs_rhoe << ", " + << std::setw(9) << abs_FT << ", " << std::setw(9) << abs_T << std::endl; std::cout.precision(oldprec); } @@ -451,7 +451,7 @@ void Radiation::MGFLD_implicit_update(int level, int iteration, int ncycle) if (it < miniter) { converged = false; } - else if (relative_out <= reltol || absolute_out <= abstol) { + else if (relative_out <= reltol || absolute_out <= abstol) { // || rel_rhoe < 1.e-15) { converged = true; } @@ -471,23 +471,23 @@ void Radiation::MGFLD_implicit_update(int level, int iteration, int ncycle) eos_opacity_emissivity(S_new_border, temp_new, temp_star, // input - kappa_p, kappa_r, jg, + kappa_p, kappa_r, jg, djdT, dkdT, dedT, // output level, it+1, 0); } - + } while ( ((!converged || !inner_converged) && it(face_box)); // We don't care about the bndry values here, only the type array. #if 0 - FORT_RADBNDRY2(BL_TO_FORTRAN(bndry[face][bi]), + FORT_RADBNDRY2(BL_TO_FORTRAN(bndry[face][bi]), bctypearray[face][igrid]->dataPtr(), ARLIM(domain.loVect()), ARLIM(domain.hiVect()), dx, xlo, time); #endif @@ -239,7 +239,7 @@ void MGRadBndry::setBndryFluxConds(const BCRec& bc, const BC_Mode phys_bc_mode) FArrayBox& bnd_fab = bndry[face][bi]; BaseFab& tfab = *(bctypearray[face][i]); - FORT_RADBNDRY2(BL_TO_FORTRAN(bnd_fab), + FORT_RADBNDRY2(BL_TO_FORTRAN(bnd_fab), tfab.dataPtr(), AMREX_ARLIM(domain.loVect()), AMREX_ARLIM(domain.hiVect()), dx, xlo, time); #endif if (p_bcflag == 0) { diff --git a/Source/radiation/RadBndry.cpp b/Source/radiation/RadBndry.cpp index 24079fd85f..3635f8a512 100644 --- a/Source/radiation/RadBndry.cpp +++ b/Source/radiation/RadBndry.cpp @@ -44,7 +44,7 @@ RadBndry::RadBndry(const BoxArray& _grids, const DistributionMapping& _dmap, bctypearray[face][igrid].reset(new BaseFab(face_box)); // We don't care about the bndry values here, only the type array. #if 0 - FORT_RADBNDRY2(BL_TO_FORTRAN(bndry[face][bi]), + FORT_RADBNDRY2(BL_TO_FORTRAN(bndry[face][bi]), bctypearray[face][igrid]->dataPtr(), AMREX_ARLIM(domain.loVect()), AMREX_ARLIM(domain.hiVect()), dx, xlo, time); #endif @@ -212,7 +212,7 @@ void RadBndry::setBndryFluxConds(const BCRec& bc, const BC_Mode phys_bc_mode) if (domain[face] == grd[face] && !geom.isPeriodic(dir)) { if (bcflag[face] <= 1) { if (p_bc == AMREX_LO_MARSHAK || p_bc == AMREX_LO_SANCHEZ_POMRANING || - p_bc == AMREX_LO_DIRICHLET || p_bc == AMREX_LO_NEUMANN) { + p_bc == AMREX_LO_DIRICHLET || p_bc == AMREX_LO_NEUMANN) { setValue(face, i, value); } } @@ -225,7 +225,7 @@ void RadBndry::setBndryFluxConds(const BCRec& bc, const BC_Mode phys_bc_mode) #if 0 FArrayBox& bnd_fab = bndry[face][bi]; BaseFab& tfab = bctypearray[face][i]; - FORT_RADBNDRY2(BL_TO_FORTRAN(bnd_fab), + FORT_RADBNDRY2(BL_TO_FORTRAN(bnd_fab), tfab.dataPtr(), AMREX_ARLIM(domain.loVect()), AMREX_ARLIM(domain.hiVect()), dx, xlo, time); if (p_bcflag == 0) { diff --git a/Source/radiation/RadHydro.H b/Source/radiation/RadHydro.H index e4dbfda00d..3f600a8069 100644 --- a/Source/radiation/RadHydro.H +++ b/Source/radiation/RadHydro.H @@ -131,7 +131,7 @@ dudt(Real* u, Real* a, const Real* dx, const int n, Real* dudt_tmp) { if (use_WENO) { - for (int gg = 2; gg <= NGROUPS+1; gg++) { + for (int gg = 2; gg <= NGROUPS+1; gg++) { fg(gg) = ag(gg) * ug(gg); ag(gg) = std::abs(ag(gg)); } diff --git a/Source/radiation/RadMultiGroup.cpp b/Source/radiation/RadMultiGroup.cpp index 4a8e682d78..d2f4064eba 100644 --- a/Source/radiation/RadMultiGroup.cpp +++ b/Source/radiation/RadMultiGroup.cpp @@ -113,7 +113,7 @@ void Radiation::get_groups(int verbose) for (int i = 0; i < dlognugroup.size(); i++) { groupfile << "group(" << i << ") = " << dlognugroup[i] << std::endl; - } + } } groupfile.close(); diff --git a/Source/radiation/RadPlotvar.cpp b/Source/radiation/RadPlotvar.cpp index 33b90393a7..3eb677f58c 100644 --- a/Source/radiation/RadPlotvar.cpp +++ b/Source/radiation/RadPlotvar.cpp @@ -44,7 +44,7 @@ void Radiation::save_lambda_in_plotvar(int level, const Array& lambda, const MultiFab& Er, const MultiFab& Fr, int iflx, const Real lab_factor) diff --git a/Source/radiation/RadSolve.cpp b/Source/radiation/RadSolve.cpp index 40a84b59a0..cca74cc94d 100644 --- a/Source/radiation/RadSolve.cpp +++ b/Source/radiation/RadSolve.cpp @@ -64,7 +64,7 @@ RadSolve::read_params () } if (Radiation::SolverType == Radiation::SGFLDSolver - && Radiation::Er_Lorentz_term) { + && Radiation::Er_Lorentz_term) { if (radsolve::level_solver_flag < 100) { amrex::Error("To do Lorentz term implicitly level_solver_flag must be >= 100."); @@ -75,7 +75,7 @@ RadSolve::read_params () } } - if (Radiation::SolverType == Radiation::MGFLDSolver && + if (Radiation::SolverType == Radiation::MGFLDSolver && Radiation::accelerate == 2 && Radiation::nGroups > 1) { if (radsolve::level_solver_flag < 100) { @@ -135,7 +135,7 @@ void RadSolve::cellCenteredApplyMetrics(int level, MultiFab& cc) #ifdef _OPENMP #pragma omp parallel #endif - for (MFIter mfi(cc, TilingIfNotGPU()); mfi.isValid(); ++mfi) + for (MFIter mfi(cc, TilingIfNotGPU()); mfi.isValid(); ++mfi) { const Box& bx = mfi.tilebox(); @@ -242,7 +242,7 @@ void RadSolve::levelACoeffs(int level, } } -void RadSolve::levelSPas(int level, Array& lambda, int igroup, +void RadSolve::levelSPas(int level, Array& lambda, int igroup, int lo_bc[3], int hi_bc[3]) { const BoxArray& grids = parent->boxArray(level); @@ -256,9 +256,9 @@ void RadSolve::levelSPas(int level, Array& lambda, int #endif for (MFIter mfi(spa,true); mfi.isValid(); ++mfi) { const Box& reg = mfi.tilebox(); - + spa[mfi].setVal(1.e210,reg,0); - + bool nexttoboundary=false; for (int idim=0; idim& lambda, int break; } } - + if (nexttoboundary) { auto spa_arr = spa[mfi].array(); @@ -324,7 +324,7 @@ void RadSolve::levelSPas(int level, Array& lambda, int hd->SPalpha(spa); } else { - amrex::Abort("Should not be in RadSolve::levelSPas"); + amrex::Abort("Should not be in RadSolve::levelSPas"); } } @@ -644,7 +644,7 @@ void RadSolve::levelFluxFaceToCenter(int level, const ArrayGeom(level); auto geomdata = geom.data(); @@ -991,7 +991,7 @@ void RadSolve::computeBCoeffs(MultiFab& bcoefs, int idim, } } -void RadSolve::levelACoeffs(int level, MultiFab& kpp, +void RadSolve::levelACoeffs(int level, MultiFab& kpp, Real delta_t, Real c, int igroup, Real ptc_tau) { BL_PROFILE("RadSolve::levelACoeffs (MGFLD)"); @@ -1041,7 +1041,7 @@ void RadSolve::levelACoeffs(int level, MultiFab& kpp, } -void RadSolve::levelRhs(int level, MultiFab& rhs, const MultiFab& jg, +void RadSolve::levelRhs(int level, MultiFab& rhs, const MultiFab& jg, const MultiFab& mugT, const MultiFab& coupT, const MultiFab& etaT, @@ -1109,11 +1109,11 @@ void RadSolve::restoreHypreMulti() if (hem) { hem-> cMultiplier() = cMulti; hem->d1Multiplier() = d1Multi; - hem->d2Multiplier() = d2Multi; + hem->d2Multiplier() = d2Multi; } } -void RadSolve::getEdgeMetric(int idim, const Geometry& geom, const Box& edgebox, +void RadSolve::getEdgeMetric(int idim, const Geometry& geom, const Box& edgebox, Vector& r, Vector& s) { const Box& reg = amrex::enclosedCells(edgebox); diff --git a/Source/radiation/SGRadSolver.cpp b/Source/radiation/SGRadSolver.cpp index 0cf0b76904..3a2b1ea5a1 100644 --- a/Source/radiation/SGRadSolver.cpp +++ b/Source/radiation/SGRadSolver.cpp @@ -46,7 +46,7 @@ void Radiation::single_group_update(int level, int iteration, int ncycle) Ff_new[idim].define(castro->getEdgeBoxArray(idim), dmap, 1, 0); } - MultiFab Dterm; + MultiFab Dterm; if (has_dcoefs) { Dterm.define(grids, dmap, AMREX_SPACEDIM, 0); } diff --git a/Source/radiation/_interpbndry/RadBndryData.H b/Source/radiation/_interpbndry/RadBndryData.H index 3f583cccf6..3df1041532 100644 --- a/Source/radiation/_interpbndry/RadBndryData.H +++ b/Source/radiation/_interpbndry/RadBndryData.H @@ -18,7 +18,7 @@ type conversion with the Geometry::Geometry(const Box&) constructor. This class can easily make a Geometry object, but does not have a ProxyGeometry::ProxyGeometry(const Box&) constructor. -*/ +*/ /*@Doc: A ProxyGeometry object is, for most purposes, merely a wrapper to the Geometry class. The Geometry class contains a single-argument @@ -50,7 +50,7 @@ public: /*@Memo: A BndryData stores and manipulates boundary data information on each side of each box in a BoxArray. -*/ +*/ /*@Doc: A BndryData contains a BndryRegister about each side of each grid in a Boxarray. These data are used to store information along the @@ -166,7 +166,7 @@ public: amrex::FabSet &operator[](const amrex::Orientation &_face) { return amrex::BndryRegister::bndry[_face]; } - + private: // diff --git a/Source/radiation/_interpbndry/RadBndryData.cpp b/Source/radiation/_interpbndry/RadBndryData.cpp index 7e607bfa22..850a36e797 100644 --- a/Source/radiation/_interpbndry/RadBndryData.cpp +++ b/Source/radiation/_interpbndry/RadBndryData.cpp @@ -111,7 +111,7 @@ RadBndryData::define(const BoxArray& _grids, const DistributionMapping& _dmap, if (ovlp.ok()) m->setVal(covered,ovlp,0); } // handle special cases if is periodic - if( geom.isAnyPeriodic() && + if( geom.isAnyPeriodic() && !geom.Domain().contains(face_box) ){ Vector pshifts(27); geom.periodicShift( geom.Domain(), face_box, pshifts); diff --git a/Source/radiation/_interpbndry/RadBoundCond.H b/Source/radiation/_interpbndry/RadBoundCond.H index d545c86cb6..fec193e29e 100644 --- a/Source/radiation/_interpbndry/RadBoundCond.H +++ b/Source/radiation/_interpbndry/RadBoundCond.H @@ -6,13 +6,13 @@ //@Man: /*@Memo: Maintain an identifier for boundary condition types. -*/ +*/ /*@Doc: This is a placeholder for more extensive boundary condition implementations, which might include stencils, etc. Presently, boundary conditions are specified via an integer identifier. This class maintains that integer. -*/ +*/ class RadBoundCond { public: diff --git a/Source/radiation/_interpbndry/RadInterpBndryData.H b/Source/radiation/_interpbndry/RadInterpBndryData.H index c797a1d985..3388cc7346 100644 --- a/Source/radiation/_interpbndry/RadInterpBndryData.H +++ b/Source/radiation/_interpbndry/RadInterpBndryData.H @@ -18,7 +18,7 @@ /*@Memo: An InterpBndryData object adds to a BndryData object the ability to manipulate and set the data stored in the boundary cells. -*/ +*/ /*@Doc: The "Interpbndrydata" class is a virtual base class derived from BndryData. It is intended to provide a more physical method for @@ -38,9 +38,9 @@ \item Fills with values interpolated from a coarser FAB that bounds the cells that do not meet the above two criteria \end{enumerate} - + This class does NOT provide a copy constructor or assignment operator. - + */ class RadInterpBndryData : public RadBndryData @@ -66,7 +66,7 @@ public: //@ManDoc: set bndry values at fine level, performing necessary interpolations void setBndryValues(amrex::BndryRegister& crse, int c_start, const amrex::MultiFab& fine, int f_start, - int bnd_start, int num_comp, amrex::IntVect& ratio, + int bnd_start, int num_comp, amrex::IntVect& ratio, const amrex::BCRec& phys_bc); //@ManDoc: set bndry values to provided value void setBndryValues(amrex::Real bv); diff --git a/Source/radiation/fluxlimiter.H b/Source/radiation/fluxlimiter.H index cc19b5bbc4..7414d738f8 100644 --- a/Source/radiation/fluxlimiter.H +++ b/Source/radiation/fluxlimiter.H @@ -25,7 +25,7 @@ amrex::Real Edd_factor(Real lambda) f = 1.0_rt / 3.0_rt; } else if (radiation::limiter < 10) { // approximate LP, [123] - f = 0.5e0_rt * amrex::max(0.0_rt, (1.e0_rt - 3.e0_rt* lambda)) + + f = 0.5e0_rt * amrex::max(0.0_rt, (1.e0_rt - 3.e0_rt* lambda)) + std::sqrt(amrex::max(0.0_rt, (1.e0_rt - 3.e0_rt * lambda)) * (1.e0_rt + 5.e0_rt * lambda)); f = lambda + f * f; diff --git a/Source/rotation/Castro_rotation.H b/Source/rotation/Castro_rotation.H index 7f90a55121..0fec911450 100644 --- a/Source/rotation/Castro_rotation.H +++ b/Source/rotation/Castro_rotation.H @@ -43,7 +43,7 @@ void rsrc(const Box& bx, Array4 const& uold, - Array4 const& source, + Array4 const& source, const Real dt); /// diff --git a/Source/rotation/rotation_sources.cpp b/Source/rotation/rotation_sources.cpp index f9e461775f..3af464f0f3 100644 --- a/Source/rotation/rotation_sources.cpp +++ b/Source/rotation/rotation_sources.cpp @@ -8,7 +8,7 @@ void Castro::rsrc(const Box& bx, Array4 const& uold, - Array4 const& source, + Array4 const& source, const Real dt) { GeometryData geomdata = geom.data(); @@ -328,7 +328,7 @@ Castro::corrrsrc(const Box& bx, // of the dt_omega_matrix. It also has the correct form if we have disabled // the Coriolis force entirely; at that point it reduces to the identity matrix. - Real new_mom[3] = {}; + Real new_mom[3] = {}; // new_mom = matmul(dt_omega_matrix, new_mom) diff --git a/Source/sdc/Castro_sdc.cpp b/Source/sdc/Castro_sdc.cpp index d82d2764e9..3172ef7a6b 100644 --- a/Source/sdc/Castro_sdc.cpp +++ b/Source/sdc/Castro_sdc.cpp @@ -408,7 +408,7 @@ Castro::construct_old_react_source(MultiFab& U_state, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept { instantaneous_react(i, j, k, U_state_arr, R_source_arr); - }); + }); } } } diff --git a/Source/sdc/sdc_newton_solve.H b/Source/sdc/sdc_newton_solve.H index 500e31092e..580b3e6c43 100644 --- a/Source/sdc/sdc_newton_solve.H +++ b/Source/sdc/sdc_newton_solve.H @@ -226,7 +226,7 @@ sdc_newton_solve(const Real dt_m, U_new[UEINT] = burn_state.y[SEINT]; - // we want to do a conservative update for (rho E), so first figure out the + // we want to do a conservative update for (rho E), so first figure out the // energy generation rate Real rho_Sdot = (U_new[UEINT] - U_old[UEINT]) / dt_m - C[UEINT]; diff --git a/Util/ConvertCheckpoint/Embiggen.cpp b/Util/ConvertCheckpoint/Embiggen.cpp index 32893be58c..5a26a83b29 100644 --- a/Util/ConvertCheckpoint/Embiggen.cpp +++ b/Util/ConvertCheckpoint/Embiggen.cpp @@ -139,10 +139,10 @@ static void ScanArguments() { if (ref_ratio != 2 && ref_ratio != 4) amrex::Abort("ref_ratio must be 2 or 4"); - if (grown_factor <= 1) + if (grown_factor <= 1) amrex::Abort("must have grown_factor > 1"); - if (star_at_center == 1) + if (star_at_center == 1) if (grown_factor != 2 && grown_factor != 3) amrex::Abort("must have grown_factor = 2 or 3 for star at center"); } @@ -150,10 +150,10 @@ static void ScanArguments() { // --------------------------------------------------------------- static void PrintUsage (char *progName) { cout << "Usage: " << progName << " checkin=filename " - << "checkout=outfilename " - << "ref_ratio= 2 or 4 " - << "grown_factor=integer " - << "star_at_center =0 or 1 " + << "checkout=outfilename " + << "ref_ratio= 2 or 4 " + << "grown_factor=integer " + << "star_at_center =0 or 1 " << "[nfiles=nfilesout] " << "[verbose=trueorfalse]" << endl; exit(1); @@ -205,10 +205,10 @@ static void ReadCheckpointFile(const std::string& fileName) { is >> mx_lev; is >> fakeAmr.finest_level; - if(ParallelDescriptor::IOProcessor()) + if(ParallelDescriptor::IOProcessor()) std::cout << "previous finest_lev is " << fakeAmr.finest_level << std::endl; - // ADDING LEVELS + // ADDING LEVELS int n = num_new_levels; mx_lev = mx_lev + n; fakeAmr.finest_level = fakeAmr.finest_level + n; @@ -253,7 +253,7 @@ static void ReadCheckpointFile(const std::string& fileName) { amrex::Abort("must have domain divisible by 2*ref_ratio"); } - if (grown_factor <= 1) + if (grown_factor <= 1) amrex::Abort("must have grown_factor > 1"); for (i = 1; i < mx_lev; i++) { @@ -298,18 +298,18 @@ static void ReadCheckpointFile(const std::string& fileName) { // ADDING LEVELS - // n_cycle is always equal to 1 at the coarsest level + // n_cycle is always equal to 1 at the coarsest level fakeAmr.n_cycle[0] = 1; - // At the old coarsest level, which is now level 1, we set n_cycle to ref_ratio + // At the old coarsest level, which is now level 1, we set n_cycle to ref_ratio fakeAmr.n_cycle[1] = ref_ratio; - fakeAmr.level_steps[0] = fakeAmr.level_steps[1] / ref_ratio; - if ( (fakeAmr.level_steps[0]*ref_ratio) != fakeAmr.level_steps[1] ) + fakeAmr.level_steps[0] = fakeAmr.level_steps[1] / ref_ratio; + if ( (fakeAmr.level_steps[0]*ref_ratio) != fakeAmr.level_steps[1] ) amrex::Abort("Number of steps in original checkpoint must be divisible by ref_ratio"); // level_count is how many steps we've taken at this level since the last regrid - if (fakeAmr.level_count[1] == fakeAmr.level_steps[1]) + if (fakeAmr.level_count[1] == fakeAmr.level_steps[1]) { fakeAmr.level_count[0] = fakeAmr.level_steps[0]; @@ -322,7 +322,7 @@ static void ReadCheckpointFile(const std::string& fileName) { // READ LEVEL DATA for(int lev(1); lev <= fakeAmr.finest_level; ++lev) { - + FakeAmrLevel &falRef = fakeAmr.fakeAmrLevels[lev]; is >> falRef.level; @@ -434,7 +434,7 @@ static void ReadCheckpointFile(const std::string& fileName) { falRef.geom.define(domain,&prob_domain,coord); - if(falRef.level > 0) + if(falRef.level > 0) falRef.crse_ratio = ref_ratio * IntVect::TheUnitVector(); falRef.fine_ratio = ref_ratio * IntVect::TheUnitVector(); @@ -742,7 +742,7 @@ static void ConvertData() { } else { #endif - if (star_at_center == 1 && grown_factor == 2) + if (star_at_center == 1 && grown_factor == 2) { // Here we tile the domain with tiles smaller than the original domain -- // we first tile with domain-sized pieces, then intersect with the new domain @@ -777,13 +777,13 @@ static void ConvertData() { // Here we tile the domain with tiles the size of the original domain #if (AMREX_SPACEDIM == 3) - for (int jz = 0; jz < grown_factor; jz++) + for (int jz = 0; jz < grown_factor; jz++) #endif #if (AMREX_SPACEDIM >= 2) - for (int jy = 0; jy < grown_factor; jy++) + for (int jy = 0; jy < grown_factor; jy++) #endif - for (int jx = 0; jx < grown_factor; jx++) - for (int n = 0; n < falRef0.grids.size(); n++) + for (int jx = 0; jx < grown_factor; jx++) + for (int n = 0; n < falRef0.grids.size(); n++) { int shiftx(jx*dlenx); #if (AMREX_SPACEDIM >= 2) @@ -810,12 +810,12 @@ static void ConvertData() { int nstatetypes = falRef0.state.size(); - for (int n = 0; n < nstatetypes; n++) + for (int n = 0; n < nstatetypes; n++) falRef0.state[n].grids = newgrids; // Enlarge the ProbDomain (RealBox) of the geom at each level -- // but we only have to do this at level 0 because they are - // actually all the same copy + // actually all the same copy RealBox rb(fakeAmr.geom[0].ProbDomain()); // If this is an octant then we always grow only in the high directions @@ -823,9 +823,9 @@ static void ConvertData() { { // Here we grow only prob_hi, extending the domain in one direction. // This works when the star's center is at the origin - for (int dm = 0; dm < AMREX_SPACEDIM; dm++) + for (int dm = 0; dm < AMREX_SPACEDIM; dm++) rb.setHi(dm,grown_factor*rb.hi(dm)); - } + } // We treat the r-z case with the star in the middle specially #if (AMREX_SPACEDIM == 2) @@ -846,12 +846,12 @@ static void ConvertData() { } #endif - // This has star_at_center = 0 - else + // This has star_at_center = 0 + else { // Here we grow prob_lo and prob_hi, extending the domain in all directions. // This works when the star's center is at the center of the domain. - for (int dm = 0; dm < AMREX_SPACEDIM; dm++) + for (int dm = 0; dm < AMREX_SPACEDIM; dm++) { Real dist = 0.5 * (rb.hi(dm)-rb.lo(dm)); Real center = 0.5 * (rb.hi(dm)+rb.lo(dm)); @@ -883,7 +883,7 @@ static void ConvertData() { { if (coord == 1) // r-z { - for (int i = 0; i <= max_level; i++) + for (int i = 0; i <= max_level; i++) { Box domain(fakeAmr.geom[i].Domain()); // We only handle grown_factor = 2 @@ -891,7 +891,7 @@ static void ConvertData() { shift_iv[i][1] = domain.size()[1] / 2; } } else if (coord == 0) { // x-y - for (int i = 0; i <= max_level; i++) + for (int i = 0; i <= max_level; i++) { Box domain(fakeAmr.geom[i].Domain()); if (grown_factor == 3) { @@ -901,10 +901,10 @@ static void ConvertData() { } } } - } + } // Enlarge the Domain (Box) of the geom at each level - for (int i = 0; i <= max_level; i++) + for (int i = 0; i <= max_level; i++) { Box domain(fakeAmr.geom[i].Domain()); domain.refine(grown_factor); @@ -914,43 +914,43 @@ static void ConvertData() { falRef.geom.Domain(domain); } - // Now fix the state data domain - for (int i = 0; i <= max_level; i++) + // Now fix the state data domain + for (int i = 0; i <= max_level; i++) { FakeAmrLevel &falRef = fakeAmr.fakeAmrLevels[i]; - for (int n = 0; n < nstatetypes; n++) + for (int n = 0; n < nstatetypes; n++) falRef.state[n].domain.refine(grown_factor); } DistributionMapping newdm {newgrids}; // We need to allocate a MultiFab for new data but don't need to fill it - for (int n = 0; n < nstatetypes; n++) + for (int n = 0; n < nstatetypes; n++) { if (falRef0.state[n].new_data != 0) { int ncomps = (falRef0.state[n].new_data)->nComp(); MultiFab * newNewData = new MultiFab(newgrids,newdm,ncomps,1); - newNewData->setVal(0.); + newNewData->setVal(0.); - if (star_at_center == 1) + if (star_at_center == 1) (falRef0.state[n].new_data)->shift(shift_iv[0]); falRef0.state[n].new_data = newNewData; - + // newNewData->copy(*(falRef0.state[n].new_data),0,0,ncomps); } - } + } // If we have old_data as well as new_data - for (int n = 0; n < nstatetypes; n++) + for (int n = 0; n < nstatetypes; n++) { if (falRef0.state[n].old_data != 0) { int ncomps = (falRef0.state[n].old_data)->nComp(); MultiFab * newOldData = new MultiFab(newgrids,newdm,ncomps,1); newOldData->setVal(0.); - if (star_at_center == 1) + if (star_at_center == 1) (falRef0.state[n].old_data)->shift(shift_iv[0]); falRef0.state[n].old_data = newOldData; @@ -961,22 +961,22 @@ static void ConvertData() { // Now shift the data at the higher levels if (star_at_center == 1) { - for (int i = 1; i <= max_level; i++) + for (int i = 1; i <= max_level; i++) { FakeAmrLevel &falRef = fakeAmr.fakeAmrLevels[i]; // Shift the grids associated with each level falRef.grids.shift(shift_iv[i]); - for (int n = 0; n < nstatetypes; n++) + for (int n = 0; n < nstatetypes; n++) { // Shift the grids associated with each StateData falRef.state[n].grids.shift(shift_iv[i]); // Shift the grids associated with the MultiFab in each StateData - if (falRef0.state[n].new_data != 0) + if (falRef0.state[n].new_data != 0) (falRef.state[n].new_data)->shift(shift_iv[i]); - if (falRef0.state[n].old_data != 0) + if (falRef0.state[n].old_data != 0) (falRef.state[n].old_data)->shift(shift_iv[i]); } } @@ -1006,7 +1006,7 @@ int main(int argc, char *argv[]) { cout << " " << std::endl; } - // Read in the original checkpoint directory and add a coarser level covering the same domain + // Read in the original checkpoint directory and add a coarser level covering the same domain ReadCheckpointFile(CheckFileIn); // Enlarge the new level 0 diff --git a/Util/code_checker/clang_static_analysis.py b/Util/code_checker/clang_static_analysis.py index 0e5057864b..0c0fe07881 100644 --- a/Util/code_checker/clang_static_analysis.py +++ b/Util/code_checker/clang_static_analysis.py @@ -2,7 +2,7 @@ import sys def process_analysis(filename): - + with open(filename, 'r') as f: r = re.compile(r'^(.\.\/\.\.\/\.\.\/Source\/[\w/]+\.cpp.*?(?:warning|note).*?)(?=\n\S)', flags=re.M|re.S) diff --git a/Util/code_checker/pr_tab_remover.sh b/Util/code_checker/pr_tab_remover.sh index 614c41a8f2..cf2bac4e8b 100755 --- a/Util/code_checker/pr_tab_remover.sh +++ b/Util/code_checker/pr_tab_remover.sh @@ -40,7 +40,7 @@ fi git commit -m "Tabs have been converted to spaces by tab_exterminator.sh" echo "pushing to $TRAVIS_PULL_REQUEST_BRANCH" git push origin $TRAVIS_PULL_REQUEST_BRANCH -cd +cd # Kill the ssh-agent ssh-agent -k diff --git a/Util/scripts/get_castro.sh b/Util/scripts/get_castro.sh index c557822ba8..bd906041c9 100755 --- a/Util/scripts/get_castro.sh +++ b/Util/scripts/get_castro.sh @@ -46,7 +46,7 @@ if [ -f castro_exports.sh ]; then rm -f castro_exports.sh fi -cat >> castro_exports.sh << EOF +cat >> castro_exports.sh << EOF export CASTRO_HOME="${pwd}/Castro" export MICROPHYSICS_HOME="${pwd}/Microphysics" export AMREX_HOME="${pwd}/amrex" diff --git a/Util/scripts/get_castro_date.sh b/Util/scripts/get_castro_date.sh index 9adfd91736..9f2f04f27d 100755 --- a/Util/scripts/get_castro_date.sh +++ b/Util/scripts/get_castro_date.sh @@ -79,7 +79,7 @@ if [ -f castro_exports.sh ]; then rm -f castro_exports.sh fi -cat >> castro_exports.sh << EOF +cat >> castro_exports.sh << EOF export CASTRO_HOME="${pwd}/Castro" export MICROPHYSICS_HOME="${pwd}/Microphysics" export AMREX_HOME="${pwd}/amrex" diff --git a/Util/yt/README.md b/Util/yt/README.md index f0a522cdcb..19322c01f9 100644 --- a/Util/yt/README.md +++ b/Util/yt/README.md @@ -9,8 +9,8 @@ These were originally written with the WD merger problem in mind. -- vol-wd-spherical.py : this script does a spherical projection (all 4 pi steradians) - with the camera set at the origin. This can be used to create - 360 degree videos for uploading to youtube. + with the camera set at the origin. This can be used to create + 360 degree videos for uploading to youtube. Note to prepare the video for youtube, follow the instructions here: @@ -18,7 +18,7 @@ These were originally written with the WD merger problem in mind. https://support.google.com/youtube/answer/6178631?hl=en In particular, you need to add metadata to the video, which can be - done with the google spatial media metadata injector: + done with the google spatial media metadata injector: https://github.com/google/spatial-media/blob/master/spatialmedia/README.md diff --git a/Util/yt/vol-wd-spherical-stereo.py b/Util/yt/vol-wd-spherical-stereo.py index 13c760f4b6..aaab7083e6 100755 --- a/Util/yt/vol-wd-spherical-stereo.py +++ b/Util/yt/vol-wd-spherical-stereo.py @@ -64,7 +64,7 @@ def doit(plotfile): # look toward the +x initially cam.focus = ds.arr(np.array([ds.domain_left_edge[0], 0.0, 0.0]), 'cm') - + # center of the domain -- eventually we might want to do the # center of mass cam.position = ds.arr(np.array([0.0, 0.0, 0.0]), 'cm') @@ -77,7 +77,7 @@ def doit(plotfile): cam.switch_orientation(normal_vector=normal, north_vector=[0., 0., 1.]) - + # there is no such thing as a camera width -- the entire volume is rendered #cam.set_width(ds.domain_width) diff --git a/Util/yt/vol-wd-spherical.py b/Util/yt/vol-wd-spherical.py index 4718c96cf2..c293df7d11 100755 --- a/Util/yt/vol-wd-spherical.py +++ b/Util/yt/vol-wd-spherical.py @@ -64,7 +64,7 @@ def doit(plotfile): # look toward the +x initially cam.focus = ds.arr(np.array([ds.domain_left_edge[0], 0.0, 0.0]), 'cm') - + # center of the domain -- eventually we might want to do the # center of mass cam.position = ds.arr(np.array([0.0, 0.0, 0.0]), 'cm') @@ -77,7 +77,7 @@ def doit(plotfile): cam.switch_orientation(normal_vector=normal, north_vector=[0., 0., 1.]) - + # there is no such thing as a camera width -- the entire volume is rendered #cam.set_width(ds.domain_width) diff --git a/deploy_docs_action.sh b/deploy_docs_action.sh index 52b4589ac8..d175f96b49 100755 --- a/deploy_docs_action.sh +++ b/deploy_docs_action.sh @@ -9,10 +9,10 @@ TARGET_BRANCH="gh-pages" mkdir out -# if on the dev branch, use the dev_layout.html template to get the +# if on the dev branch, use the dev_layout.html template to get the # links correct if [ "$GITHUB_BRANCH" = "$DEV_BRANCH" ]; then - mv Docs/source/_templates/dev_layout.html Docs/source/_templates/layout.html + mv Docs/source/_templates/dev_layout.html Docs/source/_templates/layout.html fi # Build the Sphinx documentation @@ -24,7 +24,7 @@ mkdir -p out/docs/ if [ "$GITHUB_BRANCH" = "$MAIN_BRANCH" ]; then mkdir -p out/docs mv Docs/build/html/* out/docs -else +else mkdir -p out/docs/dev/ mv Docs/build/html/* out/docs/dev fi diff --git a/license.txt b/license.txt index c2ed7ea27f..588e92bf1b 100644 --- a/license.txt +++ b/license.txt @@ -1,7 +1,7 @@ SOURCE CODE LICENSE AGREEMENT -Castro, Copyright (c) 2015, -The Regents of the University of California, -through Lawrence Berkeley National Laboratory +Castro, Copyright (c) 2015, +The Regents of the University of California, +through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy). All rights reserved."