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.
interface_object.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: Philipp Bucher, Jordi Cotela
11 //
12 // See Master-Thesis P.Bucher
13 // "Development and Implementation of a Parallel
14 // Framework for Non-Matching Grid Mapping"
15 
16 #pragma once
17 
18 // System includes
19 
20 // External includes
21 
22 // Project includes
23 #include "includes/define.h"
24 #include "includes/node.h"
25 #include "geometries/geometry.h"
26 
27 namespace Kratos
28 {
31 
34 
36 
39 class InterfaceObject : public Point
40 {
41 public:
44 
47 
48  typedef Point BaseType;
49 
51 
52  typedef Node NodeType;
54 
57 
61 
62  enum class ConstructionType
63  {
68  };
69 
73 
74  explicit InterfaceObject(const CoordinatesArrayType& rCoordinates)
75  : Point(rCoordinates) { }
76 
78  virtual ~InterfaceObject() = default;
79 
80 
84 
88 
89  virtual NodePointerType pGetBaseNode() const
90  {
91  KRATOS_ERROR << "Base class function called!" << std::endl;
92  }
93 
95  {
96  KRATOS_ERROR << "Base class function called!" << std::endl;
97  }
98 
99 
103 
105  std::string Info() const override
106  {
107  std::stringstream buffer;
108  buffer << "InterfaceObject" ;
109  return buffer.str();
110  }
111 
113  void PrintInfo(std::ostream& rOStream) const override{rOStream << "InterfaceObject";}
114 
116  void PrintData(std::ostream& rOStream) const override{}
117 
118 
120 
121 protected:
124 
125  // This constructor is called by its derived classes
126  InterfaceObject() : Point(0.0, 0.0, 0.0)
127  {
128  }
129 
131 
132 private:
135 
136  friend class Serializer;
137 
138  void save(Serializer& rSerializer) const override
139  {
140  KRATOS_ERROR << "This object is not supposed to be used with serialization!" << std::endl;
141  }
142  void load(Serializer& rSerializer) override
143  {
144  KRATOS_ERROR << "This object is not supposed to be used with serialization!" << std::endl;
145  }
146 
148 
149 }; // Class InterfaceObject
150 
152 
154 
155 
157 {
158 public:
160 
162 
164  : mpNode(pNode)
165  {
166  noalias(Coordinates()) = mpNode->Coordinates();
167  }
168 
169  NodePointerType pGetBaseNode() const override
170  {
171  return mpNode;
172  }
173 
174 private:
175  NodePointerType mpNode;
176 
177  friend class Serializer;
178 
179  void save(Serializer& rSerializer) const override
180  {
181  KRATOS_ERROR << "This object is not supposed to be used with serialization!" << std::endl;
182  }
183  void load(Serializer& rSerializer) override
184  {
185  KRATOS_ERROR << "This object is not supposed to be used with serialization!" << std::endl;
186  }
187 };
188 
190 {
191 public:
193 
195 
197  : mpGeometry(pGeometry)
198  {
199  noalias(Coordinates()) = mpGeometry->Center();
200  }
201 
203  {
204  return mpGeometry;
205  }
206 
207 private:
208  GeometryPointerType mpGeometry;
209 
210  friend class Serializer;
211 
212  void save(Serializer& rSerializer) const override
213  {
214  KRATOS_ERROR << "This object is not supposed to be used with serialization!" << std::endl;
215  }
216  void load(Serializer& rSerializer) override
217  {
218  KRATOS_ERROR << "This object is not supposed to be used with serialization!" << std::endl;
219  }
220 };
221 
222 } // namespace Kratos.
223 
224 
Geometry base class.
Definition: geometry.h:71
virtual Point Center() const
Definition: geometry.h:1514
Definition: interface_object.h:190
InterfaceObject::GeometryPointerType GeometryPointerType
Definition: interface_object.h:192
InterfaceGeometryObject(GeometryPointerType pGeometry)
Definition: interface_object.h:196
GeometryPointerType pGetBaseGeometry() const override
Definition: interface_object.h:202
InterfaceGeometryObject()
Definition: interface_object.h:194
Definition: interface_object.h:157
InterfaceNode()
Definition: interface_object.h:161
InterfaceNode(NodePointerType pNode)
Definition: interface_object.h:163
InterfaceObject::NodePointerType NodePointerType
Definition: interface_object.h:159
NodePointerType pGetBaseNode() const override
Definition: interface_object.h:169
Object used by the bin-search.
Definition: interface_object.h:40
GeometryType * GeometryPointerType
Definition: interface_object.h:56
virtual GeometryPointerType pGetBaseGeometry() const
Definition: interface_object.h:94
InterfaceObject(const CoordinatesArrayType &rCoordinates)
Definition: interface_object.h:74
Node NodeType
Definition: interface_object.h:52
BaseType::CoordinatesArrayType CoordinatesArrayType
Definition: interface_object.h:50
virtual NodePointerType pGetBaseNode() const
Definition: interface_object.h:89
Geometry< NodeType > GeometryType
Definition: interface_object.h:55
InterfaceObject()
Definition: interface_object.h:126
virtual ~InterfaceObject()=default
Destructor.
std::string Info() const override
Turn back information as a string.
Definition: interface_object.h:105
Point BaseType
Definition: interface_object.h:48
ConstructionType
Definition: interface_object.h:63
NodeType * NodePointerType
Definition: interface_object.h:53
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: interface_object.h:113
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: interface_object.h:116
KRATOS_CLASS_POINTER_DEFINITION(InterfaceObject)
Pointer definition of InterfaceObject.
This class defines the node.
Definition: node.h:65
Point class.
Definition: point.h:59
CoordinatesArrayType const & Coordinates() const
Definition: point.h:215
BaseType CoordinatesArrayType
Definition: point.h:75
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
Short class definition.
Definition: array_1d.h:61
#define KRATOS_ERROR
Definition: exception.h:161
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
T & noalias(T &TheMatrix)
Definition: amatrix_interface.h:484
def load(f)
Definition: ode_solve.py:307