00001
00002
00003
00004
00005
00006
00007
00008 #ifndef PARMA_H
00009 #define PARMA_H
00010
00014 #include "apf.h"
00015 #include "apfPartition.h"
00016
00022 void Parma_GetEntImbalance(apf::Mesh* mesh, double (*entImb)[4]);
00023
00033 void Parma_GetWeightedEntImbalance(apf::Mesh* mesh, apf::MeshTag* weight,
00034 double (*entImb)[4]);
00035
00043 double Parma_GetWeightedEntImbalance(apf::Mesh* mesh, apf::MeshTag* weight,
00044 int dim);
00045
00056 void Parma_GetNeighborStats(apf::Mesh* m, int& max, int& maxNumParts,
00057 double& avg, int& loc);
00058
00065 void Parma_WriteSmallNeighbors(apf::Mesh* m, int small, const char* prefix);
00066
00073 int Parma_GetSmallestSideMaxNeighborParts(apf::Mesh* m);
00074
00084 void Parma_GetOwnedBdryVtxStats(apf::Mesh* m, int& loc, long& tot, int& min,
00085 int& max, double& avg);
00086
00096 void Parma_GetSharedBdryVtxStats(apf::Mesh* m, int& loc, long& tot, int& min,
00097 int& max, double& avg);
00098
00108 void Parma_GetMdlBdryVtxStats(apf::Mesh* m, int& loc, long& tot, int& min,
00109 int& max, double& avg);
00110
00119 void Parma_GetDisconnectedStats(apf::Mesh* m, int& max, double& avg, int& loc);
00120
00130 void Parma_PrintPtnStats(apf::Mesh* m, std::string key, bool fine=false);
00131
00142 void Parma_PrintWeightedPtnStats(apf::Mesh* m, apf::MeshTag* w, std::string key, bool fine=false);
00143
00148 void Parma_ProcessDisconnectedParts(apf::Mesh* m);
00149
00158 apf::Balancer* Parma_MakeCentroidDiffuser(apf::Mesh* m, double stepFactor = 0.1,
00159 int verbose=0);
00160
00168 apf::Balancer* Parma_MakeShapeOptimizer(apf::Mesh* m, double stepFactor = 0.1,
00169 int verbose=0);
00170
00183 apf::Balancer* Parma_MakeMPASDiffuser(apf::Mesh* m, int layers, int bridge,
00184 double stepFactor = 0.1, int verbosity=0);
00185
00195 apf::Balancer* Parma_MakeGhostEdgeDiffuser(apf::Mesh* m,
00196 double stepFactor = 0.1, int verbosity=0);
00197
00211 apf::Balancer* Parma_MakeGhostDiffuser(apf::Mesh* m, int layers,
00212 double stepFactor = 0.1, int verbosity=0);
00213
00216 apf::Balancer* Parma_MakeGhostDiffuser(apf::Mesh* m, int layers, int bridge,
00217 double stepFactor = 0.1, int verbosity=0);
00218
00224 void Parma_WriteVtxPtn(apf::Mesh* m, const char* prefix);
00225
00232 apf::Balancer* Parma_MakeVtxBalancer(apf::Mesh* m, double stepFactor=0.1,
00233 int verbosity=0);
00234
00241 apf::Balancer* Parma_MakeElmBalancer(apf::Mesh* m, double stepFactor=0.1,
00242 int verbosity=0);
00243
00250 apf::Balancer* Parma_MakeVtxEdgeElmBalancer(apf::Mesh* m,
00251 double stepFactor=0.1, int verbosity=0);
00252
00259 apf::Balancer* Parma_MakeVtxElmBalancer(apf::Mesh* m,
00260 double stepFactor=0.1, int verbosity=0);
00261
00268 apf::Splitter* Parma_MakeRibSplitter(apf::Mesh* m, bool sync = true);
00269
00275 apf::MeshTag* Parma_WeighByMemory(apf::Mesh* m);
00276
00280 struct Parma_GroupCode
00281 {
00293 virtual void run(int group) = 0;
00294 };
00295
00308 void Parma_ShrinkPartition(apf::Mesh2* m, int factor, Parma_GroupCode& toRun);
00309
00321 void Parma_SplitPartition(apf::Mesh2* m, int factor, Parma_GroupCode& toRun);
00322
00331 int Parma_MisNumbering(apf::Mesh* m, int d);
00332
00340 apf::MeshTag* Parma_BfsReorder(apf::Mesh* m, int verbosity=0);
00341
00342 #endif