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.
geometry_dimension.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: Tobias Teschemacher
11 // Philip Bucher
12 // Pooyan Dadvand
13 //
14 //
15 
16 #if !defined(KRATOS_GEOMETRY_DIMENSION_H_INCLUDED )
17 #define KRATOS_GEOMETRY_DIMENSION_H_INCLUDED
18 
19 // System includes
20 
21 // External includes
22 
23 // Project includes
24 #include "includes/define.h"
25 #include "includes/serializer.h"
26 
27 namespace Kratos
28 {
29 
32 
42 {
43 public:
44 
47 
50 
51  typedef std::size_t IndexType;
52  typedef std::size_t SizeType;
53 
57 
72  SizeType ThisWorkingSpaceDimension,
73  SizeType ThisLocalSpaceDimension )
74  : mWorkingSpaceDimension( ThisWorkingSpaceDimension )
75  , mLocalSpaceDimension( ThisLocalSpaceDimension )
76  {
77  }
78 
83  : mWorkingSpaceDimension( rOther.mWorkingSpaceDimension )
84  , mLocalSpaceDimension( rOther.mLocalSpaceDimension )
85  {
86  }
87 
89  virtual ~GeometryDimension() {}
90 
94 
96  {
97  mWorkingSpaceDimension = rOther.mWorkingSpaceDimension;
98  mLocalSpaceDimension = rOther.mLocalSpaceDimension;
99 
100  return *this;
101  }
102 
106 
116  {
117  return mWorkingSpaceDimension;
118  }
119 
129  {
130  return mLocalSpaceDimension;
131  }
132 
136 
138  virtual std::string Info() const
139  {
140  return "geometry dimension";
141  }
142 
144  virtual void PrintInfo( std::ostream& rOStream ) const
145  {
146  rOStream << "geometry dimension";
147  }
148 
150  virtual void PrintData( std::ostream& rOStream ) const
151  {
152  rOStream << " Working space dimension : " << mWorkingSpaceDimension << std::endl;
153  rOStream << " Local space dimension : " << mLocalSpaceDimension;
154  }
155 
157 
158 private:
161 
162  SizeType mWorkingSpaceDimension;
163 
164  SizeType mLocalSpaceDimension;
165 
169 
170  friend class Serializer;
171 
172  virtual void save( Serializer& rSerializer ) const
173  {
174  rSerializer.save( "WorkingSpaceDimension", mWorkingSpaceDimension );
175  rSerializer.save( "LocalSpaceDimension", mLocalSpaceDimension );
176  }
177 
178  virtual void load( Serializer& rSerializer )
179  {
180  rSerializer.load( "WorkingSpaceDimension", mWorkingSpaceDimension );
181  rSerializer.load( "LocalSpaceDimension", mLocalSpaceDimension );
182  }
183 
184  // Private default constructor for serialization
185  GeometryDimension()
186  {
187  }
188 
190 
191 }; // Class GeometryDimension
192 
196 
198 inline std::istream& operator >> ( std::istream& rIStream,
199  GeometryDimension& rThis );
200 
202 inline std::ostream& operator << ( std::ostream& rOStream,
203  const GeometryDimension& rThis )
204 {
205  rThis.PrintInfo( rOStream );
206  rOStream << std::endl;
207  rThis.PrintData( rOStream );
208 
209  return rOStream;
210 }
211 
213 
214 } // namespace Kratos.
215 
216 #endif // KRATOS_GEOMETRY_DIMENSION_H_INCLUDED defined
Definition: geometry_dimension.h:42
SizeType LocalSpaceDimension() const
Definition: geometry_dimension.h:128
virtual std::string Info() const
Turn back information as a string.
Definition: geometry_dimension.h:138
KRATOS_CLASS_POINTER_DEFINITION(GeometryDimension)
Pointer definition of GeometryDimension.
std::size_t IndexType
Definition: geometry_dimension.h:51
GeometryDimension(SizeType ThisWorkingSpaceDimension, SizeType ThisLocalSpaceDimension)
Definition: geometry_dimension.h:71
SizeType WorkingSpaceDimension() const
Definition: geometry_dimension.h:115
virtual void PrintInfo(std::ostream &rOStream) const
Print information about this object.
Definition: geometry_dimension.h:144
GeometryDimension & operator=(const GeometryDimension &rOther)
Definition: geometry_dimension.h:95
virtual void PrintData(std::ostream &rOStream) const
Print object's data.
Definition: geometry_dimension.h:150
GeometryDimension(const GeometryDimension &rOther)
Definition: geometry_dimension.h:82
std::size_t SizeType
Definition: geometry_dimension.h:52
virtual ~GeometryDimension()
Destructor. Do nothing!!!
Definition: geometry_dimension.h:89
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
void load(std::string const &rTag, TDataType &rObject)
Definition: serializer.h:207
void save(std::string const &rTag, std::array< TDataType, TDataSize > const &rObject)
Definition: serializer.h:545
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
std::size_t SizeType
The definition of the size type.
Definition: mortar_classes.h:43
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
def load(f)
Definition: ode_solve.py:307