Line data Source code
1 0 : // Distributed under the MIT License. 2 : // See LICENSE.txt for details. 3 : 4 : #pragma once 5 : 6 : #include <cstddef> 7 : #include <pup.h> 8 : #include <string> 9 : #include <vector> 10 : 11 : #include "DataStructures/Tensor/EagerMath/Magnitude.hpp" 12 : #include "DataStructures/Tensor/TypeAliases.hpp" 13 : #include "Domain/Tags.hpp" 14 : #include "Domain/Tags/FaceNormal.hpp" 15 : #include "Elliptic/BoundaryConditions/BoundaryCondition.hpp" 16 : #include "Elliptic/BoundaryConditions/BoundaryConditionType.hpp" 17 : #include "Elliptic/Systems//BnsInitialData/Tags.hpp" 18 : #include "Options/Context.hpp" 19 : #include "Options/String.hpp" 20 : #include "PointwiseFunctions/GeneralRelativity/Tags.hpp" 21 : #include "Utilities/Gsl.hpp" 22 : #include "Utilities/Serialization/CharmPupable.hpp" 23 : #include "Utilities/TMPL.hpp" 24 : 25 : /// \cond 26 : class DataVector; 27 : /// \endcond 28 : 29 0 : namespace BnsInitialData ::BoundaryConditions { 30 : 31 : /*! 32 : * Impose StarSurface boundary conditions: 33 : * \f[ 34 : * n_i F^i = \frac{C}{\alpha^2} B^i n_i. 35 : * \f] 36 : * The boundary condition results from requiring the conservation 37 : * equations be regular at the surface of the neutron star. See 38 : * \cite BaumgarteShapiro 15.79. 39 : */ 40 1 : class StarSurface : public elliptic::BoundaryConditions::BoundaryCondition<3> { 41 : private: 42 0 : using Base = elliptic::BoundaryConditions::BoundaryCondition<3>; 43 : 44 : public: 45 0 : static constexpr Options::String help = 46 : "StarSurface boundary conditions n_i F^i = C/square(alpha) B^i n_i ."; 47 : 48 0 : using options = tmpl::list<>; 49 : 50 0 : StarSurface() = default; 51 0 : StarSurface(const StarSurface&) = default; 52 0 : StarSurface& operator=(const StarSurface&) = default; 53 0 : StarSurface(StarSurface&&) = default; 54 0 : StarSurface& operator=(StarSurface&&) = default; 55 0 : ~StarSurface() override = default; 56 : 57 : /// \cond 58 : explicit StarSurface(CkMigrateMessage* m) : Base(m) {} 59 : using PUP::able::register_constructor; 60 : WRAPPED_PUPable_decl_template(StarSurface); 61 : /// \endcond 62 : 63 0 : std::unique_ptr<domain::BoundaryConditions::BoundaryCondition> get_clone() 64 : const override { 65 : return std::make_unique<StarSurface>(*this); 66 : } 67 : 68 0 : explicit StarSurface(const Options::Context& context); 69 : 70 0 : std::vector<elliptic::BoundaryConditionType> boundary_condition_types() 71 : const override { 72 : return {elliptic::BoundaryConditionType::Neumann}; 73 : } 74 : 75 0 : using argument_tags = 76 : tmpl::list<gr::Tags::Lapse<DataVector>, 77 : BnsInitialData::Tags::RotationalShift<DataVector>, 78 : BnsInitialData::Tags::EulerEnthalpyConstant, 79 : domain::Tags::FaceNormal<3>>; 80 0 : using volume_tags = tmpl::list<BnsInitialData::Tags::EulerEnthalpyConstant>; 81 : 82 0 : static void apply(gsl::not_null<Scalar<DataVector>*> velocity_potential, 83 : gsl::not_null<Scalar<DataVector>*> n_dot_flux_for_potential, 84 : const tnsr::i<DataVector, 3>& deriv_velocity_potential, 85 : const Scalar<DataVector>& lapse, 86 : const tnsr::I<DataVector, 3>& rotational_shift, 87 : double euler_enthalpy_constant, 88 : const tnsr::i<DataVector, 3>& normal); 89 : 90 0 : using argument_tags_linearized = tmpl::list<>; 91 0 : using volume_tags_linearized = tmpl::list<>; 92 : 93 0 : static void apply_linearized( 94 : gsl::not_null<Scalar<DataVector>*> velocity_potential_correction, 95 : gsl::not_null<Scalar<DataVector>*> n_dot_flux_for_potential_correction, 96 : const tnsr::i<DataVector, 3>& deriv_velocity_potential); 97 : 98 0 : void pup(PUP::er& p) override; 99 : }; 100 : 101 0 : bool operator==(const StarSurface& lhs, const StarSurface& rhs); 102 : 103 0 : bool operator!=(const StarSurface& lhs, const StarSurface& rhs); 104 : 105 : } // namespace BnsInitialData::BoundaryConditions