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.
sampling_tool.h
Go to the documentation of this file.
1 //
2 // Project Name: Kratos
3 // Last Modified by: $Author: G.Casas (gcasas@cimmne.upc.edu) $
4 // Date: $Date: 2016-6-13 08:56:42 $
5 // Revision: $Revision: 1.5 $
6 //
7 //
8 //README::::look to the key word "VERSION" if you want to find all the points where you have to change something so that you can pass from a kdtree to a bin data search structure;
9 
10 #if !defined(KRATOS_SAMPLING_TOOL)
11 #define KRATOS_SAMPLING_TOOL
12 
13 // /* External includes */
14 #ifdef _OPENMP
15 #include <omp.h>
16 #endif
17 
18 // System includes
19 #include <vector>
20 
21 // Project includes
22 #include "includes/model_part.h"
23 #include "utilities/timer.h"
24 #include "utilities/openmp_utils.h"
26 
27 //Database includes
28 #include "includes/define.h"
31 
32 namespace Kratos
33 {
35 {
36 public:
37 
38 typedef ModelPart::ElementsContainerType::iterator ElementIterator;
39 typedef ModelPart::NodesContainerType::iterator NodeIterator;
41 
43 
46 
47 virtual ~SamplingTool(){}
48 
50 
51 //**************************************************************************************************************************************************
52 //**************************************************************************************************************************************************
53 
54 
55 //**************************************************************************************************************************************************
56 //**************************************************************************************************************************************************
57 
58 private:
59 
60 //**************************************************************************************************************************************************
61 //**************************************************************************************************************************************************
62 
66 DenseVector<unsigned int> mElementsPartition;
67 
71 
72 
73 DenseVector<unsigned int>& GetElementPartition()
74 {
75  return mElementsPartition;
76 }
77 
78 ElementIterator GetElementPartitionBegin(ModelPart& r_model_part, unsigned int k)
79 {
80  return r_model_part.GetCommunicator().LocalMesh().Elements().ptr_begin() + mElementsPartition[k];
81 }
82 
83 ElementIterator GetElementPartitionEnd(ModelPart& r_model_part, unsigned int k)
84 {
85  return r_model_part.GetCommunicator().LocalMesh().Elements().ptr_begin() + mElementsPartition[k + 1];
86 }
87 
88 //**************************************************************************************************************************************************
89 //**************************************************************************************************************************************************
90 
91 }; // Class SamplingTool
92 } // namespace Kratos.
93 
94 #endif // KRATOS_SAMPLING_TOOL defined
95 
96 
Definition: amatrix_interface.h:41
MeshType::NodesContainerType NodesContainerType
Nodes container. Which is a vector set of nodes with their Id's as key.
Definition: model_part.h:128
Definition: sampling_tool.h:35
virtual ~SamplingTool()
Calculator.
Definition: sampling_tool.h:47
ModelPart::NodesContainerType::iterator NodeIterator
Definition: sampling_tool.h:39
ModelPart::NodesContainerType NodesArrayType
Definition: sampling_tool.h:40
KRATOS_CLASS_POINTER_DEFINITION(SamplingTool)
SamplingTool()
Definition: sampling_tool.h:44
ModelPart::ElementsContainerType::iterator ElementIterator
Definition: sampling_tool.h:38
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
int k
Definition: quadrature.py:595