mirror of
https://github.com/NGSolve/netgen.git
synced 2025-04-13 08:37:28 +05:00
geometry format modularization
This commit is contained in:
parent
b0f637862b
commit
55282bac84
@ -67,9 +67,6 @@
|
|||||||
/* Define to the one symbol short name of this package. */
|
/* Define to the one symbol short name of this package. */
|
||||||
#undef PACKAGE_TARNAME
|
#undef PACKAGE_TARNAME
|
||||||
|
|
||||||
/* Define to the home page for this package. */
|
|
||||||
#undef PACKAGE_URL
|
|
||||||
|
|
||||||
/* Define to the version of this package. */
|
/* Define to the version of this package. */
|
||||||
#undef PACKAGE_VERSION
|
#undef PACKAGE_VERSION
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ revolution.hpp spline3d.hpp vscsg.hpp
|
|||||||
AM_CPPFLAGS = -I$(top_srcdir)/libsrc/include $(TCL_INCLUDES)
|
AM_CPPFLAGS = -I$(top_srcdir)/libsrc/include $(TCL_INCLUDES)
|
||||||
METASOURCES = AUTO
|
METASOURCES = AUTO
|
||||||
|
|
||||||
noinst_LTLIBRARIES = libcsg.la libcsgvis.la
|
lib_LTLIBRARIES = libcsg.la libcsgvis.la
|
||||||
|
|
||||||
|
|
||||||
libcsg_la_SOURCES = algprim.cpp brick.cpp \
|
libcsg_la_SOURCES = algprim.cpp brick.cpp \
|
||||||
@ -18,6 +18,8 @@ manifold.cpp meshsurf.cpp polyhedra.cpp revolution.cpp singularref.cpp \
|
|||||||
solid.cpp specpoin.cpp spline3d.cpp surface.cpp triapprox.cpp
|
solid.cpp specpoin.cpp spline3d.cpp surface.cpp triapprox.cpp
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
libcsgvis_la_SOURCES = vscsg.cpp csgpkg.cpp
|
libcsgvis_la_SOURCES = vscsg.cpp csgpkg.cpp
|
||||||
|
|
||||||
|
|
||||||
|
libcsgvis_la_LIBADD = libcsg.la $(top_builddir)/libsrc/geom2d/libgeom2d.la
|
||||||
|
|
||||||
|
@ -7,9 +7,6 @@
|
|||||||
|
|
||||||
namespace netgen
|
namespace netgen
|
||||||
{
|
{
|
||||||
//using namespace netgen;
|
|
||||||
|
|
||||||
|
|
||||||
static kwstruct defkw[] =
|
static kwstruct defkw[] =
|
||||||
{
|
{
|
||||||
{ TOK_RECO, "algebraic3d" },
|
{ TOK_RECO, "algebraic3d" },
|
||||||
@ -695,6 +692,65 @@ namespace netgen
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template <int D>
|
||||||
|
void LoadSpline (SplineGeometry<D> & spline, CSGScanner & scan)
|
||||||
|
{
|
||||||
|
double hd;
|
||||||
|
Point<D> x;
|
||||||
|
int nump, numseg;
|
||||||
|
|
||||||
|
//scan.ReadNext();
|
||||||
|
scan >> nump >> ';';
|
||||||
|
|
||||||
|
hd = 1;
|
||||||
|
spline.geompoints.SetSize(nump);
|
||||||
|
for(int i = 0; i<nump; i++)
|
||||||
|
{
|
||||||
|
if(D==2)
|
||||||
|
scan >> x(0) >> ',' >> x(1) >> ';';
|
||||||
|
else if(D==3)
|
||||||
|
scan >> x(0) >> ',' >> x(1) >> ',' >> x(2) >> ';';
|
||||||
|
|
||||||
|
spline.geompoints[i] = GeomPoint<D>(x,hd);
|
||||||
|
}
|
||||||
|
|
||||||
|
scan >> numseg;// >> ';';
|
||||||
|
|
||||||
|
spline.splines.SetSize(numseg);
|
||||||
|
|
||||||
|
int pnums,pnum1,pnum2,pnum3;
|
||||||
|
|
||||||
|
|
||||||
|
for(int i = 0; i<numseg; i++)
|
||||||
|
{
|
||||||
|
scan >> ';' >> pnums >> ',';
|
||||||
|
if (pnums == 2)
|
||||||
|
{
|
||||||
|
scan >> pnum1 >> ',' >> pnum2;// >> ';';
|
||||||
|
spline.splines[i] = new LineSeg<D>(spline.geompoints[pnum1-1],
|
||||||
|
spline.geompoints[pnum2-1]);
|
||||||
|
}
|
||||||
|
else if (pnums == 3)
|
||||||
|
{
|
||||||
|
scan >> pnum1 >> ',' >> pnum2 >> ','
|
||||||
|
>> pnum3;// >> ';';
|
||||||
|
spline.splines[i] = new SplineSeg3<D>(spline.geompoints[pnum1-1],
|
||||||
|
spline.geompoints[pnum2-1],
|
||||||
|
spline.geompoints[pnum3-1]);
|
||||||
|
}
|
||||||
|
else if (pnums == 4)
|
||||||
|
{
|
||||||
|
scan >> pnum1 >> ',' >> pnum2 >> ','
|
||||||
|
>> pnum3;// >> ';';
|
||||||
|
spline.splines[i] = new CircleSeg<D>(spline.geompoints[pnum1-1],
|
||||||
|
spline.geompoints[pnum2-1],
|
||||||
|
spline.geompoints[pnum3-1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void ParseFlags (CSGScanner & scan, Flags & flags)
|
void ParseFlags (CSGScanner & scan, Flags & flags)
|
||||||
{
|
{
|
||||||
@ -1118,7 +1174,8 @@ namespace netgen
|
|||||||
ParseChar (scan, '(');
|
ParseChar (scan, '(');
|
||||||
|
|
||||||
SplineGeometry<2> * newspline = new SplineGeometry<2>;
|
SplineGeometry<2> * newspline = new SplineGeometry<2>;
|
||||||
newspline->CSGLoad(scan);
|
// newspline->CSGLoad(scan);
|
||||||
|
LoadSpline (*newspline, scan);
|
||||||
|
|
||||||
ParseChar (scan, ')');
|
ParseChar (scan, ')');
|
||||||
ParseChar (scan, ';');
|
ParseChar (scan, ';');
|
||||||
@ -1143,7 +1200,8 @@ namespace netgen
|
|||||||
ParseChar (scan, '(');
|
ParseChar (scan, '(');
|
||||||
|
|
||||||
SplineGeometry<3> * newspline = new SplineGeometry<3>;
|
SplineGeometry<3> * newspline = new SplineGeometry<3>;
|
||||||
newspline->CSGLoad(scan);
|
// newspline->CSGLoad(scan);
|
||||||
|
LoadSpline (*newspline, scan);
|
||||||
|
|
||||||
ParseChar (scan, ')');
|
ParseChar (scan, ')');
|
||||||
ParseChar (scan, ';');
|
ParseChar (scan, ';');
|
||||||
|
@ -10,4 +10,6 @@ libgeom2d_la_SOURCES = genmesh2d.cpp geom2dmesh.cpp spline.cpp \
|
|||||||
|
|
||||||
|
|
||||||
libgeom2dvis_la_SOURCES = geom2dpkg.cpp vsgeom2d.cpp
|
libgeom2dvis_la_SOURCES = geom2dpkg.cpp vsgeom2d.cpp
|
||||||
|
libgeom2dvis_la_LIBADD = libgeom2d.la
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#include <mystdlib.h>
|
#include <mystdlib.h>
|
||||||
#include <csg.hpp>
|
#include <meshing.hpp>
|
||||||
#include <geometry2d.hpp>
|
#include <geometry2d.hpp>
|
||||||
#include "meshing.hpp"
|
|
||||||
|
|
||||||
namespace netgen
|
namespace netgen
|
||||||
{
|
{
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
#include <mystdlib.h>
|
#include <mystdlib.h>
|
||||||
|
|
||||||
#include <csg.hpp>
|
|
||||||
#include <geometry2d.hpp>
|
|
||||||
#include <meshing.hpp>
|
#include <meshing.hpp>
|
||||||
|
|
||||||
|
#include <geometry2d.hpp>
|
||||||
|
|
||||||
namespace netgen
|
namespace netgen
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
#include <mystdlib.h>
|
#include <mystdlib.h>
|
||||||
#include <myadt.hpp>
|
#include <myadt.hpp>
|
||||||
#include <linalg.hpp>
|
#include <linalg.hpp>
|
||||||
#include <csg.hpp>
|
|
||||||
|
|
||||||
|
|
||||||
#include <incvis.hpp>
|
#include <incvis.hpp>
|
||||||
#include <visual.hpp>
|
#include <meshing.hpp>
|
||||||
|
#include <geometry2d.hpp>
|
||||||
|
|
||||||
|
#include <visual.hpp>
|
||||||
#include "vsgeom2d.hpp"
|
#include "vsgeom2d.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
@ -5,9 +5,9 @@ Spline curve for Mesh generator
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <mystdlib.h>
|
#include <mystdlib.h>
|
||||||
#include <csg.hpp>
|
|
||||||
#include <linalg.hpp>
|
#include <linalg.hpp>
|
||||||
#include <meshing.hpp>
|
#include <meshing.hpp>
|
||||||
|
#include <geometry2d.hpp>
|
||||||
|
|
||||||
namespace netgen
|
namespace netgen
|
||||||
{
|
{
|
||||||
|
@ -11,19 +11,19 @@ namespace netgen
|
|||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
void CalcPartition (double l, double h, double h1, double h2,
|
void CalcPartition (double l, double h, double h1, double h2,
|
||||||
double hcurve, double elto0, Array<double> & points);
|
double hcurve, double elto0, Array<double> & points);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Spline curves for 2D mesh generation
|
Spline curves for 2D mesh generation
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/// Geometry point
|
/// Geometry point
|
||||||
template < int D >
|
template < int D >
|
||||||
class GeomPoint : public Point<D>
|
class GeomPoint : public Point<D>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/// refinement factor at point
|
/// refinement factor at point
|
||||||
double refatpoint;
|
double refatpoint;
|
||||||
/// max mesh-size at point
|
/// max mesh-size at point
|
||||||
@ -37,16 +37,16 @@ public:
|
|||||||
///
|
///
|
||||||
GeomPoint (const Point<D> & ap, double aref = 1, bool ahpref=false)
|
GeomPoint (const Point<D> & ap, double aref = 1, bool ahpref=false)
|
||||||
: Point<D>(ap), refatpoint(aref), hpref(ahpref) { ; }
|
: Point<D>(ap), refatpoint(aref), hpref(ahpref) { ; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// base class for 2d - segment
|
/// base class for 2d - segment
|
||||||
template < int D >
|
template < int D >
|
||||||
class SplineSeg
|
class SplineSeg
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/// left domain
|
/// left domain
|
||||||
int leftdom;
|
int leftdom;
|
||||||
/// right domain
|
/// right domain
|
||||||
@ -118,16 +118,16 @@ public:
|
|||||||
virtual void GetRawData (Array<double> & data) const
|
virtual void GetRawData (Array<double> & data) const
|
||||||
{ cerr << "GetRawData not implemented for spline base-class" << endl;}
|
{ cerr << "GetRawData not implemented for spline base-class" << endl;}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/// Straight line form p1 to p2
|
/// Straight line form p1 to p2
|
||||||
template< int D >
|
template< int D >
|
||||||
class LineSeg : public SplineSeg<D>
|
class LineSeg : public SplineSeg<D>
|
||||||
{
|
{
|
||||||
///
|
///
|
||||||
GeomPoint<D> p1, p2;
|
GeomPoint<D> p1, p2;
|
||||||
public:
|
public:
|
||||||
///
|
///
|
||||||
LineSeg (const GeomPoint<D> & ap1, const GeomPoint<D> & ap2);
|
LineSeg (const GeomPoint<D> & ap1, const GeomPoint<D> & ap2);
|
||||||
///
|
///
|
||||||
@ -159,18 +159,18 @@ public:
|
|||||||
virtual void Project (const Point<D> point, Point<D> & point_on_curve, double & t) const;
|
virtual void Project (const Point<D> point, Point<D> & point_on_curve, double & t) const;
|
||||||
|
|
||||||
virtual void GetRawData (Array<double> & data) const;
|
virtual void GetRawData (Array<double> & data) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/// curve given by a rational, quadratic spline (including ellipses)
|
/// curve given by a rational, quadratic spline (including ellipses)
|
||||||
template< int D >
|
template< int D >
|
||||||
class SplineSeg3 : public SplineSeg<D>
|
class SplineSeg3 : public SplineSeg<D>
|
||||||
{
|
{
|
||||||
///
|
///
|
||||||
GeomPoint<D> p1, p2, p3;
|
GeomPoint<D> p1, p2, p3;
|
||||||
|
|
||||||
mutable double proj_latest_t;
|
mutable double proj_latest_t;
|
||||||
public:
|
public:
|
||||||
///
|
///
|
||||||
SplineSeg3 (const GeomPoint<D> & ap1,
|
SplineSeg3 (const GeomPoint<D> & ap1,
|
||||||
const GeomPoint<D> & ap2,
|
const GeomPoint<D> & ap2,
|
||||||
@ -204,21 +204,21 @@ public:
|
|||||||
virtual void Project (const Point<D> point, Point<D> & point_on_curve, double & t) const;
|
virtual void Project (const Point<D> point, Point<D> & point_on_curve, double & t) const;
|
||||||
|
|
||||||
virtual void GetRawData (Array<double> & data) const;
|
virtual void GetRawData (Array<double> & data) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// Gundolf Haase 8/26/97
|
// Gundolf Haase 8/26/97
|
||||||
/// A circle
|
/// A circle
|
||||||
template < int D >
|
template < int D >
|
||||||
class CircleSeg : public SplineSeg<D>
|
class CircleSeg : public SplineSeg<D>
|
||||||
{
|
{
|
||||||
///
|
///
|
||||||
private:
|
private:
|
||||||
GeomPoint<D> p1, p2, p3;
|
GeomPoint<D> p1, p2, p3;
|
||||||
//const GeomPoint<D> &p1, &p2, &p3;
|
//const GeomPoint<D> &p1, &p2, &p3;
|
||||||
Point<D> pm;
|
Point<D> pm;
|
||||||
double radius, w1,w3;
|
double radius, w1,w3;
|
||||||
public:
|
public:
|
||||||
///
|
///
|
||||||
CircleSeg (const GeomPoint<D> & ap1,
|
CircleSeg (const GeomPoint<D> & ap1,
|
||||||
const GeomPoint<D> & ap2,
|
const GeomPoint<D> & ap2,
|
||||||
@ -246,20 +246,20 @@ public:
|
|||||||
Array < Point<D> > & points, const double eps) const;
|
Array < Point<D> > & points, const double eps) const;
|
||||||
|
|
||||||
virtual double MaxCurvature(void) const {return 1./radius;}
|
virtual double MaxCurvature(void) const {return 1./radius;}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
template<int D>
|
template<int D>
|
||||||
class DiscretePointsSeg : public SplineSeg<D>
|
class DiscretePointsSeg : public SplineSeg<D>
|
||||||
{
|
{
|
||||||
Array<Point<D> > pts;
|
Array<Point<D> > pts;
|
||||||
GeomPoint<D> p1n, p2n;
|
GeomPoint<D> p1n, p2n;
|
||||||
public:
|
public:
|
||||||
///
|
///
|
||||||
DiscretePointsSeg (const Array<Point<D> > & apts);
|
DiscretePointsSeg (const Array<Point<D> > & apts);
|
||||||
///
|
///
|
||||||
@ -274,7 +274,7 @@ public:
|
|||||||
virtual void GetCoeff (Vector & coeffs) const {;}
|
virtual void GetCoeff (Vector & coeffs) const {;}
|
||||||
|
|
||||||
virtual double MaxCurvature(void) const {return 1;}
|
virtual double MaxCurvature(void) const {return 1;}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -282,34 +282,33 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
// calculates length of spline-curve
|
// calculates length of spline-curve
|
||||||
template<int D>
|
template<int D>
|
||||||
double SplineSeg<D> :: Length () const
|
double SplineSeg<D> :: Length () const
|
||||||
{
|
{
|
||||||
Point<D> p, pold;
|
int n = 100;
|
||||||
|
|
||||||
int i, n = 100;
|
|
||||||
double dt = 1.0 / n;
|
double dt = 1.0 / n;
|
||||||
|
|
||||||
pold = GetPoint (0);
|
Point<D> pold = GetPoint (0);
|
||||||
|
|
||||||
double l = 0;
|
double l = 0;
|
||||||
for (i = 1; i <= n; i++)
|
for (int i = 1; i <= n; i++)
|
||||||
{
|
{
|
||||||
p = GetPoint (i * dt);
|
Point<D> p = GetPoint (i * dt);
|
||||||
l += Dist (p, pold);
|
l += Dist (p, pold);
|
||||||
pold = p;
|
pold = p;
|
||||||
}
|
}
|
||||||
|
|
||||||
return l;
|
return l;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// partitionizes spline curve
|
// partitionizes spline curve
|
||||||
template<int D>
|
template<int D>
|
||||||
void SplineSeg<D> :: Partition (double h, double elto0,
|
void SplineSeg<D> :: Partition (double h, double elto0,
|
||||||
Mesh & mesh, Point3dTree & searchtree, int segnr) const
|
Mesh & mesh, Point3dTree & searchtree, int segnr) const
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
double l; // , r1, r2, ra;
|
double l; // , r1, r2, ra;
|
||||||
double lold, dt, frac;
|
double lold, dt, frac;
|
||||||
@ -419,22 +418,22 @@ void SplineSeg<D> :: Partition (double h, double elto0,
|
|||||||
pold = p;
|
pold = p;
|
||||||
lold = l;
|
lold = l;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<int D>
|
template<int D>
|
||||||
void SplineSeg<D> :: GetPoints (int n, Array<Point<D> > & points)
|
void SplineSeg<D> :: GetPoints (int n, Array<Point<D> > & points)
|
||||||
{
|
{
|
||||||
points.SetSize (n);
|
points.SetSize (n);
|
||||||
if (n >= 2)
|
if (n >= 2)
|
||||||
for (int i = 0; i < n; i++)
|
for (int i = 0; i < n; i++)
|
||||||
points[i] = GetPoint(double(i) / (n-1));
|
points[i] = GetPoint(double(i) / (n-1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<int D>
|
template<int D>
|
||||||
void SplineSeg<D> :: PrintCoeff (ostream & ost) const
|
void SplineSeg<D> :: PrintCoeff (ostream & ost) const
|
||||||
{
|
{
|
||||||
Vector u(6);
|
Vector u(6);
|
||||||
|
|
||||||
GetCoeff(u);
|
GetCoeff(u);
|
||||||
@ -442,58 +441,58 @@ void SplineSeg<D> :: PrintCoeff (ostream & ost) const
|
|||||||
for ( int i=0; i<6; i++)
|
for ( int i=0; i<6; i++)
|
||||||
ost << u[i] << " ";
|
ost << u[i] << " ";
|
||||||
ost << endl;
|
ost << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Implementation of line-segment from p1 to p2
|
Implementation of line-segment from p1 to p2
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
template<int D>
|
template<int D>
|
||||||
LineSeg<D> :: LineSeg (const GeomPoint<D> & ap1,
|
LineSeg<D> :: LineSeg (const GeomPoint<D> & ap1,
|
||||||
const GeomPoint<D> & ap2)
|
const GeomPoint<D> & ap2)
|
||||||
: p1(ap1), p2(ap2)
|
: p1(ap1), p2(ap2)
|
||||||
{
|
{
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<int D>
|
template<int D>
|
||||||
inline Point<D> LineSeg<D> :: GetPoint (double t) const
|
inline Point<D> LineSeg<D> :: GetPoint (double t) const
|
||||||
{
|
{
|
||||||
return p1 + t * (p2 - p1);
|
return p1 + t * (p2 - p1);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<int D>
|
template<int D>
|
||||||
Vec<D> LineSeg<D> :: GetTangent (const double t) const
|
Vec<D> LineSeg<D> :: GetTangent (const double t) const
|
||||||
{
|
{
|
||||||
return p2-p1;
|
return p2-p1;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<int D>
|
template<int D>
|
||||||
void LineSeg<D> :: GetDerivatives (const double t,
|
void LineSeg<D> :: GetDerivatives (const double t,
|
||||||
Point<D> & point,
|
Point<D> & point,
|
||||||
Vec<D> & first,
|
Vec<D> & first,
|
||||||
Vec<D> & second) const
|
Vec<D> & second) const
|
||||||
{
|
{
|
||||||
first = p2 - p1;
|
first = p2 - p1;
|
||||||
point = p1 + t * first;
|
point = p1 + t * first;
|
||||||
second = 0;
|
second = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<int D>
|
template<int D>
|
||||||
double LineSeg<D> :: Length () const
|
double LineSeg<D> :: Length () const
|
||||||
{
|
{
|
||||||
return Dist (p1, p2);
|
return Dist (p1, p2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<int D>
|
template<int D>
|
||||||
void LineSeg<D> :: GetCoeff (Vector & coeffs) const
|
void LineSeg<D> :: GetCoeff (Vector & coeffs) const
|
||||||
{
|
{
|
||||||
coeffs.SetSize(6);
|
coeffs.SetSize(6);
|
||||||
|
|
||||||
double dx = p2(0) - p1(0);
|
double dx = p2(0) - p1(0);
|
||||||
@ -503,14 +502,14 @@ void LineSeg<D> :: GetCoeff (Vector & coeffs) const
|
|||||||
coeffs[3] = -dy;
|
coeffs[3] = -dy;
|
||||||
coeffs[4] = dx;
|
coeffs[4] = dx;
|
||||||
coeffs[5] = -dx * p1(1) + dy * p1(0);
|
coeffs[5] = -dx * p1(1) + dy * p1(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
template<int D>
|
template<int D>
|
||||||
void LineSeg<D> :: LineIntersections (const double a, const double b, const double c,
|
void LineSeg<D> :: LineIntersections (const double a, const double b, const double c,
|
||||||
Array < Point<D> > & points, const double eps) const
|
Array < Point<D> > & points, const double eps) const
|
||||||
{
|
{
|
||||||
points.SetSize(0);
|
points.SetSize(0);
|
||||||
|
|
||||||
double denom = -a*p2(0)+a*p1(0)-b*p2(1)+b*p1(1);
|
double denom = -a*p2(0)+a*p1(0)-b*p2(1)+b*p1(1);
|
||||||
@ -520,13 +519,13 @@ void LineSeg<D> :: LineIntersections (const double a, const double b, const doub
|
|||||||
double t = (a*p1(0)+b*p1(1)+c)/denom;
|
double t = (a*p1(0)+b*p1(1)+c)/denom;
|
||||||
if((t > -eps) && (t < 1.+eps))
|
if((t > -eps) && (t < 1.+eps))
|
||||||
points.Append(GetPoint(t));
|
points.Append(GetPoint(t));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
template<int D>
|
template<int D>
|
||||||
void LineSeg<D> :: Project (const Point<D> point, Point<D> & point_on_curve, double & t) const
|
void LineSeg<D> :: Project (const Point<D> point, Point<D> & point_on_curve, double & t) const
|
||||||
{
|
{
|
||||||
Vec<D> v = p2-p1;
|
Vec<D> v = p2-p1;
|
||||||
double l = v.Length();
|
double l = v.Length();
|
||||||
v *= 1./l;
|
v *= 1./l;
|
||||||
@ -538,35 +537,35 @@ void LineSeg<D> :: Project (const Point<D> point, Point<D> & point_on_curve, dou
|
|||||||
point_on_curve = p1+t*v;
|
point_on_curve = p1+t*v;
|
||||||
|
|
||||||
t *= 1./l;
|
t *= 1./l;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<int D>
|
template<int D>
|
||||||
void LineSeg<D> :: GetRawData (Array<double> & data) const
|
void LineSeg<D> :: GetRawData (Array<double> & data) const
|
||||||
{
|
{
|
||||||
data.Append(2);
|
data.Append(2);
|
||||||
for(int i=0; i<D; i++)
|
for(int i=0; i<D; i++)
|
||||||
data.Append(p1[i]);
|
data.Append(p1[i]);
|
||||||
for(int i=0; i<D; i++)
|
for(int i=0; i<D; i++)
|
||||||
data.Append(p2[i]);
|
data.Append(p2[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
template<int D>
|
template<int D>
|
||||||
SplineSeg3<D> :: SplineSeg3 (const GeomPoint<D> & ap1,
|
SplineSeg3<D> :: SplineSeg3 (const GeomPoint<D> & ap1,
|
||||||
const GeomPoint<D> & ap2,
|
const GeomPoint<D> & ap2,
|
||||||
const GeomPoint<D> & ap3)
|
const GeomPoint<D> & ap3)
|
||||||
: p1(ap1), p2(ap2), p3(ap3)
|
: p1(ap1), p2(ap2), p3(ap3)
|
||||||
{
|
{
|
||||||
proj_latest_t = 0.5;
|
proj_latest_t = 0.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<int D>
|
template<int D>
|
||||||
inline Point<D> SplineSeg3<D> :: GetPoint (double t) const
|
inline Point<D> SplineSeg3<D> :: GetPoint (double t) const
|
||||||
{
|
{
|
||||||
double x, y, w;
|
double x, y, w;
|
||||||
double b1, b2, b3;
|
double b1, b2, b3;
|
||||||
|
|
||||||
@ -585,14 +584,14 @@ inline Point<D> SplineSeg3<D> :: GetPoint (double t) const
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
return Point<D> (x/w, y/w);
|
return Point<D> (x/w, y/w);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
template<int D>
|
template<int D>
|
||||||
Vec<D> SplineSeg3<D> :: GetTangent (const double t) const
|
Vec<D> SplineSeg3<D> :: GetTangent (const double t) const
|
||||||
{
|
{
|
||||||
const double b1 = (1.-t)*((sqrt(2.)-2.)*t-sqrt(2.));
|
const double b1 = (1.-t)*((sqrt(2.)-2.)*t-sqrt(2.));
|
||||||
const double b2 = sqrt(2.)*(1.-2.*t);
|
const double b2 = sqrt(2.)*(1.-2.*t);
|
||||||
const double b3 = t*((sqrt(2.)-2)*t+2.);
|
const double b3 = t*((sqrt(2.)-2)*t+2.);
|
||||||
@ -604,12 +603,12 @@ Vec<D> SplineSeg3<D> :: GetTangent (const double t) const
|
|||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<int D>
|
template<int D>
|
||||||
void SplineSeg3<D> :: GetCoeff (Vector & u) const
|
void SplineSeg3<D> :: GetCoeff (Vector & u) const
|
||||||
{
|
{
|
||||||
DenseMatrix a(6, 6);
|
DenseMatrix a(6, 6);
|
||||||
DenseMatrix ata(6, 6);
|
DenseMatrix ata(6, 6);
|
||||||
Vector f(6);
|
Vector f(6);
|
||||||
@ -648,12 +647,12 @@ void SplineSeg3<D> :: GetCoeff (Vector & u) const
|
|||||||
Vec<2> gradn (grady, -gradx);
|
Vec<2> gradn (grady, -gradx);
|
||||||
|
|
||||||
if (tang * gradn < 0) u *= -1;
|
if (tang * gradn < 0) u *= -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
template<int D>
|
template<int D>
|
||||||
double SplineSeg3<D> :: MaxCurvature(void) const
|
double SplineSeg3<D> :: MaxCurvature(void) const
|
||||||
{
|
{
|
||||||
Vec<D> v1 = p1-p2;
|
Vec<D> v1 = p1-p2;
|
||||||
Vec<D> v2 = p3-p2;
|
Vec<D> v2 = p3-p2;
|
||||||
double l1 = v1.Length();
|
double l1 = v1.Length();
|
||||||
@ -665,14 +664,14 @@ double SplineSeg3<D> :: MaxCurvature(void) const
|
|||||||
(*testout) << "cosalpha " << cosalpha << endl;
|
(*testout) << "cosalpha " << cosalpha << endl;
|
||||||
|
|
||||||
return sqrt(cosalpha + 1.)/(min2(l1,l2)*(1.-cosalpha));
|
return sqrt(cosalpha + 1.)/(min2(l1,l2)*(1.-cosalpha));
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
template<int D>
|
template<int D>
|
||||||
void SplineSeg3<D> :: LineIntersections (const double a, const double b, const double c,
|
void SplineSeg3<D> :: LineIntersections (const double a, const double b, const double c,
|
||||||
Array < Point<D> > & points, const double eps) const
|
Array < Point<D> > & points, const double eps) const
|
||||||
{
|
{
|
||||||
points.SetSize(0);
|
points.SetSize(0);
|
||||||
|
|
||||||
double t;
|
double t;
|
||||||
@ -714,12 +713,12 @@ void SplineSeg3<D> :: LineIntersections (const double a, const double b, const d
|
|||||||
t = (-c2 - sqrt(discr))/(2.*c1);
|
t = (-c2 - sqrt(discr))/(2.*c1);
|
||||||
if((t > -eps) && (t < 1.+eps))
|
if((t > -eps) && (t < 1.+eps))
|
||||||
points.Append(GetPoint(t));
|
points.Append(GetPoint(t));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template < int D >
|
template < int D >
|
||||||
void SplineSeg3<D> :: GetRawData (Array<double> & data) const
|
void SplineSeg3<D> :: GetRawData (Array<double> & data) const
|
||||||
{
|
{
|
||||||
data.Append(3);
|
data.Append(3);
|
||||||
for(int i=0; i<D; i++)
|
for(int i=0; i<D; i++)
|
||||||
data.Append(p1[i]);
|
data.Append(p1[i]);
|
||||||
@ -727,18 +726,18 @@ void SplineSeg3<D> :: GetRawData (Array<double> & data) const
|
|||||||
data.Append(p2[i]);
|
data.Append(p2[i]);
|
||||||
for(int i=0; i<D; i++)
|
for(int i=0; i<D; i++)
|
||||||
data.Append(p3[i]);
|
data.Append(p3[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//########################################################################
|
//########################################################################
|
||||||
// circlesegment
|
// circlesegment
|
||||||
|
|
||||||
template<int D>
|
template<int D>
|
||||||
CircleSeg<D> :: CircleSeg (const GeomPoint<D> & ap1,
|
CircleSeg<D> :: CircleSeg (const GeomPoint<D> & ap1,
|
||||||
const GeomPoint<D> & ap2,
|
const GeomPoint<D> & ap2,
|
||||||
const GeomPoint<D> & ap3)
|
const GeomPoint<D> & ap3)
|
||||||
: p1(ap1), p2(ap2), p3(ap3)
|
: p1(ap1), p2(ap2), p3(ap3)
|
||||||
{
|
{
|
||||||
Vec<D> v1,v2;
|
Vec<D> v1,v2;
|
||||||
|
|
||||||
v1 = p1 - p2;
|
v1 = p1 - p2;
|
||||||
@ -770,35 +769,35 @@ CircleSeg<D> :: CircleSeg (const GeomPoint<D> & ap1,
|
|||||||
if ( w3>M_PI ) w3 -= 2*M_PI;
|
if ( w3>M_PI ) w3 -= 2*M_PI;
|
||||||
if ( w1>M_PI ) w1 -= 2*M_PI;
|
if ( w1>M_PI ) w1 -= 2*M_PI;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<int D>
|
template<int D>
|
||||||
Point<D> CircleSeg<D> :: GetPoint (double t) const
|
Point<D> CircleSeg<D> :: GetPoint (double t) const
|
||||||
{
|
{
|
||||||
if (t >= 1.0) { return p3; }
|
if (t >= 1.0) { return p3; }
|
||||||
|
|
||||||
double phi = StartAngle() + t*(EndAngle()-StartAngle());
|
double phi = StartAngle() + t*(EndAngle()-StartAngle());
|
||||||
Vec<D> tmp(cos(phi),sin(phi));
|
Vec<D> tmp(cos(phi),sin(phi));
|
||||||
|
|
||||||
return pm + Radius()*tmp;
|
return pm + Radius()*tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<int D>
|
template<int D>
|
||||||
void CircleSeg<D> :: GetCoeff (Vector & coeff) const
|
void CircleSeg<D> :: GetCoeff (Vector & coeff) const
|
||||||
{
|
{
|
||||||
coeff[0] = coeff[1] = 1.0;
|
coeff[0] = coeff[1] = 1.0;
|
||||||
coeff[2] = 0.0;
|
coeff[2] = 0.0;
|
||||||
coeff[3] = -2.0 * pm[0];
|
coeff[3] = -2.0 * pm[0];
|
||||||
coeff[4] = -2.0 * pm[1];
|
coeff[4] = -2.0 * pm[1];
|
||||||
coeff[5] = sqr(pm[0]) + sqr(pm[1]) - sqr(Radius());
|
coeff[5] = sqr(pm[0]) + sqr(pm[1]) - sqr(Radius());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<int D>
|
template<int D>
|
||||||
void CircleSeg<D> :: LineIntersections (const double a, const double b, const double c,
|
void CircleSeg<D> :: LineIntersections (const double a, const double b, const double c,
|
||||||
Array < Point<D> > & points, const double eps) const
|
Array < Point<D> > & points, const double eps) const
|
||||||
{
|
{
|
||||||
points.SetSize(0);
|
points.SetSize(0);
|
||||||
|
|
||||||
double px=0,py=0;
|
double px=0,py=0;
|
||||||
@ -836,15 +835,15 @@ void CircleSeg<D> :: LineIntersections (const double a, const double b, const do
|
|||||||
if(angle > StartAngle()-eps && angle < EndAngle()+eps)
|
if(angle > StartAngle()-eps && angle < EndAngle()+eps)
|
||||||
points.Append(p);
|
points.Append(p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
template<int D>
|
template<int D>
|
||||||
DiscretePointsSeg<D> :: DiscretePointsSeg (const Array<Point<D> > & apts)
|
DiscretePointsSeg<D> :: DiscretePointsSeg (const Array<Point<D> > & apts)
|
||||||
: pts (apts)
|
: pts (apts)
|
||||||
{
|
{
|
||||||
for(int i=0; i<D; i++)
|
for(int i=0; i<D; i++)
|
||||||
{
|
{
|
||||||
p1n(i) = apts[0](i);
|
p1n(i) = apts[0](i);
|
||||||
@ -854,16 +853,16 @@ DiscretePointsSeg<D> :: DiscretePointsSeg (const Array<Point<D> > & apts)
|
|||||||
p2n.refatpoint = 1;
|
p2n.refatpoint = 1;
|
||||||
p1n.hmax = 1e99;
|
p1n.hmax = 1e99;
|
||||||
p2n.hmax = 1e99;
|
p2n.hmax = 1e99;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<int D>
|
template<int D>
|
||||||
DiscretePointsSeg<D> :: ~DiscretePointsSeg ()
|
DiscretePointsSeg<D> :: ~DiscretePointsSeg ()
|
||||||
{ ; }
|
{ ; }
|
||||||
|
|
||||||
template<int D>
|
template<int D>
|
||||||
Point<D> DiscretePointsSeg<D> :: GetPoint (double t) const
|
Point<D> DiscretePointsSeg<D> :: GetPoint (double t) const
|
||||||
{
|
{
|
||||||
double t1 = t * (pts.Size()-1);
|
double t1 = t * (pts.Size()-1);
|
||||||
int segnr = int(t1);
|
int segnr = int(t1);
|
||||||
if (segnr < 0) segnr = 0;
|
if (segnr < 0) segnr = 0;
|
||||||
@ -872,16 +871,16 @@ Point<D> DiscretePointsSeg<D> :: GetPoint (double t) const
|
|||||||
double rest = t1 - segnr;
|
double rest = t1 - segnr;
|
||||||
|
|
||||||
return pts[segnr] + rest*Vec<D>(pts[segnr+1]-pts[segnr]);
|
return pts[segnr] + rest*Vec<D>(pts[segnr+1]-pts[segnr]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
typedef GeomPoint<2> GeomPoint2d;
|
typedef GeomPoint<2> GeomPoint2d;
|
||||||
typedef SplineSeg<2> SplineSegment;
|
typedef SplineSeg<2> SplineSegment;
|
||||||
typedef LineSeg<2> LineSegment;
|
typedef LineSeg<2> LineSegment;
|
||||||
typedef SplineSeg3<2> SplineSegment3;
|
typedef SplineSeg3<2> SplineSegment3;
|
||||||
typedef CircleSeg<2> CircleSegment;
|
typedef CircleSeg<2> CircleSegment;
|
||||||
typedef DiscretePointsSeg<2> DiscretePointsSegment;
|
typedef DiscretePointsSeg<2> DiscretePointsSegment;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -6,18 +6,17 @@
|
|||||||
|
|
||||||
|
|
||||||
#include <mystdlib.h>
|
#include <mystdlib.h>
|
||||||
#include <csg.hpp>
|
#include <meshing.hpp>
|
||||||
#include <geometry2d.hpp>
|
#include <geometry2d.hpp>
|
||||||
#include "meshing.hpp"
|
|
||||||
|
|
||||||
namespace netgen
|
namespace netgen
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
template<int D>
|
template<int D>
|
||||||
void SplineGeometry<D> :: LoadDataV2 ( ifstream & infile )
|
void SplineGeometry<D> :: LoadDataV2 ( ifstream & infile )
|
||||||
{
|
{
|
||||||
// new parser by Astrid Sinwel
|
// new parser by Astrid Sinwel
|
||||||
|
|
||||||
PrintMessage (1, "Load 2D Geometry V2");
|
PrintMessage (1, "Load 2D Geometry V2");
|
||||||
@ -336,7 +335,7 @@ void SplineGeometry<D> :: LoadDataV2 ( ifstream & infile )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -344,53 +343,53 @@ void SplineGeometry<D> :: LoadDataV2 ( ifstream & infile )
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
// check if comments in a .in2d file...
|
// check if comments in a .in2d file...
|
||||||
// template <int D>
|
// template <int D>
|
||||||
// void SplineGeometry<D> :: TestComment ( ifstream & infile )
|
// void SplineGeometry<D> :: TestComment ( ifstream & infile )
|
||||||
// {
|
// {
|
||||||
// bool comment = true;
|
// bool comment = true;
|
||||||
// char ch;
|
// char ch;
|
||||||
// infile.get(ch);
|
// infile.get(ch);
|
||||||
// infile.putback(ch);
|
// infile.putback(ch);
|
||||||
// int ii = 0;
|
// int ii = 0;
|
||||||
// while ( comment == true && ii < 100)
|
// while ( comment == true && ii < 100)
|
||||||
// {
|
// {
|
||||||
// infile.get(ch);
|
// infile.get(ch);
|
||||||
// if ( ch == '#' )
|
// if ( ch == '#' )
|
||||||
// while ( ch != '\n')
|
// while ( ch != '\n')
|
||||||
// {
|
// {
|
||||||
// infile.get(ch);
|
// infile.get(ch);
|
||||||
// comment = false;
|
// comment = false;
|
||||||
// }
|
// }
|
||||||
// else if ( ch == '\n' )
|
// else if ( ch == '\n' )
|
||||||
// {
|
// {
|
||||||
// comment = true;
|
// comment = true;
|
||||||
// ii ++;
|
// ii ++;
|
||||||
// }
|
// }
|
||||||
// else
|
// else
|
||||||
// {
|
// {
|
||||||
// infile.putback(ch);
|
// infile.putback(ch);
|
||||||
// comment = false;
|
// comment = false;
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// infile.get(ch) ;
|
// infile.get(ch) ;
|
||||||
// if ( ch == '\n' || ch == '#' )
|
// if ( ch == '\n' || ch == '#' )
|
||||||
// {
|
// {
|
||||||
// comment = true;
|
// comment = true;
|
||||||
// }
|
// }
|
||||||
// infile.putback(ch);
|
// infile.putback(ch);
|
||||||
// if ( !comment ) break;
|
// if ( !comment ) break;
|
||||||
// }
|
// }
|
||||||
// cerr << "** comment done" << endl;
|
// cerr << "** comment done" << endl;
|
||||||
// cerr << " * last char was " << ch << endl;
|
// cerr << " * last char was " << ch << endl;
|
||||||
// return;
|
// return;
|
||||||
//
|
//
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// herbert: fixed TestComment
|
// herbert: fixed TestComment
|
||||||
template <int D>
|
template <int D>
|
||||||
void SplineGeometry<D> :: TestComment ( ifstream & infile )
|
void SplineGeometry<D> :: TestComment ( ifstream & infile )
|
||||||
{
|
{
|
||||||
bool comment = true;
|
bool comment = true;
|
||||||
char ch;
|
char ch;
|
||||||
while ( comment == true && !infile.eof() ) {
|
while ( comment == true && !infile.eof() ) {
|
||||||
@ -412,13 +411,13 @@ void SplineGeometry<D> :: TestComment ( ifstream & infile )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
template<int D>
|
template<int D>
|
||||||
SplineGeometry<D> :: ~SplineGeometry()
|
SplineGeometry<D> :: ~SplineGeometry()
|
||||||
{
|
{
|
||||||
for(int i=0; i<splines.Size(); i++)
|
for(int i=0; i<splines.Size(); i++)
|
||||||
delete splines[i];
|
delete splines[i];
|
||||||
splines.DeleteAll();
|
splines.DeleteAll();
|
||||||
@ -427,13 +426,13 @@ SplineGeometry<D> :: ~SplineGeometry()
|
|||||||
delete materials[i];
|
delete materials[i];
|
||||||
for ( int i = 0; i < bcnames.Size(); i++ )
|
for ( int i = 0; i < bcnames.Size(); i++ )
|
||||||
if ( bcnames[i] ) delete bcnames[i];
|
if ( bcnames[i] ) delete bcnames[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
template<int D>
|
template<int D>
|
||||||
int SplineGeometry<D> :: Load (const Array<double> & raw_data, const int startpos)
|
int SplineGeometry<D> :: Load (const Array<double> & raw_data, const int startpos)
|
||||||
{
|
{
|
||||||
int pos = startpos;
|
int pos = startpos;
|
||||||
if(raw_data[pos] != D)
|
if(raw_data[pos] != D)
|
||||||
throw NgException("wrong dimension of spline raw_data");
|
throw NgException("wrong dimension of spline raw_data");
|
||||||
@ -480,11 +479,11 @@ int SplineGeometry<D> :: Load (const Array<double> & raw_data, const int startpo
|
|||||||
|
|
||||||
}
|
}
|
||||||
return pos;
|
return pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<int D>
|
template<int D>
|
||||||
void SplineGeometry<D> :: GetRawData (Array<double> & raw_data) const
|
void SplineGeometry<D> :: GetRawData (Array<double> & raw_data) const
|
||||||
{
|
{
|
||||||
raw_data.Append(D);
|
raw_data.Append(D);
|
||||||
raw_data.Append(elto0);
|
raw_data.Append(elto0);
|
||||||
|
|
||||||
@ -494,11 +493,12 @@ void SplineGeometry<D> :: GetRawData (Array<double> & raw_data) const
|
|||||||
splines[i]->GetRawData(raw_data);
|
splines[i]->GetRawData(raw_data);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template<int D>
|
/*
|
||||||
void SplineGeometry<D> :: CSGLoad (CSGScanner & scan)
|
template<int D>
|
||||||
{
|
void SplineGeometry<D> :: CSGLoad (CSGScanner & scan)
|
||||||
|
{
|
||||||
double hd;
|
double hd;
|
||||||
Point<D> x;
|
Point<D> x;
|
||||||
int nump, numseg;
|
int nump, numseg;
|
||||||
@ -553,14 +553,14 @@ void SplineGeometry<D> :: CSGLoad (CSGScanner & scan)
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
template<int D>
|
||||||
template<int D>
|
void SplineGeometry<D> :: Load (const char * filename)
|
||||||
void SplineGeometry<D> :: Load (const char * filename)
|
{
|
||||||
{
|
|
||||||
|
|
||||||
ifstream infile;
|
ifstream infile;
|
||||||
Point<D> x;
|
Point<D> x;
|
||||||
@ -595,12 +595,12 @@ void SplineGeometry<D> :: Load (const char * filename)
|
|||||||
LoadData(infile );
|
LoadData(infile );
|
||||||
}
|
}
|
||||||
infile.close();
|
infile.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<int D>
|
template<int D>
|
||||||
void SplineGeometry<D> :: LoadDataNew ( ifstream & infile )
|
void SplineGeometry<D> :: LoadDataNew ( ifstream & infile )
|
||||||
{
|
{
|
||||||
|
|
||||||
int nump, numseg, leftdom, rightdom;
|
int nump, numseg, leftdom, rightdom;
|
||||||
Point<D> x;
|
Point<D> x;
|
||||||
@ -712,7 +712,7 @@ void SplineGeometry<D> :: LoadDataNew ( ifstream & infile )
|
|||||||
spline = new CircleSeg<D> (geompoints[hi1-1],
|
spline = new CircleSeg<D> (geompoints[hi1-1],
|
||||||
geompoints[hi2-1],
|
geompoints[hi2-1],
|
||||||
geompoints[hi3-1]);
|
geompoints[hi3-1]);
|
||||||
// break;
|
// break;
|
||||||
}
|
}
|
||||||
else if (strcmp (buf, "discretepoints") == 0)
|
else if (strcmp (buf, "discretepoints") == 0)
|
||||||
{
|
{
|
||||||
@ -827,13 +827,13 @@ void SplineGeometry<D> :: LoadDataNew ( ifstream & infile )
|
|||||||
maxh[domainnr-1] = flags.GetNumFlag ( "maxh", 1000);
|
maxh[domainnr-1] = flags.GetNumFlag ( "maxh", 1000);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
template<int D>
|
template<int D>
|
||||||
void SplineGeometry<D> :: LoadData ( ifstream & infile )
|
void SplineGeometry<D> :: LoadData ( ifstream & infile )
|
||||||
{
|
{
|
||||||
|
|
||||||
int nump, numseg, leftdom, rightdom;
|
int nump, numseg, leftdom, rightdom;
|
||||||
Point<D> x;
|
Point<D> x;
|
||||||
@ -922,7 +922,7 @@ void SplineGeometry<D> :: LoadData ( ifstream & infile )
|
|||||||
spline = new CircleSeg<D> (geompoints[hi1-1],
|
spline = new CircleSeg<D> (geompoints[hi1-1],
|
||||||
geompoints[hi2-1],
|
geompoints[hi2-1],
|
||||||
geompoints[hi3-1]);
|
geompoints[hi3-1]);
|
||||||
// break;
|
// break;
|
||||||
}
|
}
|
||||||
else if (strcmp (buf, "discretepoints") == 0)
|
else if (strcmp (buf, "discretepoints") == 0)
|
||||||
{
|
{
|
||||||
@ -972,12 +972,12 @@ void SplineGeometry<D> :: LoadData ( ifstream & infile )
|
|||||||
bcnames[mybc] = new string (flags.GetStringFlag("bcname","") );
|
bcnames[mybc] = new string (flags.GetStringFlag("bcname","") );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void SplineGeometry2d :: PartitionBoundary (double h, Mesh & mesh2d)
|
void SplineGeometry2d :: PartitionBoundary (double h, Mesh & mesh2d)
|
||||||
{
|
{
|
||||||
enum { D = 2 };
|
enum { D = 2 };
|
||||||
Box<D> bbox;
|
Box<D> bbox;
|
||||||
GetBoundingBox (bbox);
|
GetBoundingBox (bbox);
|
||||||
@ -1021,12 +1021,12 @@ void SplineGeometry2d :: PartitionBoundary (double h, Mesh & mesh2d)
|
|||||||
{
|
{
|
||||||
CopyEdgeMesh (splines[i]->copyfrom, i+1, mesh2d, searchtree);
|
CopyEdgeMesh (splines[i]->copyfrom, i+1, mesh2d, searchtree);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<int D>
|
template<int D>
|
||||||
void SplineGeometry<D> :: CopyEdgeMesh (int from, int to, Mesh & mesh, Point3dTree & searchtree)
|
void SplineGeometry<D> :: CopyEdgeMesh (int from, int to, Mesh & mesh, Point3dTree & searchtree)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
Array<int, PointIndex::BASE> mappoints (mesh.GetNP());
|
Array<int, PointIndex::BASE> mappoints (mesh.GetNP());
|
||||||
@ -1110,12 +1110,12 @@ void SplineGeometry<D> :: CopyEdgeMesh (int from, int to, Mesh & mesh, Point3dTr
|
|||||||
mesh.AddSegment (nseg);
|
mesh.AddSegment (nseg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<int D>
|
template<int D>
|
||||||
void SplineGeometry<D> :: GetBoundingBox (Box<D> & box) const
|
void SplineGeometry<D> :: GetBoundingBox (Box<D> & box) const
|
||||||
{
|
{
|
||||||
if (!splines.Size())
|
if (!splines.Size())
|
||||||
{
|
{
|
||||||
Point<D> auxp = 0.;
|
Point<D> auxp = 0.;
|
||||||
@ -1132,37 +1132,37 @@ void SplineGeometry<D> :: GetBoundingBox (Box<D> & box) const
|
|||||||
for (int j = 0; j < points.Size(); j++)
|
for (int j = 0; j < points.Size(); j++)
|
||||||
box.Add (points[j]);
|
box.Add (points[j]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template<int D>
|
template<int D>
|
||||||
void SplineGeometry<D> :: SetGrading (const double grading)
|
void SplineGeometry<D> :: SetGrading (const double grading)
|
||||||
{ elto0 = grading;}
|
{ elto0 = grading;}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
template<int D>
|
template<int D>
|
||||||
void SplineGeometry<D> :: AppendPoint (const double x, const double y, const double reffac, const bool hpref)
|
void SplineGeometry<D> :: AppendPoint (const double x, const double y, const double reffac, const bool hpref)
|
||||||
{
|
{
|
||||||
geompoints.Append (GeomPoint<D>(x, y, reffac));
|
geompoints.Append (GeomPoint<D>(x, y, reffac));
|
||||||
geompoints.Last().hpref = hpref;
|
geompoints.Last().hpref = hpref;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<int D>
|
template<int D>
|
||||||
void SplineGeometry<D> :: AppendPoint (const Point<D> & p, const double reffac, const bool hpref)
|
void SplineGeometry<D> :: AppendPoint (const Point<D> & p, const double reffac, const bool hpref)
|
||||||
{
|
{
|
||||||
geompoints.Append (GeomPoint<D>(p, reffac));
|
geompoints.Append (GeomPoint<D>(p, reffac));
|
||||||
geompoints.Last().hpref = hpref;
|
geompoints.Last().hpref = hpref;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
template<int D>
|
template<int D>
|
||||||
void SplineGeometry<D> :: AppendSegment(SplineSeg<D> * spline, const int leftdomain, const int rightdomain,
|
void SplineGeometry<D> :: AppendSegment(SplineSeg<D> * spline, const int leftdomain, const int rightdomain,
|
||||||
const int bc,
|
const int bc,
|
||||||
const double reffac, const bool hprefleft, const bool hprefright,
|
const double reffac, const bool hprefleft, const bool hprefright,
|
||||||
const int copyfrom)
|
const int copyfrom)
|
||||||
{
|
{
|
||||||
spline -> leftdom = leftdomain;
|
spline -> leftdom = leftdomain;
|
||||||
spline -> rightdom = rightdomain;
|
spline -> rightdom = rightdomain;
|
||||||
spline -> bc = (bc >= 0) ? bc : (splines.Size()+1);
|
spline -> bc = (bc >= 0) ? bc : (splines.Size()+1);
|
||||||
@ -1172,47 +1172,47 @@ void SplineGeometry<D> :: AppendSegment(SplineSeg<D> * spline, const int leftdom
|
|||||||
spline -> copyfrom = copyfrom;
|
spline -> copyfrom = copyfrom;
|
||||||
|
|
||||||
splines.Append(spline);
|
splines.Append(spline);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<int D>
|
template<int D>
|
||||||
void SplineGeometry<D> :: AppendLineSegment (const int n1, const int n2, const int leftdomain, const int rightdomain,
|
void SplineGeometry<D> :: AppendLineSegment (const int n1, const int n2, const int leftdomain, const int rightdomain,
|
||||||
const int bc,
|
const int bc,
|
||||||
const double reffac, const bool hprefleft, const bool hprefright,
|
const double reffac, const bool hprefleft, const bool hprefright,
|
||||||
const int copyfrom)
|
const int copyfrom)
|
||||||
{
|
{
|
||||||
SplineSeg<D> * spline = new LineSeg<D>(geompoints[n1],geompoints[n2]);
|
SplineSeg<D> * spline = new LineSeg<D>(geompoints[n1],geompoints[n2]);
|
||||||
AppendSegment(spline,leftdomain,rightdomain,bc,reffac,hprefleft,hprefright,copyfrom);
|
AppendSegment(spline,leftdomain,rightdomain,bc,reffac,hprefleft,hprefright,copyfrom);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<int D>
|
template<int D>
|
||||||
void SplineGeometry<D> :: AppendSplineSegment (const int n1, const int n2, const int n3, const int leftdomain, const int rightdomain,
|
void SplineGeometry<D> :: AppendSplineSegment (const int n1, const int n2, const int n3, const int leftdomain, const int rightdomain,
|
||||||
const int bc,
|
const int bc,
|
||||||
const double reffac, const bool hprefleft, const bool hprefright,
|
const double reffac, const bool hprefleft, const bool hprefright,
|
||||||
const int copyfrom)
|
const int copyfrom)
|
||||||
{
|
{
|
||||||
SplineSeg<D> * spline = new SplineSeg3<D>(geompoints[n1],geompoints[n2],geompoints[n3]);
|
SplineSeg<D> * spline = new SplineSeg3<D>(geompoints[n1],geompoints[n2],geompoints[n3]);
|
||||||
AppendSegment(spline,leftdomain,rightdomain,bc,reffac,hprefleft,hprefright,copyfrom);
|
AppendSegment(spline,leftdomain,rightdomain,bc,reffac,hprefleft,hprefright,copyfrom);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<int D>
|
template<int D>
|
||||||
void SplineGeometry<D> :: AppendCircleSegment (const int n1, const int n2, const int n3, const int leftdomain, const int rightdomain,
|
void SplineGeometry<D> :: AppendCircleSegment (const int n1, const int n2, const int n3, const int leftdomain, const int rightdomain,
|
||||||
const int bc,
|
const int bc,
|
||||||
const double reffac, const bool hprefleft, const bool hprefright,
|
const double reffac, const bool hprefleft, const bool hprefright,
|
||||||
const int copyfrom)
|
const int copyfrom)
|
||||||
{
|
{
|
||||||
SplineSeg<D> * spline = new CircleSeg<D>(geompoints[n1],geompoints[n2],geompoints[n3]);
|
SplineSeg<D> * spline = new CircleSeg<D>(geompoints[n1],geompoints[n2],geompoints[n3]);
|
||||||
AppendSegment(spline,leftdomain,rightdomain,bc,reffac,hprefleft,hprefright,copyfrom);
|
AppendSegment(spline,leftdomain,rightdomain,bc,reffac,hprefleft,hprefright,copyfrom);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<int D>
|
template<int D>
|
||||||
void SplineGeometry<D> :: AppendDiscretePointsSegment (const Array< Point<D> > & points, const int leftdomain, const int rightdomain,
|
void SplineGeometry<D> :: AppendDiscretePointsSegment (const Array< Point<D> > & points, const int leftdomain, const int rightdomain,
|
||||||
const int bc,
|
const int bc,
|
||||||
const double reffac, const bool hprefleft, const bool hprefright,
|
const double reffac, const bool hprefleft, const bool hprefright,
|
||||||
const int copyfrom)
|
const int copyfrom)
|
||||||
{
|
{
|
||||||
SplineSeg<D> * spline = new DiscretePointsSeg<D>(points);
|
SplineSeg<D> * spline = new DiscretePointsSeg<D>(points);
|
||||||
AppendSegment(spline,leftdomain,rightdomain,bc,reffac,hprefleft,hprefright,copyfrom);
|
AppendSegment(spline,leftdomain,rightdomain,bc,reffac,hprefleft,hprefright,copyfrom);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<int D>
|
template<int D>
|
||||||
@ -1245,40 +1245,38 @@ void SplineGeometry<D> :: AppendDiscretePointsSegment (const Array< Point<D> > &
|
|||||||
return "default";
|
return "default";
|
||||||
}
|
}
|
||||||
|
|
||||||
template<int D>
|
template<int D>
|
||||||
string * SplineGeometry<D> :: BCNamePtr( const int bcnr )
|
string * SplineGeometry<D> :: BCNamePtr( const int bcnr )
|
||||||
{
|
{
|
||||||
if ( bcnr > bcnames.Size() )
|
if ( bcnr > bcnames.Size() )
|
||||||
return 0;
|
return 0;
|
||||||
else
|
else
|
||||||
return bcnames[bcnr-1];
|
return bcnames[bcnr-1];
|
||||||
}
|
}
|
||||||
|
|
||||||
SplineGeometry2d :: ~SplineGeometry2d()
|
SplineGeometry2d :: ~SplineGeometry2d()
|
||||||
{
|
{
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
extern void MeshFromSpline2D (SplineGeometry2d & geometry,
|
extern void MeshFromSpline2D (SplineGeometry2d & geometry,
|
||||||
Mesh *& mesh,
|
Mesh *& mesh,
|
||||||
MeshingParameters & mp);
|
MeshingParameters & mp);
|
||||||
|
|
||||||
|
|
||||||
int SplineGeometry2d :: GenerateMesh (Mesh*& mesh, MeshingParameters & mparam,
|
int SplineGeometry2d :: GenerateMesh (Mesh*& mesh, MeshingParameters & mparam,
|
||||||
int perfstepsstart, int perfstepsend)
|
int perfstepsstart, int perfstepsend)
|
||||||
{
|
{
|
||||||
cout << "SplineGeometry2d::GenerateMesh not only a dummy" << endl;
|
|
||||||
|
|
||||||
MeshFromSpline2D (*this, mesh, mparam);
|
MeshFromSpline2D (*this, mesh, mparam);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Refinement & SplineGeometry2d :: GetRefinement () const
|
Refinement & SplineGeometry2d :: GetRefinement () const
|
||||||
{
|
{
|
||||||
return * new Refinement2d (*this);
|
return * new Refinement2d (*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ in geom2d only 2D - Geometry classes (with material properties etc.)
|
|||||||
|
|
||||||
#ifndef _FILE_SPLINEGEOMETRY
|
#ifndef _FILE_SPLINEGEOMETRY
|
||||||
#define _FILE_SPLINEGEOMETRY
|
#define _FILE_SPLINEGEOMETRY
|
||||||
#include "../csg/csgparser.hpp"
|
// #include "../csg/csgparser.hpp"
|
||||||
|
|
||||||
|
|
||||||
namespace netgen
|
namespace netgen
|
||||||
@ -38,7 +38,8 @@ namespace netgen
|
|||||||
template < int D >
|
template < int D >
|
||||||
class SplineGeometry
|
class SplineGeometry
|
||||||
{
|
{
|
||||||
protected:
|
// protected:
|
||||||
|
public:
|
||||||
Array < GeomPoint<D> > geompoints;
|
Array < GeomPoint<D> > geompoints;
|
||||||
Array < SplineSeg<D>* > splines;
|
Array < SplineSeg<D>* > splines;
|
||||||
double elto0;
|
double elto0;
|
||||||
@ -59,7 +60,7 @@ namespace netgen
|
|||||||
|
|
||||||
int Load (const Array<double> & raw_data, const int startpos = 0);
|
int Load (const Array<double> & raw_data, const int startpos = 0);
|
||||||
void Load (const char * filename);
|
void Load (const char * filename);
|
||||||
void CSGLoad (CSGScanner & scan);
|
// void CSGLoad (CSGScanner & scan);
|
||||||
|
|
||||||
void LoadData( ifstream & infile );
|
void LoadData( ifstream & infile );
|
||||||
void LoadDataNew ( ifstream & infile );
|
void LoadDataNew ( ifstream & infile );
|
||||||
|
@ -3,9 +3,8 @@
|
|||||||
|
|
||||||
#include <myadt.hpp>
|
#include <myadt.hpp>
|
||||||
#include <meshing.hpp>
|
#include <meshing.hpp>
|
||||||
#include <csg.hpp>
|
|
||||||
#include <stlgeom.hpp>
|
|
||||||
|
|
||||||
|
#include <geometry2d.hpp>
|
||||||
#include <visual.hpp>
|
#include <visual.hpp>
|
||||||
|
|
||||||
#include "vsgeom2d.hpp"
|
#include "vsgeom2d.hpp"
|
||||||
@ -14,9 +13,6 @@ namespace netgen
|
|||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* *********************** Draw 2D Geometry **************** */
|
/* *********************** Draw 2D Geometry **************** */
|
||||||
|
|
||||||
|
|
||||||
|
@ -20,5 +20,9 @@ libocc_la_SOURCES = Partition_Inter2d.cxx Partition_Inter3d.cxx \
|
|||||||
Partition_Loop.cxx Partition_Loop2d.cxx Partition_Loop3d.cxx Partition_Spliter.cxx \
|
Partition_Loop.cxx Partition_Loop2d.cxx Partition_Loop3d.cxx Partition_Spliter.cxx \
|
||||||
occconstruction.cpp occgenmesh.cpp occgeom.cpp occmeshsurf.cpp
|
occconstruction.cpp occgenmesh.cpp occgeom.cpp occmeshsurf.cpp
|
||||||
|
|
||||||
liboccvis_la_SOURCES = occpkg.cpp vsocc.cpp
|
libocc_la_LIBADD = $(OCCLIBS)
|
||||||
|
|
||||||
|
liboccvis_la_SOURCES = occpkg.cpp vsocc.cpp
|
||||||
|
liboccvis_la_LIBADD = libocc.la
|
||||||
|
|
||||||
|
|
||||||
|
@ -4,12 +4,12 @@ stltool.hpp stltopology.hpp vsstl.hpp
|
|||||||
AM_CPPFLAGS = -I$(top_srcdir)/libsrc/include $(TCL_INCLUDES)
|
AM_CPPFLAGS = -I$(top_srcdir)/libsrc/include $(TCL_INCLUDES)
|
||||||
METASOURCES = AUTO
|
METASOURCES = AUTO
|
||||||
|
|
||||||
noinst_LTLIBRARIES = libstl.la libstlvis.la
|
lib_LTLIBRARIES = libstl.la libstlvis.la
|
||||||
|
|
||||||
libstl_la_SOURCES = meshstlsurface.cpp stlgeom.cpp stlgeomchart.cpp \
|
libstl_la_SOURCES = meshstlsurface.cpp stlgeom.cpp stlgeomchart.cpp \
|
||||||
stlgeommesh.cpp stlline.cpp stltool.cpp stltopology.cpp
|
stlgeommesh.cpp stlline.cpp stltool.cpp stltopology.cpp
|
||||||
|
|
||||||
|
|
||||||
libstlvis_la_SOURCES = stlpkg.cpp vsstl.cpp
|
libstlvis_la_SOURCES = stlpkg.cpp vsstl.cpp
|
||||||
|
libstlvis_la_LIBADD = libstl.la $(top_builddir)/libsrc/linalg/libla.la
|
||||||
|
|
||||||
|
@ -595,8 +595,8 @@ namespace netgen
|
|||||||
|
|
||||||
using namespace netgen;
|
using namespace netgen;
|
||||||
|
|
||||||
extern "C" int Ng_STL_Init (Tcl_Interp * interp);
|
extern "C" int Ng_stl_Init (Tcl_Interp * interp);
|
||||||
int Ng_STL_Init (Tcl_Interp * interp)
|
int Ng_stl_Init (Tcl_Interp * interp)
|
||||||
{
|
{
|
||||||
geometryregister.Append (new STLGeometryRegister);
|
geometryregister.Append (new STLGeometryRegister);
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
include_HEADERS =
|
include_HEADERS =
|
||||||
|
|
||||||
AM_CPPFLAGS = -I$(top_srcdir)/libsrc/include -I$(top_srcdir)/libsrc/interface -DOPENGL -D$(TOGL_WINDOWINGSYSTEM) $(OCCFLAGS) $(TCL_INCLUDES) $(MPI_INCLUDES) $(FFMPEG_INCLUDES) $(JPEGLIB_INCLUDES)
|
AM_CPPFLAGS = -I$(top_srcdir)/libsrc/include -I$(top_srcdir)/libsrc/interface -DOPENGL -D$(TOGL_WINDOWINGSYSTEM) $(TCL_INCLUDES) $(MPI_INCLUDES) $(FFMPEG_INCLUDES) $(JPEGLIB_INCLUDES)
|
||||||
|
|
||||||
bin_PROGRAMS = netgen
|
bin_PROGRAMS = netgen
|
||||||
netgen_SOURCES = demoview.cpp ngappinit.cpp ngpkg.cpp onetcl.cpp nginterface.cpp nginterface_v2.cpp parallelfunc.cpp parallelinterface.cpp demoview.hpp parallelfunc.hpp togl_1_7.h
|
netgen_SOURCES = demoview.cpp ngappinit.cpp ngpkg.cpp onetcl.cpp nginterface.cpp nginterface_v2.cpp parallelfunc.cpp parallelinterface.cpp demoview.hpp parallelfunc.hpp togl_1_7.h
|
||||||
@ -8,20 +8,19 @@ netgen_SOURCES = demoview.cpp ngappinit.cpp ngpkg.cpp onetcl.cpp nginterface.cpp
|
|||||||
|
|
||||||
netgen_LDADD = $(top_builddir)/libsrc/visualization/libvisual.a \
|
netgen_LDADD = $(top_builddir)/libsrc/visualization/libvisual.a \
|
||||||
$(top_builddir)/libsrc/csg/libcsgvis.la \
|
$(top_builddir)/libsrc/csg/libcsgvis.la \
|
||||||
$(top_builddir)/libsrc/csg/libcsg.la \
|
|
||||||
$(top_builddir)/libsrc/geom2d/libgeom2dvis.la \
|
$(top_builddir)/libsrc/geom2d/libgeom2dvis.la \
|
||||||
$(top_builddir)/libsrc/geom2d/libgeom2d.la \
|
|
||||||
$(top_builddir)/libsrc/interface/libinterface.la \
|
$(top_builddir)/libsrc/interface/libinterface.la \
|
||||||
$(top_builddir)/libsrc/stlgeom/libstlvis.la \
|
|
||||||
$(top_builddir)/libsrc/stlgeom/libstl.la \
|
|
||||||
$(top_builddir)/libsrc/meshing/libmesh.la \
|
$(top_builddir)/libsrc/meshing/libmesh.la \
|
||||||
$(top_builddir)/libsrc/gprim/libgprim.la \
|
$(top_builddir)/libsrc/gprim/libgprim.la \
|
||||||
$(top_builddir)/libsrc/linalg/libla.la \
|
$(top_builddir)/libsrc/linalg/libla.la \
|
||||||
$(top_builddir)/libsrc/general/libgen.la \
|
$(top_builddir)/libsrc/general/libgen.la \
|
||||||
$(OCCLIBS) -L$(TK_BIN_DIR)/Togl1.7 $(TOGLLIBDIR) -lTogl1.7 $(LIBGLU) $(TK_LIB_SPEC) $(TCL_LIB_SPEC) $(MPI_LIBS) $(FFMPEG_LIBS) $(JPEGLIB_LIBS) $(PKG_LIBS)
|
-L$(TK_BIN_DIR)/Togl1.7 $(TOGLLIBDIR) -lTogl1.7 $(LIBGLU) $(TK_LIB_SPEC) $(TCL_LIB_SPEC) $(MPI_LIBS) $(FFMPEG_LIBS) $(JPEGLIB_LIBS) $(PKG_LIBS)
|
||||||
#
|
#
|
||||||
# $(top_builddir)/libsrc/occ/liboccvis.la
|
# $(top_builddir)/libsrc/occ/liboccvis.la
|
||||||
# $(top_builddir)/libsrc/occ/libocc.la
|
# $(top_builddir)/libsrc/occ/libocc.la
|
||||||
|
# $(top_builddir)/libsrc/stlgeom/libstlvis.la
|
||||||
|
# $(top_builddir)/libsrc/stlgeom/libstl.la
|
||||||
|
# $(top_builddir)/libsrc/geom2d/libgeom2d.la
|
||||||
|
|
||||||
|
|
||||||
# add for static linkage of ngsolve:
|
# add for static linkage of ngsolve:
|
||||||
|
@ -2494,50 +2494,6 @@ proc printlatestwarning { } {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# for parallel visualization, overlapping meshes...
|
|
||||||
proc paralleldialog { } {
|
|
||||||
|
|
||||||
set w .parallel_dlg
|
|
||||||
|
|
||||||
if {[winfo exists .parallel_dlg] == 1} {
|
|
||||||
wm withdraw $w
|
|
||||||
wm deiconify $w
|
|
||||||
wm geometry $w =270x100
|
|
||||||
|
|
||||||
focus $w
|
|
||||||
} {
|
|
||||||
|
|
||||||
toplevel $w
|
|
||||||
wm geometry $w =270x100
|
|
||||||
|
|
||||||
# frame $w.buttons -relief groove -borderwidth 3 -width 300
|
|
||||||
# pack $w.buttons
|
|
||||||
set ww $w
|
|
||||||
|
|
||||||
button $ww.visallb -text "View All" -width 20 -command\
|
|
||||||
{ Ng_VisualizeAll; }
|
|
||||||
pack $ww.visallb
|
|
||||||
|
|
||||||
button $ww.visoneb -text "View One" -width 20 -command \
|
|
||||||
{ Ng_VisualizeOne; }
|
|
||||||
pack $ww.visoneb
|
|
||||||
|
|
||||||
button $ww.overlap -text "overlap++" -width 20 -command \
|
|
||||||
{ Ng_IncrOverlap; }
|
|
||||||
|
|
||||||
pack $ww.overlap
|
|
||||||
|
|
||||||
wm withdraw $w
|
|
||||||
wm geom $w +100+100
|
|
||||||
wm deiconify $w
|
|
||||||
wm title $w "Parallel Netgen"
|
|
||||||
focus .parallel_dlg
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# paralleldialog
|
|
||||||
#wm withdraw $w
|
|
||||||
|
|
||||||
proc runtestdialog { } {
|
proc runtestdialog { } {
|
||||||
source $::ngdir/ngshell.tcl
|
source $::ngdir/ngshell.tcl
|
||||||
|
@ -5,15 +5,16 @@ set oldmousex 0
|
|||||||
set oldmousey 0
|
set oldmousey 0
|
||||||
#
|
#
|
||||||
|
|
||||||
# if { 1 } {
|
|
||||||
|
|
||||||
# use this one for Togl 2.0
|
# use this one for Togl 2.0
|
||||||
|
|
||||||
|
# if { 1 } {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# if {[catch {togl .ndraw -width 400 -height 300 -rgba true -double true -depth true -privatecmap false -stereo false -indirect true -create init -display draw -reshape reshape }] } {
|
# if {[catch {togl .ndraw -width 400 -height 300 -rgba true -double true -depth true -privatecmap false -stereo false -indirect true -create init -display draw -reshape reshape }] } {
|
||||||
|
|
||||||
# changed -indirect true/false !!!
|
|
||||||
if {[catch {togl .ndraw -width 400 -height 300 -rgba true -double true -depth true -privatecmap false -stereo false -indirect true }] } {
|
if {[catch {togl .ndraw -width 400 -height 300 -rgba true -double true -depth true -privatecmap false -stereo false -indirect true }] } {
|
||||||
|
|
||||||
puts "no OpenGL"
|
puts "no OpenGL"
|
||||||
} {
|
} {
|
||||||
#
|
#
|
||||||
|
@ -833,17 +833,6 @@ pack .bubar.exitb .bubar.surfm .bubar.stopm -side left
|
|||||||
#button .bubar.scan -text "Scan" \
|
#button .bubar.scan -text "Scan" \
|
||||||
# -command { Ng_ParseGeometry; set selectvisual geometry; Ng_SetVisParameters; redraw }
|
# -command { Ng_ParseGeometry; set selectvisual geometry; Ng_SetVisParameters; redraw }
|
||||||
|
|
||||||
# fuer parallel - buttons :)
|
|
||||||
Ng_IsParallel;
|
|
||||||
if { $parallel_netgen } {
|
|
||||||
# catch{
|
|
||||||
# source ${ngdir}/ngtcltk/parallel_dialog.tcl
|
|
||||||
# }
|
|
||||||
button .bubar.visallb -text "Parallel" -command \
|
|
||||||
{ paralleldialog; redraw }
|
|
||||||
pack .bubar.visallb -side left
|
|
||||||
}
|
|
||||||
|
|
||||||
button .bubar.zoomall -text "Zoom All" \
|
button .bubar.zoomall -text "Zoom All" \
|
||||||
-command { Ng_ZoomAll; redraw }
|
-command { Ng_ZoomAll; redraw }
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ int main(int argc, char ** argv)
|
|||||||
cout << "NETGEN-" << PACKAGE_VERSION << endl;
|
cout << "NETGEN-" << PACKAGE_VERSION << endl;
|
||||||
|
|
||||||
cout << "Developed by Joachim Schoeberl at" << endl
|
cout << "Developed by Joachim Schoeberl at" << endl
|
||||||
<< "2010-xxxx Vienna UT" << endl
|
<< "2010-xxxx Vienna University of Technology" << endl
|
||||||
<< "2006-2010 RWTH Aachen University" << endl
|
<< "2006-2010 RWTH Aachen University" << endl
|
||||||
<< "1996-2006 Johannes Kepler University Linz" << endl;
|
<< "1996-2006 Johannes Kepler University Linz" << endl;
|
||||||
|
|
||||||
|
@ -1,20 +1,7 @@
|
|||||||
#include <mystdlib.h>
|
#include <mystdlib.h>
|
||||||
|
|
||||||
|
|
||||||
#include <meshing.hpp>
|
#include <meshing.hpp>
|
||||||
#include <csg.hpp>
|
|
||||||
#include <geometry2d.hpp>
|
|
||||||
#include <stlgeom.hpp>
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef OCCGEOMETRY
|
|
||||||
#include <occgeom.hpp>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef ACIS
|
|
||||||
#include <acisgeom.hpp>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef SOCKETS
|
#ifdef SOCKETS
|
||||||
#include "../sockets/sockets.hpp"
|
#include "../sockets/sockets.hpp"
|
||||||
#endif
|
#endif
|
||||||
@ -27,11 +14,6 @@
|
|||||||
#include "nginterface.h"
|
#include "nginterface.h"
|
||||||
#include "nginterface_v2.hpp"
|
#include "nginterface_v2.hpp"
|
||||||
|
|
||||||
// #include <FlexLexer.h>
|
|
||||||
|
|
||||||
|
|
||||||
// #include <mystdlib.h>
|
|
||||||
|
|
||||||
|
|
||||||
namespace netgen
|
namespace netgen
|
||||||
{
|
{
|
||||||
@ -43,16 +25,6 @@ namespace netgen
|
|||||||
extern Tcl_Interp * tcl_interp;
|
extern Tcl_Interp * tcl_interp;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern AutoPtr<SplineGeometry2d> geometry2d;
|
|
||||||
extern AutoPtr<CSGeometry> geometry;
|
|
||||||
extern STLGeometry * stlgeometry;
|
|
||||||
|
|
||||||
#ifdef OCCGEOMETRY
|
|
||||||
extern OCCGeometry * occgeometry;
|
|
||||||
#endif
|
|
||||||
#ifdef ACIS
|
|
||||||
extern ACISGeometry * acisgeometry;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef OPENGL
|
#ifdef OPENGL
|
||||||
extern VisualSceneSolution vssolution;
|
extern VisualSceneSolution vssolution;
|
||||||
@ -217,23 +189,6 @@ namespace netgen
|
|||||||
double * dxdxi, size_t sdxdxi)
|
double * dxdxi, size_t sdxdxi)
|
||||||
{
|
{
|
||||||
mesh->GetCurvedElements().CalcMultiPointSegmentTransformation<2> (elnr, npts, xi, sxi, x, sx, dxdxi, sdxdxi);
|
mesh->GetCurvedElements().CalcMultiPointSegmentTransformation<2> (elnr, npts, xi, sxi, x, sx, dxdxi, sdxdxi);
|
||||||
/*
|
|
||||||
for (int ip = 0; ip < npts; ip++)
|
|
||||||
{
|
|
||||||
Point<3> xg;
|
|
||||||
Vec<3> dx;
|
|
||||||
|
|
||||||
mesh->GetCurvedElements().CalcSegmentTransformation (xi[ip*sxi], elnr, xg, dx);
|
|
||||||
|
|
||||||
if (x)
|
|
||||||
for (int i = 0; i < 2; i++)
|
|
||||||
x[ip*sx+i] = xg(i);
|
|
||||||
|
|
||||||
if (dxdxi)
|
|
||||||
for (int i=0; i<2; i++)
|
|
||||||
dxdxi[ip*sdxdxi+i] = dx(i);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
@ -257,7 +212,6 @@ namespace netgen
|
|||||||
return mesh->GetTopology().GetNFaces();
|
return mesh->GetTopology().GetNFaces();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template <> DLL_HEADER Ng_Node<1> Ng_GetNode<1> (int nr)
|
template <> DLL_HEADER Ng_Node<1> Ng_GetNode<1> (int nr)
|
||||||
{
|
{
|
||||||
Ng_Node<1> node;
|
Ng_Node<1> node;
|
||||||
@ -265,8 +219,6 @@ namespace netgen
|
|||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <> DLL_HEADER Ng_Node<2> Ng_GetNode<2> (int nr)
|
template <> DLL_HEADER Ng_Node<2> Ng_GetNode<2> (int nr)
|
||||||
{
|
{
|
||||||
Ng_Node<2> node;
|
Ng_Node<2> node;
|
||||||
|
119
ng/ngpkg.cpp
119
ng/ngpkg.cpp
@ -24,7 +24,6 @@ The interface between the GUI and the netgen library
|
|||||||
#include "../libsrc/sockets/socketmanager.hpp"
|
#include "../libsrc/sockets/socketmanager.hpp"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// #include <parallel.hpp>
|
|
||||||
|
|
||||||
// to be sure to include the 'right' togl-version
|
// to be sure to include the 'right' togl-version
|
||||||
#include "togl_1_7.h"
|
#include "togl_1_7.h"
|
||||||
@ -2012,10 +2011,10 @@ namespace netgen
|
|||||||
return TCL_ERROR;
|
return TCL_ERROR;
|
||||||
|
|
||||||
cout << "call Togl - load font (crash on my Linux64)" << endl;
|
cout << "call Togl - load font (crash on my Linux64)" << endl;
|
||||||
// togl_font = Togl_LoadBitmapFont( togl, "Times"); // TOGL_BITMAP_8_BY_13 );
|
togl_font = Togl_LoadBitmapFont( togl, "Times"); // TOGL_BITMAP_8_BY_13 );
|
||||||
// togl_font = Togl_LoadBitmapFont( togl, TOGL_BITMAP_8_BY_13 );
|
// togl_font = Togl_LoadBitmapFont( togl, TOGL_BITMAP_8_BY_13 );
|
||||||
// togl_font = Togl_LoadBitmapFont( togl, NULL );
|
// togl_font = Togl_LoadBitmapFont( togl, NULL );
|
||||||
// cout << "success" << endl;
|
cout << "success" << endl;
|
||||||
|
|
||||||
glMatrixMode(GL_PROJECTION);
|
glMatrixMode(GL_PROJECTION);
|
||||||
glLoadIdentity();
|
glLoadIdentity();
|
||||||
@ -2882,91 +2881,7 @@ namespace netgen
|
|||||||
return TCL_OK;
|
return TCL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PARALLEL
|
|
||||||
int Ng_VisualizeAll (ClientData clientData,
|
|
||||||
Tcl_Interp * interp,
|
|
||||||
int argc, tcl_const char *argv[])
|
|
||||||
{
|
|
||||||
int id, rc, ntasks;
|
|
||||||
MPI_Comm_size(MPI_COMM_WORLD, &ntasks);
|
|
||||||
MPI_Comm_rank(MPI_COMM_WORLD, &id);
|
|
||||||
|
|
||||||
string visualizationmode = Tcl_GetVar (interp, "::selectvisual", 0);
|
|
||||||
string scalfun = Tcl_GetVar (interp, "::visoptions.scalfunction", 0);
|
|
||||||
for ( int dest = 1; dest < ntasks; dest++)
|
|
||||||
{
|
|
||||||
MyMPI_Send ( "visualize", dest );
|
|
||||||
MyMPI_Send ( visualizationmode, dest);
|
|
||||||
if ( visualizationmode == "solution" )
|
|
||||||
MyMPI_Send ( scalfun, dest);
|
|
||||||
}
|
|
||||||
return TCL_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
int Ng_VisualizeOne (ClientData clientData,
|
|
||||||
Tcl_Interp * interp,
|
|
||||||
int argc, tcl_const char *argv[])
|
|
||||||
{
|
|
||||||
int id, rc, ntasks;
|
|
||||||
MPI_Comm_size(MPI_COMM_WORLD, &ntasks);
|
|
||||||
MPI_Comm_rank(MPI_COMM_WORLD, &id);
|
|
||||||
|
|
||||||
string visualizationmode = Tcl_GetVar (interp, "::selectvisual", 0);
|
|
||||||
string scalfun = Tcl_GetVar (interp, "::visoptions.scalfunction", 0);
|
|
||||||
|
|
||||||
MyMPI_Send ( "visualize", 1 );
|
|
||||||
MyMPI_Send ( visualizationmode, 1);
|
|
||||||
|
|
||||||
if ( visualizationmode == "solution" )
|
|
||||||
MyMPI_Send ( scalfun, 1);
|
|
||||||
return TCL_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
int Ng_IncrOverlap ( ClientData clientDate,
|
|
||||||
Tcl_Interp * interp,
|
|
||||||
int argc, tcl_const char * argv[] )
|
|
||||||
{
|
|
||||||
int id, rc, ntasks;
|
|
||||||
MPI_Comm_size(MPI_COMM_WORLD, &ntasks);
|
|
||||||
MPI_Comm_rank(MPI_COMM_WORLD, &id);
|
|
||||||
|
|
||||||
for ( int dest = 1; dest < ntasks; dest++)
|
|
||||||
{
|
|
||||||
MyMPI_Send ( "overlap++", dest );
|
|
||||||
}
|
|
||||||
mesh->UpdateOverlap();
|
|
||||||
return TCL_OK;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
int Ng_SetSelectVisual ( ClientData clientDate,
|
|
||||||
Tcl_Interp * interp,
|
|
||||||
int argc, tcl_const char * argv[] )
|
|
||||||
{
|
|
||||||
string visualizationmode;
|
|
||||||
MyMPI_Recv ( visualizationmode, 0);
|
|
||||||
Tcl_SetVar (interp, "::selectvisual", visualizationmode.c_str(), 0);
|
|
||||||
return TCL_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
int Ng_SetScalarFunction ( ClientData clientDate,
|
|
||||||
Tcl_Interp * interp,
|
|
||||||
int argc, tcl_const char * argv[] )
|
|
||||||
{
|
|
||||||
string visualizationmode;
|
|
||||||
string scalarfun;
|
|
||||||
visualizationmode = Tcl_GetVar (interp, "::selectvisual", 0);
|
|
||||||
|
|
||||||
if ( visualizationmode == "solution" )
|
|
||||||
{
|
|
||||||
MyMPI_Recv ( scalarfun, 0);
|
|
||||||
Tcl_SetVar (interp, "::visoptions.scalfunction", scalarfun.c_str(), 0);
|
|
||||||
}
|
|
||||||
return TCL_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int Ng_IsParallel (ClientData clientData,
|
int Ng_IsParallel (ClientData clientData,
|
||||||
Tcl_Interp * interp,
|
Tcl_Interp * interp,
|
||||||
@ -3073,7 +2988,7 @@ namespace netgen
|
|||||||
|
|
||||||
extern "C" int Ng_Init (Tcl_Interp * interp);
|
extern "C" int Ng_Init (Tcl_Interp * interp);
|
||||||
extern "C" int Ng_CSG_Init (Tcl_Interp * interp);
|
extern "C" int Ng_CSG_Init (Tcl_Interp * interp);
|
||||||
extern "C" int Ng_STL_Init (Tcl_Interp * interp);
|
// extern "C" int Ng_stl_Init (Tcl_Interp * interp);
|
||||||
|
|
||||||
#ifdef OCCGEOMETRY
|
#ifdef OCCGEOMETRY
|
||||||
// extern "C" int Ng_occ_Init (Tcl_Interp * interp);
|
// extern "C" int Ng_occ_Init (Tcl_Interp * interp);
|
||||||
@ -3094,11 +3009,8 @@ namespace netgen
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
Ng_CSG_Init(interp);
|
Ng_CSG_Init(interp);
|
||||||
Ng_STL_Init(interp);
|
// Ng_stl_Init(interp);
|
||||||
|
|
||||||
#ifdef OCCGEOMETRY
|
|
||||||
// Ng_occ_Init(interp);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
Ng_Geom2d_Init(interp);
|
Ng_Geom2d_Init(interp);
|
||||||
|
|
||||||
@ -3358,29 +3270,6 @@ namespace netgen
|
|||||||
(ClientData)NULL,
|
(ClientData)NULL,
|
||||||
(Tcl_CmdDeleteProc*) NULL);
|
(Tcl_CmdDeleteProc*) NULL);
|
||||||
|
|
||||||
|
|
||||||
#ifdef PARALLEL
|
|
||||||
Tcl_CreateCommand (interp, "Ng_VisualizeAll", Ng_VisualizeAll,
|
|
||||||
(ClientData)NULL,
|
|
||||||
(Tcl_CmdDeleteProc*) NULL);
|
|
||||||
|
|
||||||
Tcl_CreateCommand (interp, "Ng_VisualizeOne", Ng_VisualizeOne,
|
|
||||||
(ClientData)NULL,
|
|
||||||
(Tcl_CmdDeleteProc*) NULL);
|
|
||||||
|
|
||||||
Tcl_CreateCommand (interp, "Ng_IncrOverlap", Ng_IncrOverlap,
|
|
||||||
(ClientData)NULL,
|
|
||||||
(Tcl_CmdDeleteProc*) NULL);
|
|
||||||
|
|
||||||
Tcl_CreateCommand (interp, "Ng_SetSelectVisual", Ng_SetSelectVisual,
|
|
||||||
(ClientData)NULL,
|
|
||||||
(Tcl_CmdDeleteProc*) NULL);
|
|
||||||
|
|
||||||
Tcl_CreateCommand (interp, "Ng_SetScalarFunction", Ng_SetScalarFunction,
|
|
||||||
(ClientData)NULL,
|
|
||||||
(Tcl_CmdDeleteProc*) NULL);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
Tcl_CreateCommand (interp, "Ng_IsParallel", Ng_IsParallel,
|
Tcl_CreateCommand (interp, "Ng_IsParallel", Ng_IsParallel,
|
||||||
(ClientData)NULL,
|
(ClientData)NULL,
|
||||||
(Tcl_CmdDeleteProc*) NULL);
|
(Tcl_CmdDeleteProc*) NULL);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
if { [catch { load liboccvis[info sharedlibextension] Ng_OCC } result ] } {
|
if { [catch { load liboccvis[info sharedlibextension] Ng_OCC } result ] } {
|
||||||
# puts "cannot load occ"
|
puts "cannot load occ"
|
||||||
# puts "error: $result"
|
puts "error: $result"
|
||||||
|
|
||||||
# dummy
|
# dummy
|
||||||
proc rebuildoccdialog { } { }
|
proc rebuildoccdialog { } { }
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
if { [catch { load libstlvis[info sharedlibextension] Ng_STL } result ] } {
|
||||||
|
puts "cannot load stl"
|
||||||
|
puts "error: $result"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.ngmenu.geometry add separator
|
.ngmenu.geometry add separator
|
||||||
|
|
||||||
.ngmenu.geometry add command -label "STL Doctor..." \
|
.ngmenu.geometry add command -label "STL Doctor..." \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user