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.
co_sim_io_conversion_utilities.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: Philipp Bucher (https://github.com/philbucher)
11 //
12 
13 #if !defined(KRATOS_CO_SIM_IO_CONVERSION_UTILITIES_H_INCLUDED )
14 #define KRATOS_CO_SIM_IO_CONVERSION_UTILITIES_H_INCLUDED
15 
16 // System includes
17 
18 // External includes
19 #include "custom_external_libraries/CoSimIO/co_sim_io/includes/model_part.hpp"
20 #include "custom_external_libraries/CoSimIO/co_sim_io/includes/info.hpp"
21 
22 // Project includes
23 #include "includes/define.h"
24 #include "includes/model_part.h"
27 
28 namespace Kratos
29 {
32 
35 
37 
39 class KRATOS_API(CO_SIMULATION_APPLICATION) CoSimIOConversionUtilities
40 {
41 public:
44 
47 
49 
53 
56 
59 
62 
66 
67  static void CoSimIOModelPartToKratosModelPart(
68  const CoSimIO::ModelPart& rCoSimIOModelPart,
69  Kratos::ModelPart& rKratosModelPart,
70  const DataCommunicator& rDataComm);
71 
72  static void KratosModelPartToCoSimIOModelPart(
73  const Kratos::ModelPart& rKratosModelPart,
74  CoSimIO::ModelPart& rCoSimIOModelPart);
75 
76  template<typename TDataType>
77  static void GetData(
78  Kratos::ModelPart& rModelPart,
79  std::vector<double>& rData,
80  const Variable<TDataType>& rVariable,
81  const DataLocation DataLoc);
82 
83  template<typename TDataType>
84  static void SetData(
85  Kratos::ModelPart& rModelPart,
86  const std::vector<double>& rData,
87  const Variable<TDataType>& rVariable,
88  const DataLocation DataLoc);
89 
90  static CoSimIO::Info InfoFromParameters(const Parameters rSettings);
91 
93 
94 }; // Class CoSimIOConversionUtilities
95 
97 
99 
100 } // namespace Kratos.
101 
102 #endif // KRATOS_CO_SIM_IO_CONVERSION_UTILITIES_H_INCLUDED defined
std::string Info() const override
Turn back information as a string.
Definition: periodic_interface_process.hpp:93
Short class definition.
Definition: co_sim_io_conversion_utilities.h:40
CoSimIOConversionUtilities & operator=(CoSimIOConversionUtilities const &rOther)=delete
Assignment operator.
CoSimIOConversionUtilities()=delete
Default constructor.
KRATOS_CLASS_POINTER_DEFINITION(CoSimIOConversionUtilities)
Pointer definition of CoSimIOConversionUtilities.
static void SetData(Kratos::ModelPart &rModelPart, const std::vector< double > &rData, const Variable< TDataType > &rVariable, const DataLocation DataLoc)
static void GetData(Kratos::ModelPart &rModelPart, std::vector< double > &rData, const Variable< TDataType > &rVariable, const DataLocation DataLoc)
CoSimIOConversionUtilities(CoSimIOConversionUtilities const &rOther)=delete
Copy constructor.
Serial (do-nothing) version of a wrapper class for MPI communication.
Definition: data_communicator.h:318
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
Variable class contains all information needed to store and retrive data from a data container.
Definition: variable.h:63
Kratos::ModelPart ModelPart
Definition: kratos_wrapper.h:31
DataLocation
Enum for location of data.
Definition: global_variables.h:48
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21