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.
universal_file_io.h
Go to the documentation of this file.
1 // ==============================================================================
2 // KratosShapeOptimizationApplication
3 //
4 // License: BSD License
5 // license: ShapeOptimizationApplication/license.txt
6 //
7 // Main authors: Baumgaertner Daniel, https://github.com/dbaumgaertner
8 //
9 // ==============================================================================
10 
11 #ifndef UNIVERSAL_FILE_IO_H
12 #define UNIVERSAL_FILE_IO_H
13 
14 // ------------------------------------------------------------------------------
15 // System includes
16 // ------------------------------------------------------------------------------
17 #include <iostream>
18 #include <string>
19 
20 // ------------------------------------------------------------------------------
21 // Project includes
22 // ------------------------------------------------------------------------------
23 #include "includes/model_part.h"
24 
25 // ==============================================================================
26 
27 namespace Kratos
28 {
29 
32 
36 
37 
41 
45 
49 
51 
58 class KRATOS_API(SHAPE_OPTIMIZATION_APPLICATION) UniversalFileIO
59 {
60 public:
63 
67 
69  UniversalFileIO( ModelPart& OutputModelPart, std::string OutputFilenameWithoutExtension, std::string WriteConditionsFlag, Parameters NodalResults );
70 
72  virtual ~UniversalFileIO()
73  {
74  }
75 
76 
80 
81 
85 
86  // ==============================================================================
87  void InitializeLogging();
88 
89  // --------------------------------------------------------------------------
90  void WriteMeshToResultFile();
91 
92  // --------------------------------------------------------------------------
93  void InitializeOutputFile();
94 
95  // --------------------------------------------------------------------------
96  void WriteUnits();
97 
98  // --------------------------------------------------------------------------
99  void WriteNodes();
100 
101  // --------------------------------------------------------------------------
102  void WriteElements();
103 
104  // --------------------------------------------------------------------------
105  void WriteAllElementsButNoConditions();
106 
107  // --------------------------------------------------------------------------
108  void WriteConditionsAsDummyElements();
109 
110  // --------------------------------------------------------------------------
111  void LogNodalResults( const int optimizationIteration );
112 
113  // ==============================================================================
114 
118 
119 
123 
124 
128 
130  virtual std::string Info() const
131  {
132  return "UniversalFileIO";
133  }
134 
136  virtual void PrintInfo(std::ostream& rOStream) const
137  {
138  rOStream << "UniversalFileIO";
139  }
140 
142  virtual void PrintData(std::ostream& rOStream) const
143  {
144  }
145 
146 
150 
151 
153 
154 protected:
157 
158 
162 
163 
167 
168 
172 
173 
177 
178 
182 
183 
187 
188 
190 
191 private:
194 
195 
199 
200  // ==============================================================================
201  // Initialized by class constructor
202  // ==============================================================================
203  ModelPart& mrOutputModelPart;
204  std::string mOutputFilenameWithExtension;
205  Parameters mrNodalResults;
206  std::string mWriteConditionsFlag;
207 
211 
212 
216 
217 
221 
222 
226 
227 
231 
233 // UniversalFileIO& operator=(UniversalFileIO const& rOther);
234 
236 // UniversalFileIO(UniversalFileIO const& rOther);
237 
238 
240 
241 }; // Class UniversalFileIO
242 
244 
247 
248 
252 
254 
255 
256 } // namespace Kratos.
257 
258 #endif // UNIVERSAL_FILE_IO_H
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
Short class definition.
Definition: universal_file_io.h:59
virtual std::string Info() const
Turn back information as a std::string.
Definition: universal_file_io.h:130
virtual ~UniversalFileIO()
Destructor.
Definition: universal_file_io.h:72
virtual void PrintInfo(std::ostream &rOStream) const
Print information about this object.
Definition: universal_file_io.h:136
virtual void PrintData(std::ostream &rOStream) const
Print object's data.
Definition: universal_file_io.h:142
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
WriteConditionsFlag
Definition: gid_io.h:53