2009-01-13 04:40:13 +05:00
|
|
|
#ifndef FILE_IMPROVE2
|
|
|
|
#define FILE_IMPROVE2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
///
|
|
|
|
class MeshOptimize2d
|
|
|
|
{
|
|
|
|
int faceindex;
|
|
|
|
int improveedges;
|
|
|
|
double metricweight;
|
|
|
|
int writestatus;
|
|
|
|
|
|
|
|
public:
|
|
|
|
///
|
|
|
|
MeshOptimize2d ();
|
2014-08-20 01:58:36 +06:00
|
|
|
virtual ~MeshOptimize2d() { ; }
|
2009-01-13 04:40:13 +05:00
|
|
|
///
|
2011-07-25 14:40:23 +06:00
|
|
|
void ImproveMesh (Mesh & mesh2d, const MeshingParameters & mp);
|
|
|
|
void ImproveMeshJacobian (Mesh & mesh2d, const MeshingParameters & mp);
|
2009-01-13 04:40:13 +05:00
|
|
|
void ImproveVolumeMesh (Mesh & mesh);
|
2019-07-09 13:39:16 +05:00
|
|
|
void ProjectBoundaryPoints(NgArray<int> & surfaceindex,
|
|
|
|
const NgArray<Point<3>* > & from, NgArray<Point<3>* > & dest);
|
2009-01-13 04:40:13 +05:00
|
|
|
|
|
|
|
void EdgeSwapping (Mesh & mesh, int usemetric);
|
|
|
|
void CombineImprove (Mesh & mesh);
|
2019-09-27 23:49:12 +05:00
|
|
|
void SplitImprove (Mesh & mesh);
|
2009-01-13 04:40:13 +05:00
|
|
|
|
|
|
|
void GenericImprove (Mesh & mesh);
|
|
|
|
|
|
|
|
|
|
|
|
void SetFaceIndex (int fi) { faceindex = fi; }
|
|
|
|
void SetImproveEdges (int ie) { improveedges = ie; }
|
|
|
|
void SetMetricWeight (double mw) { metricweight = mw; }
|
|
|
|
void SetWriteStatus (int ws) { writestatus = ws; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
///
|
|
|
|
virtual void ProjectPoint (INDEX /* surfind */, Point<3> & /* p */) const { };
|
|
|
|
|
|
|
|
/// project point, use gi as initial value, and compute new gi
|
|
|
|
virtual int ProjectPointGI (INDEX surfind, Point<3> & p, PointGeomInfo & gi) const
|
|
|
|
{ ProjectPoint (surfind, p); return CalcPointGeomInfo (surfind, gi, p); }
|
|
|
|
|
|
|
|
///
|
|
|
|
virtual void ProjectPoint2 (INDEX /* surfind */, INDEX /* surfind2 */, Point<3> & /* p */) const { };
|
|
|
|
|
|
|
|
/// liefert zu einem 3d-Punkt die geominfo (Dreieck) und liefert 1, wenn erfolgreich,
|
|
|
|
/// 0, wenn nicht (Punkt ausserhalb von chart)
|
|
|
|
virtual int CalcPointGeomInfo(PointGeomInfo& gi, const Point<3> & /*p3*/) const
|
|
|
|
{ gi.trignum = 1; return 1;};
|
|
|
|
|
|
|
|
virtual int CalcPointGeomInfo(int /* surfind */, PointGeomInfo& gi, const Point<3> & p3) const
|
|
|
|
{ return CalcPointGeomInfo (gi, p3); }
|
|
|
|
|
|
|
|
///
|
|
|
|
virtual void GetNormalVector(INDEX surfind, const Point<3> & p, PointGeomInfo & gi, Vec<3> & n) const;
|
|
|
|
virtual void GetNormalVector(INDEX surfind, const Point<3> & p, Vec<3> & n) const;
|
|
|
|
|
|
|
|
void CheckMeshApproximation (Mesh & mesh);
|
|
|
|
|
|
|
|
|
|
|
|
///
|
|
|
|
friend class Opti2SurfaceMinFunction;
|
|
|
|
///
|
|
|
|
friend class Opti2EdgeMinFunction;
|
|
|
|
///
|
|
|
|
friend double Opti2FunctionValueGrad (const Vector & x, Vector & grad);
|
|
|
|
///
|
|
|
|
friend double Opti2EdgeFunctionValueGrad (const Vector & x, Vector & grad);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
extern void CalcTriangleBadness (double x2, double x3, double y3,
|
|
|
|
double metricweight,
|
|
|
|
double h, double & badness,
|
|
|
|
double & g1x, double & g1y);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-02-03 20:40:27 +06:00
|
|
|
extern double CalcTriangleBadness (const Point<3> & p1,
|
|
|
|
const Point<3> & p2,
|
|
|
|
const Point<3> & p3,
|
2009-01-13 04:40:13 +05:00
|
|
|
double metricweight,
|
|
|
|
double h);
|
|
|
|
|
2013-02-03 20:40:27 +06:00
|
|
|
extern double CalcTriangleBadness (const Point<3> & p1,
|
|
|
|
const Point<3> & p2,
|
|
|
|
const Point<3> & p3,
|
|
|
|
const Vec<3> & n,
|
2009-01-13 04:40:13 +05:00
|
|
|
double metricweight,
|
|
|
|
double h);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|