Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor derived variables #63

Merged
merged 38 commits into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
8148218
CI: Add constraint vars to regression test
mirenradia Jan 10, 2024
db12775
Core: Move variable setup and derive to BinaryBH example
mirenradia Jan 10, 2024
8ac69da
BinaryBH: Remove plot_constraints member
mirenradia Jan 10, 2024
f00216b
GRAMRLevel: Add stateVariableSetUp()
mirenradia Jan 11, 2024
1f05688
BinaryBH: Add Weyl4 to derived vars
mirenradia Jan 12, 2024
fc52fdf
Weyl4: Fix missing qualifiers
mirenradia Jan 22, 2024
5fe898b
Tests: Add Weyl4 test that compares with GRChombo
mirenradia Jan 22, 2024
317302e
CI: Build unit tests with HDF5
mirenradia Jan 23, 2024
913b9bb
Remove unneeded AMREX_USE_HDF5 codepaths
mirenradia Jan 23, 2024
83d2316
git: Ignore *.h5 files
mirenradia Jan 23, 2024
a231b0b
CI: Make regression test fail if present vars differ
mirenradia Jan 24, 2024
d602c7d
CI: Add Weyl4 vars to regression test plt file
mirenradia Jan 24, 2024
dc3b75a
BinaryBH: Set activate_extraction = 1
mirenradia Jan 24, 2024
46cfcd7
BinaryBH: Allow derive() to fill a MultiFab with ghosts
mirenradia Jan 24, 2024
5d97098
Core: Switch to using hardcoded parities
mirenradia May 21, 2024
85cd7fb
Params: Remove vars_parity and vars_parity_diagnostic
mirenradia May 23, 2024
df06b14
Core: Rename variable types
mirenradia May 23, 2024
325b374
Core: Remove diagnostic variables
mirenradia May 23, 2024
5b744da
Core: Rename UserVariables -> StateVariables
mirenradia May 23, 2024
875720b
Tests: Add Constraints test
mirenradia May 24, 2024
cca5662
Tests: Make Weyl4 consistent with Constraints
mirenradia May 24, 2024
4f10305
Weyl4/Constraints: Move variable names into class
mirenradia May 24, 2024
c0d1b5a
Tests: Remove old constraints test
mirenradia May 24, 2024
dab5f53
CCZ4: Rename NewConstraints -> Constraints
mirenradia May 24, 2024
ceb20d7
BinaryBH: Fix clang-tidy warnings
mirenradia Jun 3, 2024
20db39f
BoundaryConditions: Add bc_parity_map
mirenradia Jun 3, 2024
6a61a25
BoundaryConditions: Default BCParity to undefined
mirenradia Jun 3, 2024
51f0958
Core: Make StateVariables::names an amrex::Vector
mirenradia Jun 3, 2024
bbe6352
Utils: Use SFINAE to restrict ArrayTools::concatenate template
mirenradia Jun 4, 2024
cc699f6
BinaryBH: Move set up of derived quantities to derived class
mirenradia Jun 4, 2024
89c83e0
utils/Interval: Fix missing GPU qualifiers
mirenradia Jun 5, 2024
4dafa67
Derive: Leverage new amrex::DeriveFuncMF
mirenradia Jul 18, 2024
68a987d
CI: Add more files to .lint-ignore
mirenradia Jul 19, 2024
761c626
Lint: Fix clang-tidy warnings
mirenradia Jul 19, 2024
285b685
Core: Move VariableType to utils
mirenradia Jul 19, 2024
ca79b14
README: Update derived variable feature status
mirenradia Jul 19, 2024
2798237
Weyl4: Fix segfault/failed assertion
mirenradia Aug 16, 2024
facb388
BinaryBH: Fix some invalid params in inputs.test
mirenradia Aug 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/data/plt00008_compare/Header
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
HyperCLaw-V1.1
25
31
chi
h11
h12
Expand All @@ -25,6 +25,12 @@ shift3
B1
B2
B3
Ham
Mom1
Mom2
Mom3
Weyl4_Re
Weyl4_Im
3
0.5
0
Expand Down
Binary file modified .github/workflows/data/plt00008_compare/Level_0/Cell_D_00000
Binary file not shown.
Binary file modified .github/workflows/data/plt00008_compare/Level_0/Cell_D_00001
Binary file not shown.
26 changes: 13 additions & 13 deletions .github/workflows/data/plt00008_compare/Level_0/Cell_H
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
1
1
25
31
0
(4 0
((0,0,0) (15,15,15) (0,0,0))
Expand All @@ -10,19 +10,19 @@
)
4
FabOnDisk: Cell_D_00000 0
FabOnDisk: Cell_D_00000 819290
FabOnDisk: Cell_D_00000 1015898
FabOnDisk: Cell_D_00001 0
FabOnDisk: Cell_D_00001 819291
FabOnDisk: Cell_D_00001 1015899

4,25
4.5700896323026922e-02,9.9838364361793386e-01,-1.5031784065826692e-02,-4.8729573554266714e-03,9.7722110523801820e-01,-3.0070407835777291e-04,9.9824728480751257e-01,-2.9556979548167460e-02,-7.0113181199803934e-02,-2.7286982515495172e-02,-3.6608692828050786e-02,-2.1247640029690693e-03,-2.6217367437056403e-02,-6.7180947425935791e-02,-1.9602894352501763e-02,-3.9395452939456552e-02,-6.0505478903668630e-04,-6.9665398708926357e-03,2.2848012969743353e-01,-4.6593025468040531e-03,-6.2590303322144198e-05,-1.6299256966890241e-03,-3.3183049543717813e-02,-5.2160105127382742e-04,-5.1735990600953914e-03,
4.7004773779023186e-02,9.8377628653255245e-01,-2.0716115173438382e-02,-4.9652149088644593e-03,9.9935959026712651e-01,-2.0112358731818429e-02,9.8362481448463890e-01,-2.7989844962644696e-02,-6.1398019674665787e-02,-7.5588444741133687e-02,-4.5412118713521112e-02,-1.2752833678597392e-01,2.2140292940425855e-05,-5.8578570582204018e-02,-1.9738744234863603e-02,-3.6179790094482675e-02,-1.3750310438750316e-01,-3.7615839442600076e-03,2.3123206118141787e-01,-6.3887292434837272e-03,-2.5106655859541763e-02,-3.3866629228354128e-04,-2.7661484436504364e-02,-1.0402756324144745e-01,-3.3100288878819524e-03,
4.7004773779023186e-02,9.8377628653255245e-01,-2.0716115173438375e-02,-5.9717184452350077e-03,9.9935959026712640e-01,-2.5834188739791384e-05,9.8362481448463890e-01,-2.7989844962644624e-02,-6.1398019674665766e-02,-7.5588444741133631e-02,-4.0381338969416723e-02,-1.2752833678597392e-01,-7.9030951039676348e-02,-5.8578570582204031e-02,-1.9738744234863576e-02,-4.4313982928937561e-02,-3.5237268155835322e-03,-3.7615839442603138e-03,2.3123206118141787e-01,-7.4452015972642106e-03,-3.0213409788056793e-04,-3.3866629228353299e-04,-3.4387047465918620e-02,-3.1208813517427754e-03,-3.3100288878822699e-03,
4.5700896323026922e-02,9.9838364361793386e-01,-1.5031784065826689e-02,-4.0033002312327053e-03,9.7722110523801820e-01,-1.4796226962349479e-02,9.9824728480751257e-01,-2.9556979548166766e-02,-7.0113181199803934e-02,-2.7286982515495200e-02,-3.8152979745954975e-02,-2.1247640029688946e-03,-1.9489276979107902e-02,-6.7180947425935805e-02,-1.9602894352501680e-02,-3.0011227911482294e-02,-9.2186696779471750e-02,-6.9665398708926201e-03,2.2848012969743353e-01,-3.5043804755845358e-03,-1.5791049355068934e-02,-1.6299256966890339e-03,-2.5338720610702910e-02,-7.1131964306046527e-02,-5.1735990600953619e-03,
4,31
4.5700896323026922e-02,9.9838364361793386e-01,-1.5031784065826692e-02,-4.8729573554266714e-03,9.7722110523801820e-01,-3.0070407835777291e-04,9.9824728480751257e-01,-2.9556979548167460e-02,-7.0113181199803934e-02,-2.7286982515495172e-02,-3.6608692828050786e-02,-2.1247640029690693e-03,-2.6217367437056403e-02,-6.7180947425935791e-02,-1.9602894352501763e-02,-3.9395452939456552e-02,-6.0505478903668630e-04,-6.9665398708926357e-03,2.2848012969743353e-01,-4.6593025468040531e-03,-6.2590303322144198e-05,-1.6299256966890241e-03,-3.3183049543717813e-02,-5.2160105127382742e-04,-5.1735990600953914e-03,-1.1220910384202052e+00,-1.5094484342922457e-01,-1.8968496762502796e-01,-1.0329058875313397e-01,-3.4336086215733441e-01,-3.8675689288732740e-01,
4.7004773779023186e-02,9.8377628653255245e-01,-2.0716115173438382e-02,-4.9652149088644593e-03,9.9935959026712651e-01,-2.0112358731818429e-02,9.8362481448463890e-01,-2.7989844962644696e-02,-6.1398019674665787e-02,-7.5588444741133687e-02,-4.5412118713521112e-02,-1.2752833678597392e-01,2.2140292940425855e-05,-5.8578570582204018e-02,-1.9738744234863603e-02,-3.6179790094482675e-02,-1.3750310438750316e-01,-3.7615839442600076e-03,2.3123206118141787e-01,-6.3887292434837272e-03,-2.5106655859541763e-02,-3.3866629228354128e-04,-2.7661484436504364e-02,-1.0402756324144745e-01,-3.3100288878819524e-03,-1.1225155784433918e+00,-1.4961685888947426e-01,-1.3811033653991370e-01,-1.0328360988106688e-01,-3.2691156196794657e-01,-1.8115183759409962e-02,
4.7004773779023186e-02,9.8377628653255245e-01,-2.0716115173438375e-02,-5.9717184452350077e-03,9.9935959026712640e-01,-2.5834188739791384e-05,9.8362481448463890e-01,-2.7989844962644624e-02,-6.1398019674665766e-02,-7.5588444741133631e-02,-4.0381338969416723e-02,-1.2752833678597392e-01,-7.9030951039676348e-02,-5.8578570582204031e-02,-1.9738744234863576e-02,-4.4313982928937561e-02,-3.5237268155835322e-03,-3.7615839442603138e-03,2.3123206118141787e-01,-7.4452015972642106e-03,-3.0213409788056793e-04,-3.3866629228353299e-04,-3.4387047465918620e-02,-3.1208813517427754e-03,-3.3100288878822699e-03,-1.1225155784433947e+00,-1.4697662860764465e-01,-1.0225892960468289e-01,-1.0328360988106962e-01,-3.2691156196794624e-01,-1.8115183759410552e-02,
4.5700896323026922e-02,9.9838364361793386e-01,-1.5031784065826689e-02,-4.0033002312327053e-03,9.7722110523801820e-01,-1.4796226962349479e-02,9.9824728480751257e-01,-2.9556979548166766e-02,-7.0113181199803934e-02,-2.7286982515495200e-02,-3.8152979745954975e-02,-2.1247640029688946e-03,-1.9489276979107902e-02,-6.7180947425935805e-02,-1.9602894352501680e-02,-3.0011227911482294e-02,-9.2186696779471750e-02,-6.9665398708926201e-03,2.2848012969743353e-01,-3.5043804755845358e-03,-1.5791049355068934e-02,-1.6299256966890339e-03,-2.5338720610702910e-02,-7.1131964306046527e-02,-5.1735990600953619e-03,-1.1220910384202034e+00,-1.5482713385431740e-01,-1.0481917594170294e-01,-1.0329058875312620e-01,-3.4336086215733452e-01,-3.8675689288732745e-01,

4,25
7.4985222856563083e-01,1.0117477155933374e+00,1.4558956690263844e-02,4.0033002312327044e-03,1.0005070575828181e+00,1.4796226962349477e-02,1.0114331106618624e+00,1.1903809666105619e-01,2.1358516160280103e-02,2.5773052062409509e-02,3.8152979745954996e-02,4.6386663842622543e-02,1.9489276979107906e-02,2.2159183641129003e-02,1.1418174992219736e-01,3.0011227911482297e-02,9.2186696779471763e-02,3.6059839696627932e-02,8.6509374416967610e-01,3.5043804755845367e-03,1.5791049355068927e-02,4.2484527075500704e-03,2.5338720610702914e-02,7.1131964306046513e-02,3.0395236086561184e-02,
7.4985222854075251e-01,1.0072488864366447e+00,1.9008002545167171e-02,5.9717184452350129e-03,1.0334550043563624e+00,2.5834188739791361e-05,1.0065443387684381e+00,1.1796882427119543e-01,6.0400891903036290e-02,8.0631488622718864e-02,4.0381338969416737e-02,1.5273885464171411e-02,7.9030951039676348e-02,6.0757074979636526e-02,1.1242536951149032e-01,4.4313982928937588e-02,3.5237268155836705e-03,4.1531392794373831e-02,8.6509374416505669e-01,7.4452015972642140e-03,3.0213409788056869e-04,7.1017472543868738e-03,3.4387047465918634e-02,3.1208813517429124e-03,3.2062396455191336e-02,
7.4985222854075251e-01,1.0072488864366447e+00,1.9008002545167171e-02,4.9652149088644576e-03,1.0334550043563624e+00,2.0112358731818429e-02,1.0065443387684381e+00,1.1796882427119541e-01,6.0400891903036269e-02,8.0631488622718780e-02,4.5412118713521084e-02,1.5273885464171421e-02,-2.2140292940425869e-05,6.0757074979636547e-02,1.1242536951149029e-01,3.6179790094482668e-02,1.3750310438750307e-01,4.1531392794373831e-02,8.6509374416505669e-01,6.3887292434837255e-03,2.5106655859541756e-02,7.1017472543868729e-03,2.7661484436504371e-02,1.0402756324144741e-01,3.2062396455191336e-02,
7.4985222856563083e-01,1.0117477155933374e+00,1.4558956690263844e-02,4.8729573554266801e-03,1.0005070575828181e+00,3.0070407835777041e-04,1.0114331106618624e+00,1.1903809666105630e-01,2.1358516160280061e-02,2.5773052062409523e-02,3.6608692828050779e-02,4.6386663842622577e-02,2.6217367437056376e-02,2.2159183641128968e-02,1.1418174992219743e-01,3.9395452939456593e-02,6.0505478903629545e-04,3.6059839696627974e-02,8.6509374416967610e-01,4.6593025468040531e-03,6.2590303322106969e-05,4.2484527075500747e-03,3.3183049543717855e-02,5.2160105127348612e-04,3.0395236086561216e-02,
4,31
7.4985222856563083e-01,1.0117477155933374e+00,1.4558956690263844e-02,4.0033002312327044e-03,1.0005070575828181e+00,1.4796226962349477e-02,1.0114331106618624e+00,1.1903809666105619e-01,2.1358516160280103e-02,2.5773052062409509e-02,3.8152979745954996e-02,4.6386663842622543e-02,1.9489276979107906e-02,2.2159183641129003e-02,1.1418174992219736e-01,3.0011227911482297e-02,9.2186696779471763e-02,3.6059839696627932e-02,8.6509374416967610e-01,3.5043804755845367e-03,1.5791049355068927e-02,4.2484527075500704e-03,2.5338720610702914e-02,7.1131964306046513e-02,3.0395236086561184e-02,2.8875999224050726e+00,1.5482713385431754e-01,1.0481917594170471e-01,1.5534225952034122e-01,3.5388990302410928e-01,1.7438834151411561e-02,
7.4985222854075251e-01,1.0072488864366447e+00,1.9008002545167171e-02,5.9717184452350129e-03,1.0334550043563624e+00,2.5834188739791361e-05,1.0065443387684381e+00,1.1796882427119543e-01,6.0400891903036290e-02,8.0631488622718864e-02,4.0381338969416737e-02,1.5273885464171411e-02,7.9030951039676348e-02,6.0757074979636526e-02,1.1242536951149032e-01,4.4313982928937588e-02,3.5237268155836705e-03,4.1531392794373831e-02,8.6509374416505669e-01,7.4452015972642140e-03,3.0213409788056869e-04,7.1017472543868738e-03,3.4387047465918634e-02,3.1208813517429124e-03,3.2062396455191336e-02,2.8110120522249948e+00,1.4697662860764485e-01,1.0225892960468438e-01,1.5088212706891804e-01,3.3507176667420951e-01,3.6494524386885530e-01,
7.4985222854075251e-01,1.0072488864366447e+00,1.9008002545167171e-02,4.9652149088644576e-03,1.0334550043563624e+00,2.0112358731818429e-02,1.0065443387684381e+00,1.1796882427119541e-01,6.0400891903036269e-02,8.0631488622718780e-02,4.5412118713521084e-02,1.5273885464171421e-02,-2.2140292940425869e-05,6.0757074979636547e-02,1.1242536951149029e-01,3.6179790094482668e-02,1.3750310438750307e-01,4.1531392794373831e-02,8.6509374416505669e-01,6.3887292434837255e-03,2.5106655859541756e-02,7.1017472543868729e-03,2.7661484436504371e-02,1.0402756324144741e-01,3.2062396455191336e-02,2.8110120522249975e+00,1.4961685888947426e-01,1.3811033653991414e-01,1.5088212706891843e-01,3.3507176667420929e-01,3.6494524386885513e-01,
7.4985222856563083e-01,1.0117477155933374e+00,1.4558956690263844e-02,4.8729573554266801e-03,1.0005070575828181e+00,3.0070407835777041e-04,1.0114331106618624e+00,1.1903809666105630e-01,2.1358516160280061e-02,2.5773052062409523e-02,3.6608692828050779e-02,4.6386663842622577e-02,2.6217367437056376e-02,2.2159183641128968e-02,1.1418174992219743e-01,3.9395452939456593e-02,6.0505478903629545e-04,3.6059839696627974e-02,8.6509374416967610e-01,4.6593025468040531e-03,6.2590303322106969e-05,4.2484527075500747e-03,3.3183049543717855e-02,5.2160105127348612e-04,3.0395236086561216e-02,2.8875999224050748e+00,1.5094484342922457e-01,1.8968496762502751e-01,1.5534225952034200e-01,3.5388990302410916e-01,1.7438834151412976e-02,

1 change: 1 addition & 0 deletions .github/workflows/regression-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ jobs:
${AMREX_HOME}/Tools/Plotfile/fcompare.gnu.ex \
--abs_tol 1e-10 \
--rel_tol 1e-10 \
--abort_if_not_all_found \
${GITHUB_WORKSPACE}/GRTeclyn/.github/workflows/data/plt00008_compare \
${BINARYBH_EXAMPLE_DIR}/plt00008

Expand Down
17 changes: 15 additions & 2 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@ jobs:
AMREX_HOME: ${{ github.workspace }}/amrex
OMP_NUM_THREADS: 1
TESTS_DIR: ${{ github.workspace }}/GRTeclyn/Tests
BUILD_CONFIG: COMP=${{ matrix.comp }} DEBUG=${{ matrix.debug}} USE_MPI=${{ matrix.mpi }} USE_OMP=${{ matrix.omp }}
BUILD_CONFIG: >
COMP=${{ matrix.comp }}
DEBUG=${{ matrix.debug}}
USE_MPI=${{ matrix.mpi }}
USE_OMP=${{ matrix.omp }}
USE_HDF5=TRUE

steps:
- name: Checkout AMReX
Expand Down Expand Up @@ -66,8 +71,11 @@ jobs:

- name: Install dependencies
run: |
PACKAGES="hdf5-tools"
if [[ "${{ matrix.mpi }}" == "TRUE" ]]; then
PACKAGES="libopenmpi-dev"
PACKAGES="${PACKAGES} libopenmpi-dev libhdf5-openmpi-dev"
else
PACKAGES="${PACKAGES} libhdf5-dev"
fi
if [[ "${{ matrix.comp }}" == "llvm" && "${{ matrix.omp }}" == "TRUE" ]]; then
PACKAGES="${PACKAGES} libomp-${{ matrix.comp-version }}-dev"
Expand Down Expand Up @@ -105,6 +113,11 @@ jobs:
- name: Build Tests
working-directory: ${{ env.TESTS_DIR }}
run: |
if [[ "${{ matrix.mpi }}" == "TRUE" ]]; then
export HDF5_HOME=/usr/lib/x86_64-linux-gnu/hdf5/openmpi
else
export HDF5_HOME=/usr/lib/x86_64-linux-gnu/hdf5/serial
fi
export OMPI_CXX=${{ steps.set-compilers.outputs.ompi_cxx }}
make -j 4 ${{ steps.set-compilers.outputs.build_args }}

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Backtrace.*
pout.*
*.out
*.dat
*.h5
Weyl_integral*
*ExtractionOut_*

Expand Down
8 changes: 8 additions & 0 deletions .lint-ignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@

# These directories have yet to be ported to AMReX
Source/AMRInterpolator/*
Source/BoxUtils/SixthOrderDerivatives.hpp
Source/CCZ4/GammaCalculator.hpp
Source/InitialConditions/BlackHoles/KerrBH*
Source/InitialConditions/ScalarFields/*
Source/Matter/*
Source/utils/WeylExtraction*
Examples/KerrBH/*
Examples/ScalarField/*
Tests/.*

# These are old files we don't want to change
Tests/CCZ4RHSTest/*fdf5a7a*
33 changes: 15 additions & 18 deletions Examples/BinaryBH/BinaryBHLevel.cpp
mirenradia marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,24 @@
#include "PositiveChiAndAlpha.hpp"
#include "PunctureTracker.hpp"
// xxxxx #include "SixthOrderDerivatives.hpp"
#include "Constraints.hpp"
#include "TraceARemoval.hpp"
#include "TwoPuncturesInitialData.hpp"
#include "Weyl4.hpp"
#include "WeylExtraction.hpp"

void BinaryBHLevel::variableSetUp()
{
BL_PROFILE("BinaryBHLevel::variableSetUp()");

// Set up the state variables
stateVariableSetUp();

Constraints::set_up(State_Type);

Weyl4::set_up(State_Type);
}

// Things to do during the advance step after RK4 steps
void BinaryBHLevel::specificAdvance()
{
Expand Down Expand Up @@ -221,7 +234,7 @@ void BinaryBHLevel::specificPostTimeStep()
bool fill_ghosts = false;
m_gr_amr.m_interpolator->refresh(fill_ghosts);
m_gr_amr.fill_multilevel_ghosts(
VariableType::diagnostic, Interval(c_Weyl4_Re, c_Weyl4_Im),
VariableType::derived, Interval(c_Weyl4_Re, c_Weyl4_Im),
min_level);
WeylExtraction my_extraction(m_p.extraction_params, m_dt,
m_time, first_step,
Expand All @@ -238,7 +251,7 @@ void BinaryBHLevel::specificPostTimeStep()
m_state_new, m_state_diagnostics, EXCLUDE_GHOST_CELLS);
if (m_level == 0)
{
AMRReductions<VariableType::diagnostic> amr_reductions(m_gr_amr);
AMRReductions<VariableType::derived> amr_reductions(m_gr_amr);
double L2_Ham = amr_reductions.norm(c_Ham);
double L2_Mom = amr_reductions.norm(Interval(c_Mom1, c_Mom3));
SmallDataIO constraints_file(m_p.data_path + "constraint_norms",
Expand All @@ -265,19 +278,3 @@ void BinaryBHLevel::specificPostTimeStep()
}
#endif
}

#ifdef AMREX_USE_HDF5
// Things to do before a plot level - need to calculate the Weyl scalars
void BinaryBHLevel::prePlotLevel()
{
fillAllGhosts();
if (m_p.activate_extraction == 1)
{
BoxLoops::loop(
make_compute_pack(
Weyl4(m_p.extraction_params.center, m_dx, m_p.formulation),
Constraints(m_dx, c_Ham, Interval(c_Mom1, c_Mom3))),
m_state_new, m_state_diagnostics, EXCLUDE_GHOST_CELLS);
}
}
#endif /* AMREX_USE_HDF5 */
6 changes: 1 addition & 5 deletions Examples/BinaryBH/BinaryBHLevel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
class BinaryBHLevel : public GRAMRLevel
{
public:
static void variableSetUp();

// Inherit the contructors from GRAMRLevel
using GRAMRLevel::GRAMRLevel;
Expand All @@ -37,11 +38,6 @@ class BinaryBHLevel : public GRAMRLevel

void errorEst(amrex::TagBoxArray &tag_box_array, int clearval, int tagval,
amrex::Real time, int n_error_buf = 0, int ngrow = 0) final;

#ifdef AMREX_USE_HDF5
/// Any actions that should happen just before plot files output
virtual void prePlotLevel() override;
#endif /* AMREX_USE_HDF5 */
};

#endif /* BINARYBHLEVEL_HPP_ */
34 changes: 0 additions & 34 deletions Examples/BinaryBH/DiagnosticVariables.hpp

This file was deleted.

2 changes: 1 addition & 1 deletion Examples/BinaryBH/Make.package
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
GRTECLYN_CEXE_sources += BinaryBHLevel.cpp Main_BinaryBH.cpp

GRTECLYN_CEXE_headers += BinaryBHLevel.hpp DiagnosticVariables.hpp SimulationParameters.hpp TPAMR.hpp UserVariables.hpp
GRTECLYN_CEXE_headers += BinaryBHLevel.hpp SimulationParameters.hpp TPAMR.hpp StateVariables.hpp


Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
* Please refer to LICENSE in GRTeclyn's root directory.
*/

#ifndef USERVARIABLES_HPP
#define USERVARIABLES_HPP
#ifndef STATEVARIABLES_HPP
#define STATEVARIABLES_HPP

#include "ArrayTools.hpp"
#include "CCZ4UserVariables.hpp"
#include "DiagnosticVariables.hpp"
#include "BCParity.hpp"
#include "CCZ4Variables.hpp"

/// This enum gives the index of every variable stored in the grid
enum
Expand All @@ -18,12 +18,11 @@ enum
NUM_VARS = NUM_CCZ4_VARS,
};

namespace UserVariables
namespace StateVariables
{
static const std::array<std::string, NUM_VARS> variable_names =
ccz4_variable_names;
} // namespace UserVariables
static const amrex::Vector<std::string> names = CCZ4Variables::names;

#include "UserVariables.inc.hpp"
static const std::array<BCParity, NUM_VARS> parities = CCZ4Variables::parities;
} // namespace StateVariables

#endif /* USERVARIABLES_HPP */
#endif /* STATEVARIABLES_HPP */
16 changes: 3 additions & 13 deletions Examples/BinaryBH/inputs.test
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,6 @@ isPeriodic = 0 0 0
hi_boundary = 1 1 1
lo_boundary = 1 1 2

# if reflective boundaries selected, must set
# parity of all vars (in order given by UserVariables.hpp)
# 0 = even
# 1,2,3 = odd x, y, z
# 7 = odd xyz
vars_parity = 0 0 4 6 0 5 0 0 0 4 6 0 5 0 0 1 2 3 0 1 2 3 1 2 3
#chi and hij K and Aij Theta and Gamma Gauge
vars_parity_diagnostic = 0 1 2 3 0 7
#Ham and Mom Weyl

# if sommerfeld boundaries selected, must select
# non zero asymptotic values
num_nonzero_asymptotic_vars = 5
Expand Down Expand Up @@ -164,8 +154,8 @@ extraction_levels = 0
num_points_phi = 24
num_points_theta = 37
num_modes = 3
modes = 2 0 # l m for spherical harmonics
2 1
modes = 2 0 \
2 1 \
2 2
# integral_file_prefix = "Weyl4_mode_"

Expand All @@ -184,4 +174,4 @@ amrex.fpe_trap_zero=1
amrex.fpe_trap_overflow=1

amr.plot_vars = chi # The default is to plot all state variables
amr.derive_plot_vars = Ham Mom # The default is none for derived variables.
amr.derive_plot_vars = constraints # The default is none for derived variables.
15 changes: 0 additions & 15 deletions Examples/BinaryBH/params.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,28 +95,13 @@ isPeriodic = 0 0 0
hi_boundary = 1 1 1
lo_boundary = 1 1 2

# if reflective boundaries selected, must set
# parity of all vars (in order given by UserVariables.hpp)
# 0 = even
# 1,2,3 = odd x, y, z
# 4,5,6 = odd xy, yz, xz
# 7 = odd xyz
vars_parity = 0 0 4 6 0 5 0 #chi and hij
0 0 4 6 0 5 0 #K and Aij
0 1 2 3 #Theta and Gamma
0 1 2 3 1 2 3 #lapse shift and B
vars_parity_diagnostic = 0 1 2 3 #Ham and Mom
0 7 #Weyl

# if sommerfeld boundaries selected, must select
# asymptotic values
num_nonzero_asymptotic_vars = 5
nonzero_asymptotic_vars = chi h11 h22 h33 lapse
nonzero_asymptotic_values = 1.0 1.0 1.0 1.0 1.0

# if you are using extrapolating BC:
# extrapolation_order = 1
# num_extrapolating_vars = -1
# extrapolating_vars =

#################################################
Expand Down
Loading