21 #ifndef FUB_TAGGING_METHOD_HPP
22 #define FUB_TAGGING_METHOD_HPP
39 virtual std::unique_ptr<TaggingMethodStrategy_>
Clone()
const = 0;
60 typename = std::enable_if_t<!decays_to<T, AnyTaggingMethod>()>>
87 std::unique_ptr<TaggingMethodStrategy_<GriddingAlgorithm>>
tag_;
93 template <
typename Gr
iddingAlgorithm,
typename T>
102 int level,
Duration time_point)
override {
103 tag_.TagCellsForRefinement(tags, gridding, level, time_point);
106 std::unique_ptr<TaggingMethodStrategy_<GriddingAlgorithm>>
108 return std::make_unique<TaggingMethodWrapper_<GriddingAlgorithm, T>>(
tag_);
114 template <
typename Gr
iddingAlgorithm>
117 : tag_(other.tag_ ? other.tag_->Clone() : nullptr) {}
119 template <
typename Gr
iddingAlgorithm>
123 return *
this = std::move(tmp);
126 template <
typename Gr
iddingAlgorithm>
127 template <
typename T,
typename>
129 : tag_{std::make_unique<
131 std::forward<T>(tag))} {}
133 template <
typename Gr
iddingAlgorithm>
138 return tag_->TagCellsForRefinement(tags, gridding, level, time_point);
This class is a polymorphic value type that stores objects which satisfies the TaggingMethod<Gridding...
Definition: AnyTaggingMethod.hpp:48
typename GridTraits< GriddingAlgorithm >::TagDataHandle TagDataHandle
Definition: AnyTaggingMethod.hpp:50
AnyTaggingMethod(AnyTaggingMethod &&other) noexcept=default
Moves the other object without allocating and leaves an empty method.
AnyTaggingMethod()=default
This constructs a method that does nothing on invocation.
AnyTaggingMethod & operator=(AnyTaggingMethod &&other) noexcept=default
Moves the other object without allocating and leaves an empty method.
AnyTaggingMethod & operator=(const AnyTaggingMethod &other)
Copies the implementation.
Definition: AnyTaggingMethod.hpp:121
void TagCellsForRefinement(TagDataHandle tags, GriddingAlgorithm &gridding, int level, Duration t)
Mask cells that need further refinement in a regridding procedure.
Definition: AnyTaggingMethod.hpp:134
std::unique_ptr< TaggingMethodStrategy_< GriddingAlgorithm > > tag_
Definition: AnyTaggingMethod.hpp:87
The fub namespace.
Definition: AnyBoundaryCondition.hpp:31
typename remove_cvref< T >::type remove_cvref_t
Definition: type_traits.hpp:226
std::chrono::duration< double > Duration
Definition: Duration.hpp:31
Definition: AnyTaggingMethod.hpp:36
typename GridTraits< GriddingAlgorithm >::TagDataHandle TagDataHandle
Definition: AnyTaggingMethod.hpp:37
virtual std::unique_ptr< TaggingMethodStrategy_ > Clone() const =0
virtual ~TaggingMethodStrategy_()=default
virtual void TagCellsForRefinement(TagDataHandle tags, GriddingAlgorithm &gridding, int level, Duration time_point)=0
Definition: AnyTaggingMethod.hpp:95
TaggingMethodWrapper_(T &&tag)
Definition: AnyTaggingMethod.hpp:99
std::unique_ptr< TaggingMethodStrategy_< GriddingAlgorithm > > Clone() const override
Definition: AnyTaggingMethod.hpp:107
TaggingMethodWrapper_(const T &tag)
Definition: AnyTaggingMethod.hpp:98
T tag_
Definition: AnyTaggingMethod.hpp:109
void TagCellsForRefinement(TagDataHandle tags, GriddingAlgorithm &gridding, int level, Duration time_point) override
Definition: AnyTaggingMethod.hpp:101