diff --git a/src/PointwiseFunctions/AnalyticSolutions/GeneralRelativity/GaugePlaneWave.cpp b/src/PointwiseFunctions/AnalyticSolutions/GeneralRelativity/GaugePlaneWave.cpp index 4afbbd433836..89cc4a94563e 100644 --- a/src/PointwiseFunctions/AnalyticSolutions/GeneralRelativity/GaugePlaneWave.cpp +++ b/src/PointwiseFunctions/AnalyticSolutions/GeneralRelativity/GaugePlaneWave.cpp @@ -23,9 +23,9 @@ GaugePlaneWave::GaugePlaneWave(CkMigrateMessage* /*msg*/) {} template GaugePlaneWave::GaugePlaneWave( - std::array wave_vector, + const std::array& wave_vector, std::unique_ptr> profile) - : wave_vector_(std::move(wave_vector)), + : wave_vector_(wave_vector), profile_(std::move(profile)), omega_(magnitude(wave_vector_)) {} @@ -64,6 +64,7 @@ GaugePlaneWave::IntermediateVars::IntermediateVars( } h = profile->operator()(u); du_h = profile->first_deriv(u); + du_du_h = profile->second_deriv(u); det_gamma = 1.0 + h * square(omega); lapse = 1.0 / sqrt(det_gamma); } diff --git a/src/PointwiseFunctions/AnalyticSolutions/GeneralRelativity/GaugePlaneWave.hpp b/src/PointwiseFunctions/AnalyticSolutions/GeneralRelativity/GaugePlaneWave.hpp index 3b6382e9d394..b8d4845ee58b 100644 --- a/src/PointwiseFunctions/AnalyticSolutions/GeneralRelativity/GaugePlaneWave.hpp +++ b/src/PointwiseFunctions/AnalyticSolutions/GeneralRelativity/GaugePlaneWave.hpp @@ -92,9 +92,6 @@ namespace gr::Solutions { template class GaugePlaneWave : public AnalyticSolution, public MarkAsAnalyticSolution { - template - struct IntermediateVars; - public: static constexpr size_t volume_dim = Dim; struct WaveVector { @@ -112,7 +109,7 @@ class GaugePlaneWave : public AnalyticSolution, static constexpr Options::String help{"Gauge plane wave in flat spacetime"}; GaugePlaneWave() = default; - GaugePlaneWave(std::array wave_vector, + GaugePlaneWave(const std::array& wave_vector, std::unique_ptr> profile); GaugePlaneWave(const GaugePlaneWave&); GaugePlaneWave& operator=(const GaugePlaneWave&); @@ -133,6 +130,20 @@ class GaugePlaneWave : public AnalyticSolution, ::Tags::deriv, tmpl::size_t, Frame::Inertial>; + template + struct IntermediateVars { + IntermediateVars( + const std::array& wave_vector, + const std::unique_ptr>& profile, + double omega, const tnsr::I& x, + double t); + DataType h{}; + DataType du_h{}; + DataType du_du_h{}; + DataType det_gamma{}; + DataType lapse{}; + }; + template tuples::TaggedTuple variables( const tnsr::I& x, double t, @@ -148,11 +159,13 @@ class GaugePlaneWave : public AnalyticSolution, const IntermediateVars& vars, tmpl::list /*meta*/) const { static_assert(sizeof...(Tags) > 1, - "Unrecognized tag requested. See the function parameters " + "Unrecognized tag requested. See the function parameters " "for the tag."); return {get(variables(x, t, vars, tmpl::list{}))...}; } + std::array get_wave_vector() const { return wave_vector_; } + // NOLINTNEXTLINE(google-runtime-references) void pup(PUP::er& p); @@ -239,19 +252,6 @@ class GaugePlaneWave : public AnalyticSolution, const -> tuples::TaggedTuple< gr::Tags::InverseSpatialMetric>; - template - struct IntermediateVars { - IntermediateVars( - const std::array& wave_vector, - const std::unique_ptr>& profile, - double omega, const tnsr::I& x, - double t); - DataType h{}; - DataType du_h{}; - DataType det_gamma{}; - DataType lapse{}; - }; - template // NOLINTNEXTLINE(readability-redundant-declaration) friend bool operator==(const GaugePlaneWave& lhs,