Line data Source code
1 0 : // Distributed under the MIT License.
2 : // See LICENSE.txt for details.
3 :
4 : #pragma once
5 :
6 : #include <array>
7 : #include <cstddef>
8 : #include <optional>
9 : #include <string>
10 :
11 : #include "DataStructures/Tensor/TypeAliases.hpp"
12 : #include "NumericalAlgorithms/LinearOperators/PartialDerivatives.hpp"
13 : #include "Options/String.hpp"
14 : #include "PointwiseFunctions/AnalyticSolutions/AnalyticSolution.hpp"
15 : #include "PointwiseFunctions/AnalyticSolutions/RelativisticEuler/Solutions.hpp"
16 : #include "PointwiseFunctions/Hydro/EquationsOfState/PolytropicFluid.hpp"
17 : #include "PointwiseFunctions/Hydro/Temperature.hpp"
18 : #include "PointwiseFunctions/InitialDataUtilities/InitialData.hpp"
19 : #include "Utilities/TMPL.hpp"
20 : #include "Utilities/TaggedTuple.hpp"
21 :
22 : namespace RelativisticEuler::Solutions {
23 : namespace detail {
24 : /*!
25 : * \brief Read the CST rotating neutron star solution from file, rescaling the
26 : * solution assuming a polytropic constant `kappa`
27 : *
28 : * The CST RotNS code uses `kappa=1`.
29 : */
30 : class CstSolution {
31 : public:
32 : CstSolution() = default;
33 : CstSolution(const std::string& filename, double kappa);
34 :
35 : std::array<double, 6> interpolate(double target_radius,
36 : double target_cos_theta,
37 : bool interpolate_hydro_vars) const;
38 :
39 : double polytropic_index() const { return polytropic_index_; }
40 :
41 : double equatorial_radius() const { return equatorial_radius_; }
42 :
43 : void pup(PUP::er& p);
44 :
45 : private:
46 : double maximum_radius_{std::numeric_limits<double>::signaling_NaN()};
47 : double max_density_ratio_for_linear_interpolation_ = 1.0e2;
48 :
49 : double equatorial_radius_{std::numeric_limits<double>::signaling_NaN()};
50 : double polytropic_index_{std::numeric_limits<double>::signaling_NaN()};
51 : double central_angular_speed_{std::numeric_limits<double>::signaling_NaN()};
52 : double rotation_profile_{std::numeric_limits<double>::signaling_NaN()};
53 : size_t num_radial_points_{std::numeric_limits<size_t>::max()};
54 : size_t num_angular_points_{std::numeric_limits<size_t>::max()};
55 : size_t num_grid_points_{std::numeric_limits<size_t>::max()};
56 :
57 : DataVector radius_;
58 : DataVector cos_theta_; // Note that cos(theta) is between 0 and 1.
59 : DataVector rest_mass_density_;
60 : DataVector fluid_velocity_;
61 : DataVector alpha_;
62 : DataVector rho_;
63 : DataVector gamma_;
64 : DataVector omega_;
65 : };
66 : } // namespace detail
67 :
68 : /*!
69 : * \brief A solution obtained by reading in rotating neutron star initial data
70 : * from the RotNS code based on \cite Cook1992 and \cite Cook1994.
71 : *
72 : * The code that generates the initial data is part of a private SXS repository
73 : * called `RotNS`.
74 : *
75 : * The metric in spherical coordinates is given by \cite Cook1992
76 : *
77 : * \f{align}{
78 : * ds^2=-e^{\gamma+\rho}dt^2+e^{2\alpha}(dr^2+r^2d\theta^2)
79 : * +e^{\gamma-\rho}r^2\sin^2(\theta)(d\phi-\omega dt)^2.
80 : * \f}
81 : *
82 : * We use rotation about the \f$z\f$-axis. That is,
83 : *
84 : * \f{align}{
85 : * g_{tt}
86 : * &=-e^{\gamma+\rho} + e^{\gamma-\rho}r^2\sin^2(\theta)\omega^2 \\
87 : * g_{rr}
88 : * &=e^{2\alpha} \\
89 : * g_{\theta\theta}
90 : * &=e^{2\alpha}r^2 \\
91 : * g_{\phi\phi}
92 : * &=e^{\gamma-\rho}r^2\sin^2(\theta) \\
93 : * g_{t\phi}
94 : * &=-e^{\gamma-\rho}r^2\sin^2(\theta)\omega.
95 : * \f}
96 : *
97 : * We can transform from spherical to Cartesian coordinates using
98 : *
99 : * \f{align}{
100 : * \label{eq:Jacobian}
101 : * \frac{\partial (r,\theta,\phi)}{\partial (x,y,z)}=
102 : * \begin{pmatrix}
103 : * \cos(\phi) \sin(\theta) & \sin(\theta)\sin(\phi) & \cos(\theta) \\
104 : * \tfrac{\cos(\phi)\cos(\theta)}{r} & \tfrac{\sin(\phi)\cos(\theta)}{r}
105 : * & -\tfrac{\sin(\theta)}{r} \\
106 : * -\tfrac{\sin(\phi)}{r\sin(\theta)} & \tfrac{\cos(\phi)}{r\sin(\theta)}
107 : * & 0
108 : * \end{pmatrix}
109 : * \f}
110 : *
111 : * and
112 : *
113 : * \f{align}{
114 : * \frac{\partial (x,y,z)}{\partial (r,\theta,\phi)}=
115 : * \begin{pmatrix}
116 : * \cos(\phi) \sin(\theta) & r\cos(\phi)\cos(\theta) &
117 : * -r\sin(\theta)\sin(\phi)
118 : * \\
119 : * \sin(\theta)\sin(\phi) & r\sin(\phi)\cos(\theta) &
120 : * r\cos(\phi)\sin(\theta)
121 : * \\
122 : * \cos(\theta) & -r\sin(\theta) & 0
123 : * \end{pmatrix}
124 : * \f}
125 : *
126 : *
127 : * We denote the lapse as \f$N\f$ since \f$\alpha\f$ is already being used,
128 : *
129 : * \f{align}{
130 : * N = e^{(\gamma+\rho)/2}.
131 : * \f}
132 : *
133 : * The shift is
134 : *
135 : * \f{align}{
136 : * \beta^\phi =& -\omega
137 : * \f}
138 : *
139 : * so
140 : *
141 : * \f{align}{
142 : * \beta^x &= \partial_\phi x \beta^\phi = \sin(\phi)\omega r \sin(\theta), \\
143 : * \beta^y &= \partial_\phi y \beta^\phi = -\cos(\phi)\omega r \sin(\theta),
144 : * \\ \beta^z &= 0. \f}
145 : *
146 : * The spatial metric is
147 : *
148 : * \f{align}{
149 : * \gamma_{xx}
150 : * &= \sin^2(\theta)\cos^2(\phi) e^{(2 \alpha)}
151 : * + \cos^2(\theta)\cos^2(\phi) e^{(2 \alpha)}
152 : * + \sin^2(\phi) e^{(\gamma-\rho)} \notag \\
153 : * &=\cos^2(\phi)e^{2\alpha} + \sin^2(\phi) e^{(\gamma-\rho)} \\
154 : * \gamma_{xy}
155 : * &= \sin^2(\theta)\cos(\phi)\sin(\phi) e^{(2 \alpha)}
156 : * + \cos^2(\theta)\cos(\phi)\sin(\phi) e^{(2 \alpha)}
157 : * - \sin(\phi)\cos(\phi) e^{(\gamma-\rho)} \notag \\
158 : * &=\cos(\phi)\sin(\phi)e^{2\alpha} - \sin(\phi)\cos(\phi) e^{(\gamma-\rho)}
159 : * \\ \gamma_{yy}
160 : * &= \sin^2(\theta)\sin^2(\phi) e^{(2 \alpha)}
161 : * + \cos^2(\theta)\sin^2(\phi) e^{(2 \alpha)}
162 : * + \cos^2(\phi) e^{(\gamma-\rho)} \notag \\
163 : * &=\sin^2(\phi)e^{2\alpha} + \cos^2(\phi) e^{(\gamma-\rho)} \\
164 : * \gamma_{xz}
165 : * &= \sin(\theta)\cos(\phi)\cos(\theta) e^{2\alpha}
166 : * -\cos(\theta)\cos(\phi)\sin(\theta)e^{2\alpha} = 0 \\
167 : * \gamma_{yz}
168 : * &= \sin(\theta)\sin(\phi)\cos(\theta) e^{2\alpha}
169 : * -\cos(\theta)\sin(\phi)\sin(\theta)e^{2\alpha} = 0 \\
170 : * \gamma_{zz}
171 : * &=\cos^2(\theta)e^{2\alpha} + \sin^2(\theta) e^{2\alpha}
172 : * = e^{2\alpha}
173 : * \f}
174 : *
175 : * and its determinant is
176 : *
177 : * \f{align}{
178 : * \gamma = e^{4\alpha + (\gamma-\rho)} = e^{4\alpha}e^{(\gamma-\rho)}.
179 : * \f}
180 : *
181 : * At \f$r=0\f$ we have \f$2\alpha=\gamma-\rho\f$ and so the
182 : * \f$\gamma_{xx}=\gamma_{yy}=\gamma_{zz} = e^{2\alpha}\f$ and all other
183 : * components are zero. The inverse spatial metric is given by
184 : *
185 : * \f{align}{
186 : * \gamma^{xx}
187 : * &= \frac{\gamma_{yy}}{e^{2\alpha}e^{(\gamma-\rho)}} =
188 : * \left[\sin^2(\phi)e^{2\alpha} + \cos^2(\phi) e^{(\gamma-\rho)}\right]
189 : * e^{-2\alpha} e^{-(\gamma-\rho)} \notag \\
190 : * &=\sin^2(\phi)e^{-(\gamma-\rho)} + \cos^2(\phi) e^{-2\alpha} \\
191 : * \gamma^{yy}
192 : * &= \frac{\gamma_{xx}}{e^{2\alpha}e^{(\gamma-\rho)}} =
193 : * \left[\cos^2(\phi)e^{2\alpha} + \sin^2(\phi) e^{(\gamma-\rho)}\right]
194 : * e^{-2\alpha} e^{-(\gamma-\rho)} \notag \\
195 : * &=\cos^2(\phi) e^{-(\gamma-\rho)} + \sin^2(\phi) e^{-2\alpha} \\
196 : * \gamma^{xy}
197 : * &=\frac{-\gamma_{xy}}{e^{2\alpha}e^{(\gamma-\rho)}} =
198 : * -\left[\cos(\phi)\sin(\phi)e^{2\alpha} - \sin(\phi)\cos(\phi)
199 : * e^{(\gamma-\rho)}\right] e^{-2\alpha} e^{-(\gamma-\rho)} \notag \\
200 : * &=-\cos(\phi)\sin(\phi)e^{-(\gamma-\rho)} -
201 : * \sin(\phi)\cos(\phi)e^{-2\alpha} \notag \\
202 : * &=\cos(\phi)\sin(\phi) \left[e^{-2\alpha} -
203 : * e^{-(\gamma-\rho)}\right] \\
204 : * \gamma^{xz}
205 : * &= 0 \\
206 : * \gamma^{yz}
207 : * &= 0 \\
208 : * \gamma^{zz} &= e^{-2\alpha}.
209 : * \f}
210 : *
211 : * The 4-velocity in spherical coordinates is given by
212 : *
213 : * \f{align}{
214 : * u^{\bar{a}}=\frac{e^{-(\rho+\gamma)/2}}{\sqrt{1-v^2}}
215 : * \left[1,0,0,\Omega\right],
216 : * \f}
217 : *
218 : * where
219 : *
220 : * \f{align}{
221 : * v=(\Omega-\omega)r\sin(\theta)e^{-\rho}.
222 : * \f}
223 : *
224 : * Transforming to Cartesian coordinates we have
225 : *
226 : * \f{align}{
227 : * u^t
228 : * &=\frac{e^{-(\rho+\gamma)/2}}{\sqrt{1-v^2}} \\
229 : * u^x
230 : * &=\partial_\phi x u^\phi = -r\sin(\theta)\sin(\phi) u^t\Omega \\
231 : * u^y
232 : * &=\partial_\phi y u^\phi = r\sin(\theta)\cos(\phi) u^t\Omega \\
233 : * u^z &= 0.
234 : * \f}
235 : *
236 : * The Lorentz factor is given by
237 : *
238 : * \f{align}{
239 : * W
240 : * &=Nu^t=e^{(\gamma+\rho)/2}\frac{e^{-(\rho+\gamma)/2}}{\sqrt{1-v^2}} \notag
241 : * \\
242 : * &=\frac{1}{\sqrt{1-v^2}}.
243 : * \f}
244 : *
245 : * Using
246 : *
247 : * \f{align}{
248 : * v^i = \frac{1}{N}\left(\frac{u^i}{u^t} + \beta^i\right)
249 : * \f}
250 : *
251 : * we get
252 : *
253 : * \f{align}{
254 : * v^x
255 : * &= -e^{-(\gamma+\rho)/2}r\sin(\theta)\sin(\phi)(\Omega-\omega)
256 : * =-e^{-(\gamma-\rho)/2}\sin(\phi) v\\
257 : * v^y
258 : * &= e^{-(\gamma+\rho)/2}r\sin(\theta)\cos(\phi)(\Omega-\omega)
259 : * = e^{-(\gamma-\rho)/2}\cos(\phi)v \\
260 : * v^z&=0.
261 : * \f}
262 : *
263 : * Lowering with the spatial metric we get
264 : *
265 : * \f{align}{
266 : * v_x
267 : * &=\gamma_{xx} v^x + \gamma_{xy} v^y \notag \\
268 : * &=-\left[\cos^2(\phi)e^{2\alpha}+\sin^2(\phi)e^{\gamma-\rho}\right]
269 : * e^{-(\gamma-\rho)/2}\sin(\phi) v \notag \\
270 : * &+\left[\cos(\phi)\sin(\phi)e^{2\alpha} -
271 : * \sin(\phi)\cos(\phi)e^{\gamma-\rho}\right]
272 : * e^{-(\gamma-\rho)/2}\cos(\phi)v \notag \\
273 : * &=-e^{-(\gamma-\rho)/2}v\sin(\phi)e^{\gamma-\rho}
274 : * \left[\sin^2(\phi)+\cos^2(\phi)\right] \notag \\
275 : * &=-e^{(\gamma-\rho)/2}v\sin(\phi) \\
276 : * v_y
277 : * &=\gamma_{yx} v^x + \gamma_{yy} v^y \notag \\
278 : * &=-\left[\cos(\phi)\sin(\phi)e^{2\alpha} - \sin(\phi)\cos(\phi)
279 : * e^{(\gamma-\rho)}\right] e^{-(\gamma-\rho)/2}\sin(\phi) v \notag \\
280 : * &+\left[\sin^2(\phi)e^{2\alpha} + \cos^2(\phi) e^{(\gamma-\rho)}\right]
281 : * e^{-(\gamma-\rho)/2}\cos(\phi)v \notag \\
282 : * &=e^{(\gamma-\rho)/2}v\cos(\phi) \\
283 : * v_z &= 0.
284 : * \f}
285 : *
286 : * This is consistent with the Lorentz factor read off from \f$u^t\f$ since
287 : * \f$v^iv_i=v^2\f$. For completeness, \f$u_i=Wv_i\f$ so
288 : *
289 : * \f{align}{
290 : * u_x
291 : * &=-\frac{e^{(\gamma-\rho)/2}v\sin(\phi)}{\sqrt{1-v^2}} \\
292 : * u_y
293 : * &=\frac{e^{(\gamma-\rho)/2}v\cos(\phi)}{\sqrt{1-v^2}} \\
294 : * u_z&=0.
295 : * \f}
296 : *
297 : * \warning Near (within `1e-2`) \f$r=0\f$ the numerical errors from
298 : * interpolation and computing the metric derivatives by finite difference no
299 : * longer cancel out and so the `tilde_s` time derivative only vanishes to
300 : * roughly `1e-8` rather than machine precision. Computing the Cartesian
301 : * derivatives from analytic differentiation of the radial and angular
302 : * polynomial fits might improve the situation but is a decent about of work to
303 : * implement.
304 : */
305 1 : class RotatingStar : public virtual evolution::initial_data::InitialData,
306 : public MarkAsAnalyticSolution,
307 : public AnalyticSolution<3>,
308 : public hydro::TemperatureInitialization<RotatingStar> {
309 : template <typename DataType>
310 0 : struct IntermediateVariables {
311 0 : IntermediateVariables(
312 : const tnsr::I<DataType, 3, Frame::Inertial>& in_coords,
313 : double in_delta_r);
314 :
315 0 : struct MetricData {
316 0 : MetricData() = default;
317 0 : MetricData(size_t num_points);
318 0 : DataType alpha;
319 0 : DataType rho;
320 0 : DataType gamma;
321 0 : DataType omega;
322 : };
323 :
324 0 : const tnsr::I<DataType, 3, Frame::Inertial>& coords;
325 0 : DataType radius;
326 0 : DataType phi;
327 0 : DataType cos_theta;
328 0 : DataType sin_theta;
329 : // Data at coords
330 0 : std::optional<DataType> rest_mass_density;
331 0 : std::optional<DataType> fluid_velocity;
332 0 : std::optional<MetricData> metric_data;
333 : // Data for 2nd-order FD derivatives.
334 : //
335 : // Technically we could do full-order accurate derivatives by using
336 : // Jacobians to transform quantities, but since we really want the initial
337 : // data to be solved natively in SpECTRE and satisfy the Einstein equations
338 : // with neutrinos and magnetic fields, doing the 2nd order FD like SpEC
339 : // should be fine.
340 : //
341 : // Note: We guard all the upper/lower values by checking if
342 : // metric_data_upper is computed. While not perfect, this simplifies the
343 : // code a lot.
344 0 : double delta_r;
345 0 : std::optional<std::array<MetricData, 3>> metric_data_upper{};
346 0 : std::optional<std::array<MetricData, 3>> metric_data_lower{};
347 0 : std::array<DataType, 3> radius_upper{};
348 0 : std::array<DataType, 3> radius_lower{};
349 0 : std::array<DataType, 3> cos_theta_upper{};
350 0 : std::array<DataType, 3> cos_theta_lower{};
351 0 : std::array<DataType, 3> sin_theta_upper{};
352 0 : std::array<DataType, 3> sin_theta_lower{};
353 0 : std::array<DataType, 3> phi_upper{};
354 0 : std::array<DataType, 3> phi_lower{};
355 : };
356 :
357 : public:
358 0 : using equation_of_state_type = EquationsOfState::PolytropicFluid<true>;
359 :
360 : /// The path to the RotNS data file.
361 1 : struct RotNsFilename {
362 0 : using type = std::string;
363 0 : static constexpr Options::String help = {
364 : "The path to the RotNS data file."};
365 : };
366 :
367 : /// The polytropic constant of the fluid.
368 : ///
369 : /// The data in the RotNS file will be rescaled.
370 1 : struct PolytropicConstant {
371 0 : using type = double;
372 0 : static constexpr Options::String help = {
373 : "The polytropic constant of the fluid."};
374 0 : static type lower_bound() { return 0.; }
375 : };
376 :
377 0 : using options = tmpl::list<RotNsFilename, PolytropicConstant>;
378 0 : static constexpr Options::String help = {
379 : "Rotating neutron star initial data solved by the RotNS solver. The data "
380 : "is read in from disk."};
381 :
382 0 : RotatingStar() = default;
383 0 : RotatingStar(const RotatingStar& /*rhs*/) = default;
384 0 : RotatingStar& operator=(const RotatingStar& /*rhs*/) = default;
385 0 : RotatingStar(RotatingStar&& /*rhs*/) = default;
386 0 : RotatingStar& operator=(RotatingStar&& /*rhs*/) = default;
387 0 : ~RotatingStar() override = default;
388 :
389 0 : RotatingStar(std::string rot_ns_filename, double polytropic_constant);
390 :
391 0 : auto get_clone() const
392 : -> std::unique_ptr<evolution::initial_data::InitialData> override;
393 :
394 : /// \cond
395 : explicit RotatingStar(CkMigrateMessage* msg);
396 : using PUP::able::register_constructor;
397 : WRAPPED_PUPable_decl_template(RotatingStar);
398 : /// \endcond
399 :
400 : /// Retrieve a collection of variables at `(x, t)`
401 : template <typename DataType, typename... Tags>
402 1 : tuples::TaggedTuple<Tags...> variables(const tnsr::I<DataType, 3>& x,
403 : const double /*t*/,
404 : tmpl::list<Tags...> /*meta*/) const {
405 : IntermediateVariables<DataType> intermediate_vars{
406 : x, 1.0e-4 * cst_solution_.equatorial_radius()};
407 : return {get<Tags>(variables(make_not_null(&intermediate_vars), x,
408 : tmpl::list<Tags>{}))...};
409 : }
410 :
411 : // NOLINTNEXTLINE(google-runtime-references)
412 0 : void pup(PUP::er& p) override;
413 :
414 0 : const EquationsOfState::PolytropicFluid<true>& equation_of_state() const {
415 : return equation_of_state_;
416 : }
417 :
418 0 : double equatorial_radius() const {
419 : return cst_solution_.equatorial_radius();
420 : }
421 :
422 : protected:
423 : template <typename DataType>
424 0 : using DerivLapse = ::Tags::deriv<gr::Tags::Lapse<DataType>, tmpl::size_t<3>,
425 : Frame::Inertial>;
426 :
427 : template <typename DataType>
428 0 : using DerivShift = ::Tags::deriv<gr::Tags::Shift<DataType, 3>,
429 : tmpl::size_t<3>, Frame::Inertial>;
430 :
431 : template <typename DataType>
432 0 : using DerivSpatialMetric = ::Tags::deriv<gr::Tags::SpatialMetric<DataType, 3>,
433 : tmpl::size_t<3>, Frame::Inertial>;
434 :
435 : template <typename DataType>
436 0 : void interpolate_vars_if_necessary(
437 : gsl::not_null<IntermediateVariables<DataType>*> vars) const;
438 :
439 : template <typename DataType>
440 0 : void interpolate_deriv_vars_if_necessary(
441 : gsl::not_null<IntermediateVariables<DataType>*> vars) const;
442 :
443 : template <typename DataType>
444 0 : Scalar<DataType> lapse(const DataType& gamma, const DataType& rho) const;
445 :
446 : template <typename DataType>
447 0 : tnsr::I<DataType, 3, Frame::Inertial> shift(const DataType& omega,
448 : const DataType& phi,
449 : const DataType& radius,
450 : const DataType& sin_theta) const;
451 :
452 : template <typename DataType>
453 0 : tnsr::ii<DataType, 3, Frame::Inertial> spatial_metric(
454 : const DataType& gamma, const DataType& rho, const DataType& alpha,
455 : const DataType& phi) const;
456 :
457 : template <typename DataType>
458 0 : tnsr::II<DataType, 3, Frame::Inertial> inverse_spatial_metric(
459 : const DataType& gamma, const DataType& rho, const DataType& alpha,
460 : const DataType& phi) const;
461 :
462 : template <typename DataType>
463 0 : Scalar<DataType> sqrt_det_spatial_metric(const DataType& gamma,
464 : const DataType& rho,
465 : const DataType& alpha) const;
466 :
467 : template <typename DataType>
468 0 : auto make_metric_data(size_t num_points) const ->
469 : typename IntermediateVariables<DataType>::MetricData;
470 :
471 : template <typename DataType>
472 0 : auto variables(gsl::not_null<IntermediateVariables<DataType>*> vars,
473 : const tnsr::I<DataType, 3>& x,
474 : tmpl::list<hydro::Tags::RestMassDensity<DataType>> /*meta*/)
475 : const -> tuples::TaggedTuple<hydro::Tags::RestMassDensity<DataType>>;
476 :
477 : template <typename DataType>
478 0 : auto variables(gsl::not_null<IntermediateVariables<DataType>*> vars,
479 : const tnsr::I<DataType, 3>& x,
480 : tmpl::list<hydro::Tags::ElectronFraction<DataType>> /*meta*/)
481 : const -> tuples::TaggedTuple<hydro::Tags::ElectronFraction<DataType>>;
482 :
483 : template <typename DataType>
484 0 : auto variables(gsl::not_null<IntermediateVariables<DataType>*> vars,
485 : const tnsr::I<DataType, 3>& x,
486 : tmpl::list<hydro::Tags::SpecificEnthalpy<DataType>> /*meta*/)
487 : const -> tuples::TaggedTuple<hydro::Tags::SpecificEnthalpy<DataType>>;
488 :
489 : template <typename DataType>
490 0 : auto variables(gsl::not_null<IntermediateVariables<DataType>*> vars,
491 : const tnsr::I<DataType, 3>& x,
492 : tmpl::list<hydro::Tags::Temperature<DataType>> /*meta*/) const
493 : -> tuples::TaggedTuple<hydro::Tags::Temperature<DataType>>;
494 :
495 : template <typename DataType>
496 0 : auto variables(gsl::not_null<IntermediateVariables<DataType>*> vars,
497 : const tnsr::I<DataType, 3>& x,
498 : tmpl::list<hydro::Tags::Pressure<DataType>> /*meta*/) const
499 : -> tuples::TaggedTuple<hydro::Tags::Pressure<DataType>>;
500 :
501 : template <typename DataType>
502 0 : auto variables(
503 : gsl::not_null<IntermediateVariables<DataType>*> vars,
504 : const tnsr::I<DataType, 3>& x,
505 : tmpl::list<hydro::Tags::SpecificInternalEnergy<DataType>> /*meta*/) const
506 : -> tuples::TaggedTuple<hydro::Tags::SpecificInternalEnergy<DataType>>;
507 :
508 : template <typename DataType>
509 0 : auto variables(gsl::not_null<IntermediateVariables<DataType>*> vars,
510 : const tnsr::I<DataType, 3>& x,
511 : tmpl::list<hydro::Tags::SpatialVelocity<DataType, 3>> /*meta*/)
512 : const -> tuples::TaggedTuple<hydro::Tags::SpatialVelocity<DataType, 3>>;
513 :
514 : template <typename DataType>
515 0 : auto variables(gsl::not_null<IntermediateVariables<DataType>*> vars,
516 : const tnsr::I<DataType, 3>& x,
517 : tmpl::list<hydro::Tags::LorentzFactor<DataType>> /*meta*/)
518 : const -> tuples::TaggedTuple<hydro::Tags::LorentzFactor<DataType>>;
519 :
520 : template <typename DataType>
521 0 : auto variables(gsl::not_null<IntermediateVariables<DataType>*> vars,
522 : const tnsr::I<DataType, 3>& x,
523 : tmpl::list<hydro::Tags::MagneticField<DataType, 3>> /*meta*/)
524 : const -> tuples::TaggedTuple<hydro::Tags::MagneticField<DataType, 3>>;
525 :
526 : template <typename DataType>
527 0 : auto variables(
528 : gsl::not_null<IntermediateVariables<DataType>*> vars,
529 : const tnsr::I<DataType, 3>& x,
530 : tmpl::list<hydro::Tags::DivergenceCleaningField<DataType>> /*meta*/) const
531 : -> tuples::TaggedTuple<hydro::Tags::DivergenceCleaningField<DataType>>;
532 :
533 : template <typename DataType>
534 0 : auto variables(gsl::not_null<IntermediateVariables<DataType>*> vars,
535 : const tnsr::I<DataType, 3>& x,
536 : tmpl::list<gr::Tags::Lapse<DataType>> /*meta*/) const
537 : -> tuples::TaggedTuple<gr::Tags::Lapse<DataType>>;
538 :
539 : template <typename DataType>
540 0 : auto variables(gsl::not_null<IntermediateVariables<DataType>*> vars,
541 : const tnsr::I<DataType, 3>& x,
542 : tmpl::list<gr::Tags::Shift<DataType, 3>> /*meta*/) const
543 : -> tuples::TaggedTuple<gr::Tags::Shift<DataType, 3>>;
544 :
545 : template <typename DataType>
546 0 : auto variables(gsl::not_null<IntermediateVariables<DataType>*> vars,
547 : const tnsr::I<DataType, 3>& x,
548 : tmpl::list<gr::Tags::SpatialMetric<DataType, 3>> /*meta*/)
549 : const -> tuples::TaggedTuple<gr::Tags::SpatialMetric<DataType, 3>>;
550 :
551 : template <typename DataType>
552 0 : auto variables(gsl::not_null<IntermediateVariables<DataType>*> vars,
553 : const tnsr::I<DataType, 3>& x,
554 : tmpl::list<gr::Tags::SqrtDetSpatialMetric<DataType>> /*meta*/)
555 : const -> tuples::TaggedTuple<gr::Tags::SqrtDetSpatialMetric<DataType>>;
556 :
557 : template <typename DataType>
558 0 : auto variables(
559 : gsl::not_null<IntermediateVariables<DataType>*> vars,
560 : const tnsr::I<DataType, 3>& x,
561 : tmpl::list<gr::Tags::InverseSpatialMetric<DataType, 3>> /*meta*/) const
562 : -> tuples::TaggedTuple<gr::Tags::InverseSpatialMetric<DataType, 3>>;
563 :
564 : template <typename DataType>
565 0 : auto variables(gsl::not_null<IntermediateVariables<DataType>*> vars,
566 : const tnsr::I<DataType, 3>& x,
567 : tmpl::list<::Tags::dt<gr::Tags::Lapse<DataType>>> /*meta*/)
568 : const -> tuples::TaggedTuple<::Tags::dt<gr::Tags::Lapse<DataType>>>;
569 :
570 : template <typename DataType>
571 0 : auto variables(gsl::not_null<IntermediateVariables<DataType>*> vars,
572 : const tnsr::I<DataType, 3>& x,
573 : tmpl::list<DerivLapse<DataType>> /*meta*/) const
574 : -> tuples::TaggedTuple<DerivLapse<DataType>>;
575 :
576 : template <typename DataType>
577 0 : auto variables(gsl::not_null<IntermediateVariables<DataType>*> vars,
578 : const tnsr::I<DataType, 3>& x,
579 : tmpl::list<::Tags::dt<gr::Tags::Shift<DataType, 3>>> /*meta*/)
580 : const -> tuples::TaggedTuple<::Tags::dt<gr::Tags::Shift<DataType, 3>>>;
581 :
582 : template <typename DataType>
583 0 : auto variables(gsl::not_null<IntermediateVariables<DataType>*> vars,
584 : const tnsr::I<DataType, 3>& x,
585 : tmpl::list<DerivShift<DataType>> /*meta*/) const
586 : -> tuples::TaggedTuple<DerivShift<DataType>>;
587 :
588 : template <typename DataType>
589 0 : auto variables(
590 : gsl::not_null<IntermediateVariables<DataType>*> vars,
591 : const tnsr::I<DataType, 3>& x,
592 : tmpl::list<::Tags::dt<gr::Tags::SpatialMetric<DataType, 3>>> /*meta*/)
593 : const
594 : -> tuples::TaggedTuple<::Tags::dt<gr::Tags::SpatialMetric<DataType, 3>>>;
595 :
596 : template <typename DataType>
597 0 : auto variables(gsl::not_null<IntermediateVariables<DataType>*> vars,
598 : const tnsr::I<DataType, 3>& x,
599 : tmpl::list<DerivSpatialMetric<DataType>> /*meta*/) const
600 : -> tuples::TaggedTuple<DerivSpatialMetric<DataType>>;
601 :
602 : template <typename DataType>
603 0 : auto variables(gsl::not_null<IntermediateVariables<DataType>*> vars,
604 : const tnsr::I<DataType, 3>& x,
605 : tmpl::list<gr::Tags::ExtrinsicCurvature<DataType, 3>> /*meta*/)
606 : const -> tuples::TaggedTuple<gr::Tags::ExtrinsicCurvature<DataType, 3>>;
607 :
608 0 : friend bool operator==(const RotatingStar& lhs, const RotatingStar& rhs);
609 :
610 0 : std::string rot_ns_filename_{};
611 0 : detail::CstSolution cst_solution_{};
612 0 : double polytropic_constant_ = std::numeric_limits<double>::signaling_NaN();
613 0 : double polytropic_exponent_ = std::numeric_limits<double>::signaling_NaN();
614 0 : EquationsOfState::PolytropicFluid<true> equation_of_state_{};
615 : };
616 :
617 0 : bool operator!=(const RotatingStar& lhs, const RotatingStar& rhs);
618 : } // namespace RelativisticEuler::Solutions
|