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.
cpp_tests_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 
17 // External includes
18 
19 // Project includes
20 #include "testing/testing.h"
21 
22 namespace Kratos
23 {
26 
30 
34 
38 
42 // forward declaring ModelPart and Model to be avoid including heavy header here
43 class ModelPart;
44 class Model;
45 
55 namespace CppTestsUtilities
56 {
64  void KRATOS_API(KRATOS_CORE) Create2DGeometry(
65  ModelPart& rModelPart,
66  const std::string& rEntityName = "Element2D3N",
67  const bool Initialize = true,
68  const bool Elements = true
69  );
70 
75  void KRATOS_API(KRATOS_CORE) CreateTestModelPartTriangle2D3N(ModelPart& rModelPart);
76 
85  ModelPart& rModelPart,
86  const std::string& rEntityName = "Element2D4N",
87  const bool Initialize = true,
88  const bool Elements = true
89  );
90 
97  void KRATOS_API(KRATOS_CORE) Create3DGeometry(
98  ModelPart& rModelPart,
99  const std::string& rElementName = "Element3D4N",
100  const bool Initialize = true
101  );
102 
107  void KRATOS_API(KRATOS_CORE) CreateTestModelPartTetrahedra3D4N(ModelPart& rModelPart);
108 
115  void KRATOS_API(KRATOS_CORE) Create3DHexahedraGeometry(
116  ModelPart& rModelPart,
117  const std::string& rElementName = "Element3D8N",
118  const bool Initialize = true
119  );
120 
127  void KRATOS_API(KRATOS_CORE) Create3DQuadraticGeometry(
128  ModelPart& rModelPart,
129  const std::string& rElementName = "Element3D10N",
130  const bool Initialize = true
131  );
132 
140  void KRATOS_API(KRATOS_CORE) CreateSphereTriangularMesh(
141  ModelPart& rModelPart,
142  const std::string& rConditionName = "SurfaceCondition3D3N",
143  const double Radius = 0.25,
144  const std::array<double, 3>& rCenter = {0.0, 0.0, 0.0}
145  );
146 
157  Model& rCurrentModel,
158  const double HalfX = 0.6,
159  const double HalfY = 0.9,
160  const double HalfZ = 0.3,
161  const DataCommunicator& rDataCommunicator = Testing::GetDefaultDataCommunicator()
162  );
163 
171  Model& rCurrentModel,
172  const DataCommunicator& rDataCommunicator = Testing::GetDefaultDataCommunicator()
173  );
174 
175 }; // namespace CppTestsUtilities
176 } // namespace Kratos
#define KRATOS_API(...)
Definition: kratos_export_api.h:40
Kratos::ModelPart ModelPart
Definition: kratos_wrapper.h:31
This namespace includes utilities for simplifying the deploy of C++ tests.
Definition: cpp_tests_utilities.h:44
void CreateSphereTriangularMesh(ModelPart &rModelPart, const std::string &rConditionName, const double Radius, const std::array< double, 3 > &rCenter)
This method creates a simple geometry sphere of triangles.
Definition: cpp_tests_utilities.cpp:403
void Create2DQuadrilateralsGeometry(ModelPart &rModelPart, const std::string &rEntityName, const bool Initialize, const bool Elements)
This method creates a simple geometry in 2D (quadrilaterals)
Definition: cpp_tests_utilities.cpp:118
void Create2DGeometry(ModelPart &rModelPart, const std::string &rEntityName, const bool Initialize, const bool Elements)
This method creates a simple geometry in 2D (triangles)
Definition: cpp_tests_utilities.cpp:28
void Create3DGeometry(ModelPart &rModelPart, const std::string &rElementName, const bool Initialize)
This method creates a simple geometry in 3D (tetrahedra)
Definition: cpp_tests_utilities.cpp:161
void CreateTestModelPartTriangle2D3N(ModelPart &rModelPart)
This method creates a pure (Element) simple geometry in 2D (triangles)
Definition: cpp_tests_utilities.cpp:75
ModelPart & CreateCubeModelPart(Model &rCurrentModel, const DataCommunicator &rDataCommunicator)
Create a cube model part.
Definition: cpp_tests_utilities.cpp:736
void CreateTestModelPartTetrahedra3D4N(ModelPart &rModelPart)
This method creates a pure (Element) simple geometry in 3D (tetrahedra)
Definition: cpp_tests_utilities.cpp:208
ModelPart & CreateCubeSkinModelPart(Model &rCurrentModel, const double HalfX, const double HalfY, const double HalfZ, const DataCommunicator &rDataCommunicator)
Create a cube skin model part.
Definition: cpp_tests_utilities.cpp:625
void Create3DQuadraticGeometry(ModelPart &rModelPart, const std::string &rElementName, const bool Initialize)
This method creates a simple geometry in 3D (tetrahedra quadratic)
Definition: cpp_tests_utilities.cpp:335
void Create3DHexahedraGeometry(ModelPart &rModelPart, const std::string &rElementName, const bool Initialize)
This method creates a simple geometry in 3D (hexahedra)
Definition: cpp_tests_utilities.cpp:298
DataCommunicator & GetDefaultDataCommunicator()
Definition: testing.cpp:24
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
dictionary Model
TODO replace this "model" for real one once available in kratos core.
Definition: script.py:94