Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef SUNDANCE_SERIALPARTITIONERBASE_H
00032 #define SUNDANCE_SERIALPARTITIONERBASE_H
00033
00034 #include "SundanceDefs.hpp"
00035 #include "SundanceMap.hpp"
00036 #include "SundanceMesh.hpp"
00037 #include "SundanceMeshType.hpp"
00038 #include "SundanceHandle.hpp"
00039
00040 namespace Sundance
00041 {
00042
00043
00044
00045 class SerialPartitionerBase
00046 {
00047 public:
00048
00049
00050 virtual ~SerialPartitionerBase(){;}
00051
00052
00053 void getNeighbors(const Mesh& mesh,
00054 Array<Array<int> >& neighbors, int& nEdges) const ;
00055
00056
00057 Set<int> arrayToSet(const Array<int>& a) const ;
00058
00059
00060 virtual void getAssignments(const Mesh& mesh, int np,
00061 Array<int>& assignments) const = 0 ;
00062
00063
00064 Array<Mesh> makeMeshParts(const Mesh& mesh, int np,
00065 Array<Sundance::Map<int, int> >& oldElemLIDToNewLIDMap,
00066 Array<Sundance::Map<int, int> >& oldVertLIDToNewLIDMap
00067 ) const ;
00068
00069
00070 void getOffProcData(int p,
00071 const Array<int>& elemAssignments,
00072 const Array<int>& nodeAssignments,
00073 Set<int>& offProcNodes,
00074 Set<int>& offProcElems) const ;
00075
00076
00077
00078
00079 void getNodeAssignments(int nProc,
00080 const Array<int>& elemAssignments,
00081 Array<int>& nodeAssignments,
00082 Array<int>& nodeOwnerElems,
00083 Array<int>& nodesPerProc) const ;
00084
00085
00086 void getElemsPerProc(int nProc,
00087 const Array<int>& elemAssignments,
00088 Array<int>& elemsPerProc) const ;
00089
00090
00091
00092
00093 void remapEntities(const Array<int>& assignments, int nProc,
00094 Array<int>& entityMap) const ;
00095
00096
00097 private:
00098
00099
00100 int max(const Set<int>& s) const ;
00101 mutable Array<Set<int> > elemVerts_;
00102 mutable Array<Set<int> > vertElems_;
00103 };
00104 }
00105
00106 #endif