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.
kernel.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 
14 #if !defined(KRATOS_KERNEL_H_INCLUDED)
15 #define KRATOS_KERNEL_H_INCLUDED
16 
17 // System includes
18 #include <string>
19 #include <iostream>
20 #include <unordered_set>
21 
22 // External includes
23 
24 // Project includes
25 #include "includes/define.h"
27 
28 namespace Kratos {
29 
32 
34 
53 class KRATOS_API(KRATOS_CORE) Kernel {
54  public:
57 
60 
64 
66 
72  Kernel();
73 
75 
77 
79  Kernel(Kernel const& rOther) {}
80 
82  virtual ~Kernel() {}
83 
87 
89 
98  void ImportApplication(KratosApplication::Pointer pNewApplication);
99 
101 
103  void Initialize();
104 
106 
111  void InitializeApplication(KratosApplication& NewApplication) {}
112 
113  bool IsImported(const std::string& ApplicationName) const;
114 
115  static bool IsDistributedRun();
116 
120 
122  virtual std::string Info() const;
123 
125  virtual void PrintInfo(std::ostream& rOStream) const;
126 
128  virtual void PrintData(std::ostream& rOStream) const;
129 
130  static std::unordered_set<std::string>&
131  GetApplicationsList();
132 
133  static std::string Version();
134 
135  static std::string BuildType();
136 
137  static std::string OSName();
138 
139  static std::string PythonVersion();
140 
141  static std::string Compiler();
142 
143  static void SetPythonVersion(std::string);
144 
145  void PrintParallelismSupportInfo() const;
146 
148  protected:
149  private:
152 
153  KratosApplication::Pointer mpKratosCoreApplication;
154 
155  static bool mIsDistributedRun;
156  static std::string mPyVersion;
157 
161 
165 
166  void RegisterKratosCore();
167 
171 
173  Kernel& operator=(Kernel const& rOther);
174 
176 
177 }; // Class Kernel
178 
182 
184 inline std::istream& operator>>(std::istream& rIStream, Kernel& rThis);
185 
187 inline std::ostream& operator<<(std::ostream& rOStream, const Kernel& rThis) {
188  rThis.PrintInfo(rOStream);
189  rOStream << std::endl;
190  rThis.PrintData(rOStream);
191 
192  return rOStream;
193 }
195 
196 } // namespace Kratos.
197 
198 #endif // KRATOS_KERNEL_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
Kernel is in charge of synchronization the whole system of Kratos itself and its application.
Definition: kernel.h:53
Kernel(Kernel const &rOther)
Copy constructor.
Definition: kernel.h:79
virtual ~Kernel()
Destructor.
Definition: kernel.h:82
void InitializeApplication(KratosApplication &NewApplication)
Initializes and synchronizes the list of variables, elements and conditions in each application.
Definition: kernel.h:111
KRATOS_CLASS_POINTER_DEFINITION(Kernel)
Pointer definition of Kernel.
virtual void PrintData(std::ostream &rOStream) const
Print object's data.
Definition: kernel.cpp:85
virtual void PrintInfo(std::ostream &rOStream) const
Print information about this object.
Definition: kernel.cpp:82
This class defines the interface with kernel for all applications in Kratos.
Definition: kratos_application.h:91
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 IsDistributedRun()
Definition: __init__.py:146