Line data Source code
1 0 : // Distributed under the MIT License.
2 : // See LICENSE.txt for details.
3 :
4 : #pragma once
5 :
6 : #include <cstddef>
7 :
8 : #include "DataStructures/Tensor/TypeAliases.hpp"
9 : #include "Utilities/Gsl.hpp"
10 :
11 : namespace Ccz4 {
12 : /// @{
13 : /*!
14 : * \brief Computes the spatial part of the Z4 constraint
15 : *
16 : * \details Computes the constraint as:
17 : *
18 : * \f{align}
19 : * Z_i &= \frac{1}{2} \tilde{\gamma}_{ij} \left(
20 : * \hat{\Gamma}^j - \tilde{\Gamma}^j\right)
21 : * \f}
22 : *
23 : * where \f$\tilde{\gamma}_{ij}\f$ is the conformal spatial metric defined by
24 : * `Ccz4::Tags::ConformalMetric` and
25 : * \f$\left(\hat{\Gamma}^i - \tilde{\Gamma}^i\right)\f$ is the CCZ4 temporary
26 : * expression defined by
27 : * `Ccz4::Tags::GammaHatMinusContractedConformalChristoffel`.
28 : */
29 : template <typename DataType, size_t Dim, typename Frame>
30 1 : void spatial_z4_constraint(
31 : const gsl::not_null<tnsr::i<DataType, Dim, Frame>*> result,
32 : const tnsr::ii<DataType, Dim, Frame>& conformal_spatial_metric,
33 : const tnsr::I<DataType, Dim, Frame>&
34 : gamma_hat_minus_contracted_conformal_christoffel);
35 :
36 : template <typename DataType, size_t Dim, typename Frame>
37 1 : tnsr::i<DataType, Dim, Frame> spatial_z4_constraint(
38 : const tnsr::ii<DataType, Dim, Frame>& conformal_spatial_metric,
39 : const tnsr::I<DataType, Dim, Frame>&
40 : gamma_hat_minus_contracted_conformal_christoffel);
41 : /// @}
42 :
43 : /// @{
44 : /*!
45 : * \brief Computes the spatial part of the upper Z4 constraint
46 : *
47 : * \details Computes the constraint as:
48 : *
49 : * \f{align}
50 : * Z^i &= \frac{1}{2} \phi^2 \left(
51 : * \hat{\Gamma}^i - \tilde{\Gamma}^i\right)
52 : * \f}
53 : *
54 : * where \f$\phi^2 \f$ is the square of the conformal factor defined by
55 : * `Ccz4::Tags::ConformalFactorSquared` and
56 : * \f$\left(\hat{\Gamma}^i - \tilde{\Gamma}^i\right)\f$ is the CCZ4 temporary
57 : * expression defined by
58 : * `Ccz4::Tags::GammaHatMinusContractedConformalChristoffel`.
59 : */
60 : template <typename DataType, size_t Dim, typename Frame>
61 1 : void upper_spatial_z4_constraint(
62 : const gsl::not_null<tnsr::I<DataType, Dim, Frame>*> result,
63 : const Scalar<DataType>& half_conformal_factor_squared,
64 : const tnsr::I<DataType, Dim, Frame>&
65 : gamma_hat_minus_contracted_conformal_christoffel);
66 :
67 : template <typename DataType, size_t Dim, typename Frame>
68 1 : tnsr::I<DataType, Dim, Frame> upper_spatial_z4_constraint(
69 : const Scalar<DataType>& half_conformal_factor_squared,
70 : const tnsr::I<DataType, Dim, Frame>&
71 : gamma_hat_minus_contracted_conformal_christoffel);
72 : /// @}
73 : } // namespace Ccz4
|