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.
specifications_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: Vicente Mataix Ferrandiz
11 //
12 
13 #pragma once
14 
15 // System includes
16 #include <unordered_map>
17 
18 // External includes
19 
20 // Project includes
21 #include "includes/model_part.h"
25 #include "utilities/geometry_utilities.h"
26 
27 namespace Kratos
28 {
31 
35 
39 
43 
47 
48 namespace
49 {
50  template< class TContainerType>
51  std::vector<std::string> GetDofsListFromGenericEntitiesSpecifications(const TContainerType& rContainer);
52 
53  static std::unordered_map<std::string, GeometryData::KratosGeometryType> GenerateStringGeometryMap()
54  {
55  std::unordered_map<std::string, GeometryData::KratosGeometryType> my_map;
56  for (unsigned int i = 0; i < static_cast<unsigned int>(GeometryData::KratosGeometryType::NumberOfGeometryTypes); ++i) {
57  const auto type = static_cast<GeometryData::KratosGeometryType>(i);
58  my_map.insert({GeometryUtils::GetGeometryName(type), type});
59  }
60  return my_map;
61  }
62 
63  // Definition of the map between the geometries in enum and string
64  static std::unordered_map<std::string, GeometryData::KratosGeometryType> string_geometry_map = GenerateStringGeometryMap();
65 
66  // Definition of the map between the dimension and integers
67  static std::unordered_map<std::string, std::size_t> string_dimension_map = {
68  {"2D",2},
69  {"3D",3}
70  };
71 }
72 
79 class KRATOS_API(KRATOS_CORE) SpecificationsUtilities
80 {
81 public:
84 
87 
91  enum class TimeIntegration
92  {
93  Static = 0,
94  Implicit = 1,
95  Explicit = 2
96  };
97 
101  enum class Framework
102  {
103  Lagrangian = 0,
104  Eulerian = 1,
105  ALE = 2
106  };
107 
111 
116 
120 
124 
129  static void AddMissingVariables(ModelPart& rModelPart);
130 
136  static void AddMissingVariablesFromEntitiesList(
137  ModelPart& rModelPart,
138  const Parameters EntitiesList
139  );
140 
147  static void AddMissingVariablesFromSpecifications(
148  ModelPart& rModelPart,
149  const Parameters SpecificationsParameters,
150  const std::string EntityName = "NOT_DEFINED"
151  );
152 
157  static void AddMissingDofs(ModelPart& rModelPart);
158 
164  static void AddMissingDofsFromEntitiesList(
165  ModelPart& rModelPart,
166  const Parameters EntitiesList
167  );
168 
175  static void AddMissingDofsFromSpecifications(
176  ModelPart& rModelPart,
177  const Parameters SpecificationsParameters,
178  const std::string EntityName = "NOT_DEFINED"
179  );
180 
185  static std::vector<std::string> GetDofsListFromSpecifications(const ModelPart& rModelPart);
186 
191  static std::vector<std::string> GetDofsListFromElementsSpecifications(const ModelPart& rModelPart);
192 
197  static std::vector<std::string> GetDofsListFromConditionsSpecifications(const ModelPart& rModelPart);
198 
203  static void DetermineFlagsUsed(const ModelPart& rModelPart);
204 
210  static std::vector<std::string> DetermineTimeIntegration(const ModelPart& rModelPart);
211 
217  static std::string DetermineFramework(const ModelPart& rModelPart);
218 
224  static bool DetermineSymmetricLHS(const ModelPart& rModelPart);
225 
231  static bool DeterminePositiveDefiniteLHS(const ModelPart& rModelPart);
232 
238  static bool DetermineIfCompatibleGeometries(const ModelPart& rModelPart);
239 
245  static bool DetermineIfRequiresTimeIntegration(const ModelPart& rModelPart);
246 
252  static bool CheckCompatibleConstitutiveLaws(const ModelPart& rModelPart);
253 
259  static int CheckGeometricalPolynomialDegree(const ModelPart& rModelPart);
260 
266  static Parameters GetDocumention(const ModelPart& rModelPart);
267 
269 }; // class SpecificationsUtilities
273 
277 
279 } // namespace Kratos
KratosGeometryType
Definition: geometry_data.h:110
static std::string GetGeometryName(const GeometryData::KratosGeometryType TypeOfGeometry)
This function returns a string equivalent for the geometry type.
Definition: geometry_utilities.cpp:25
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
This namespace includes several utilities necessaries for evaluate specifications.
Definition: specifications_utilities.h:80
Framework
This enum defines a "hash" used to identify if Lagrangian/Eulerian or ALE framework is considered.
Definition: specifications_utilities.h:102
TimeIntegration
This enum defines a "hash" used to identify if implicit/explicit or static time integration is consid...
Definition: specifications_utilities.h:92
SpecificationsUtilities()=delete
The default constructor.
KRATOS_CLASS_POINTER_DEFINITION(SpecificationsUtilities)
Counted pointer of SpecificationsUtilities.
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
type
Definition: generate_gid_list_file.py:35
integer i
Definition: TensorModule.f:17