netgen/libsrc/meshing/paralleltop.hpp

138 lines
5.1 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)
*/
2020-08-28 11:57:30 +05:00
DynamicTable<int> loc2distvert;
TABLE<int> loc2distedge, loc2distface;
2009-01-26 00:37:14 +05:00
2020-08-28 11:57:30 +05:00
Array<int> glob_vert;
NgArray<int> glob_edge, glob_face;
2019-07-09 13:39:16 +05:00
NgArray<int> glob_el, glob_surfel, glob_segm;
2012-06-21 20:19:25 +06:00
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();
2020-08-28 11:57:30 +05:00
void IdentifyVerticesAfterRefinement();
2012-06-21 20:19:25 +06:00
// 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);
2020-08-28 11:57:30 +05:00
void SetNV_Loc2Glob (int anv);
2012-06-21 20:19:25 +06:00
void SetNE (int ane);
void SetNSE (int anse);
void SetNSegm (int anseg);
2009-01-26 00:37:14 +05:00
2012-06-21 20:19:25 +06:00
void SetLoc2Glob_Vert (int locnum, int globnum) { glob_vert[locnum-1] = globnum; }
2020-08-21 19:29:33 +05:00
[[deprecated("Try to avoid global enumration!")]]
2012-06-21 20:19:25 +06:00
void SetLoc2Glob_Edge (int locnum, int globnum) { glob_edge[locnum-1] = globnum; }
2020-08-21 19:29:33 +05:00
[[deprecated("Try to avoid global enumration!")]]
2012-06-21 20:19:25 +06:00
void SetLoc2Glob_Face (int locnum, int globnum) { glob_face[locnum-1] = globnum; }
2020-08-21 19:29:33 +05:00
[[deprecated("Try to avoid global enumration!")]]
2012-06-21 20:19:25 +06:00
void SetLoc2Glob_VolEl (int locnum, int globnum) { glob_el[locnum-1] = globnum; }
2020-08-21 19:29:33 +05:00
[[deprecated("Try to avoid global enumration!")]]
2012-06-21 20:19:25 +06:00
void SetLoc2Glob_SurfEl (int locnum, int globnum) { glob_surfel[locnum-1] = globnum; }
2020-08-21 19:29:33 +05:00
[[deprecated("Try to avoid global enumration!")]]
2012-06-21 20:19:25 +06:00
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]; }
2020-08-21 19:29:33 +05:00
[[deprecated("Try to avoid global enumration!")]]
2012-06-21 20:19:25 +06:00
int GetGlobalEdgeNum (int locnum) const { return glob_edge[locnum-1]; }
2020-08-21 19:29:33 +05:00
[[deprecated("Try to avoid global enumration!")]]
2012-06-21 20:19:25 +06:00
int GetGlobalFaceNum (int locnum) const { return glob_face[locnum-1]; }
2020-08-21 19:29:33 +05:00
[[deprecated("Try to avoid global enumration!")]]
2012-06-21 20:19:25 +06:00
int GetGlobalElNum (int locnum) const { return glob_el[locnum-1]; }
2020-08-21 19:29:33 +05:00
[[deprecated("Try to avoid global enumration!")]]
2012-06-21 20:19:25 +06:00
int GetGlobalSElNum (int locnum) const { return glob_surfel[locnum-1]; }
2011-03-03 01:50:39 +05:00
2020-08-21 19:29:33 +05:00
void EnumeratePointsGlobally ();
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
2020-08-21 19:29:33 +05:00
[[deprecated("Use GetDistantPNums(locnum).Size() instead!")]]
int GetNDistantPNums (int locpnum) const { return loc2distvert[locpnum-1].Size(); }
[[deprecated("Use GetDistantFaceNums(locnum).Size() instead!")]]
int GetNDistantFaceNums (int locfacenum) const { return loc2distface[locfacenum-1].Size(); }
[[deprecated("Use GetDistantEdgeNums(locnum).Size() instead!")]]
2012-06-21 20:19:25 +06:00
int GetNDistantEdgeNums ( int locedgenum) const { return loc2distedge[locedgenum-1].Size(); }
2020-08-21 19:29:33 +05:00
[[deprecated("Use GetDistantPNums(locnum) -> FlatArray instead!")]]
2012-06-21 20:19:25 +06:00
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];
}
2020-08-21 19:29:33 +05:00
[[deprecated("Use GetDistantFaceNums(locnum) -> FlatArray instead!")]]
2012-06-21 20:19:25 +06:00
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
2020-08-21 19:29:33 +05:00
[[deprecated("Use GetDistantFaceNums(locnum) -> FlatArray instead!")]]
2019-07-09 13:39:16 +05:00
void GetDistantFaceNums (int locfacenum, NgArray<int> & distfacenums ) const
2012-08-20 20:10:23 +06:00
{
distfacenums = loc2distface[locfacenum-1];
}
2020-08-21 19:29:33 +05:00
[[deprecated("Use GetDistantEdgeNums(locnum) -> FlatArray instead!")]]
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
2020-08-21 19:29:33 +05:00
[[deprecated("Use GetDistantEdgeNums(locnum) -> FlatArray instead!")]]
2019-07-09 13:39:16 +05:00
void GetDistantEdgeNums (int locedgenum, NgArray<int> & distedgenums ) const
2012-08-20 20:10:23 +06:00
{
distedgenums = loc2distedge[locedgenum-1];
}
2020-08-21 19:29:33 +05:00
FlatArray<int> GetDistantPNums (int locnum) const { return loc2distvert[locnum]; }
FlatArray<int> GetDistantFaceNums (int locnum) const { return loc2distface[locnum]; }
FlatArray<int> GetDistantEdgeNums (int locnum) const { return loc2distedge[locnum]; }
2014-12-03 02:50:38 +05:00
2020-08-28 11:57:30 +05:00
[[deprecated("Use GetDistantPNums(..).Contains instead!")]]
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