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.
legacy_partitioning_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: Philipp Bucher (https://github.com/philbucher)
11 //
12 
13 #pragma once
14 
15 // System includes
16 
17 
18 // External includes
19 #include "metis.h"
20 
21 
22 // Project includes
23 #include "includes/io.h"
24 
25 
26 namespace Kratos {
27 
30 
33 
35 
37 class KRATOS_API(METIS_APPLICATION) LegacyPartitioningUtilities
38 {
39 public:
42 
45 
46  using idxtype = idx_t; // from metis
47  using PartitionIndicesType = std::vector<idxtype>;
48  using SizeType = std::size_t;
49 
53 
56 
59 
63 
66 
70 
71  static void CalculateDomainsGraph(
72  IO::GraphType& rDomainsGraph,
73  SizeType NumberOfElements,
74  IO::ConnectivitiesContainerType& ElementsConnectivities,
75  PartitionIndicesType const& NPart,
76  PartitionIndicesType const& EPart);
77 
78  static void DividingNodes(
79  IO::PartitionIndicesContainerType& rNodesAllPartitions,
80  IO::ConnectivitiesContainerType& ElementsConnectivities,
81  IO::ConnectivitiesContainerType& ConditionsConnectivities,
82  PartitionIndicesType const& NodesPartitions,
83  PartitionIndicesType const& ElementsPartitions,
84  PartitionIndicesType const& ConditionsPartitions);
85 
86  static void DividingElements(
87  IO::PartitionIndicesContainerType& rElementsAllPartitions,
88  PartitionIndicesType const& ElementsPartitions);
89 
90  static void DividingConditions(
91  IO::PartitionIndicesContainerType& rConditionsAllPartitions,
92  PartitionIndicesType const& ConditionsPartitions);
93 
94  static void ConvertKratosToCSRFormat(
95  IO::ConnectivitiesContainerType& KratosFormatNodeConnectivities,
96  idxtype** NodeIndices,
97  idxtype** NodeConnectivities);
98 
100 
101 }; // Class LegacyPartitioningUtilities
102 
104 
106 
107 } // namespace Kratos
std::vector< std::vector< std::size_t > > ConnectivitiesContainerType
Definition: io.h:91
std::vector< std::vector< std::size_t > > PartitionIndicesContainerType
Definition: io.h:93
Definition: amatrix_interface.h:41
This class contains legacy versions of utilities used by the metis partitioners.
Definition: legacy_partitioning_utilities.h:38
std::vector< idxtype > PartitionIndicesType
Definition: legacy_partitioning_utilities.h:47
idx_t idxtype
Definition: legacy_partitioning_utilities.h:46
LegacyPartitioningUtilities(LegacyPartitioningUtilities const &rOther)=delete
Copy constructor.
std::size_t SizeType
Definition: legacy_partitioning_utilities.h:48
LegacyPartitioningUtilities()=delete
Default constructor.
LegacyPartitioningUtilities & operator=(LegacyPartitioningUtilities const &rOther)=delete
Assignment operator.
KRATOS_CLASS_POINTER_DEFINITION(LegacyPartitioningUtilities)
Pointer definition of LegacyPartitioningUtilities.
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21