-
Notifications
You must be signed in to change notification settings - Fork 64
/
Copy pathapfZoltan.h
128 lines (109 loc) · 4.31 KB
/
apfZoltan.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
/*
* Copyright (C) 2014 Scientific Computation Research Center
*
* This work is open source software, licensed under the terms of the
* BSD license as described in the LICENSE file in the top-level directory.
*/
#ifndef APF_ZOLTAN_H
#define APF_ZOLTAN_H
/** \page zoltan APF-Zoltan
Zoltan is a unification of several scientific data partitioning tools
which are especially suited to parallel mesh partitioning.
It is developed at Sandia National Labs, and its home page is
http://www.cs.sandia.gov/zoltan/
This package implements an interface between APF and Zoltan,
Converting data from an apf::Mesh to Zoltan data structures,
running one of the many algorithms available in Zoltan, and
using the result to migrate the mesh.
By using a mesh abstraction together with a partitioner abstraction,
we create a very general and useful component.
The interface is in apfZoltan.h
*/
/** \file apfZoltan.h
\brief Zoltan partitioning for apf::Mesh objects */
#include <apfNumbering.h>
namespace apf {
/** \brief Zoltan partitioning method */
enum ZoltanMethod {
/** \brief Recursive Coordinate Bisection */
RCB,
/** \brief Recursive Inertial Bisection */
RIB,
/** \brief Hyper-graph partitioning */
HYPERGRAPH,
/** \brief Use ParMetis */
PARMETIS,
PTSCOTCH, /**< Use PT-Scotch */
/** \brief General graph partitionig */
GRAPH
};
/** \brief Zoltan partitioning approach */
enum ZoltanApproach {
/** \brief (Hyper)Graph - does not consider the initial distribution */
PARTITION,
/** \brief (Hyper)Graph - considers the initial distribution */
REPARTITION,
/** \brief (HYPER)Graph - targets partitions needing only small changes */
REFINE,
/** \brief Graph - multilevel */
PART_KWAY,
/** \brief Graph - space filling curves */
PART_GEOM,
/** \brief Graph - hybrid method combining PART_KWAY and PART_GEOM */
PART_GEOM_KWAY,
/** \brief Graph - targets graphs generated from adaptively refined meshes */
ADAPT_REPART,
/** \brief Graph - targets partitions needing only small changes*/
REFINE_KWAY
};
class Mesh;
class Splitter;
class Balancer;
class MeshTag;
/** \brief Make a Zoltan Splitter object
\details the resulting splitter will apply Zoltan
to the local mesh part to break it into several new parts.
\param method select from apf::ZoltanMethod
\param approach select from apf::ZoltanApproach
\param debug print the full Zoltan configuration when splitting
\param sync all parts are splitting by the same factor,
multiply the part ids in the resulting apf::Migration
accordingly */
Splitter* makeZoltanSplitter(Mesh* mesh, int method, int approach,
bool debug = false, bool sync = true);
/** \brief Make a Zoltan Splitter object
\details the resulting splitter will apply Zoltan
to the global mesh part to break it into several new parts.
\param method select from apf::ZoltanMethod
\param approach select from apf::ZoltanApproach
\param debug print the full Zoltan configuration when splitting
*/
Splitter* makeZoltanGlobalSplitter(Mesh* mesh, int method, int approach,
bool debug = false);
/** \brief Make a Zoltan Balancer object
\details this Balancer will apply Zoltan to the global mesh
to improve load balance.
Also note that this Balancer will create a Zoltan edge
between two elements that share matched faces.
\param method select from apf::ZoltanMethod
\param approach select from apf::ZoltanApproach
\param debug print the full Zoltan configuration */
Balancer* makeZoltanBalancer(Mesh* mesh, int method, int approach,
bool debug = false);
/** \brief Tag global ids of opposite elements to boundary faces
\details this function creates a LONG tag of one value
and attaches to all partition boundary faces the global
id of the element on the other side.
\param gn global element numbering
\param name the name of the resulting tag */
MeshTag* tagOpposites(GlobalNumbering* gn, const char* name);
/** \brief Get an element-to-element connectivity array
\details this function assumes the mesh has one element type.
the resulting array is created with new int[nelements * nsides].
nsides is the number of faces of an element.
entry [i * nsides + j] is the global id of the j'th adjacent
element to local element i, which can be -1 for a geometric
boundary. */
int* getElementToElement(apf::Mesh* m);
}
#endif