SpECTRE Documentation Coverage Report
 Current view: top level - Evolution/Systems/NewtonianEuler/Sources - UniformAcceleration.hpp Hit Total Coverage Commit: 3c2e9d3ed337bca2146eee9de07432e292a38c3a Lines: 2 20 10.0 % Date: 2024-06-11 22:56:19 Legend: Lines: hit not hit
  Line data Source code  1 0 : // Distributed under the MIT License. 2 : // See LICENSE.txt for details. 3 : 4 : #pragma once 5 : 6 : #include 7 : #include 8 : 9 : #include "DataStructures/Tensor/TypeAliases.hpp" 10 : #include "Evolution/Systems/NewtonianEuler/Sources/Source.hpp" 11 : #include "Evolution/Systems/NewtonianEuler/TagsDeclarations.hpp" 12 : #include "Options/String.hpp" 13 : #include "Utilities/MakeArray.hpp" 14 : #include "Utilities/TMPL.hpp" 15 : 16 : /// \cond 17 : class DataVector; 18 : 19 : namespace PUP { 20 : class er; 21 : } // namespace PUP 22 : 23 : namespace gsl { 24 : template 25 : struct not_null; 26 : } // namespace gsl 27 : /// \endcond 28 : 29 : namespace NewtonianEuler::Sources { 30 : 31 : /*! 32 : * \brief Source generated from an external uniform acceleration. 33 : * 34 : * The NewtonianEuler system with source terms is written as 35 : * 36 : * \f{align*} 37 : * \partial_t\rho + \partial_i F^i(\rho) &= S(\rho)\\ 38 : * \partial_t S^i + \partial_j F^{j}(S^i) &= S(S^i)\\ 39 : * \partial_t e + \partial_i F^i(e) &= S(e), 40 : * \f} 41 : * 42 : * where \f$F^i(u)\f$ is the volume flux of the conserved quantity \f$u\f$ 43 : * (see ComputeFluxes). For an external acceleration \f$a^i\f$, one has 44 : * 45 : * \f{align*} 46 : * S(\rho) &= 0\\ 47 : * S(S^i) &= \rho a^i\\ 48 : * S(e) &= S_ia^i, 49 : * \f} 50 : * 51 : * where \f$\rho\f$ is the mass density, \f$S^i\f$ is the momentum density, 52 : * and \f$e\f$ is the energy density. 53 : */ 54 : template 55 1 : class UniformAcceleration : public Source { 56 : public: 57 : /// The applied acceleration 58 1 : struct Acceleration { 59 0 : using type = std::array; 60 0 : static constexpr Options::String help = {"The applied accerelation."}; 61 : }; 62 : 63 0 : using options = tmpl::list; 64 : 65 0 : static constexpr Options::String help = { 66 : "Source terms corresponding to a uniform acceleration."}; 67 : 68 0 : UniformAcceleration() = default; 69 0 : UniformAcceleration(const UniformAcceleration& /*rhs*/) = default; 70 0 : UniformAcceleration& operator=(const UniformAcceleration& /*rhs*/) = default; 71 0 : UniformAcceleration(UniformAcceleration&& /*rhs*/) = default; 72 0 : UniformAcceleration& operator=(UniformAcceleration&& /*rhs*/) = default; 73 0 : ~UniformAcceleration() override = default; 74 : 75 0 : explicit UniformAcceleration( 76 : const std::array& acceleration_field); 77 : 78 : /// \cond 79 : explicit UniformAcceleration(CkMigrateMessage* msg); 80 : using PUP::able::register_constructor; 81 : WRAPPED_PUPable_decl_template(UniformAcceleration); 82 : /// \endcond 83 : 84 : // NOLINTNEXTLINE(google-runtime-references) 85 0 : void pup(PUP::er& p) override; 86 : 87 0 : auto get_clone() const -> std::unique_ptr> override; 88 : 89 0 : void operator()( 90 : gsl::not_null*> source_mass_density_cons, 91 : gsl::not_null*> source_momentum_density, 92 : gsl::not_null*> source_energy_density, 93 : const Scalar& mass_density_cons, 94 : const tnsr::I& momentum_density, 95 : const Scalar& energy_density, 96 : const tnsr::I& velocity, 97 : const Scalar& pressure, 98 : const Scalar& specific_internal_energy, 99 : const EquationsOfState::EquationOfState& eos, 100 : const tnsr::I& coords, double time) const override; 101 : 102 : private: 103 : template 104 0 : friend bool operator==( // NOLINT(readability-redundant-declaration) 105 : const UniformAcceleration& lhs, 106 : const UniformAcceleration& rhs); 107 : 108 0 : std::array acceleration_field_ = 109 : make_array(std::numeric_limits::signaling_NaN()); 110 : }; 111 : 112 : template 113 0 : bool operator!=(const UniformAcceleration& lhs, 114 : const UniformAcceleration& rhs); 115 : } // namespace NewtonianEuler::Sources 

 Generated by: LCOV version 1.14