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 gradient of the gradient of the lapse.
15 : *
16 : * \details Computes the gradient of the gradient as:
17 : * \f{align}
18 : * \nabla_i \nabla_j \alpha &= \alpha A_i A_j -
19 : * \alpha \Gamma^k{}_{ij} A_k + \alpha \partial_{(i} A_{j)}
20 : * \f}
21 : * where \f$\alpha\f$, \f$\Gamma^k{}_{ij}\f$, \f$A_i\f$, and
22 : * \f$\partial_j A_i\f$ are the lapse, spatial christoffel symbols of the second
23 : * kind, the CCZ4 auxiliary variable defined by `Ccz4::Tags::FieldA`, and its
24 : * spatial derivative, respectively.
25 : *
26 : * \note In second-order Ccz4, we impose symmetry of index i and j
27 : * in \f$ \partial_i A_j=\partial_i \partial_j \ln \alpha \f$,
28 : * because partial derivatives commute and to use
29 : * `second_partial_derivatives()`. \f$ A_i \f$ is evolved in
30 : * the first-order system so no such symmetry is imposed.
31 : */
32 : template <typename DataType, size_t Dim, typename Frame, typename TensorType>
33 1 : void grad_grad_lapse(
34 : const gsl::not_null<tnsr::ij<DataType, Dim, Frame>*> result,
35 : const Scalar<DataType>& lapse,
36 : const tnsr::Ijj<DataType, Dim, Frame>& christoffel_second_kind,
37 : const tnsr::i<DataType, Dim, Frame>& field_a, const TensorType& d_field_a);
38 :
39 : template <typename DataType, size_t Dim, typename Frame, typename TensorType>
40 1 : tnsr::ij<DataType, Dim, Frame> grad_grad_lapse(
41 : const Scalar<DataType>& lapse,
42 : const tnsr::Ijj<DataType, Dim, Frame>& christoffel_second_kind,
43 : const tnsr::i<DataType, Dim, Frame>& field_a, const TensorType& d_field_a);
44 :
45 : /// @}
46 :
47 : /// @{
48 : /*!
49 : * \ingroup GeneralRelativityGroup
50 : * \brief Computes the divergence of the lapse.
51 : *
52 : * \details Computes the divergence as:
53 : * \f{align}
54 : * \nabla^i \nabla_i \alpha &= \phi^2 \tilde{\gamma}^{ij}
55 : * (\nabla_i \nabla_j \alpha)
56 : * \f}
57 : * where \f$\phi\f$, \f$\tilde{\gamma}^{ij}\f$, and
58 : * \f$\nabla_i \nabla_j \alpha\f$ are the conformal factor, inverse conformal
59 : * spatial metric, and the gradient of the gradient of the lapse defined by
60 : * `Ccz4::Tags::ConformalFactor`, `Ccz4::Tags::InverseConformalMetric`, and
61 : * `Ccz4::Tags::GradGradLapse`, respectively.
62 : */
63 : template <typename DataType, size_t Dim, typename Frame>
64 1 : void divergence_lapse(
65 : const gsl::not_null<Scalar<DataType>*> result,
66 : const Scalar<DataType>& conformal_factor_squared,
67 : const tnsr::II<DataType, Dim, Frame>& inverse_conformal_metric,
68 : const tnsr::ij<DataType, Dim, Frame>& grad_grad_lapse);
69 :
70 : template <typename DataType, size_t Dim, typename Frame>
71 1 : Scalar<DataType> divergence_lapse(
72 : const Scalar<DataType>& conformal_factor_squared,
73 : const tnsr::II<DataType, Dim, Frame>& inverse_conformal_metric,
74 : const tnsr::ij<DataType, Dim, Frame>& grad_grad_lapse);
75 : /// @}
76 : } // namespace Ccz4
|