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.
med_model_part_io.h
Go to the documentation of this file.
1 // KRATOS __ __ _ _ _ _ _ _
2 // | \/ | ___ __| | / \ _ __ _ __ | (_) ___ __ _| |_(_) ___ _ ___
3 // | |\/| |/ _ \/ _` | / _ \ | '_ \| '_ \| | |/ __/ _` | __| |/ _ \| '_ |
4 // | | | | __/ (_| |/ ___ \| |_) | |_) | | | (_| (_| | |_| | (_) | | | |
5 // |_| |_|\___|\__,_/_/ \_\ .__/| .__/|_|_|\___\__,_|\__|_|\___/|_| |_|
6 // |_| |_|
7 // License: BSD License
8 // Kratos default license: kratos/license.txt
9 //
10 // Main authors: Philipp Bucher (https://github.com/philbucher)
11 //
12 
13 #pragma once
14 
15 // System includes
16 #include <filesystem>
17 
18 // External includes
19 
20 // Project includes
21 #include "includes/io.h"
22 
23 
24 namespace Kratos {
25 
28 
31 
35 
39 
43 
47 
49 
51 class KRATOS_API(MED_APPLICATION) MedModelPartIO : public IO
52 {
53 public:
56 
59 
63 
66  const std::filesystem::path& rFileName,
67  const Flags Options = IO::READ);
68 
70  MedModelPartIO(MedModelPartIO const& rOther) = delete;
71 
75 
77  MedModelPartIO& operator=(MedModelPartIO const& rOther) = delete;
78 
82 
87  void ReadModelPart(ModelPart& rThisModelPart) override;
88 
93  void WriteModelPart(const ModelPart& rThisModelPart) override;
94 
100  void DivideInputToPartitions(SizeType NumberOfPartitions,
101  const PartitioningInfo& rPartitioningInfo) override;
102 
109  void DivideInputToPartitions(Kratos::shared_ptr<std::iostream> * pStreams,
110  SizeType NumberOfPartitions,
111  const PartitioningInfo& rPartitioningInfo) override;
112 
116 
117 
121 
122 
126 
128  std::string Info() const override
129  {
130  return "MedModelPartIO";
131  }
132 
134  void PrintInfo(std::ostream& rOStream) const override
135  {
136  rOStream << "MedModelPartIO";
137  }
138 
140  void PrintData(std::ostream& rOStream) const override
141  {
142  }
143 
147 
148 
150 
151 protected:
154 
155 
159 
160 
164 
165 
169 
170 
174 
175 
179 
180 
184 
185 
187 
188 private:
191 
192 
196 
197  std::filesystem::path mFileName;
198 
199  Flags mOptions;
200 
201  class MedFileHandler; // forward declared to avoid "med.h" include in header
203 
207 
208 
212 
216 
217 
221 
222 
224 
225 }; // Class MedModelPartIO
226 
228 
231 
232 
236 
237 
239 inline std::istream& operator >> (std::istream& rIStream,
240  MedModelPartIO& rThis);
241 
243 inline std::ostream& operator << (std::ostream& rOStream,
244  const MedModelPartIO& rThis)
245 {
246  rThis.PrintInfo(rOStream);
247  rOStream << std::endl;
248  rThis.PrintData(rOStream);
249 
250  return rOStream;
251 }
253 
255 
256 } // namespace Kratos.
Definition: flags.h:58
IO provides different implementation of input output procedures which can be used to read and write w...
Definition: io.h:58
std::size_t SizeType
Definition: io.h:97
Short class definition.
Definition: med_model_part_io.h:52
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: med_model_part_io.h:140
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: med_model_part_io.h:134
MedModelPartIO & operator=(MedModelPartIO const &rOther)=delete
Assignment operator.
std::string Info() const override
Turn back information as a string.
Definition: med_model_part_io.h:128
MedModelPartIO(MedModelPartIO const &rOther)=delete
Copy constructor.
KRATOS_CLASS_POINTER_DEFINITION(MedModelPartIO)
Pointer definition of MedModelPartIO.
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
string path
Definition: DEM_run_all_benchmarks_analysis.py:10
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
std::shared_ptr< T > shared_ptr
Definition: smart_pointers.h:27
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 ReadModelPart(model_part, inputfile)
Definition: read_modelpart_from_json.py:3
Definition: io.h:103