From 738d505911bf6292cec1db3caaa52ad5806c03cd Mon Sep 17 00:00:00 2001 From: Iago Mendes Date: Thu, 19 Sep 2024 02:43:07 -0700 Subject: [PATCH] fixup: specify if integrands need to be integrated with conformal/flat elements. --- .../Systems/Xcts/Events/ObserveAdmIntegrals.cpp | 12 +++++++----- src/PointwiseFunctions/Xcts/AdmLinearMomentum.hpp | 7 +++++++ src/PointwiseFunctions/Xcts/AdmMass.hpp | 11 +++++++++-- src/PointwiseFunctions/Xcts/CenterOfMass.hpp | 6 ++++++ 4 files changed, 29 insertions(+), 7 deletions(-) diff --git a/src/Elliptic/Systems/Xcts/Events/ObserveAdmIntegrals.cpp b/src/Elliptic/Systems/Xcts/Events/ObserveAdmIntegrals.cpp index cfbaaea52421..1a457745f76d 100644 --- a/src/Elliptic/Systems/Xcts/Events/ObserveAdmIntegrals.cpp +++ b/src/Elliptic/Systems/Xcts/Events/ObserveAdmIntegrals.cpp @@ -104,6 +104,9 @@ void local_adm_integrals( const auto& face_mesh = mesh.slice_away(boundary_direction.dimension()); const auto& conformal_face_normal = conformal_face_normals.at(boundary_direction); + const auto face_normal_magnitude = magnitude(conformal_face_normal); + const auto flat_face_normal = tenex::evaluate( + conformal_face_normal(ti::i) / face_normal_magnitude()); // Compute curved and flat area elements const auto face_sqrt_det_conformal_metric = @@ -131,17 +134,16 @@ void local_adm_integrals( const auto contracted_mass_integrand = tenex::evaluate(mass_integrand(ti::I) * conformal_face_normal(ti::i)); const auto contracted_linear_momentum_integrand = tenex::evaluate( - linear_momentum_integrand(ti::I, ti::J) * conformal_face_normal(ti::j)); + linear_momentum_integrand(ti::I, ti::J) * flat_face_normal(ti::j)); // Take integrals adm_mass->get() += definite_integral( get(contracted_mass_integrand) * get(conformal_area_element), face_mesh); for (int I = 0; I < 3; I++) { - adm_linear_momentum->get(I) += - definite_integral(contracted_linear_momentum_integrand.get(I) * - get(conformal_area_element), - face_mesh); + adm_linear_momentum->get(I) += definite_integral( + contracted_linear_momentum_integrand.get(I) * get(flat_area_element), + face_mesh); center_of_mass->get(I) += definite_integral( center_of_mass_integrand.get(I) * get(flat_area_element), face_mesh); } diff --git a/src/PointwiseFunctions/Xcts/AdmLinearMomentum.hpp b/src/PointwiseFunctions/Xcts/AdmLinearMomentum.hpp index 7e3a32737085..df45b5521a75 100644 --- a/src/PointwiseFunctions/Xcts/AdmLinearMomentum.hpp +++ b/src/PointwiseFunctions/Xcts/AdmLinearMomentum.hpp @@ -23,6 +23,10 @@ namespace Xcts { * \Big) \, dS_j. * \end{equation} * + * \note For consistency with `adm_linear_momentum_volume_integrand`, this + * integrand needs to be contracted with the Euclidean face normal and + * integrated with the Euclidean area element. + * * \param result output pointer * \param conformal_factor the conformal factor $\psi$ * \param inv_spatial_metric the inverse spatial metric $\gamma^{ij}$ @@ -62,6 +66,9 @@ tnsr::II adm_linear_momentum_surface_integrand( * where $1/(8\pi) P^{jk}$ is the result from * `adm_linear_momentum_surface_integrand`. * + * \note For consistency with `adm_linear_momentum_surface_integrand`, this + * integrand needs to be integrated with the Euclidean volume element. + * * \param result output pointer * \param surface_integrand the quantity $1/(8\pi) P^{ij}$ (result of * `adm_linear_momentum_surface_integrand`) diff --git a/src/PointwiseFunctions/Xcts/AdmMass.hpp b/src/PointwiseFunctions/Xcts/AdmMass.hpp index a55fb8fbf0ff..17d7a6b13dfc 100644 --- a/src/PointwiseFunctions/Xcts/AdmMass.hpp +++ b/src/PointwiseFunctions/Xcts/AdmMass.hpp @@ -21,13 +21,17 @@ namespace Xcts { * \bar\gamma^{jk} \bar\Gamma^i_{jk} * - \bar\gamma^{ij} \bar\Gamma_{j} * - 8 \bar\gamma^{ij} \partial_j \psi - * \Big) dS_i. + * \Big) d\bar{S}_i. * \end{equation} * * \note We don't use the other versions presented in \cite BaumgarteShapiro of * this integral because they make assumptions like $\bar\gamma = 1$, * $\bar\Gamma^i_{ij} = 0$ and faster fall-off of the conformal metric. * + * \note For consistency with `adm_mass_volume_integrand`, this integrand needs + * to be contracted with the conformal face normal and integrated with the + * conformal area element. + * * \param result output pointer * \param deriv_conformal_factor the gradient of the conformal factor * $\partial_i \psi$ @@ -69,7 +73,7 @@ tnsr::I adm_mass_surface_integrand( * - \bar\gamma^{ij} \partial_i \bar\Gamma_j * - \bar\Gamma_l \bar\gamma^{lj} \bar\Gamma_j * - 8 \bar D^2 \psi - * \Big) dV, + * \Big) d\bar{V}, * \end{equation} * * where we can use the Hamiltonian constraint (Eq. 3.37 in @@ -86,6 +90,9 @@ tnsr::I adm_mass_surface_integrand( * \note This is similar to Eq. 3.149 in \cite BaumgarteShapiro, except that * here we don't assume $\bar\gamma = 1$. * + * \note For consistency with `adm_mass_surface_integrand`, this integrand needs + * to be integrated with the conformal volume element. + * * \param result output pointer * \param conformal_factor the conformal factor * \param conformal_ricci_scalar the conformal Ricci scalar $\bar R$ diff --git a/src/PointwiseFunctions/Xcts/CenterOfMass.hpp b/src/PointwiseFunctions/Xcts/CenterOfMass.hpp index c02b29596313..ed913d725720 100644 --- a/src/PointwiseFunctions/Xcts/CenterOfMass.hpp +++ b/src/PointwiseFunctions/Xcts/CenterOfMass.hpp @@ -26,6 +26,9 @@ namespace Xcts { * \note We don't include the ADM mass $M_{ADM}$ in this integrand. After * integrating the result of this function, you have to divide by $M_{ADM}$. * + * \note For consistency with `center_of_mass_volume_integrand`, this + * integrand needs to be integrated with the Euclidean area element. + * * \see `Xcts::adm_mass_surface_integrand` * * \warning This integral assumes that the conformal metric falls off to @@ -71,6 +74,9 @@ tnsr::I center_of_mass_surface_integrand( * * where $n^i = x^i / r$ and $r = \sqrt{x^2 + y^2 + z^2}$. * + * \note For consistency with `center_of_mass_surface_integrand`, this + * integrand needs to be integrated with the Euclidean volume element. + * * \see `center_of_mass_surface_integrand` * * \param result output pointer