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

Z4c: fix typo in calculating HC and MtC #47

Merged
merged 2 commits into from
Nov 12, 2024
Merged
Changes from all commits
Commits
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
9 changes: 6 additions & 3 deletions Z4c/src/z4c_vars.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -538,11 +538,14 @@ template <typename T> struct z4c_vars : z4c_vars_noderivs<T> {
// Constraints
// (13)
ZtC([&](int a) ARITH_INLINE { return (Gamt(a) - Gamtd(a)) / 2; }), //
// For the Hamiltonian and momentum constraints, the equations in
// 1212.2901 is incorrect, whereas the one in 0912.2920 is correct,
// as double-checked by Liwei Ji.
// (14)
HC(Rsc //
+ sum_symm<3>([&](int x, int y)
- sum_symm<3>([&](int x, int y)
ARITH_INLINE { return At(x, y) * Atu(x, y); }) //
- 2 / T(3) * pow2(Kh + 2 * Theta) //
+ 2 / T(3) * pow2(Kh + 2 * Theta) //
- 16 * T(M_PI) * rho),
// (15)
MtC([&](int a) ARITH_INLINE {
Expand All @@ -554,7 +557,7 @@ template <typename T> struct z4c_vars : z4c_vars_noderivs<T> {
return (delta3(a, x) + gammatu(a, x)) *
(dKh(x) + 2 * dTheta(x));
}) //
- 2 / T(3) * sum<3>([&](int x) ARITH_INLINE {
- 3 / T(2) * sum<3>([&](int x) ARITH_INLINE {
return Atu(a, x) * dchi(x) / (1 + chi);
}) //
- 8 * T(M_PI) * sum<3>([&](int x) ARITH_INLINE {
Expand Down