SCOREC core
Parallel unstructured mesh tools
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
parma.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2011-2013 Scientific Computation Research Center
3  *
4  * This work is open source software, licensed under the terms of the
5  * BSD license as described in the LICENSE file in the top-level directory.
6  */
7 
8 #ifndef PARMA_H
9 #define PARMA_H
10 
14 #include "apf.h"
15 #include "apfPartition.h"
16 
22 void Parma_GetEntImbalance(apf::Mesh* mesh, double (*entImb)[4]);
23 
33 void Parma_GetWeightedEntImbalance(apf::Mesh* mesh, apf::MeshTag* weight,
34  double (*entImb)[4]);
35 
43 double Parma_GetWeightedEntImbalance(apf::Mesh* mesh, apf::MeshTag* weight,
44  int dim);
45 
56 void Parma_GetNeighborStats(apf::Mesh* m, int& max, int& maxNumParts,
57  double& avg, int& loc);
58 
65 void Parma_WriteSmallNeighbors(apf::Mesh* m, int small, const char* prefix);
66 
74 
84 void Parma_GetOwnedBdryVtxStats(apf::Mesh* m, int& loc, long& tot, int& min,
85  int& max, double& avg);
86 
96 void Parma_GetSharedBdryVtxStats(apf::Mesh* m, int& loc, long& tot, int& min,
97  int& max, double& avg);
98 
108 void Parma_GetMdlBdryVtxStats(apf::Mesh* m, int& loc, long& tot, int& min,
109  int& max, double& avg);
110 
119 void Parma_GetDisconnectedStats(apf::Mesh* m, int& max, double& avg, int& loc);
120 
130 void Parma_PrintPtnStats(apf::Mesh* m, std::string key, bool fine=false);
131 
142 void Parma_PrintWeightedPtnStats(apf::Mesh* m, apf::MeshTag* w, std::string key, bool fine=false);
143 
149 
158 apf::Balancer* Parma_MakeCentroidDiffuser(apf::Mesh* m, double stepFactor = 0.1,
159  int verbose=0);
160 
168 apf::Balancer* Parma_MakeShapeOptimizer(apf::Mesh* m, double stepFactor = 0.1,
169  int verbose=0);
170 
183 apf::Balancer* Parma_MakeMPASDiffuser(apf::Mesh* m, int layers, int bridge,
184  double stepFactor = 0.1, int verbosity=0);
185 
196  double stepFactor = 0.1, int verbosity=0);
197 
212  double stepFactor = 0.1, int verbosity=0);
213 
216 apf::Balancer* Parma_MakeGhostDiffuser(apf::Mesh* m, int layers, int bridge,
217  double stepFactor = 0.1, int verbosity=0);
218 
224 void Parma_WriteVtxPtn(apf::Mesh* m, const char* prefix);
225 
232 apf::Balancer* Parma_MakeVtxBalancer(apf::Mesh* m, double stepFactor=0.1,
233  int verbosity=0);
234 
241 apf::Balancer* Parma_MakeElmBalancer(apf::Mesh* m, double stepFactor=0.1,
242  int verbosity=0);
243 
251  double stepFactor=0.1, int verbosity=0);
252 
260  double stepFactor=0.1, int verbosity=0);
261 
268 apf::Splitter* Parma_MakeRibSplitter(apf::Mesh* m, bool sync = true);
269 
275 apf::MeshTag* Parma_WeighByMemory(apf::Mesh* m);
276 
281 {
293  virtual void run(int group) = 0;
294 };
295 
308 void Parma_ShrinkPartition(apf::Mesh2* m, int factor, Parma_GroupCode& toRun);
309 
321 void Parma_SplitPartition(apf::Mesh2* m, int factor, Parma_GroupCode& toRun);
322 
331 int Parma_MisNumbering(apf::Mesh* m, int d);
332 
340 apf::MeshTag* Parma_BfsReorder(apf::Mesh* m, int verbosity=0);
341 
342 #endif
User-defined code to run on process sub-groups.
Definition: parma.h:280
apf::Balancer * Parma_MakeCentroidDiffuser(apf::Mesh *m, double stepFactor=0.1, int verbose=0)
create an APF Balancer using centroid diffusion
int Parma_MisNumbering(apf::Mesh *m, int d)
Compute maximal independent set numbering.
The APF Field interface.
Load balance over all mesh parts.
Definition: apfPartition.h:46
void Parma_GetMdlBdryVtxStats(apf::Mesh *m, int &loc, long &tot, int &min, int &max, double &avg)
get the number of vertices classified on the model boundary
void Parma_SplitPartition(apf::Mesh2 *m, int factor, Parma_GroupCode &toRun)
Split the processes into groups of (factor).
void Parma_WriteVtxPtn(apf::Mesh *m, const char *prefix)
write the vertex based partition to file
apf::MeshTag * Parma_WeighByMemory(apf::Mesh *m)
create a mesh tag that weighs elements by their memory consumption
apf::Balancer * Parma_MakeVtxBalancer(apf::Mesh *m, double stepFactor=0.1, int verbosity=0)
create an APF Balancer targeting vertex imbalance
void Parma_ShrinkPartition(apf::Mesh2 *m, int factor, Parma_GroupCode &toRun)
Shrink the mesh into N/factor processes.
void Parma_GetNeighborStats(apf::Mesh *m, int &max, int &maxNumParts, double &avg, int &loc)
get the maximum and average number of vtx-connected neighboring parts
void Parma_GetOwnedBdryVtxStats(apf::Mesh *m, int &loc, long &tot, int &min, int &max, double &avg)
get the number of owned vertices on inter-part boundaries
void Parma_GetWeightedEntImbalance(apf::Mesh *mesh, apf::MeshTag *weight, double(*entImb)[4])
see Parma_GetEntImbalance(...)
apf::Balancer * Parma_MakeElmBalancer(apf::Mesh *m, double stepFactor=0.1, int verbosity=0)
create an APF Balancer targeting element imbalance
tools for changing mesh partitioning
void Parma_GetEntImbalance(apf::Mesh *mesh, double(*entImb)[4])
get entity imbalance
void Parma_GetDisconnectedStats(apf::Mesh *m, int &max, double &avg, int &loc)
get the maximum, average and local number of face-disconnected components
apf::Balancer * Parma_MakeVtxElmBalancer(apf::Mesh *m, double stepFactor=0.1, int verbosity=0)
create an APF Balancer targeting vertex, and elm imbalance
apf::Balancer * Parma_MakeMPASDiffuser(apf::Mesh *m, int layers, int bridge, double stepFactor=0.1, int verbosity=0)
create an APF Balancer for MPAS
apf::Balancer * Parma_MakeShapeOptimizer(apf::Mesh *m, double stepFactor=0.1, int verbose=0)
create an APF Balancer to optimize part shape
Interface to a mesh part.
Definition: apfMesh.h:103
apf::Balancer * Parma_MakeGhostEdgeDiffuser(apf::Mesh *m, double stepFactor=0.1, int verbosity=0)
create an edge balancer that is ghost aware
apf::Splitter * Parma_MakeRibSplitter(apf::Mesh *m, bool sync=true)
create an APF Splitter using recursive inertial bisection
apf::Balancer * Parma_MakeGhostDiffuser(apf::Mesh *m, int layers, double stepFactor=0.1, int verbosity=0)
create an APF Balancer using ghost element aware diffusion for a vertex-based partition ...
apf::Balancer * Parma_MakeVtxEdgeElmBalancer(apf::Mesh *m, double stepFactor=0.1, int verbosity=0)
create an APF Balancer targeting vertex, edge, and elm imbalance
void Parma_ProcessDisconnectedParts(apf::Mesh *m)
re-connect disconnected parts
void Parma_GetSharedBdryVtxStats(apf::Mesh *m, int &loc, long &tot, int &min, int &max, double &avg)
get the number of shared vertices on inter-part boundaries
Extended mesh interface for modification.
Definition: apfMesh2.h:29
void Parma_PrintPtnStats(apf::Mesh *m, std::string key, bool fine=false)
prints partition stats
void Parma_WriteSmallNeighbors(apf::Mesh *m, int small, const char *prefix)
write the number of parts with neighbors formed by a small number of shared vtx
Splits a mesh part into many.
Definition: apfPartition.h:21
int Parma_GetSmallestSideMaxNeighborParts(apf::Mesh *m)
get the smallest number of shared vertices forming a neighbor ,a 'side', in a part with the maximum n...
void Parma_PrintWeightedPtnStats(apf::Mesh *m, apf::MeshTag *w, std::string key, bool fine=false)
prints partition stats using entity weights
apf::MeshTag * Parma_BfsReorder(apf::Mesh *m, int verbosity=0)
reorder the mesh via a breadth first search
virtual void run(int group)=0
Called withing sub-groups.