Skip to content

Commit

Permalink
Corrections for symmetry factor feature in GRChombo (#26)
Browse files Browse the repository at this point in the history
* Corrections for symmetry factor feature in GRChombo

Corrected the params files and any uses of AMRReductions in
both of the Examples, to account for the integral symmetry factor
feature in GRChombo (see GRChombo Issue No. 197). Specifically:

1. Added the symmetry_correction flag to the params files
(under the Boundary Condition parameters)
2. Provided the chombo parameter storing the symmetry factor
to every instance of the norm and sum AMRReductions functions,
in the specificPostTimeStep() function for each example.

Note that the symmetry factor is calculated entirely in the
ChomboParameters.h file of the main GRChombo repo.

* Corrections for symmetry factor feature in GRChombo

Added the symmetry factor flag to params for both examples,
enabling calls to AMRReductions the ability to correct for
symmetry factor associated with reflective boundary conditions
(see Issue 197).

* Removed symmetry factor from amr_reductions

* Removed symmetry_correction flag

* Update intel test, as in GRChombo

* Small changes in tests

* Revert "Small changes in tests"

This reverts commit ac53bf2.

* Small changes to tests

* Remove output path in aparams and symmetry factors in conservation plots

* Remove mpi matrix

* typo fix

* Comment out max_steps line

---------

Co-authored-by: dinatraykova <dina.traykova@aei.mpg.de>
  • Loading branch information
the-florist and dinatraykova authored Nov 5, 2024
1 parent 90fe0ba commit 41e18f5
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/joss-paper.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
# This should be the path to the paper within your repo.
paper-path: paper/paper.md
- name: Upload
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v4
with:
name: paper
# This is the output path where Pandoc will write the compiled
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/run-grdzhadzha-tests-intel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [push]

jobs:
build-and-test:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
env:
CHOMBO_HOME: ${{ github.workspace }}/Chombo/lib
OMP_NUM_THREADS: 1
Expand Down Expand Up @@ -34,12 +34,13 @@ jobs:
sudo apt-get update
sudo apt-get -y --no-install-recommends install csh libgetopt-complete-perl
- name: Install Intel compilers/MPI
- name: Install Intel compilers
run: |
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main"
sudo apt-get -y install intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic intel-oneapi-compiler-fortran intel-oneapi-mkl intel-oneapi-mpi intel-oneapi-mpi-devel intel-oneapi-openmp
wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \
| gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null
echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
sudo apt-get update
sudo apt-get -y install intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic-2023.2.4 intel-oneapi-compiler-fortran-2023.2.4 intel-oneapi-mkl-2023.2.0 intel-oneapi-openmp-2023.2.4 intel-oneapi-mpi intel-oneapi-mpi-devel
working-directory: /tmp

- name: Build Chombo
Expand Down
6 changes: 3 additions & 3 deletions Examples/BoostedBHComplexScalar/params.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
verbosity = 0

# location / naming of output files
# output_path = "" # Main path for all files. Must exist!
output_path = "" # Main path for all files. Must exist!
chk_prefix = BoostedBH_
plot_prefix = BoostedBHp_
# restart_file = BoostedBH_000000.3d.hdf5
Expand Down Expand Up @@ -122,7 +122,7 @@ lo_boundary = 3 2 2
vars_parity = 0 0 0 0 #phi and Pi (Re and Im)
vars_parity_diagnostic = 0 0 0 #chi, rhoLinMom and rhoEnergy
0 0 0 #fluxLinMom, fluxEnergy and sourceLinMom

# if sommerfeld boundaries selected, must select
# non zero asymptotic values
num_nonzero_asymptotic_vars = 0
Expand All @@ -143,7 +143,7 @@ extrapolation_order = 0
# dt will be dx*dt_multiplier on each grid level
dt_multiplier = 0.1
stop_time = 250.0
# max_steps = 4
#max_steps = 4

nan_check = 1

Expand Down
8 changes: 3 additions & 5 deletions Examples/BoostedBHComplexScalar/plot_conservation.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,13 @@
plt.rcParams.update({'figure.figsize' : '6, 4.2'})
plt.rcParams.update({'figure.autolayout': True})

symmetry = 4.0

EMS = np.loadtxt('data/EnergyIntegrals.dat')
F = np.loadtxt('data/FluxIntegrals.dat')
timedata = EMS[:,0][1:]
dt = timedata[1] - timedata[0]
E = EMS[:,1][1:]*symmetry
M = EMS[:,2][1:]*symmetry
S = EMS[:,3][1:]*symmetry
E = EMS[:,1][1:]
M = EMS[:,2][1:]
S = EMS[:,3][1:]
E0 = E-E[0]
M0 = M-M[0]
FEi = F[:,1]
Expand Down
2 changes: 1 addition & 1 deletion Examples/KerrBHScalarField/params.txt
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ lo_boundary = 1 1 2
vars_parity = 0 0 0 0 #phi and Pi (Re and Im)
vars_parity_diagnostic = 0 0 0 #chi, rhoEnergy and rhoAngMom
0 0 0 #sourceAngMom, fluxAngMom and fluxEnergy

# if sommerfeld boundaries selected, must select
# non zero asymptotic values
num_nonzero_asymptotic_vars = 0
Expand Down
6 changes: 2 additions & 4 deletions Examples/KerrBHScalarField/plot_conservation.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,12 @@
plt.rcParams.update({'figure.figsize' : '6, 4.2'})
plt.rcParams.update({'figure.autolayout': True})

symmetry = 2.0

EMS = np.loadtxt('data/EnergyIntegrals.dat')
F = np.loadtxt('data/FluxIntegrals.dat')
timedata = EMS[:,0][1:]
dt = timedata[1] - timedata[0]
E = EMS[:,1][1:]*symmetry
M = EMS[:,2][1:]*symmetry
E = EMS[:,1][1:]
M = EMS[:,2][1:]
E0 = E-E[0]
M0 = M-M[0]
FEi = F[:,1]
Expand Down

0 comments on commit 41e18f5

Please sign in to comment.