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.
hdf5_nodal_solution_step_data_io.h
Go to the documentation of this file.
1 // | / |
2 // ' / __| _` | __| _ \ __|
3 // . \ | ( | | ( |\__ `
4 // _|\_\_| \__,_|\__|\___/ ____/
5 // Multi-Physics
6 //
7 // License: BSD License
8 // license: HDF5Application/license.txt
9 //
10 // Main author: Michael Andre, https://github.com/msandre
11 //
12 
13 #if !defined(KRATOS_HDF5_NODAL_SOLUTION_STEP_DATA_IO_H_INCLUDED)
14 #define KRATOS_HDF5_NODAL_SOLUTION_STEP_DATA_IO_H_INCLUDED
15 
16 // System includes
17 #include <string>
18 #include <vector>
19 
20 // External includes
21 
22 // Project includes
23 #include "includes/define.h"
24 
25 // Application includes
27 #include "custom_io/hdf5_file.h"
28 
29 namespace Kratos
30 {
31 
32 class Parameters;
33 class Communicator;
34 
35 namespace HDF5
36 {
39 
42 
44 class KRATOS_API(HDF5_APPLICATION) NodalSolutionStepDataIO
45 {
46 public:
49 
52 
56 
58  NodalSolutionStepDataIO(Parameters Settings, File::Pointer pFile);
59 
63 
64  void WriteNodalResults(ModelPart& rModelPart, unsigned Step=0);
65 
66  void ReadNodalResults(ModelPart& rModelPart, unsigned Step=0);
67 
69 
70 protected:
73 
74  std::string const& GetPrefix() const noexcept
75  {
76  return mPrefix;
77  }
78 
79  std::vector<std::string> const& VariableNames() const noexcept
80  {
81  return mVariableNames;
82  }
83 
85  {
86  return *mpFile;
87  }
88 
90 
91 private:
94  File::Pointer mpFile;
95  std::string mPrefix;
96  std::vector<std::string> mVariableNames;
100 
102 
103 }; // class NodalSolutionStepDataIO.
104 
107 } // namespace HDF5.
108 } // namespace Kratos.
109 
110 #endif // KRATOS_HDF5_NODAL_SOLUTION_STEP_DATA_IO_H_INCLUDED defined
A base class for reading and writing an HDF5 file.
Definition: hdf5_file.h:57
A class for IO of nodal solution step data in HDF5.
Definition: hdf5_nodal_solution_step_data_io.h:45
std::string const & GetPrefix() const noexcept
Definition: hdf5_nodal_solution_step_data_io.h:74
File & GetFile()
Definition: hdf5_nodal_solution_step_data_io.h:84
KRATOS_CLASS_POINTER_DEFINITION(NodalSolutionStepDataIO)
Pointer definition.
std::vector< std::string > const & VariableNames() const noexcept
Definition: hdf5_nodal_solution_step_data_io.h:79
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
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
tuple const
Definition: ode_solve.py:403