mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-27 13:20:34 +05:00
fix Periodic with trafo
This commit is contained in:
parent
aa8dbac6be
commit
777b5ed216
@ -225,21 +225,30 @@ Identifyable (const SpecialPoint & sp1, const SpecialPoint & sp2,
|
|||||||
n2 /= n2.Length();
|
n2 /= n2.Length();
|
||||||
if ( fabs(n2 * hsp2.v) > 1e-3)
|
if ( fabs(n2 * hsp2.v) > 1e-3)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
||||||
Vec<3> v = hsp2.p - hsp1.p;
|
|
||||||
double vl = v.Length();
|
|
||||||
double cl = fabs (v*n1);
|
|
||||||
|
|
||||||
|
if ((trafo(hsp1.v)-hsp2.v).Length2() > 1e-12)
|
||||||
|
return false;
|
||||||
|
|
||||||
double val1 = 1 - cl*cl/(vl*vl);
|
double d2typ = Dist2(hsp1.p, hsp2.p);
|
||||||
double val2 = (hsp1.v - hsp2.v).Length();
|
|
||||||
|
if (Dist2 (trafo(hsp1.p),hsp2.p) < 1e-18*d2typ)
|
||||||
if (val1 < 1e-10 && val2 < 1e-6)
|
return true;
|
||||||
return 1;
|
|
||||||
|
if (Dist2 (hsp1.p, trafo(hsp1.p)) < 1e-18*d2typ)
|
||||||
|
{ // old style without trafo, but normal projection
|
||||||
|
Vec<3> v = hsp2.p - hsp1.p;
|
||||||
|
double vl = v.Length();
|
||||||
|
double cl = fabs (v*n1);
|
||||||
|
|
||||||
|
double val1 = 1 - cl*cl/(vl*vl);
|
||||||
|
double val2 = (hsp1.v - hsp2.v).Length();
|
||||||
|
|
||||||
|
if (val1 < 1e-10 && val2 < 1e-6)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int PeriodicIdentification ::
|
int PeriodicIdentification ::
|
||||||
|
@ -86,23 +86,23 @@ namespace netgen
|
|||||||
const Surface * as1,
|
const Surface * as1,
|
||||||
const Surface * as2,
|
const Surface * as2,
|
||||||
Transformation<3> atrafo = Vec<3>(0,0,0));
|
Transformation<3> atrafo = Vec<3>(0,0,0));
|
||||||
virtual ~PeriodicIdentification ();
|
virtual ~PeriodicIdentification () override;
|
||||||
virtual void Print (ostream & ost) const;
|
virtual void Print (ostream & ost) const override;
|
||||||
virtual void GetData (ostream & ost) const;
|
virtual void GetData (ostream & ost) const override;
|
||||||
|
|
||||||
|
|
||||||
// virtual void IdentifySpecialPoints (Array<class SpecialPoint> & points);
|
// virtual void IdentifySpecialPoints (Array<class SpecialPoint> & points);
|
||||||
virtual int Identifyable (const SpecialPoint & sp1, const SpecialPoint & sp2,
|
virtual int Identifyable (const SpecialPoint & sp1, const SpecialPoint & sp2,
|
||||||
const TABLE<int> & specpoint2solid,
|
const TABLE<int> & specpoint2solid,
|
||||||
const TABLE<int> & specpoint2surface) const;
|
const TABLE<int> & specpoint2surface) const override;
|
||||||
|
|
||||||
virtual int Identifyable (const Point<3> & p1, const Point<3> & sp2) const;
|
virtual int Identifyable (const Point<3> & p1, const Point<3> & sp2) const override;
|
||||||
virtual int GetIdentifiedPoint (class Mesh & mesh, int pi1);
|
virtual int GetIdentifiedPoint (class Mesh & mesh, int pi1) override;
|
||||||
virtual void IdentifyPoints (class Mesh & mesh);
|
virtual void IdentifyPoints (class Mesh & mesh) override;
|
||||||
virtual void IdentifyFaces (class Mesh & mesh);
|
virtual void IdentifyFaces (class Mesh & mesh) override;
|
||||||
virtual void BuildSurfaceElements (Array<class Segment> & segs,
|
virtual void BuildSurfaceElements (Array<class Segment> & segs,
|
||||||
class Mesh & mesh,
|
class Mesh & mesh,
|
||||||
const Surface * surf);
|
const Surface * surf) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user