Line data Source code
1 0 : // Distributed under the MIT License. 2 : // See LICENSE.txt for details. 3 : 4 : #pragma once 5 : 6 : #include <pup.h> 7 : #include <string> 8 : 9 : #include "DataStructures/DataVector.hpp" 10 : #include "DataStructures/Tensor/Tensor.hpp" 11 : #include "Domain/CoordinateMaps/CoordinateMap.hpp" 12 : #include "Domain/CoordinateMaps/Tags.hpp" 13 : #include "Domain/ElementMap.hpp" 14 : #include "Domain/FunctionsOfTime/FunctionOfTime.hpp" 15 : #include "Domain/FunctionsOfTime/Tags.hpp" 16 : #include "Domain/Structure/Direction.hpp" 17 : #include "Domain/Tags.hpp" 18 : #include "Evolution/BoundaryConditions/Type.hpp" 19 : #include "Evolution/DgSubcell/GhostZoneLogicalCoordinates.hpp" 20 : #include "Evolution/DgSubcell/Tags/Coordinates.hpp" 21 : #include "Evolution/DgSubcell/Tags/Mesh.hpp" 22 : #include "Evolution/Systems/Ccz4/BoundaryConditions/BoundaryCondition.hpp" 23 : #include "Evolution/Systems/Ccz4/FiniteDifference/Tags.hpp" 24 : #include "Evolution/Systems/Ccz4/Tags.hpp" 25 : #include "Evolution/TypeTraits.hpp" 26 : #include "Options/String.hpp" 27 : #include "Utilities/Gsl.hpp" 28 : #include "Utilities/Serialization/CharmPupable.hpp" 29 : #include "Utilities/TMPL.hpp" 30 : 31 : /// \cond 32 : namespace Tags { 33 : struct Time; 34 : } // namespace Tags 35 : /// \endcond 36 : 37 : namespace Ccz4::BoundaryConditions { 38 : /*! 39 : * \brief Sets Sommerfeld boundary conditions per tensor component. 40 : * 41 : * Unlike time-independent subcell external boundary conditions, 42 : * the Sommerfeld boundary condition is applied at the outermost 43 : * interior points in the volume instead of the ghost zone. 44 : * This is because the Sommerfeld condition requires radial derivatives 45 : * of the fields and modify their time derivatives, which then need to 46 : * be time integrated. Under current infrastructure, it is therefore 47 : * the simplest to apply this boundary condition in the interior 48 : * rather than the ghost zone. This file extrapolates the interior 49 : * evolved variables into the ghost zone. Their radial derivatives and 50 : * time derivatives are then computed and applied in SoTimeDerivative.hpp for 51 : * the outermost interior points. All tensor components (including lapse and 52 : * shift) are treated as independent fields when applying this boundary 53 : * condition. 54 : * 55 : * \warning This boundary condition assumes a complete sphere domain 56 : * (all wedges), as we only apply it on the upper_zeta 57 : * direction in blocks with external boundaries. 58 : */ 59 1 : class Sommerfeld final : public BoundaryCondition { 60 : public: 61 0 : using options = tmpl::list<>; 62 0 : static constexpr Options::String help{ 63 : "Sommerfeld boundary conditions applied per tensor component."}; 64 : 65 0 : Sommerfeld() = default; 66 0 : Sommerfeld(Sommerfeld&&) = default; 67 0 : Sommerfeld& operator=(Sommerfeld&&) = default; 68 0 : Sommerfeld(const Sommerfeld&); 69 0 : Sommerfeld& operator=(const Sommerfeld&); 70 0 : ~Sommerfeld() override = default; 71 : 72 0 : explicit Sommerfeld(CkMigrateMessage* msg); 73 : 74 0 : WRAPPED_PUPable_decl_base_template( 75 : domain::BoundaryConditions::BoundaryCondition, Sommerfeld); 76 : 77 0 : auto get_clone() const -> std::unique_ptr< 78 : domain::BoundaryConditions::BoundaryCondition> override; 79 : 80 0 : static constexpr evolution::BoundaryConditions::Type bc_type = 81 : evolution::BoundaryConditions::Type::Ghost; 82 : 83 0 : void pup(PUP::er& p) override; 84 : 85 0 : using fd_interior_evolved_variables_tags = 86 : ::Ccz4::fd::System::variables_tag_list; 87 0 : using fd_interior_temporary_tags = 88 : tmpl::list<evolution::dg::subcell::Tags::Mesh<3>>; 89 0 : using fd_interior_primitive_variables_tags = tmpl::list<>; 90 0 : using fd_gridless_tags = tmpl::list<::Ccz4::fd::Tags::Reconstructor>; 91 0 : static void fd_ghost( 92 : gsl::not_null<tnsr::ii<DataVector, 3, Frame::Inertial>*> conformal_metric, 93 : gsl::not_null<Scalar<DataVector>*> lapse, 94 : gsl::not_null<tnsr::I<DataVector, 3, Frame::Inertial>*> shift, 95 : gsl::not_null<Scalar<DataVector>*> conformal_factor, 96 : gsl::not_null<tnsr::ii<DataVector, 3, Frame::Inertial>*> a_tilde, 97 : gsl::not_null<Scalar<DataVector>*> trace_extrinsic_curvature, 98 : gsl::not_null<Scalar<DataVector>*> theta, 99 : gsl::not_null<tnsr::I<DataVector, 3, Frame::Inertial>*> gamma_hat, 100 : gsl::not_null<tnsr::I<DataVector, 3, Frame::Inertial>*> auxiliary_shift_b, 101 : const Direction<3>& direction, 102 : 103 : // fd_interior_evolved_variables_tags (variables_tag_list order) 104 : const tnsr::ii<DataVector, 3, Frame::Inertial>& interior_conformal_metric, 105 : const Scalar<DataVector>& interior_conformal_factor, 106 : const tnsr::ii<DataVector, 3, Frame::Inertial>& interior_a_tilde, 107 : const Scalar<DataVector>& interior_trace_extrinsic_curvature, 108 : const Scalar<DataVector>& interior_theta, 109 : const tnsr::I<DataVector, 3, Frame::Inertial>& interior_gamma_hat, 110 : const Scalar<DataVector>& interior_lapse, 111 : const tnsr::I<DataVector, 3, Frame::Inertial>& interior_shift, 112 : const tnsr::I<DataVector, 3, Frame::Inertial>& interior_auxiliary_shift_b, 113 : 114 : // fd_interior_temporary_tags 115 : const Mesh<3>& subcell_mesh, 116 : 117 : // fd_gridless_tags 118 : const fd::Reconstructor& reconstructor); 119 : }; 120 : } // namespace Ccz4::BoundaryConditions