Skip to content

Commit

Permalink
Merge branch 'main' into uct
Browse files Browse the repository at this point in the history
  • Loading branch information
jaykalinani committed Aug 13, 2024
2 parents 9161846 + 07cfaad commit a5f52ed
Show file tree
Hide file tree
Showing 21 changed files with 3,403 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:

# The type of runner that the job will run on
runs-on: ubuntu-latest
container: einsteintoolkit/carpetx:${{matrix.accelerator}}-${{matrix.real-precision}}
container: lwji/carpetx:${{matrix.accelerator}}-${{matrix.real-precision}}

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand Down
1 change: 1 addition & 0 deletions AsterX/schedule.ccl
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ SCHEDULE AsterX_Fluxes IN AsterX_RHSGroup
READS: dens(everywhere) tau(everywhere) mom(everywhere)
READS: HydroBaseX::rho(everywhere) HydroBaseX::vel(everywhere) HydroBaseX::press(everywhere) HydroBaseX::eps(everywhere)
READS: HydroBaseX::Bvec(everywhere)
READS: dBx_stag(everywhere) dBy_stag(everywhere) dBz_stag(everywhere)
READS: Avec_x(everywhere) Avec_y(everywhere) Avec_z(everywhere) Psi(everywhere)
WRITES: flux_x(interior) flux_y(interior) flux_z(interior)
WRITES: Aux_in_RHSof_A_Psi(interior)
Expand Down
29 changes: 25 additions & 4 deletions AsterX/src/fluxes.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ void CalcFlux(CCTK_ARGUMENTS, EOSType &eos_th) {
/* grid functions */
const vec<GF3D2<const CCTK_REAL>, dim> gf_vels{velx, vely, velz};
const vec<GF3D2<const CCTK_REAL>, dim> gf_Bvecs{Bvecx, Bvecy, Bvecz};
const vec<GF3D2<const CCTK_REAL>, dim> gf_dBstags{dBx_stag, dBy_stag, dBz_stag};
const vec<GF3D2<const CCTK_REAL>, dim> gf_beta{betax, betay, betaz};
const smat<GF3D2<const CCTK_REAL>, dim> gf_g{gxx, gxy, gxz, gyy, gyz, gzz};
/* grid functions for Upwind CT */
Expand Down Expand Up @@ -163,6 +164,10 @@ void CalcFlux(CCTK_ARGUMENTS, EOSType &eos_th) {
constexpr array<int, dim> face_centred = {!(dir == 0), !(dir == 1),
!(dir == 2)};

constexpr array<int, dim> dir_arr = {(dir==0) ? 2 : ( (dir==1) ? 0 : 1 ),
dir,
(dir==0) ? 1 : ( (dir==1) ? 2 : 0 )};

grid.loop_int_device<
face_centred[0], face_centred[1],
face_centred
Expand Down Expand Up @@ -201,10 +206,6 @@ void CalcFlux(CCTK_ARGUMENTS, EOSType &eos_th) {
eos_th.press_from_valid_rho_eps_ye(rho_rc(1), eps_min, ye_rc(1));
}

const vec<vec<CCTK_REAL, 2>, 3> Bs_rc([&](int i) ARITH_INLINE {
return vec<CCTK_REAL, 2>{reconstruct_pt(gf_Bvecs(i), p, false, false)};
});

/* Interpolate metric components from vertices to faces */
const CCTK_REAL alp_avg = calc_avg_v2f(alp, p, dir);
const vec<CCTK_REAL, 3> betas_avg(
Expand All @@ -229,6 +230,26 @@ void CalcFlux(CCTK_ARGUMENTS, EOSType &eos_th) {
return 1 / sqrt(1 - calc_contraction(vlows_rc, vels_rc)(f));
});

// Introduce reconstructed Bs
// Use staggered dB for i == dir

vec<vec<CCTK_REAL, 2>, 3> Bs_rc;
array<CCTK_REAL,2> Bs_rc_dummy; // note: can't copy array<,2> to vec<,2>, only construct

Bs_rc(dir)(0) = gf_dBstags(dir)(p.I)/sqrtg;
Bs_rc(dir)(1) = Bs_rc(dir)(0);

Bs_rc_dummy = reconstruct_pt(gf_Bvecs(dir_arr[0]), p, false, false);
Bs_rc(dir_arr[0])(0) = Bs_rc_dummy[0];
Bs_rc(dir_arr[0])(1) = Bs_rc_dummy[1];

Bs_rc_dummy = reconstruct_pt(gf_Bvecs(dir_arr[2]), p, false, false);
Bs_rc(dir_arr[2])(0) = Bs_rc_dummy[0];
Bs_rc(dir_arr[2])(1) = Bs_rc_dummy[1];

// End of setting Bs


/* alpha * b0 = W * B^i * v_i */
const vec<CCTK_REAL, 2> alp_b0_rc([&](int f) ARITH_INLINE {
return w_lorentz_rc(f) * calc_contraction(Bs_rc, vlows_rc)(f);
Expand Down
25 changes: 25 additions & 0 deletions FishboneMoncriefIDX/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
BSD 2-Clause License

Copyright (c) 2019, Zachariah Etienne
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
42 changes: 42 additions & 0 deletions FishboneMoncriefIDX/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
Cactus Code Thorn TOVSolver
Author: Zachariah B. Etienne
zachetie **at** gmail **dot* com
Maintainer(s): Einstein Toolkit
Licence : BSD 2-Clause
--------------------------------------------------------------------------

1. Purpose

This thorn constructs Fishbone-Moncrief accretion
disk initial data, within a Kerr-Schild spinning
black hole spacetime.

2. Documentation

Full documentation may be found in the NRPy+
Jupyter notebook tutorial modules:
* Tutorial-FishboneMoncriefID.ipynb and
* Tutorial-ETK_thorn-FishboneMoncriefID.ipynb ,

Both of the above notebooks are located in the
doc/ directory,

The notebooks also generate clickable LaTeX'ed versions
of themselves, and compile the LaTeX into PDFs.

3. Example parameter file

An example parameter file may be found in parfile_examples/

4. Note on automatic code generation

This thorn is automatically generated by running the
Tutorial-ETK_thorn-FishboneMoncriefID.ipynb within
NRPy+, which is also BSD 2-Clause licensed:
https://github.com/zachetienne/nrpytutorial

5. Special acknowledgement

Thanks to Brendan Drachler for spotting and fixing
a bug in an earlier release, and to Steve Brandt &
Roland Haas for code review and additional suggestions.
1 change: 1 addition & 0 deletions FishboneMoncriefIDX/configuration.ccl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
REQUIRES Loop
Loading

0 comments on commit a5f52ed

Please sign in to comment.