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.
nodal_data.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: Pooyan Dadvand
11 //
12 
13 #if !defined(KRATOS_NODAL_DATA_H_INCLUDED )
14 #define KRATOS_NODAL_DATA_H_INCLUDED
15 
16 // System includes
17 #include <iostream>
18 
19 // External includes
20 
21 // Project includes
23 
24 namespace Kratos
25 {
28 
31 
33 
36 class KRATOS_API(KRATOS_CORE) NodalData
37 {
38 public:
41 
44 
45  using IndexType = std::size_t;
46 
47  using SizeType = std::size_t;
48 
50 
52 
56 
57  NodalData(IndexType TheId);
58 
59  NodalData(IndexType TheId, VariablesList::Pointer pVariablesList, SizeType NewQueueSize = 1);
60 
61  NodalData(IndexType TheId, VariablesList::Pointer pVariablesList, BlockType const * ThisData, SizeType NewQueueSize = 1);
62 
65 
69 
71  NodalData& operator=(NodalData const& rOther);
72 
76 
77 
81 
83  IndexType Id() const
84  {
85  return mId;
86  }
87 
89  IndexType GetId() const
90  {
91  return mId;
92  }
93 
95  void SetId(IndexType NewId)
96  {
97  mId = NewId;
98  }
99 
100 
102  {
103  mSolutionStepsNodalData = TheData;
104  }
105 
107  {
108  return mSolutionStepsNodalData;
109  }
110 
112  {
113  return mSolutionStepsNodalData;
114  }
115 
119 
120 
124 
126  std::string Info() const;
127 
129  void PrintInfo(std::ostream& rOStream) const;
130 
132  void PrintData(std::ostream& rOStream) const;
133 
134 
138 
139 
141 
142 private:
145 
146 
150 
151  IndexType mId;
152 
153  SolutionStepsNodalDataContainerType mSolutionStepsNodalData;
154 
158 
159 
163 
167 
168  friend class Serializer;
169 
170  // Only for serializer
171  NodalData() : mId(0), mSolutionStepsNodalData(){}
172 
173  void save(Serializer& rSerializer) const;
174 
175  void load(Serializer& rSerializer);
176 
180 
181 
185 
186 
190 
192  NodalData(NodalData const& rOther);
193 
194 
196 
197 }; // Class NodalData
198 
200 
203 
204 
208 
209 
211 inline std::istream& operator >> (std::istream& rIStream,
212  NodalData& rThis);
213 
215 inline std::ostream& operator << (std::ostream& rOStream,
216  const NodalData& rThis)
217 {
218  rThis.PrintInfo(rOStream);
219  rOStream << std::endl;
220  rThis.PrintData(rOStream);
221 
222  return rOStream;
223 }
225 
227 
228 } // namespace Kratos.
229 
230 #endif // KRATOS_NODAL_DATA_H_INCLUDED defined
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
std::string Info() const override
Turn back information as a string.
Definition: periodic_interface_process.hpp:93
Stores all data and dofs which are stored in each elements.
Definition: nodal_data.h:37
const VariablesListDataValueContainer & GetSolutionStepData() const
Definition: nodal_data.h:111
std::size_t SizeType
Definition: nodal_data.h:47
void SetId(IndexType NewId)
Sets the Id of the Node.
Definition: nodal_data.h:95
IndexType Id() const
Returns the Id of the Node. Same as GetId to ensure backward compatibility.
Definition: nodal_data.h:83
void SetSolutionStepData(VariablesListDataValueContainer const &TheData)
Definition: nodal_data.h:101
void PrintInfo(std::ostream &rOStream) const
Print information about this object.
Definition: nodal_data.cpp:62
VariablesListDataValueContainer::BlockType BlockType
Definition: nodal_data.h:51
~NodalData()
Destructor.
Definition: nodal_data.h:64
VariablesListDataValueContainer & GetSolutionStepData()
Definition: nodal_data.h:106
void PrintData(std::ostream &rOStream) const
Print object's data.
Definition: nodal_data.cpp:68
IndexType GetId() const
Returns the Id of the Node.
Definition: nodal_data.h:89
std::size_t IndexType
Definition: nodal_data.h:45
KRATOS_CLASS_POINTER_DEFINITION(NodalData)
Pointer definition of NodalData.
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
A shared variable list gives the position of each variable in the containers sharing it.
Definition: variables_list_data_value_container.h:61
VariablesList::BlockType BlockType
The block type definition.
Definition: variables_list_data_value_container.h:70
std::size_t IndexType
The definition of the index type.
Definition: key_hash.h:35
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
def load(f)
Definition: ode_solve.py:307