netgen/libsrc/meshing/ruler3.hpp

212 lines
5.6 KiB
C++
Raw Normal View History

2009-01-13 04:40:13 +05:00
#ifndef FILE_RULER3
#define FILE_RULER3
namespace netgen
{
2009-01-13 04:40:13 +05:00
/**
3D element generation rule.
*/
class vnetrule
{
private:
/// rule is applicable for quality classes above this value
int quality;
/// name of rule
char * name;
/// point coordinates in reference position
2019-07-09 13:39:16 +05:00
NgArray<Point3d> points;
2009-01-13 04:40:13 +05:00
/// old and new faces in reference numbering
2019-07-09 13:39:16 +05:00
NgArray<Element2d> faces;
2009-01-13 04:40:13 +05:00
/// additional edges of rule
2019-07-09 13:39:16 +05:00
NgArray<twoint> edges;
2009-01-13 04:40:13 +05:00
/// points of freezone in reference coordinates
2019-07-09 13:39:16 +05:00
NgArray<Point3d> freezone;
2009-01-13 04:40:13 +05:00
/// points of freezone in reference coordinates if tolcalss to infty
2019-07-09 13:39:16 +05:00
NgArray<Point3d> freezonelimit;
2009-01-13 04:40:13 +05:00
/// point index, if point equal to mappoint, otherwise 0
2019-07-09 13:39:16 +05:00
NgArray<int> freezonepi;
2009-01-13 04:40:13 +05:00
/// faces of each convex part of freezone
2019-07-09 13:39:16 +05:00
NgArray<NgArray<threeint>*> freefaces;
2009-01-13 04:40:13 +05:00
/// set of points of each convex part of freezone
2019-07-09 13:39:16 +05:00
NgArray<NgArray<int>*> freesets;
2009-01-13 04:40:13 +05:00
/// points of transformed freezone
2019-07-09 13:39:16 +05:00
NgArray<Point3d> transfreezone;
2009-01-13 04:40:13 +05:00
/// edges of each convex part of freezone
2019-07-09 13:39:16 +05:00
NgArray<NgArray<twoint>*> freeedges;
2009-01-13 04:40:13 +05:00
/// face numbers to be deleted
2019-07-09 13:39:16 +05:00
NgArray<int> delfaces;
2009-01-13 04:40:13 +05:00
/// elements to be generated
2019-07-09 13:39:16 +05:00
NgArray<Element> elements;
2009-01-13 04:40:13 +05:00
/// tolerances for points and faces (used ??)
2019-07-09 13:39:16 +05:00
NgArray<double> tolerances, linetolerances;
2009-01-13 04:40:13 +05:00
/// transformation matrix
DenseMatrix oldutonewu;
/// transformation matrix: deviation old point to dev. freezone
DenseMatrix * oldutofreezone;
/** transformation matrix: deviation old point to dev. freezone,
quality class to infinity */
DenseMatrix * oldutofreezonelimit;
// can be deleted:
// BaseMatrix *outf, *outfl;
/**
a point is outside of convex part of freezone,
iff mat * (point, 1) >= 0 for each component (correct ?)
*/
2019-07-09 13:39:16 +05:00
NgArray<DenseMatrix*> freefaceinequ;
2009-01-13 04:40:13 +05:00
///
2019-07-09 13:39:16 +05:00
NgArray<fourint> orientations;
2009-01-13 04:40:13 +05:00
/**
flags specified in rule-description file:
t .. test rule
*/
2019-07-09 13:39:16 +05:00
NgArray<char> flags;
2009-01-13 04:40:13 +05:00
/**
topological distance of face to base element
non-connected: > 100 (??)
*/
2019-07-09 13:39:16 +05:00
NgArray<int> fnearness;
NgArray<int> pnearness;
2009-01-13 04:40:13 +05:00
int maxpnearness;
/// number of old points in rule
int noldp;
/// number of new poitns in rule
int noldf;
/// box containing free-zone
public:
// double fzminx, fzmaxx, fzminy, fzmaxy, fzminz, fzmaxz;
Box3d fzbox;
public:
///
vnetrule ();
///
~vnetrule ();
///
int GetNP () const { return points.Size(); }
///
int GetNF () const { return faces.Size(); }
///
int GetNE () const { return elements.Size(); }
///
int GetNO () const { return orientations.Size(); }
///
int GetNEd () const { return edges.Size(); }
///
int GetNOldP () const { return noldp; }
///
int GetNOldF () const { return noldf; }
///
int GetNDelF () const { return delfaces.Size(); }
///
int GetQuality () const { return quality; }
///
int GetFNearness (int fi) const { return fnearness.Get(fi); }
///
int GetPNearness (int pi) const { return pnearness.Get(pi); }
///
int GetMaxPNearness () const { return maxpnearness; }
///
const Point3d & GetPoint (int i) const { return points.Get(i); }
///
const Element2d & GetFace (int i) const { return faces.Get(i); }
///
const Element & GetElement (int i) const { return elements.Get(i); }
///
const twoint & GetEdge (int i) const { return edges.Get(i); }
///
int GetDelFace (int i) const { return delfaces.Get(i); }
///
int IsDelFace (int fn) const;
///
float CalcPointDist (int pi, const Point3d & p) const;
///
double PointDistFactor (int pi) const
{
return tolerances.Get(pi);
}
///
void SetFreeZoneTransformation (const Vector & allp,
int tolclass);
///
int IsInFreeZone (const Point3d & p) const;
/**
0 not in free-zone
1 in free-zone
-1 maybe
*/
int IsTriangleInFreeZone (const Point3d & p1, const Point3d & p2,
2019-07-09 13:39:16 +05:00
const Point3d & p3, const NgArray<int> & pi, int newone);
2009-01-13 04:40:13 +05:00
///
int IsQuadInFreeZone (const Point3d & p1, const Point3d & p2,
const Point3d & p3, const Point3d & p4,
2019-07-09 13:39:16 +05:00
const NgArray<int> & pi, int newone);
2009-01-13 04:40:13 +05:00
///
int IsTriangleInFreeSet (const Point3d & p1, const Point3d & p2,
2019-07-09 13:39:16 +05:00
const Point3d & p3, int fs, const NgArray<int> & pi, int newone);
2009-01-13 04:40:13 +05:00
///
int IsQuadInFreeSet (const Point3d & p1, const Point3d & p2,
const Point3d & p3, const Point3d & p4,
2019-07-09 13:39:16 +05:00
int fs, const NgArray<int> & pi, int newone);
2009-01-13 04:40:13 +05:00
///
int ConvexFreeZone () const;
/// if t1 and t2 are neighbourtriangles, NTP returns the opposite Point of t1 in t2
int NeighbourTrianglePoint (const threeint & t1, const threeint & t2) const;
///
const Point3d & GetTransFreeZone (int i) { return transfreezone.Get(i); }
///
int GetNP (int fn) const
{ return faces.Get(fn).GetNP(); }
///
2024-12-15 00:21:18 +05:00
PointIndex GetPointNr (int fn, int endp) const
2009-01-13 04:40:13 +05:00
{ return faces.Get(fn).PNum(endp); }
///
int GetPointNrMod (int fn, int endp) const
{ return faces.Get(fn).PNumMod(endp); }
///
const fourint & GetOrientation (int i) { return orientations.Get(i); }
///
int TestFlag (char flag) const;
///
const DenseMatrix & GetOldUToNewU () const { return oldutonewu; }
//
// const DenseMatrix & GetOldUToFreeZone () const { return oldutofreezone; }
//
// const DenseMatrix & GetOldUToFreeZoneLimit () const
// { return oldutofreezonelimit; }
///
const char * Name () const { return name; }
///
void LoadRule (istream & ist);
///
2019-07-09 13:39:16 +05:00
const NgArray<Point3d> & GetTransFreeZone () { return transfreezone; }
2009-01-13 04:40:13 +05:00
///
int TestOk () const;
///
friend void TestRules ();
///
// friend void Plot3DRule (const ROT3D & r, char key);
};
} // namespace netgen
2009-01-13 04:40:13 +05:00
#endif