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 <string> 8 : #include <vector> 9 : 10 : #include "DataStructures/Tensor/TypeAliases.hpp" 11 : #include "Domain/Tags.hpp" 12 : #include "Elliptic/BoundaryConditions/BoundaryCondition.hpp" 13 : #include "Elliptic/BoundaryConditions/BoundaryConditionType.hpp" 14 : #include "Options/String.hpp" 15 : #include "Utilities/Gsl.hpp" 16 : #include "Utilities/TMPL.hpp" 17 : 18 : /// \cond 19 : class DataVector; 20 : /// \endcond 21 : 22 : namespace Punctures::BoundaryConditions { 23 : 24 : /// Impose asymptotic flatness boundary conditions $\partial_r(ru)=0$ 25 1 : class Flatness : public elliptic::BoundaryConditions::BoundaryCondition<3> { 26 : private: 27 0 : using Base = elliptic::BoundaryConditions::BoundaryCondition<3>; 28 : 29 : public: 30 0 : static constexpr Options::String help = "Asymptotic flatness d_r(ru)=0"; 31 0 : using options = tmpl::list<>; 32 : 33 0 : Flatness() = default; 34 0 : Flatness(const Flatness&) = default; 35 0 : Flatness& operator=(const Flatness&) = default; 36 0 : Flatness(Flatness&&) = default; 37 0 : Flatness& operator=(Flatness&&) = default; 38 0 : ~Flatness() = default; 39 : 40 : /// \cond 41 : explicit Flatness(CkMigrateMessage* m) : Base(m) {} 42 : using PUP::able::register_constructor; 43 : WRAPPED_PUPable_decl_template(Flatness); 44 : /// \endcond 45 : 46 0 : std::unique_ptr<domain::BoundaryConditions::BoundaryCondition> get_clone() 47 : const override { 48 : return std::make_unique<Flatness>(*this); 49 : } 50 : 51 0 : std::vector<elliptic::BoundaryConditionType> boundary_condition_types() 52 : const override { 53 : return {elliptic::BoundaryConditionType::Neumann}; 54 : } 55 : 56 0 : using argument_tags = 57 : tmpl::list<domain::Tags::Coordinates<3, Frame::Inertial>>; 58 0 : using volume_tags = tmpl::list<>; 59 : 60 0 : static void apply(gsl::not_null<Scalar<DataVector>*> field, 61 : gsl::not_null<Scalar<DataVector>*> n_dot_field_gradient, 62 : const tnsr::i<DataVector, 3>& field_gradient, 63 : const tnsr::I<DataVector, 3>& x); 64 : 65 0 : using argument_tags_linearized = 66 : tmpl::list<domain::Tags::Coordinates<3, Frame::Inertial>>; 67 0 : using volume_tags_linearized = tmpl::list<>; 68 : 69 0 : static void apply_linearized( 70 : gsl::not_null<Scalar<DataVector>*> field_correction, 71 : gsl::not_null<Scalar<DataVector>*> n_dot_field_gradient_correction, 72 : const tnsr::i<DataVector, 3>& field_gradient, 73 : const tnsr::I<DataVector, 3>& x); 74 : }; 75 : 76 0 : bool operator==(const Flatness& lhs, const Flatness& rhs); 77 0 : bool operator!=(const Flatness& lhs, const Flatness& rhs); 78 : 79 : } // namespace Punctures::BoundaryConditions