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

Apply radiative boundary conditions to Z4c variables #19

Merged
merged 21 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
ce1ec93
Z4c: Apply radiative boundary conditions via NewRadX
Sep 25, 2023
98e1943
Merge branch 'lwJi:main' into main
jaykalinani Oct 20, 2023
2a658d3
TwoPuncturesX: Add missing sync to metric variables in schedule
jaykalinani Oct 20, 2023
9e673ff
Z4c: Fixes suggested in PR
jaykalinani Oct 25, 2023
ad5b080
Z4c: Bug fix in schedule.ccl
jaykalinani Oct 25, 2023
976c7ec
NewRadX: Add "Provides" statement in configuration.ccl
jaykalinani Oct 27, 2023
ff77725
TwoPuncturesX: Revert back to original schedule.ccl
jaykalinani Oct 27, 2023
e7b4a2e
Z4c: Fixes suggested in PR. Add new test case
jaykalinani Oct 27, 2023
030d533
Z4c: Update the unit test
jaykalinani Nov 1, 2023
481707b
Z4c: Fix unit test
jaykalinani Nov 2, 2023
f7935c8
Z4c: Remove weyl output from test
jaykalinani Nov 2, 2023
cea62b5
Merge branch 'LJ_main' into main
jaykalinani Nov 2, 2023
52f314f
Z4c: Remove NewRadX parameter from parfile
jaykalinani Nov 2, 2023
c657b73
Z4c: Update qc0 unit test
jaykalinani Nov 2, 2023
89d415d
Z4c: Update qc0 unit test
lwJi Nov 3, 2023
794caa8
Z4c: Update schedule for apply_boundary_conditions
lwJi Nov 21, 2023
3433f13
Z4c: Modify field value at infinity for apply_boundary_conditions
lwJi Nov 21, 2023
22d7c17
Z4c: Set radpower=1 for all vars in radiative boundary condition
lwJi Nov 21, 2023
2d49665
Z4c: Sync rhs before applying radiative boundary conditions
lwJi Nov 23, 2023
587f907
Z4c: Update schedule for radiative boundary conditions
lwJi Nov 23, 2023
0842024
Z4c: Fixes suggested in PR
lwJi Nov 28, 2023
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
7 changes: 4 additions & 3 deletions TwoPuncturesX/schedule.ccl
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ if (CCTK_Equals(initial_data, "twopunctures"))
STORAGE: puncture_u
# TODO: these WRITES are conditional on parameters
READS: CoordinatesX::vertex_coords(everywhere)
WRITES: ADMBaseX::metric(everywhere)
lwJi marked this conversation as resolved.
Show resolved Hide resolved
WRITES: ADMBaseX::curv(everywhere)
WRITES: ADMBaseX::lapse(everywhere)
WRITES: ADMBaseX::metric(interior)
WRITES: ADMBaseX::curv(interior)
WRITES: ADMBaseX::lapse(interior)
WRITES: puncture_u(everywhere)
WRITES: mp, mm, mp_adm, mm_adm, E, J1, J2, J3
SYNC: ADMBaseX::metric ADMBaseX::lapse ADMBaseX::curv
} "Create puncture black hole initial data"

SCHEDULE TwoPuncturesX_Metadata IN TwoPuncturesX_Group AFTER TwoPuncturesX
Expand Down
2 changes: 1 addition & 1 deletion Z4c/interface.ccl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ USES INCLUDE HEADER: simd.hxx
USES INCLUDE HEADER: sum.hxx
USES INCLUDE HEADER: vec.hxx
USES INCLUDE HEADER: vect.hxx

USES INCLUDE HEADER: newradx.hxx
lwJi marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The list of include files should be sorted alphabetically.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The above comment suggested instead to add another line instead. Let me know if you prefer an additional line or all header files sorted alphabetically.


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add another empty line here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. However, the following comment suggests arranging the header files alphabetically. For now, I have added an empty line. Should I rather arrange everything alphabetically and remove the empty line?


CCTK_INT FUNCTION GetCallFunctionCount()
Expand Down
7 changes: 5 additions & 2 deletions Z4c/param.ccl
lwJi marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ BOOLEAN calc_constraints "Calculate constraints" STEERABLE=recover
{
} yes


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you deleting these lines? They separate two groups of parameters.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.


BOOLEAN set_Theta_zero "set Theta to zero, which converts Z4c to BSSN"
{
} no
Expand Down Expand Up @@ -57,3 +55,8 @@ CCTK_REAL epsdiss "Dissipation coefficient <arXiv:gr-qc/0610128>" STEERABLE=alwa
{
0.0:* :: ""
} 0.32

KEYWORD boundary_conditions "boundary conditions"{
"radiative" :: "radiative boundary conditions using NewRadX"
"none" :: "use CarpetX default BCS"
lwJi marked this conversation as resolved.
Show resolved Hide resolved
} "none"
21 changes: 21 additions & 0 deletions Z4c/schedule.ccl
Original file line number Diff line number Diff line change
Expand Up @@ -256,3 +256,24 @@ SCHEDULE Z4c_RHS IN Z4c_RHSGroup
# SYNC: alphaG_rhs
# SYNC: betaG_rhs
} "Calculate Z4c RHS"

SCHEDULE Z4c_apply_boundary_conditions IN ODESolvers_RHS AFTER Z4c_RHS
lwJi marked this conversation as resolved.
Show resolved Hide resolved
{
LANG: C
READS: chi(interior)
READS: gamma_tilde(interior)
READS: K_hat(interior)
READS: A_tilde(interior)
READS: Gam_tilde(interior)
READS: Theta(interior)
READS: alphaG(interior)
READS: betaG(interior)
WRITES: chi_rhs(interior)
WRITES: gamma_tilde_rhs(interior)
WRITES: K_hat_rhs(interior)
WRITES: A_tilde_rhs(interior)
WRITES: Gam_tilde_rhs(interior)
WRITES: Theta_rhs(interior)
WRITES: alphaG_rhs(interior)
WRITES: betaG_rhs(interior)
} "Apply NewRad boundary conditions to Z4c RHS variables"
48 changes: 48 additions & 0 deletions Z4c/src/apply_newrad.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// Apply NewRadX boundary conditions to Z4c variables
//=============================================================================

#include "cctk.h"
lwJi marked this conversation as resolved.
Show resolved Hide resolved
#include "cctk_Arguments.h"
#include "cctk_Parameters.h"
#include "loop_device.hxx"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need loop_device.hxx here.

#include "newradx.hxx"

using namespace Loop;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are not using Loop nor std in this file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

using namespace std;
using namespace NewRadX;

namespace Z4c {

extern "C" void Z4c_apply_boundary_conditions(CCTK_ARGUMENTS){
DECLARE_CCTK_ARGUMENTSX_Z4c_apply_boundary_conditions;
DECLARE_CCTK_PARAMETERS;

if (CCTK_Equals(boundary_conditions, "radiative")) {
lwJi marked this conversation as resolved.
Show resolved Hide resolved

NewRadX_Apply(cctkGH, chi, chi_rhs, 0, 1, 1);
NewRadX_Apply(cctkGH, gammatxx, gammatxx_rhs, 0, 1, 1);
NewRadX_Apply(cctkGH, gammatxy, gammatxy_rhs, 0, 1, 1);
NewRadX_Apply(cctkGH, gammatxz, gammatxz_rhs, 0, 1, 1);
NewRadX_Apply(cctkGH, gammatyy, gammatyy_rhs, 0, 1, 1);
NewRadX_Apply(cctkGH, gammatyz, gammatyz_rhs, 0, 1, 1);
NewRadX_Apply(cctkGH, gammatzz, gammatzz_rhs, 0, 1, 1);
NewRadX_Apply(cctkGH, Kh, Kh_rhs, 0, 1, 1);
NewRadX_Apply(cctkGH, Atxx, Atxx_rhs, 0, 1, 2);
NewRadX_Apply(cctkGH, Atxy, Atxy_rhs, 0, 1, 2);
NewRadX_Apply(cctkGH, Atxz, Atxz_rhs, 0, 1, 2);
NewRadX_Apply(cctkGH, Atyy, Atyy_rhs, 0, 1, 2);
NewRadX_Apply(cctkGH, Atyz, Atyz_rhs, 0, 1, 2);
NewRadX_Apply(cctkGH, Atzz, Atzz_rhs, 0, 1, 2);
NewRadX_Apply(cctkGH, Gamtx, Gamtx_rhs, 0, 1, 1);
NewRadX_Apply(cctkGH, Gamty, Gamty_rhs, 0, 1, 1);
NewRadX_Apply(cctkGH, Gamtz, Gamtz_rhs, 0, 1, 1);
NewRadX_Apply(cctkGH, Theta, Theta_rhs, 0, 1, 1);
NewRadX_Apply(cctkGH, alphaG, alphaG_rhs, 1, 1, 1);
NewRadX_Apply(cctkGH, betaGx, betaGx_rhs, 0, 1, 1);
NewRadX_Apply(cctkGH, betaGy, betaGy_rhs, 0, 1, 1);
NewRadX_Apply(cctkGH, betaGz, betaGz_rhs, 0, 1, 1);

}
}

}
1 change: 1 addition & 0 deletions Z4c/src/make.code.defn
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
SRCS = \
adm.cxx \
adm2.cxx \
apply_newrad.cxx \
constraints.cxx \
enforce.cxx \
initial1.cxx \
Expand Down