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.
test_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: Suneth Warnakulasuriya
11 //
12 
13 #if !defined(KRATOS_RANS_TEST_UTILITIES_H_INCLUDED)
14 #define KRATOS_RANS_TEST_UTILITIES_H_INCLUDED
15 
16 // System includes
17 #include <functional>
18 
19 // External includes
20 
21 // Project includes
22 #include "includes/model_part.h"
23 
24 namespace Kratos
25 {
26 namespace RansApplicationTestUtilities
27 {
28 using IndexType = std::size_t;
29 
30 template <class TDataType>
31 KRATOS_API(RANS_APPLICATION) void AssignRandomValues(
32  TDataType& rValue,
33  const std::string& rSeed,
34  const double MinValue = 0.0,
35  const double MaxValue = 1.0);
36 
37 KRATOS_API(RANS_APPLICATION) ModelPart& CreateTestModelPart(
38  Model& rModel,
39  const std::string& rElementName,
40  const std::string& rConditionName,
41  const std::function<void(ModelPart& rModelPart)>& rAddNodalSolutionStepVariablesFuncion,
42  const std::function<void(ModelPart::NodeType&)>& rAddDofsFunction,
43  const std::function<void(Properties&)>& rSetProperties,
44  const int BufferSize = 2);
45 
47  Model& rModel,
48  const std::string& rElementName,
49  const std::string& rConditionName,
50  const std::function<void(ModelPart& rModelPart)>& rAddNodalSolutionStepVariablesFuncion,
51  const std::function<void(Properties&)>& rSetProperties,
52  const Variable<double>& rDofVariable,
53  const int BufferSize = 2,
54  const bool DoInitializeElements = true,
55  const bool DoInitializeConditions = true);
56 
57 template <class TDataType>
58 KRATOS_API(RANS_APPLICATION) void RandomFillNodalHistoricalVariable(
59  ModelPart& rModelPart,
60  const Variable<TDataType>& rVariable,
61  const double MinValue = 0.0,
62  const double MaxValue = 1.0,
63  const int Step = 0);
64 
65 template <class TContainerType, class TDataType>
66 KRATOS_API(RANS_APPLICATION) void RandomFillContainerVariable(
67  ModelPart& rModelPart,
68  const Variable<TDataType>& rVariable,
69  const double MinValue = 0.0,
70  const double MaxValue = 1.0);
71 
72 template <class TContainerType>
73 KRATOS_API(RANS_APPLICATION) void TestEquationIdVector(
74  ModelPart& rModelPart);
75 
76 template <class TContainerType>
77 KRATOS_API(RANS_APPLICATION) void TestGetDofList(
78  ModelPart& rModelPart,
79  const Variable<double>& rVariable);
80 
81 KRATOS_API(RANS_APPLICATION) void CheckElementsAndConditions(
82  const ModelPart& rModelPart);
83 
84 } // namespace RansApplicationTestUtilities
85 } // namespace Kratos
86 
87 #endif
This class aims to manage different model parts across multi-physics simulations.
Definition: model.h:60
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
This class defines the node.
Definition: node.h:65
Properties encapsulates data shared by different Elements or Conditions. It can store any type of dat...
Definition: properties.h:69
#define KRATOS_API(...)
Definition: kratos_export_api.h:40
void TestGetDofList(ModelPart &rModelPart, const Variable< double > &rVariable)
Definition: test_utilities.cpp:211
std::size_t IndexType
Definition: test_utilities.h:28
void TestEquationIdVector(ModelPart &rModelPart)
Definition: test_utilities.cpp:196
ModelPart & CreateTestModelPart(Model &rModel, const std::string &rElementName, const std::string &rConditionName, const std::function< void(ModelPart &rModelPart)> &rAddNodalSolutionStepVariablesFuncion, const std::function< void(ModelPart::NodeType &)> &rAddDofsFunction, const std::function< void(Properties &)> &rSetProperties, const int BufferSize)
Definition: test_utilities.cpp:94
void CheckElementsAndConditions(const ModelPart &rModelPart)
Definition: test_utilities.cpp:227
ModelPart & CreateScalarVariableTestModelPart(Model &rModel, const std::string &rElementName, const std::string &rConditionName, const std::function< void(ModelPart &rModelPart)> &rAddNodalSolutionStepVariablesFuncion, const std::function< void(Properties &)> &rSetProperties, const Variable< double > &rDofVariable, const int BufferSize, const bool DoInitializeElements, const bool DoInitializeConditions)
Definition: test_utilities.cpp:132
void RandomFillContainerVariable(ModelPart &rModelPart, const Variable< TDataType > &rVariable, const double MinValue, const double MaxValue)
Definition: test_utilities.cpp:179
void AssignRandomValues(double &rValue, const std::string &rSeed, const double MinValue, const double MaxValue)
Definition: test_utilities.cpp:48
void RandomFillNodalHistoricalVariable(ModelPart &rModelPart, const Variable< TDataType > &rVariable, const double MinValue, const double MaxValue, const int Step)
Definition: test_utilities.cpp:163
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21