|
| 1 | +/* GRTeclyn |
| 2 | + * Copyright 2022 The GRTL collaboration. |
| 3 | + * Please refer to LICENSE in GRTeclyn's root directory. |
| 4 | + */ |
| 5 | + |
| 6 | +#ifndef MOVINGPUNCTUREGAUGEWITHMATTER_HPP_ |
| 7 | +#define MOVINGPUNCTUREGAUGEWITHMATTER_HPP_ |
| 8 | + |
| 9 | +#include "CCZ4RHSWithMatter.hpp" |
| 10 | +#include "DimensionDefinitions.hpp" |
| 11 | +// #include "EMTensor.hpp" |
| 12 | +#include "Tensor.hpp" |
| 13 | + |
| 14 | +#include <cmath> |
| 15 | + |
| 16 | +/** |
| 17 | + * This class implements a slightly more generic version of the moving puncture |
| 18 | + * gauge. In particular it uses a Bona-Masso slicing condition of the form |
| 19 | + * f(lapse) = -c*lapse^(p-2) |
| 20 | + * and a Gamma-driver shift condition |
| 21 | + **/ |
| 22 | + |
| 23 | +/// This class adds the matter terms to the RHS of the gauge equation |
| 24 | +/// for the moving puncture gauge |
| 25 | + |
| 26 | +class MovingPunctureGaugeWithMatter : public MovingPunctureGauge |
| 27 | +{ |
| 28 | + |
| 29 | + public: |
| 30 | + MovingPunctureGaugeWithMatter(const params_t &a_params) |
| 31 | + : MovingPunctureGauge(a_params) |
| 32 | + { |
| 33 | + } |
| 34 | + |
| 35 | + // NOLINTBEGIN(bugprone-easily-swappable-parameters) |
| 36 | + template <class data_t, template <typename> class vars_t> |
| 37 | + AMREX_GPU_DEVICE AMREX_FORCE_INLINE void rhs_gauge_add_matter_terms( |
| 38 | + vars_t<data_t> &matter_rhs, const vars_t<data_t> &matter_vars, |
| 39 | + Tensor<2, data_t, 3> h_UU, const emtensor_t<data_t> emtensor, |
| 40 | + const double G_Newton) const |
| 41 | + // NOLINTEND(bugprone-easily-swappable-parameters) |
| 42 | + { |
| 43 | + FOR (i) |
| 44 | + { |
| 45 | + data_t matter_term_Gamma = 0.0; |
| 46 | + FOR (j) |
| 47 | + { |
| 48 | + matter_term_Gamma += -16.0 * M_PI * G_Newton * |
| 49 | + matter_vars.lapse * h_UU[i][j] * |
| 50 | + emtensor.Si[j]; |
| 51 | + } |
| 52 | + |
| 53 | + matter_rhs.B[i] += matter_term_Gamma; |
| 54 | + } |
| 55 | + } |
| 56 | +}; |
| 57 | + |
| 58 | +#endif /* MOVINGPUNCTUREGAUGEWITHMATTER_HPP_ */ |
0 commit comments