/usr/share/netgen/libsrc/meshing/adfront3.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 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 | #ifndef FILE_ADFRONT3
#define FILE_ADFRONT3
/**************************************************************************/
/* File: adfront3.hh */
/* Author: Joachim Schoeberl */
/* Date: 01. Okt. 95 */
/**************************************************************************/
/*
Advancing front class for volume meshing
*/
/// Point in advancing front
class FrontPoint3
{
/// coordinates
Point<3> p;
/// global node index
PointIndex globalindex;
/// number of faces connected to point
int nfacetopoint;
/// distance to original boundary
int frontnr;
///
int cluster;
public:
///
FrontPoint3 ();
///
FrontPoint3 (const Point<3> & ap, PointIndex agi);
///
const Point<3> & P () const
{ return p; }
///
PointIndex GlobalIndex () const
{ return globalindex; }
///
void AddFace ()
{ nfacetopoint++; }
///
void RemoveFace()
{
nfacetopoint--;
if (nfacetopoint == 0) nfacetopoint = -1;
}
///
int Valid () const
{ return nfacetopoint >= 0; }
///
void DecFrontNr (int afrontnr)
{
if (frontnr > afrontnr) frontnr = afrontnr;
}
///
int FrontNr () const
{ return frontnr; }
///
friend class AdFront3;
};
class MiniElement2d
{
protected:
int np;
PointIndex pnum[4];
bool deleted;
public:
MiniElement2d ()
{ np = 3; deleted = 0; }
MiniElement2d (int anp)
{ np = anp; deleted = 0; }
int GetNP() const { return np; }
PointIndex & operator[] (int i) { return pnum[i]; }
const PointIndex operator[] (int i) const { return pnum[i]; }
const PointIndex PNum (int i) const { return pnum[i-1]; }
PointIndex & PNum (int i) { return pnum[i-1]; }
const PointIndex PNumMod (int i) const { return pnum[(i-1)%np]; }
void Delete () { deleted = 1; pnum[0] = pnum[1] = pnum[2] = pnum[3] = PointIndex::BASE-1; }
bool IsDeleted () const { return deleted; }
};
inline ostream & operator<<(ostream & s, const MiniElement2d & el)
{
s << "np = " << el.GetNP();
for (int j = 0; j < el.GetNP(); j++)
s << " " << el[j];
return s;
}
/// Face in advancing front
class FrontFace
{
private:
///
MiniElement2d f;
///
int qualclass;
///
char oldfront;
///
int hashvalue;
///
int cluster;
public:
///
FrontFace ();
///
FrontFace (const MiniElement2d & af);
///
const MiniElement2d & Face () const
{ return f; }
///
int QualClass () const
{ return qualclass; }
///
void IncrementQualClass ()
{ qualclass++; }
///
void ResetQualClass ()
{
if (qualclass > 1)
{
qualclass = 1;
oldfront = 0;
}
}
///
bool Valid () const
{ return !f.IsDeleted(); }
///
void Invalidate ();
///
int HashValue() const
{ return hashvalue; }
///
void SetHashValue(int hv)
{ hashvalue = hv; }
///
friend class AdFront3;
int Cluster () const { return cluster; }
};
/// Advancing front, 3D.
class AdFront3
{
///
Array<FrontPoint3, PointIndex::BASE> points;
///
Array<FrontFace> faces;
///
Array<PointIndex> delpointl;
/// which points are connected to pi ?
TABLE<int, PointIndex::BASE> * connectedpairs;
/// number of total front faces;
int nff;
/// number of quads in front
int nff4;
///
double vol;
///
GeomSearch3d hashtable;
///
int hashon;
///
int hashcreated;
/// counter for rebuilding internal tables
int rebuildcounter;
/// last base element
int lasti;
/// minimal selection-value of baseelements
int minval;
///
class Box3dTree * facetree;
public:
///
AdFront3 ();
///
~AdFront3 ();
///
void GetPoints (Array<Point<3> > & apoints) const;
///
int GetNP() const
{ return points.Size(); }
///
const Point<3> & GetPoint (PointIndex pi) const
{ return points[pi].P(); }
///
int GetNF() const
{ return nff; }
///
const MiniElement2d & GetFace (int i) const
{ return faces.Get(i).Face(); }
///
void Print () const;
///
bool Empty () const
{ return nff == 0; }
///
bool Empty (int elnp) const
{
if (elnp == 4)
return (nff4 == 0);
return (nff - nff4 == 0);
}
///
int SelectBaseElement ();
///
void CreateTrees ();
///
void GetIntersectingFaces (const Point<3> & pmin, const Point<3> & pmax,
Array<int> & ifaces) const;
///
void GetFaceBoundingBox (int i, Box3d & box) const;
///
int GetLocals (int baseelement,
Array<Point3d > & locpoints,
Array<MiniElement2d> & locfaces, // local index
Array<PointIndex> & pindex,
Array<INDEX> & findex,
INDEX_2_HASHTABLE<int> & connectedpairs,
float xh,
float relh,
INDEX& facesplit);
///
void GetGroup (int fi,
Array<MeshPoint> & grouppoints,
Array<MiniElement2d> & groupelements,
Array<PointIndex> & pindex,
Array<INDEX> & findex
) const;
///
void DeleteFace (INDEX fi);
///
PointIndex AddPoint (const Point<3> & p, PointIndex globind);
///
INDEX AddFace (const MiniElement2d & e);
///
INDEX AddConnectedPair (const INDEX_2 & pair);
///
void IncrementClass (INDEX fi)
{ faces.Elem(fi).IncrementQualClass(); }
///
void ResetClass (INDEX fi)
{ faces.Elem(fi).ResetQualClass(); }
///
void SetStartFront (int baseelnp = 0);
/// is Point p inside Surface ?
bool Inside (const Point<3> & p) const;
/// both points on same side ?
int SameSide (const Point<3> & lp1, const Point<3> & lp2,
const Array<int> * testfaces = NULL) const;
///
PointIndex GetGlobalIndex (PointIndex pi) const
{ return points[pi].GlobalIndex(); }
///
double Volume () const
{ return vol; }
private:
void RebuildInternalTables();
};
#endif
|