/usr/share/netgen/libsrc/meshing/paralleltop.hpp is in netgen-headers 4.9.13.dfsg-8build2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 | #ifndef FILE_PARALLELTOP
#define FILE_PARALLELTOP
#include <meshing.hpp>
extern int ntasks;
class ParallelMeshTopology
{
const Mesh & mesh;
// number of local elements, vertices, points (?), edges, faces
int ne, nv, np, ned, nfa;
// number of local segments and surface elements
int nseg, nsurfel;
// number of global elements, vertices, ???, faces
int neglob, nvglob;
int nparel;
int nfaglob;
/**
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)
*/
TABLE<int,PointIndex::BASE> loc2distvert;
TABLE<int,0> loc2distedge, loc2distface, loc2distel;
TABLE<int,0> loc2distsegm, loc2distsurfel;
BitArray * isexchangeface, * isexchangevert, * isexchangeedge, * isexchangeel;
BitArray isghostedge, isghostface;
bool coarseupdate;
int overlap;
public:
ParallelMeshTopology (const Mesh & amesh);
~ParallelMeshTopology ();
/// 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 );
void Reset ();
void SetLoc2Glob_Vert ( int locnum, int globnum ) { loc2distvert[locnum][0] = globnum; }
void SetLoc2Glob_VolEl ( int locnum, int globnum ) { loc2distel[locnum-1][0] = globnum; }
void SetLoc2Glob_SurfEl ( int locnum, int globnum ) { loc2distsurfel[locnum-1][0] = globnum; }
void SetLoc2Glob_Segm ( int locnum, int globnum ) { loc2distsegm[locnum-1][0] = globnum; }
int GetLoc2Glob_Vert ( int locnum ) const { return loc2distvert[locnum][0]; }
int GetLoc2Glob_VolEl ( int locnum ) const { return loc2distel[locnum-1][0]; }
void GetVertNeighbours ( int vnum, Array<int> & dests ) const;
int Glob2Loc_SurfEl ( int globnum );
int Glob2Loc_VolEl ( int globnum );
int Glob2Loc_Segm ( int globnum );
int Glob2Loc_Vert ( int globnum );
int GetNDistantPNums ( int locpnum ) const { return loc2distvert[locpnum].Size() / 2 + 1; }
int GetNDistantFaceNums ( int locfacenum ) const { return loc2distface[locfacenum-1].Size() / 2 + 1; }
int GetNDistantEdgeNums ( int locedgenum ) const { return loc2distedge[locedgenum-1].Size() / 2 + 1; }
int GetNDistantElNums ( int locelnum ) const { return loc2distel[locelnum-1].Size() / 2 + 1; }
int GetDistantPNum ( int proc, int locpnum ) const;
int GetDistantEdgeNum ( int proc, int locedgenum ) const;
int GetDistantFaceNum ( int proc, int locedgenum ) const;
int GetDistantElNum ( int proc, int locelnum ) const;
int GetDistantPNums ( int locpnum, int * distpnums ) const;
int GetDistantEdgeNums ( int locedgenum, int * distedgenums ) const;
int GetDistantFaceNums ( int locedgenum, int * distfacenums ) const;
int GetDistantElNums ( int locelnum, int * distfacenums ) const;
void Print() const;
void SetExchangeFace ( int fnr ) { isexchangeface->Set( (fnr-1)*(ntasks+1) ); }
void SetExchangeVert ( int vnum ) { isexchangevert->Set( (vnum-1)*(ntasks+1) ); }
void SetExchangeElement ( int elnum ) { isexchangeel->Set((elnum-1)*(ntasks+1) ); }
void SetExchangeEdge ( int ednum ) { isexchangeedge->Set ((ednum-1)*(ntasks+1)); }
// fuer diese Fkts kann man ja O(N) - bitarrays lassen
bool IsExchangeVert ( PointIndex vnum ) const
{
return loc2distvert[vnum].Size() > 1;
// return isexchangevert->Test((vnum-1)*(ntasks+1));
}
bool IsExchangeEdge ( int ednum ) const
{
/*
if ( isexchangeedge->Test( (ednum-1)*(ntasks+1) ) !=
( loc2distedge[ednum-1].Size() > 1) )
{
cerr << "isexedge differs, id = " << id << ", ednum = " << ednum << endl;
}
*/
// return loc2distedge[ednum-1].Size() > 1;
int i = (ednum-1)*(ntasks+1);
return isexchangeedge->Test(i);
}
bool IsExchangeFace ( int fnum ) const
{
/*
if ( isexchangeface->Test( (fnum-1)*(ntasks+1) ) !=
( loc2distface[fnum-1].Size() > 1) )
{
cerr << "it differs, id = " << id << ", fnum = " << fnum << endl;
}
*/
// nur hier funktioniert's so nicht ???? (JS)
// return loc2distface[fnum-1].Size() > 1;
return isexchangeface->Test( (fnum-1)*(ntasks+1) );
}
bool IsExchangeElement ( int elnum ) const
{
// return loc2distel[elnum-1].Size() > 1;
return isexchangeel->Test((elnum-1)*(ntasks+1));
}
bool IsExchangeSEl ( int selnum ) const
{
return loc2distsurfel[selnum-1].Size() > 1;
}
void SetExchangeFace (int dest, int fnr )
{
// isexchangeface->Set((fnr-1)*(ntasks+1) + (dest+1));
}
void SetExchangeVert (int dest, int vnum )
{
// isexchangevert->Set((vnum-1)*(ntasks+1) + (dest+1) );
}
void SetExchangeElement (int dest, int vnum )
{
isexchangeel->Set( (vnum-1)*(ntasks+1) + (dest+1) );
}
void SetExchangeEdge (int dest, int ednum )
{
// isexchangeedge->Set ( (ednum-1)*(ntasks+1) + (dest+1) );
}
bool IsExchangeVert (int dest, int vnum ) const
{
FlatArray<int> exchange = loc2distvert[vnum];
for (int i = 1; i < exchange.Size(); i += 2)
if (exchange[i] == dest) return true;
return false;
// return isexchangevert->Test((vnum-1)*(ntasks+1) + (dest+1) );
}
bool IsExchangeEdge (int dest, int ednum ) const
{
FlatArray<int> exchange = loc2distedge[ednum-1];
for (int i = 1; i < exchange.Size(); i += 2)
if (exchange[i] == dest) return true;
return false;
// return isexchangeedge->Test((ednum-1)*(ntasks+1) + (dest+1));
}
bool IsExchangeFace (int dest, int fnum ) const
{
FlatArray<int> exchange = loc2distface[fnum-1];
for (int i = 1; i < exchange.Size(); i += 2)
if (exchange[i] == dest) return true;
return false;
// return isexchangeface->Test((fnum-1)*(ntasks+1) + (dest+1) );
}
bool IsExchangeElement (int dest, int elnum ) const
{
// das geht auch nicht
/*
FlatArray<int> exchange = loc2distel[elnum-1];
for (int i = 1; i < exchange.Size(); i += 2)
if (exchange[i] == dest) return true;
return false;
*/
return isexchangeel->Test((elnum-1)*(ntasks+1) + (dest+1));
}
int Overlap() const
{ return overlap; }
int IncreaseOverlap ()
{ overlap++; return overlap; }
void Update();
void UpdateCoarseGrid();
void UpdateCoarseGridOverlap();
void UpdateRefinement ();
void UpdateTopology ();
void UpdateExchangeElements();
void UpdateCoarseGridGlobal();
bool DoCoarseUpdate() const
{ return !coarseupdate; }
void SetDistantFaceNum ( int dest, int locnum, int distnum );
void SetDistantPNum ( int dest, int locnum, int distnum );
void SetDistantEdgeNum ( int dest, int locnum, int distnum );
void SetDistantEl ( int dest, int locnum, int distnum );
void SetDistantSurfEl ( int dest, int locnum, int distnum );
void SetDistantSegm ( int dest, int locnum, int distnum );
bool IsGhostEl ( int elnum ) const { return mesh.VolumeElement(elnum).IsGhost(); }
bool IsGhostFace ( int fanum ) const { return isghostface.Test(fanum-1); }
bool IsGhostEdge ( int ednum ) const { return isghostedge.Test(ednum-1); }
bool IsGhostVert ( int pnum ) const { return mesh.Point(pnum).IsGhost(); }
// inline void SetGhostVert ( const int pnum )
// { isghostvert.Set(pnum-1); }
void SetGhostEdge ( int ednum )
{ isghostedge.Set(ednum-1); }
void ClearGhostEdge ( int ednum )
{ isghostedge.Clear(ednum-1); }
void SetGhostFace ( int fanum )
{ isghostface.Set(fanum-1); }
void ClearGhostFace ( int fanum )
{ isghostface.Clear(fanum-1); }
bool IsElementInPartition ( int elnum, int dest ) const
{
return IsExchangeElement ( dest, elnum);
}
void SetElementInPartition ( int elnum, int dest )
{
SetExchangeElement ( dest, elnum );
}
void SetNVGlob ( int anvglob ) { nvglob = anvglob; }
void SetNEGlob ( int aneglob ) { neglob = aneglob; }
int GetNVGlob () { return nvglob; }
int GetNEGlob () { return neglob; }
};
#endif
|