Skip to content

Commit

Permalink
fixup 2
Browse files Browse the repository at this point in the history
  • Loading branch information
isaaclegred committed Apr 13, 2024
1 parent 6990b04 commit 5c1a257
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 30 deletions.
1 change: 1 addition & 0 deletions src/PointwiseFunctions/Hydro/InitialData/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Distributed under the MIT License.
# See LICENSE.txt for details.

spectre_target_sources(
${LIBRARY}
PRIVATE
Expand Down
6 changes: 3 additions & 3 deletions src/PointwiseFunctions/Hydro/InitialData/IrrotationalBns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "Utilities/Gsl.hpp"
#include "Utilities/SetNumberOfGridPoints.hpp"

namespace hydro::initial_data {
namespace hydro::initial_data::irrotational_bns {
template <typename DataType>
void rotational_shift(
const gsl::not_null<tnsr::I<DataType, 3>*> result,
Expand Down Expand Up @@ -143,7 +143,7 @@ void derivative_spatial_rotational_killing_vector(
const Scalar<DataType>& /*local_angular_velocity_around_z*/,
const Scalar<DataType>& /*sqrt_det_spatial_metric*/) {
set_number_of_grid_points(result, x);
tenex::update<ti::i, ti::J>(result, 0.0 * (*result)(ti::i, ti::J));
std::fill(result->begin(), result->end(), 0.0);
}

template <typename DataType>
Expand Down Expand Up @@ -227,4 +227,4 @@ GENERATE_INSTANTIATIONS(INSTANTIATION, (double, DataVector))
#undef DTYPE
#undef INSTANTIATION

} // namespace hydro::initial_data
} // namespace hydro::initial_data::irrotational_bns
26 changes: 15 additions & 11 deletions src/PointwiseFunctions/Hydro/InitialData/IrrotationalBns.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@
#include "DataStructures/Tensor/TypeAliases.hpp"
#include "Utilities/Gsl.hpp"


/*!
* \ingroup HydroInitialDataGroup
* \brief Items related to solving for irrotational bns initial data
* See e.g. Baumgarte and Shapiro, Ch. 15 (P. 523)
* See e.g. \cite BaumgarteShapiro Ch. 15 (P. 523)
*/
namespace hydro::initial_data::irrotational_bns {
/// @{
Expand All @@ -22,11 +21,13 @@ void rotational_shift(
gsl::not_null<tnsr::I<DataType, 3>*> result,
const tnsr::I<DataType, 3>& shift,
const tnsr::I<DataType, 3>& spatial_rotational_killing_vector);
/// @}

template <typename DataType>
tnsr::I<DataType, 3> rotational_shift(
const tnsr::I<DataType, 3>& shift,
const tnsr::I<DataType, 3>& spatial_rotational_killing_vector);
/// @}

/// @{
/// \brief Compute the stress-energy corresponding to the rotation shift
///
Expand Down Expand Up @@ -68,13 +69,15 @@ tnsr::iJ<DataType, 3> derivative_rotational_shift_over_lapse(
/// the spacetime
///
/// The eqn. is identical to B&S 15.76
/// \f[
/// h^2 \rho^2 = \frac{1}{\alpha^2} \left(C + B^i D_i \Phi\right)^2 - D_i
/// \Phi D^i \Phi
/// \f]
/// Where \f$\Phi \f$ is the velocity potential, andC is the Euler-constant,
/// which in a slowly rotating, slowly orbiting configuration becomes the
/// central enthalpy squared over the central lapse squared
/*!
\f[
h^2 \rho^2 = \frac{1}{\alpha^2} \left(C + B^i D_i \Phi\right)^2 - D_i
\Phi D^i \Phi
\f]
*/
/// Where \f$\Phi \f$ is the velocity potential, and \f$C\f$ is the
/// Euler-constant, which in a slowly rotating, slowly orbiting configuration
/// becomes the central enthalpy squared over the central lapse squared
template <typename DataType>
void enthalpy_density_squared(
gsl::not_null<Scalar<DataType>*> result,
Expand Down Expand Up @@ -108,7 +111,8 @@ tnsr::I<DataType, 3> spatial_rotational_killing_vector(
/// @{
/// \brief The spatial derivative of the spatial rotational killing vector
///
/// As above, assumes uniform rotation around the z-axis
/// As for `spatial_rotational_killing_vector`, assumes uniform rotation around
/// the z-axis
template <typename DataType>
void derivative_spatial_rotational_killing_vector(
gsl::not_null<tnsr::iJ<DataType, 3>*> result, const tnsr::I<DataType, 3>& x,
Expand Down
16 changes: 2 additions & 14 deletions tests/Unit/PointwiseFunctions/Hydro/InitialData/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,13 @@ set(LIBRARY "Test_HydroInitialData")

set(LIBRARY_SOURCES
Test_IrrotationalBns.cpp
)
)

add_test_library(${LIBRARY} "${LIBRARY_SOURCES}")



target_link_libraries(
${LIBRARY}
PRIVATE
CoordinateMaps
DataStructures
DataStructuresHelpers
Domain
GeneralRelativity
GeneralRelativityHelpers
Hydro
HydroHelpers
IO
LinearOperators
Spectral
Utilities
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "Framework/SetupLocalPythonEnvironment.hpp"
#include "PointwiseFunctions/Hydro/InitialData/IrrotationalBns.hpp"

namespace hydro::initial_data {
namespace hydro::initial_data::irrotational_bns {
SPECTRE_TEST_CASE("Unit.PointwiseFunctions.Hydro.InitialData.IrrotationalBns",
"[Unit][Hydro][Elliptic]") {
pypp::SetupLocalPythonEnvironment local_python_env(
Expand Down Expand Up @@ -58,4 +58,4 @@ SPECTRE_TEST_CASE("Unit.PointwiseFunctions.Hydro.InitialData.IrrotationalBns",
"IrrotationalBns", "derivative_spatial_rotational_killing_vector",
{{{0.0, 1.0}}}, used_for_size);
}
} // namespace hydro::initial_data
} // namespace hydro::initial_data::irrotational_bns

0 comments on commit 5c1a257

Please sign in to comment.