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/TypeAliases.hpp" 12 : #include "Elliptic/BoundaryConditions/BoundaryCondition.hpp" 13 : #include "Elliptic/BoundaryConditions/BoundaryConditionType.hpp" 14 : #include "Options/Context.hpp" 15 : #include "Options/String.hpp" 16 : #include "Utilities/Gsl.hpp" 17 : #include "Utilities/Serialization/CharmPupable.hpp" 18 : #include "Utilities/TMPL.hpp" 19 : 20 : /// \cond 21 : class DataVector; 22 : /// \endcond 23 : 24 0 : namespace sgb::BoundaryConditions { 25 : 26 : /// Do not apply a boundary condition, used exclusively for singular boundary 27 : /// value problems. 28 : 29 1 : class DoNothing : public elliptic::BoundaryConditions::BoundaryCondition<3> { 30 : private: 31 0 : using Base = elliptic::BoundaryConditions::BoundaryCondition<3>; 32 : 33 : public: 34 0 : static constexpr Options::String help = 35 : "Do not apply a boundary condition, used exclusively for singular " 36 : "boundary value problems."; 37 : 38 0 : using options = tmpl::list<>; 39 : 40 0 : DoNothing() = default; 41 0 : DoNothing(const DoNothing&) = default; 42 0 : DoNothing& operator=(const DoNothing&) = default; 43 0 : DoNothing(DoNothing&&) = default; 44 0 : DoNothing& operator=(DoNothing&&) = default; 45 0 : ~DoNothing() override = default; 46 : 47 : /// \cond 48 : explicit DoNothing(CkMigrateMessage* m) : Base(m) {} 49 : using PUP::able::register_constructor; 50 : WRAPPED_PUPable_decl_template(DoNothing); 51 : /// \endcond 52 : 53 0 : std::unique_ptr<domain::BoundaryConditions::BoundaryCondition> get_clone() 54 : const override { 55 : return std::make_unique<DoNothing>(*this); 56 : } 57 : 58 0 : std::vector<elliptic::BoundaryConditionType> boundary_condition_types() 59 : const override { 60 : return {1, elliptic::BoundaryConditionType::Dirichlet}; 61 : } 62 : 63 0 : using argument_tags = tmpl::list<>; 64 0 : using volume_tags = tmpl::list<>; 65 : 66 0 : void apply(gsl::not_null<Scalar<DataVector>*> /*field*/, 67 : gsl::not_null<Scalar<DataVector>*> /*n_dot_field_gradient*/, 68 : const tnsr::i<DataVector, 3>& /*deriv_field*/) const {}; 69 : 70 0 : using argument_tags_linearized = tmpl::list<>; 71 0 : using volume_tags_linearized = tmpl::list<>; 72 : 73 0 : void apply_linearized( 74 : gsl::not_null<Scalar<DataVector>*> /*field_correction*/, 75 : gsl::not_null<Scalar<DataVector>*> 76 : /*n_dot_field_gradient_correction*/, 77 : const tnsr::i<DataVector, 3>& /*deriv_field_correction*/) const {}; 78 : }; 79 : 80 0 : inline bool operator==(const DoNothing& /*lhs*/, const DoNothing& /*rhs*/) { 81 : return true; 82 : } 83 : 84 0 : inline bool operator!=(const DoNothing& /*lhs*/, const DoNothing& /*rhs*/) { 85 : return false; 86 : } 87 : 88 : /// \cond 89 : PUP::able::PUP_ID DoNothing::my_PUP_ID = 0; // NOLINT 90 : /// \endcond 91 : 92 : } // namespace sgb::BoundaryConditions