6 #include "containers/variable.h"
7 #include "includes/process_info.h"
8 #include "containers/model.h"
9 #include "includes/model_part.h"
10 #include "includes/kratos_parameters.h"
11 #include "utilities/interval_utility.h"
50 {
return rModel.GetModelPart(mModelPartName);}
55 std::string mModelPartName;
71 const ProcessInfo&
operator()(
const ModelPart& rModelPart)
const
72 {
return rModelPart.GetProcessInfo();}
81 template <
class TVariable>
88 : mVariable({rVariable})
97 typename TVariable::Type
operator()(
const ProcessInfo& rProcessInfo)
const
99 KRATOS_ERROR_IF_NOT(
bool(mVariable)) <<
"uninitialized variable in VariableFromProcessInfo";
100 return rProcessInfo[mVariable.value().get()];
106 std::optional<std::reference_wrapper<const TVariable>> mVariable;
140 template <
class TValue,
class TOperator>
159 template <
class TValue>
174 {
return mInterval.IsInInterval(Value);}
185 template <
class TValue>
199 TValue operator()(TValue Value)
const
201 if constexpr (std::is_integral_v<TValue>) {
202 return Value % mModulo;
204 return std::fmod(Value, mModulo);
217 template <
class TValue>
225 Add(const Parameters& rParameters);
227 TValue operator()(TValue input) const noexcept
229 return input + mValue;
242 template <
class TInput>
256 bool operator()(TInput) const noexcept
274 #include "wrapp/pipes/impl/basic_pipes_impl.hpp"
Add a constant value to the input.
Definition: basic_pipes.hpp:219
static Parameters GetDefaultParameters()
Perform a comparison operation on the input as the left hand side.
Definition: basic_pipes.hpp:142
static Parameters GetDefaultParameters()
Comparison(const Parameters &rParameters)
bool operator()(TValue lhs) const noexcept
Return a bool regardless of the input.
Definition: basic_pipes.hpp:244
ConstPredicate() noexcept
static Parameters GetDefaultParameters()
Pipe wrapper for Detail::IntervalUtility.
Definition: basic_pipes.hpp:161
IntervalPredicate(TValue begin, TValue end)
bool operator()(TValue Value) const
Definition: basic_pipes.hpp:173
IntervalPredicate(const Parameters &rParameters)
IntervalPredicate(IntervalPredicate &&rOther) noexcept=default
static Parameters GetDefaultParameters()
IntervalPredicate()=default
IntervalPredicate(const IntervalPredicate &rOther)=default
Get a ModelPart from a Model by name.
Definition: basic_pipes.hpp:35
ModelPartFromModel(ModelPartFromModel &&rOther) noexcept=default
ModelPartFromModel(const ModelPartFromModel &rOther)=default
ModelPartFromModel(const Parameters &rParameters)
ModelPartFromModel(std::string &&rModelPartName) noexcept
ModelPartFromModel()=default
static Parameters GetDefaultParameters()
ModelPartFromModel(const std::string &rModelPartName)
const ModelPart & operator()(const Model &rModel) const
Definition: basic_pipes.hpp:49
Compute the mod of the input.
Definition: basic_pipes.hpp:187
static Parameters GetDefaultParameters()
Get a variable from ProcessInfo.
Definition: basic_pipes.hpp:83
TVariable::Type operator()(const ProcessInfo &rProcessInfo) const
Definition: basic_pipes.hpp:97
VariableFromProcessInfo(const VariableFromProcessInfo &rOther)=default
VariableFromProcessInfo(const TVariable &rVariable)
Definition: basic_pipes.hpp:87
static Parameters GetDefaultParameters()
VariableFromProcessInfo(VariableFromProcessInfo &&rOther) noexcept=default
VariableFromProcessInfo()=default
VariableFromProcessInfo(const Parameters &rParameters)
Utility class for membership tests on a 1D interval.
Definition: IntervalUtility.hpp:26
Unix-inspired pipes in C++.
Definition: basic_pipes.hpp:23
Get the ProcessInfo of a ModelPart.
Definition: basic_pipes.hpp:62
const ProcessInfo & operator()(const ModelPart &rModelPart) const
Definition: basic_pipes.hpp:71
ProcessInfoFromModelPart(const ProcessInfoFromModelPart &rOther)=default
static Parameters GetDefaultParameters()
ProcessInfoFromModelPart(ProcessInfoFromModelPart &&rOther) noexcept=default
ProcessInfoFromModelPart() noexcept=default
Get STEP from a ProcessInfo.
Definition: basic_pipes.hpp:127
StepFromProcessInfo(const Parameters &rParameters)
StepFromProcessInfo(StepFromProcessInfo &&rOther)=default
StepFromProcessInfo(const StepFromProcessInfo &rOther)=default
Get TIME from a ProcessInfo.
Definition: basic_pipes.hpp:113
TimeFromProcessInfo(const TimeFromProcessInfo &rOther)=default
TimeFromProcessInfo(const Parameters &rParameters)
TimeFromProcessInfo(TimeFromProcessInfo &&rOther)=default
Metaclass containing type information every pipe must inherit from.
Definition: pipe.hpp:72