Line data Source code
1 0 : // Distributed under the MIT License.
2 : // See LICENSE.txt for details.
3 :
4 : #pragma once
5 :
6 : #include <complex>
7 : #include <cstddef>
8 : #include <limits>
9 : #include <memory>
10 :
11 : #include "DataStructures/SpinWeighted.hpp"
12 : #include "DataStructures/Tensor/TypeAliases.hpp"
13 : #include "Evolution/Systems/Cce/Initialize/InitializeJ.hpp"
14 : #include "Parallel/NodeLock.hpp"
15 : #include "Utilities/Gsl.hpp"
16 : #include "Utilities/Serialization/CharmPupable.hpp"
17 :
18 : /// \cond
19 : class DataVector;
20 : class ComplexDataVector;
21 : /// \endcond
22 :
23 : namespace Cce::Solutions::LinearizedBondiSachs_detail::InitializeJ {
24 : // First hypersurface Initialization for the
25 : // `Cce::Solutions::LinearizedBondiSachs` analytic solution.
26 : //
27 : // This initialization procedure should not be used except when the
28 : // `Cce::Solutions::LinearizedBondiSachs` analytic solution is used,
29 : // as a consequence, this initial data generator is deliberately not
30 : // option-creatable; it should only be obtained from the `get_initialize_j`
31 : // function of `Cce::InitializeJ::LinearizedBondiSachs`.
32 : //
33 : // It lives in its own lightweight header (depending only on `InitializeJ.hpp`,
34 : // not the heavy `LinearizedBondiSachs.hpp`/`SphericalMetricData.hpp`) so that
35 : // `InitializeJ.hpp` can bottom-include it for the `call_with_dynamic_type`
36 : // dispatch over `InitializeJ<false>::creatable_classes` without an include
37 : // cycle.
38 : struct LinearizedBondiSachs : ::Cce::InitializeJ::InitializeJ<false> {
39 : WRAPPED_PUPable_decl_template(LinearizedBondiSachs); // NOLINT
40 : explicit LinearizedBondiSachs(CkMigrateMessage* /*unused*/) {}
41 :
42 : LinearizedBondiSachs() = default;
43 :
44 : LinearizedBondiSachs(double start_time, double frequency,
45 : std::complex<double> c_2a, std::complex<double> c_2b,
46 : std::complex<double> c_3a, std::complex<double> c_3b);
47 :
48 : // Deliberately not option-creatable (see note above); obtained only via
49 : // `Cce::Solutions::LinearizedBondiSachs::get_initialize_j`. It is still in
50 : // `InitializeJ<false>::creatable_classes` so the dispatch and charm
51 : // registration see it; `factory_creatable = false` keeps it out of the
52 : // option factory.
53 : static constexpr bool factory_creatable = false;
54 :
55 : std::unique_ptr<InitializeJ> get_clone() const override;
56 :
57 : void operator()(
58 : gsl::not_null<Scalar<SpinWeighted<ComplexDataVector, 2>>*> j,
59 : gsl::not_null<tnsr::i<DataVector, 3>*> cartesian_cauchy_coordinates,
60 : gsl::not_null<
61 : tnsr::i<DataVector, 2, ::Frame::Spherical<::Frame::Inertial>>*>
62 : angular_cauchy_coordinates,
63 : const Scalar<SpinWeighted<ComplexDataVector, 2>>& boundary_j,
64 : const Scalar<SpinWeighted<ComplexDataVector, 2>>& boundary_dr_j,
65 : const Scalar<SpinWeighted<ComplexDataVector, 0>>& r,
66 : const Scalar<SpinWeighted<ComplexDataVector, 0>>& beta, size_t l_max,
67 : size_t number_of_radial_points,
68 : gsl::not_null<Parallel::NodeLock*> hdf5_lock) const;
69 :
70 : void pup(PUP::er& /*p*/) override;
71 :
72 : private:
73 : std::complex<double> c_2a_ = std::numeric_limits<double>::signaling_NaN();
74 : std::complex<double> c_2b_ = std::numeric_limits<double>::signaling_NaN();
75 : std::complex<double> c_3a_ = std::numeric_limits<double>::signaling_NaN();
76 : std::complex<double> c_3b_ = std::numeric_limits<double>::signaling_NaN();
77 : double frequency_ = std::numeric_limits<double>::signaling_NaN();
78 : double time_ = std::numeric_limits<double>::signaling_NaN();
79 : };
80 : } // namespace Cce::Solutions::LinearizedBondiSachs_detail::InitializeJ
|