Path: blob/devel/ElmerGUI/netgen/libsrc/csg/specpoin.hpp
3206 views
#ifndef FILE_SPECPOIN1#define FILE_SPECPOIN234/**************************************************************************/5/* File: specpoin.hpp */6/* Author: Joachim Schoeberl */7/* Date: 01. Okt. 95 */8/**************************************************************************/910/*1112Special Point Calculation1314*/1516class Surface;17class Solid;1819/// Special point.20class SpecialPoint21{22public:23/// coordinates24Point<3> p;25/// tangential to edge26Vec<3> v;27///28int layer;29/// point must be used in mesh30bool unconditional;3132/// surfaces defining edge33int s1, s2;34/// if s1 and s2 are only representatives, then these are the original indices35int s1_orig, s2_orig;36int nr;37///38SpecialPoint () : p(0,0,0), v(0,0,0), layer(0), unconditional(0), s1(0), s2(0), s1_orig(0), s2_orig(0)39{ ; }4041///42SpecialPoint (const SpecialPoint & sp2);4344///45SpecialPoint & operator= (const SpecialPoint & sp2);4647///48void Print (ostream & str) const;495051int GetLayer() const { return layer; }5253///54bool HasSurfaces (int as1, int as2) const55{56return (s1 == as1 && s2 == as2 || s1 == as2 && s2 == as1);57}58};5960inline ostream & operator<< (ostream & ost, const SpecialPoint & sp)61{62sp.Print (ost);63return ost;64}6566676869///70class SpecialPointCalculation71{72private:73///74const CSGeometry * geometry;75///76ARRAY<MeshPoint> * points;77///78ARRAY<long int> boxesinlevel;7980///81double size;82///83double relydegtest; // maximal dimension of bisection intervall for84/// test of degeneration parameters85double cpeps1, epeps1, epeps2, epspointdist2;8687double ideps;8889public:9091///92SpecialPointCalculation ();9394///95void SetIdEps(const double epsin) {ideps = epsin;}9697///98void CalcSpecialPoints (const CSGeometry & ageometry,99ARRAY<MeshPoint> & points);100///101void AnalyzeSpecialPoints (const CSGeometry & geometry,102ARRAY<MeshPoint> & points,103ARRAY<SpecialPoint> & specpoints);104105protected:106///107void CalcSpecialPointsRec (const Solid * sol, int layer,108const BoxSphere<3> & box,109int level,110bool calccp, bool calcep);111112113///114bool CrossPointNewtonConvergence (const Surface * f1, const Surface * f2,115const Surface * f3, const BoxSphere<3> & box);116///117bool CrossPointDegenerated (const Surface * f1, const Surface * f2,118const Surface * f3, const BoxSphere<3> & box) const;119///120void CrossPointNewton (const Surface * f1, const Surface * f2,121const Surface * f3, Point<3> & p);122123bool EdgeNewtonConvergence (const Surface * f1, const Surface * f2,124const Point<3> & p);125///126bool EdgeDegenerated (const Surface * f1, const Surface * f2,127const BoxSphere<3> & box) const;128///129void EdgeNewton (const Surface * f1, const Surface * f2,130Point<3> & p);131///132bool IsEdgeExtremalPoint (const Surface * f1, const Surface * f2,133const Point<3> & p, Point<3> & pp, double rad);134135136137/*138///139bool ExtremalPointPossible (const Surface * f1, const Surface * f2,140int dir, const BoxSphere<3> & box);141///142bool ExtremalPointDegenerated (const Surface * f1, const Surface * f2,143int dir, const BoxSphere<3> & box);144///145bool ExtremalPointNewtonConvergence (const Surface * f1, const Surface * f2,146int dir, const BoxSphere<3> & box);147*/148///149void ExtremalPointNewton (const Surface * f1, const Surface * f2,150int dir, Point<3> & p);151152153///154bool AddPoint (const Point<3> & p, int layer);155156void ComputeExtremalPoints (const Plane * plane,157const QuadraticSurface * quadric,158ARRAY<Point<3> > & pts);159160void ComputeCrossPoints (const Plane * plane1,161const Plane * plane2,162const Plane * plane3,163ARRAY<Point<3> > & pts);164165void ComputeCrossPoints (const Plane * plane1,166const Plane * plane2,167const QuadraticSurface * quadratic,168ARRAY<Point<3> > & pts);169};170171#endif172173174175176