WRApplication
External kratos "application" for multiscale time integration.
ModelPredicatePipe.hpp
Go to the documentation of this file.
1 
3 #pragma once
4 
5 // --- WRApp Includes ---
6 #include "basic_pipes.hpp"
10 
11 // --- Core Includes ---
12 #include "includes/smart_pointers.h"
13 #include "includes/model_part.h"
14 #include "includes/kratos_parameters.h"
15 #include "utilities/interval_utility.h"
16 
17 // --- STL Includes ---
18 #include <functional> // std::less
19 
20 
21 namespace Kratos::WRApp {
22 
23 
28 
29 
30 template <class TPipe>
31 class KRATOS_API(WR_APPLICATION) ModelPredicatePipe
32  : public WRApp::ModelPredicate,
33  public Pipes::Traits<const Model&, bool>,
34  public WRAppClass
35 {
36 public:
38 
40  : mPipe()
41  {}
42 
43  ModelPredicatePipe(const Parameters& rParameters)
44  : mPipe(rParameters)
45  {}
46 
47  ModelPredicatePipe(ModelPredicatePipe&& rOther) noexcept = default;
48 
49  ModelPredicatePipe(const ModelPredicatePipe& rOther) = default;
50 
51  bool operator()(const Model& rModel) const override
52  {return mPipe(rModel);}
53 
54  virtual Parameters GetDefaultParameters() const override
55  {return TPipe::GetDefaultParameters();}
56 
57 private:
58  TPipe mPipe;
59 }; // class ModelPredicatePipe
60 
61 
73 >>;
74 
75 
88 using TimeGreaterPredicate = ModelPredicatePipe<Pipes::Pipeline<
93 >>;
94 
95 
115 >>;
116 
117 
139 >>;
140 
141 
175 >>;
176 
177 
208 >>;
209 
210 
213 
214 
215 } // namespace Kratos::WRApp
Add a constant value to the input.
Definition: basic_pipes.hpp:219
Perform a comparison operation on the input as the left hand side.
Definition: basic_pipes.hpp:142
Return a bool regardless of the input.
Definition: basic_pipes.hpp:244
Pipe wrapper for Detail::IntervalUtility.
Definition: basic_pipes.hpp:161
Get a ModelPart from a Model by name.
Definition: basic_pipes.hpp:35
Compute the mod of the input.
Definition: basic_pipes.hpp:187
An adaptor class for pipelines consisting of a single segment.
Definition: pipe.hpp:204
Definition: ModelPredicatePipe.hpp:35
ModelPredicatePipe(ModelPredicatePipe &&rOther) noexcept=default
ModelPredicatePipe()
Definition: ModelPredicatePipe.hpp:39
bool operator()(const Model &rModel) const override
Definition: ModelPredicatePipe.hpp:51
ModelPredicatePipe(const ModelPredicatePipe &rOther)=default
KRATOS_CLASS_POINTER_DEFINITION(ModelPredicatePipe)
virtual Parameters GetDefaultParameters() const override
Definition: ModelPredicatePipe.hpp:54
ModelPredicatePipe(const Parameters &rParameters)
Definition: ModelPredicatePipe.hpp:43
decltype((...|std::declval< TPipes >())) Pipeline
Convenience type alias for complex pipes.
Definition: pipe.hpp:225
Definition: MPIUtils.hpp:9
Get the ProcessInfo of a ModelPart.
Definition: basic_pipes.hpp:62
Get STEP from a ProcessInfo.
Definition: basic_pipes.hpp:127
Get TIME from a ProcessInfo.
Definition: basic_pipes.hpp:113
Metaclass containing type information every pipe must inherit from.
Definition: pipe.hpp:72
Base class for functors that take a Model and return a bool.
Definition: ModelPredicate.hpp:25
Dummy base class for registering and exporting exposed classes in WRApplication.
Definition: WRAppClass.hpp:23