netgen/libsrc/meshing/paralleltop.hpp

109 lines
3.3 KiB
C++
Raw Normal View History

2009-01-26 00:37:14 +05:00
#ifndef FILE_PARALLELTOP
#define FILE_PARALLELTOP
2011-03-03 01:50:39 +05:00
namespace netgen
2009-01-26 00:37:14 +05:00
{
2011-03-03 01:50:39 +05:00
class ParallelMeshTopology
2009-01-26 00:37:14 +05:00
{
2011-03-03 01:50:39 +05:00
const Mesh & mesh;
2009-01-26 00:37:14 +05:00
2011-03-03 01:50:39 +05:00
/**
mapping from local to distant vertex number
each row of the table corresponds to one vertex
each row contains a list of pairs (procnr, dist_vnum)
*/
2009-01-26 00:37:14 +05:00
2012-06-21 20:19:25 +06:00
TABLE<int> loc2distvert, loc2distedge, loc2distface;
Array<int> glob_vert, glob_edge, glob_face;
Array<int> glob_el, glob_surfel, glob_segm;
bool is_updated;
2009-01-26 00:37:14 +05:00
2011-03-03 01:50:39 +05:00
public:
2009-01-26 00:37:14 +05:00
2011-03-03 01:50:39 +05:00
ParallelMeshTopology (const Mesh & amesh);
~ParallelMeshTopology ();
2009-01-26 00:37:14 +05:00
2011-03-03 01:50:39 +05:00
void Reset ();
2012-06-21 20:19:25 +06:00
void Print() const;
2009-01-26 00:37:14 +05:00
2012-06-21 20:19:25 +06:00
void UpdateCoarseGrid();
void UpdateCoarseGridGlobal();
// bool DoCoarseUpdate() const { return !coarseupdate; }
2012-06-16 18:04:04 +06:00
2009-01-26 00:37:14 +05:00
2012-06-21 20:19:25 +06:00
/// set number of local vertices, reset sizes of loc2dist_vert, isexchangevert...
void SetNV (int anv);
void SetNE (int ane);
void SetNSE (int anse);
void SetNSegm (int anseg);
2009-01-26 00:37:14 +05:00
2011-07-15 22:26:32 +06:00
2012-06-21 20:19:25 +06:00
void SetLoc2Glob_Vert (int locnum, int globnum) { glob_vert[locnum-1] = globnum; }
void SetLoc2Glob_Edge (int locnum, int globnum) { glob_edge[locnum-1] = globnum; }
void SetLoc2Glob_Face (int locnum, int globnum) { glob_face[locnum-1] = globnum; }
void SetLoc2Glob_VolEl (int locnum, int globnum) { glob_el[locnum-1] = globnum; }
void SetLoc2Glob_SurfEl (int locnum, int globnum) { glob_surfel[locnum-1] = globnum; }
void SetLoc2Glob_Segm (int locnum, int globnum) { glob_segm[locnum-1] = globnum; }
2009-01-26 00:37:14 +05:00
2012-06-21 20:19:25 +06:00
int GetGlobalPNum (int locnum) const { return glob_vert[locnum-1]; }
int GetGlobalEdgeNum (int locnum) const { return glob_edge[locnum-1]; }
int GetGlobalFaceNum (int locnum) const { return glob_face[locnum-1]; }
int GetGlobalElNum (int locnum) const { return glob_el[locnum-1]; }
int GetGlobalSElNum (int locnum) const { return glob_surfel[locnum-1]; }
2011-03-03 01:50:39 +05:00
2012-06-21 20:19:25 +06:00
void SetDistantFaceNum (int dest, int locnum);
void SetDistantPNum (int dest, int locnum);
void SetDistantEdgeNum (int dest, int locnum);
2011-03-03 01:50:39 +05:00
2012-06-21 20:19:25 +06:00
int GetNDistantPNums (int locpnum) const { return loc2distvert[locpnum-1].Size(); }
int GetNDistantFaceNums (int locfacenum) const { return loc2distface[locfacenum-1].Size(); }
int GetNDistantEdgeNums ( int locedgenum) const { return loc2distedge[locedgenum-1].Size(); }
void GetDistantPNums (int locpnum, int * distpnums ) const
2011-03-03 01:50:39 +05:00
{
2012-06-21 20:19:25 +06:00
for (int i = 0; i < loc2distvert[locpnum-1].Size(); i++ )
distpnums[i] = loc2distvert[locpnum-1][i];
}
void GetDistantFaceNums (int locfacenum, int * distfacenums ) const
2011-03-03 01:50:39 +05:00
{
2012-06-21 20:19:25 +06:00
for ( int i = 0; i < loc2distface[locfacenum-1].Size(); i++ )
distfacenums[i] = loc2distface[locfacenum-1][i];
}
2012-08-20 20:10:23 +06:00
void GetDistantFaceNums (int locfacenum, Array<int> & distfacenums ) const
{
distfacenums = loc2distface[locfacenum-1];
}
2012-06-21 20:19:25 +06:00
void GetDistantEdgeNums (int locedgenum, int * distedgenums ) const
{
for (int i = 0; i < loc2distedge[locedgenum-1].Size(); i++ )
distedgenums[i] = loc2distedge[locedgenum-1][i];
}
2011-03-03 01:50:39 +05:00
2012-08-20 20:10:23 +06:00
void GetDistantEdgeNums (int locedgenum, Array<int> & distedgenums ) const
{
distedgenums = loc2distedge[locedgenum-1];
}
2012-06-21 20:19:25 +06:00
bool IsExchangeVert (int dest, int vnum) const
2011-03-03 01:50:39 +05:00
{
2012-06-21 20:19:25 +06:00
return loc2distvert[vnum-1].Contains (dest);
2011-03-03 01:50:39 +05:00
}
};
2009-01-26 00:37:14 +05:00
2011-03-03 01:50:39 +05:00
}
2009-01-26 00:37:14 +05:00
#endif