Line data Source code
1 0 : // Distributed under the MIT License. 2 : // See LICENSE.txt for details. 3 : 4 : #pragma once 5 : 6 : #include <memory> 7 : #include <vector> 8 : 9 : #include "DataStructures/DataBox/Tag.hpp" 10 : #include "Options/String.hpp" 11 : #include "ParallelAlgorithms/ApparentHorizonFinder/Criteria/Criterion.hpp" 12 : #include "Utilities/Serialization/Serialize.hpp" 13 : #include "Utilities/TMPL.hpp" 14 : 15 : namespace ah::Criteria { 16 : /// Option tags for adaptive horizon finding criteria 17 1 : namespace OptionTags { 18 : /// \ingroup OptionTagsGroup 19 : /// Options for adaptive horizon finding criteria 20 1 : struct Criteria { 21 0 : static constexpr Options::String help = 22 : "Options for adaptive horizon finding criteria"; 23 0 : using type = std::vector<std::unique_ptr<ah::Criterion>>; 24 : }; 25 : } // namespace OptionTags 26 : 27 1 : namespace Tags { 28 : /// The set of adaptive horizon finding criteria 29 1 : struct Criteria : db::SimpleTag { 30 0 : using type = std::vector<std::unique_ptr<ah::Criterion>>; 31 0 : using option_tags = tmpl::list<ah::Criteria::OptionTags::Criteria>; 32 : 33 0 : static constexpr bool pass_metavariables = false; 34 0 : static type create_from_options(const type& value) { 35 : return {deserialize<type>(serialize<type>(value).data())}; 36 : } 37 : }; 38 : } // namespace Tags 39 : } // namespace ah::Criteria