KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
get_value_functor.h
Go to the documentation of this file.
1 // | / |
2 // ' / __| _` | __| _ \ __|
3 // . \ | ( | | ( |\__ `
4 // _|\_\_| \__,_|\__|\___/ ____/
5 // Multi-Physics
6 //
7 // License: BSD License
8 // Kratos default license: kratos/license.txt
9 //
10 // Main authors: Riccardo Rossi
11 //
12 
13 #if !defined(KRATOS_GET_VALUE_FUNCTOR_H_INCLUDED )
14 #define KRATOS_GET_VALUE_FUNCTOR_H_INCLUDED
15 
16 
17 // System includes
18 #include <string>
19 #include <iostream>
20 
21 
22 // External includes
23 
24 
25 // Project includes
26 #include "includes/define.h"
27 
28 namespace Kratos
29 {
32 
35 
39 
43 
47 
51 
53 
55 template< class TVariableType >
57 {
58 public:
61 
64 
68 
71  const TVariableType& rVariable
72  )
73  : mrVariable(rVariable)
74  {}
75 
76 
78  virtual ~GetValueFunctor(){}
79 
83  typename TVariableType::Type operator()(GlobalPointer< Node >& gp) const
84  {
85  return gp->GetValue(mrVariable);
86  }
87 
88 
92 
93 
97 
98 
102 
103 
107 
109  virtual std::string Info() const
110  {
111  std::stringstream buffer;
112  buffer << "GetValueFunctor" ;
113  return buffer.str();
114  }
115 
117  virtual void PrintInfo(std::ostream& rOStream) const {rOStream << "GetValueFunctor";}
118 
120  virtual void PrintData(std::ostream& rOStream) const {}
121 
125 
126 
128 
129 protected:
132 
133 
137 
138 
142 
143 
147 
148 
152 
153 
157 
158 
162 
163 
165 
166 private:
169 
170 
174  const TVariableType& mrVariable;
175 
176 
180 
181 
185 
186 
190 
191 
195 
196 
200 
202 
203 }; // Class GetValueFunctor
204 
206 
209 
210 
214 
215 
217 template<class TContainerType>
218 inline std::istream& operator >> (std::istream& rIStream,
220 {return rIStream;}
221 
223 template<class TContainerType>
224 inline std::ostream& operator << (std::ostream& rOStream,
225  const GetValueFunctor<TContainerType>& rThis)
226 {
227  rThis.PrintInfo(rOStream);
228  rOStream << std::endl;
229  rThis.PrintData(rOStream);
230 
231  return rOStream;
232 }
234 
236 
237 } // namespace Kratos.
238 
239 #endif // KRATOS_GET_VALUE_FUNCTOR_H_INCLUDED defined
240 
241 
Short class definition.
Definition: get_value_functor.h:57
GetValueFunctor(const TVariableType &rVariable)
Default constructor.
Definition: get_value_functor.h:70
virtual std::string Info() const
Turn back information as a string.
Definition: get_value_functor.h:109
virtual void PrintInfo(std::ostream &rOStream) const
Print information about this object.
Definition: get_value_functor.h:117
virtual void PrintData(std::ostream &rOStream) const
Print object's data.
Definition: get_value_functor.h:120
TVariableType::Type operator()(GlobalPointer< Node > &gp) const
Definition: get_value_functor.h:83
KRATOS_CLASS_POINTER_DEFINITION(GetValueFunctor)
Pointer definition of GetValueFunctor.
virtual ~GetValueFunctor()
Destructor.
Definition: get_value_functor.h:78
This class is a wrapper for a pointer to a data that is located in a different rank.
Definition: global_pointer.h:44
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &rThis)
input stream function
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432