meshing headers

This commit is contained in:
Joachim Schoeberl 2011-03-02 20:50:39 +00:00
parent 807d091d9e
commit ab0077c609
11 changed files with 2198 additions and 2164 deletions

View File

@ -7,14 +7,15 @@
/* Date: 23. Aug. 09 */ /* Date: 23. Aug. 09 */
/**************************************************************************/ /**************************************************************************/
class Tcl_Interp;
struct Tcl_Interp;
namespace netgen namespace netgen
{ {
class NetgenGeometry class NetgenGeometry
{ {
public: public:
virtual ~NetgenGeometry () { ; } virtual ~NetgenGeometry () { ; }
virtual int GenerateMesh (Mesh*& mesh, MeshingParameters & mparam, virtual int GenerateMesh (Mesh*& mesh, MeshingParameters & mparam,
@ -24,24 +25,24 @@ public:
virtual void Save (string filename) const; virtual void Save (string filename) const;
virtual void SaveToMeshFile (ostream & ost) const { ; } virtual void SaveToMeshFile (ostream & ost) const { ; }
}; };
class GeometryRegister class GeometryRegister
{ {
public: public:
virtual ~GeometryRegister(); virtual ~GeometryRegister();
virtual NetgenGeometry * Load (string filename) const = 0; virtual NetgenGeometry * Load (string filename) const = 0;
virtual NetgenGeometry * LoadFromMeshFile (istream & ist) const { return NULL; } virtual NetgenGeometry * LoadFromMeshFile (istream & ist) const { return NULL; }
virtual class VisualScene * GetVisualScene (const NetgenGeometry * geom) const virtual class VisualScene * GetVisualScene (const NetgenGeometry * geom) const
{ return NULL; } { return NULL; }
virtual void SetParameters (Tcl_Interp * interp) { ; } virtual void SetParameters (Tcl_Interp * interp) { ; }
}; };
extern Array<GeometryRegister*> geometryregister; extern Array<GeometryRegister*> geometryregister;
} }

View File

@ -12,23 +12,26 @@
global functions and variables global functions and variables
*/ */
/// namespace netgen
DLL_HEADER extern double GetTime ();
extern void ResetTime ();
///
extern int testmode;
/// calling parameters
// extern Flags parameters;
extern MeshingParameters mparam;
extern Array<int> tets_in_qualclass;
class multithreadt
{ {
public:
///
DLL_HEADER extern double GetTime ();
extern void ResetTime ();
///
extern int testmode;
/// calling parameters
// extern Flags parameters;
extern MeshingParameters mparam;
extern Array<int> tets_in_qualclass;
class multithreadt
{
public:
int pause; int pause;
int testmode; int testmode;
int redraw; int redraw;
@ -39,12 +42,13 @@ public:
const char * task; const char * task;
bool demorunning; bool demorunning;
multithreadt(); multithreadt();
}; };
extern volatile multithreadt multithread; extern volatile multithreadt multithread;
extern string ngdir; extern string ngdir;
extern DebugParameters debugparam; extern DebugParameters debugparam;
extern bool verbose; extern bool verbose;
}
#endif #endif

View File

@ -8,11 +8,13 @@
/**************************************************************************/ /**************************************************************************/
namespace netgen
/// box for grading
class GradingBox
{ {
/// box for grading
class GradingBox
{
/// xmid /// xmid
float xmid[3]; float xmid[3];
/// half edgelength /// half edgelength
@ -24,7 +26,7 @@ class GradingBox
/// ///
double hopt; double hopt;
/// ///
public: public:
struct struct
{ {
@ -48,16 +50,16 @@ public:
static BlockAllocator ball; static BlockAllocator ball;
void * operator new(size_t); void * operator new(size_t);
void operator delete (void *); void operator delete (void *);
}; };
/** /**
Control of 3D mesh grading Control of 3D mesh grading
*/ */
class LocalH class LocalH
{ {
/// ///
GradingBox * root; GradingBox * root;
/// ///
@ -66,7 +68,7 @@ class LocalH
Array<GradingBox*> boxes; Array<GradingBox*> boxes;
/// ///
Box3d boundingbox; Box3d boundingbox;
public: public:
/// ///
LocalH (const Point3d & pmin, const Point3d & pmax, double grading); LocalH (const Point3d & pmin, const Point3d & pmax, double grading);
/// ///
@ -119,7 +121,7 @@ public:
{ return boundingbox; } { return boundingbox; }
/// ///
void PrintMemInfo (ostream & ost) const; void PrintMemInfo (ostream & ost) const;
private: private:
/// ///
double GetMinHRec (const Point3d & pmin, const Point3d & pmax, double GetMinHRec (const Point3d & pmin, const Point3d & pmax,
const GradingBox * box) const; const GradingBox * box) const;
@ -160,24 +162,26 @@ private:
void ConvexifyRec (GradingBox * box); void ConvexifyRec (GradingBox * box);
friend ostream & operator<< (ostream & ost, const LocalH & loch); friend ostream & operator<< (ostream & ost, const LocalH & loch);
}; };
inline ostream & operator<< (ostream & ost, const GradingBox & box) inline ostream & operator<< (ostream & ost, const GradingBox & box)
{ {
ost << "gradbox, pmid = " << box.PMid() << ", h2 = " << box.H2() ost << "gradbox, pmid = " << box.PMid() << ", h2 = " << box.H2()
<< " cutbound = " << box.flags.cutboundary << " isinner = " << box.flags.isinner << " cutbound = " << box.flags.cutboundary << " isinner = " << box.flags.isinner
<< endl; << endl;
return ost; return ost;
} }
inline ostream & operator<< (ostream & ost, const LocalH & loch) inline ostream & operator<< (ostream & ost, const LocalH & loch)
{ {
for (int i = 0; i < loch.boxes.Size(); i++) for (int i = 0; i < loch.boxes.Size(); i++)
ost << "box[" << i << "] = " << *(loch.boxes[i]); ost << "box[" << i << "] = " << *(loch.boxes[i]);
return ost; return ost;
}
} }
#endif #endif

View File

@ -11,18 +11,19 @@
The mesh class The mesh class
*/ */
namespace netgen
{
enum resthtype { RESTRICTH_FACE, RESTRICTH_EDGE,
enum resthtype { RESTRICTH_FACE, RESTRICTH_EDGE,
RESTRICTH_SURFACEELEMENT, RESTRICTH_POINT, RESTRICTH_SEGMENT }; RESTRICTH_SURFACEELEMENT, RESTRICTH_POINT, RESTRICTH_SEGMENT };
class HPRefElement; class HPRefElement;
/// 2d/3d mesh /// 2d/3d mesh
class Mesh class Mesh
{ {
public: public:
typedef ::netgen::T_POINTS T_POINTS; typedef ::netgen::T_POINTS T_POINTS;
// typedef MoveableArray<MeshPoint,PointIndex::BASE> T_POINTS; // typedef MoveableArray<MeshPoint,PointIndex::BASE> T_POINTS;
@ -34,7 +35,7 @@ public:
typedef Array<Element2d> T_SURFELEMENTS; typedef Array<Element2d> T_SURFELEMENTS;
private: private:
/// point coordinates /// point coordinates
T_POINTS points; T_POINTS points;
@ -147,10 +148,10 @@ private:
#endif #endif
private: private:
void BuildBoundaryEdges(void); void BuildBoundaryEdges(void);
public: public:
bool PointContainedIn2DElement(const Point3d & p, bool PointContainedIn2DElement(const Point3d & p,
double lami[3], double lami[3],
const int element, const int element,
@ -162,7 +163,7 @@ public:
double lami[3], double lami[3],
const int element) const; const int element) const;
public: public:
// store coarse mesh before hp-refinement // store coarse mesh before hp-refinement
Array<HPRefElement> * hpelements; Array<HPRefElement> * hpelements;
@ -605,31 +606,31 @@ public:
FaceDescriptor & GetFaceDescriptor (int i) FaceDescriptor & GetFaceDescriptor (int i)
{ return facedecoding.Elem(i); } { return facedecoding.Elem(i); }
// #ifdef NONE // #ifdef NONE
// /* // /*
// Identify points pi1 and pi2, due to // Identify points pi1 and pi2, due to
// identification nr identnr // identification nr identnr
// */ // */
// void AddIdentification (int pi1, int pi2, int identnr); // void AddIdentification (int pi1, int pi2, int identnr);
// int GetIdentification (int pi1, int pi2) const; // int GetIdentification (int pi1, int pi2) const;
// int GetIdentificationSym (int pi1, int pi2) const; // int GetIdentificationSym (int pi1, int pi2) const;
// /// // ///
// INDEX_2_HASHTABLE<int> & GetIdentifiedPoints () // INDEX_2_HASHTABLE<int> & GetIdentifiedPoints ()
// { // {
// return *identifiedpoints; // return *identifiedpoints;
// } // }
// /// // ///
// void GetIdentificationMap (int identnr, Array<int> & identmap) const; // void GetIdentificationMap (int identnr, Array<int> & identmap) const;
// /// // ///
// void GetIdentificationPairs (int identnr, Array<INDEX_2> & identpairs) const; // void GetIdentificationPairs (int identnr, Array<INDEX_2> & identpairs) const;
// /// // ///
// int GetMaxIdentificationNr () const // int GetMaxIdentificationNr () const
// { // {
// return maxidentnr; // return maxidentnr;
// } // }
// #endif // #endif
/// return periodic, close surface etc. identifications /// return periodic, close surface etc. identifications
Identifications & GetIdentifications () { return *ident; } Identifications & GetIdentifications () { return *ident; }
@ -728,10 +729,10 @@ public:
void ReceiveParallelMesh (); void ReceiveParallelMesh ();
/// find connection to parallel meshes /// find connection to parallel meshes
// void FindExchangePoints () ; // void FindExchangePoints () ;
// void FindExchangeEdges (); // void FindExchangeEdges ();
// void FindExchangeFaces (); // void FindExchangeFaces ();
/// use metis to decompose master mesh /// use metis to decompose master mesh
void ParallelMetis (); // Array<int> & neloc ); void ParallelMetis (); // Array<int> & neloc );
@ -747,15 +748,16 @@ public:
#endif #endif
}; };
inline ostream& operator<<(ostream& ost, const Mesh& mesh) inline ostream& operator<<(ostream& ost, const Mesh& mesh)
{ {
ost << "mesh: " << endl; ost << "mesh: " << endl;
mesh.Save(ost); mesh.Save(ost);
return ost; return ost;
} }
}
#endif #endif

View File

@ -12,20 +12,22 @@
namespace netgen namespace netgen
{ {
// extern int printmessage_importance;
extern int printmessage_importance;
class CSGeometry; class CSGeometry;
class NetgenGeometry;
}
#include "msghandler.hpp" #include "msghandler.hpp"
#include "meshtype.hpp" #include "meshtype.hpp"
#include "localh.hpp" #include "localh.hpp"
#include "meshclass.hpp" #include "meshclass.hpp"
#include "global.hpp" #include "global.hpp"
namespace netgen
{
#include "meshtool.hpp" #include "meshtool.hpp"
#include "ruler2.hpp" #include "ruler2.hpp"
#include "adfront2.hpp" #include "adfront2.hpp"
@ -37,17 +39,12 @@ namespace netgen
#include "adfront3.hpp" #include "adfront3.hpp"
#include "ruler3.hpp" #include "ruler3.hpp"
#ifndef SMALLLIB
#define _INCLUDE_MORE #define _INCLUDE_MORE
#endif
#ifdef LINUX
#define _INCLUDE_MORE
#endif
#ifdef _INCLUDE_MORE
#include "meshing3.hpp" #include "meshing3.hpp"
#include "improve3.hpp" #include "improve3.hpp"
#endif
#include "findip.hpp" #include "findip.hpp"
#include "findip2.hpp" #include "findip2.hpp"
@ -55,23 +52,20 @@ namespace netgen
#include "curvedelems.hpp" #include "curvedelems.hpp"
#include "clusters.hpp" #include "clusters.hpp"
#ifdef _INCLUDE_MORE
#include "meshfunc.hpp" #include "meshfunc.hpp"
#endif
#include "bisect.hpp" #include "bisect.hpp"
#include "hprefinement.hpp" #include "hprefinement.hpp"
#include "boundarylayer.hpp" #include "boundarylayer.hpp"
#include "specials.hpp" #include "specials.hpp"
}
#include "validate.hpp" #include "validate.hpp"
#include "basegeom.hpp"
#ifdef PARALLEL #ifdef PARALLEL
#include "paralleltop.hpp" #include "paralleltop.hpp"
// #include "../parallel/parallelmesh.hpp"
#endif #endif
}
#include "basegeom.hpp"
#endif #endif

View File

@ -8,64 +8,68 @@
/* Date: 01. Okt. 95 */ /* Date: 01. Okt. 95 */
/**************************************************************************/ /**************************************************************************/
/* namespace netgen
{
/*
Classes for NETGEN Classes for NETGEN
*/ */
enum ELEMENT_TYPE {
enum ELEMENT_TYPE {
SEGMENT = 1, SEGMENT3 = 2, SEGMENT = 1, SEGMENT3 = 2,
TRIG = 10, QUAD=11, TRIG6 = 12, QUAD6 = 13, QUAD8 = 14, TRIG = 10, QUAD=11, TRIG6 = 12, QUAD6 = 13, QUAD8 = 14,
TET = 20, TET10 = 21, TET = 20, TET10 = 21,
PYRAMID = 22, PRISM = 23, PRISM12 = 24, PYRAMID = 22, PRISM = 23, PRISM12 = 24,
HEX = 25 HEX = 25
}; };
typedef int ELEMENT_EDGE[2]; // initial point, end point typedef int ELEMENT_EDGE[2]; // initial point, end point
typedef int ELEMENT_FACE[4]; // points, last one is -1 for trig typedef int ELEMENT_FACE[4]; // points, last one is -1 for trig
#define ELEMENT_MAXPOINTS 12 #define ELEMENT_MAXPOINTS 12
#define ELEMENT2D_MAXPOINTS 8 #define ELEMENT2D_MAXPOINTS 8
enum POINTTYPE { FIXEDPOINT = 1, EDGEPOINT = 2, SURFACEPOINT = 3, INNERPOINT = 4 }; enum POINTTYPE { FIXEDPOINT = 1, EDGEPOINT = 2, SURFACEPOINT = 3, INNERPOINT = 4 };
enum ELEMENTTYPE { FREEELEMENT, FIXEDELEMENT }; enum ELEMENTTYPE { FREEELEMENT, FIXEDELEMENT };
enum OPTIMIZEGOAL { OPT_QUALITY, OPT_CONFORM, OPT_REST, OPT_WORSTCASE, OPT_LEGAL }; enum OPTIMIZEGOAL { OPT_QUALITY, OPT_CONFORM, OPT_REST, OPT_WORSTCASE, OPT_LEGAL };
extern int GetTimeStamp(); extern int GetTimeStamp();
extern int NextTimeStamp(); extern int NextTimeStamp();
class PointGeomInfo class PointGeomInfo
{ {
public: public:
int trignum; // for STL Meshing int trignum; // for STL Meshing
double u, v; // for OCC Meshing double u, v; // for OCC Meshing
PointGeomInfo () PointGeomInfo ()
: trignum(-1), u(0), v(0) { ; } : trignum(-1), u(0), v(0) { ; }
}; };
inline ostream & operator<< (ostream & ost, const PointGeomInfo & gi) inline ostream & operator<< (ostream & ost, const PointGeomInfo & gi)
{ {
return (ost << gi.trignum << " " << gi.u << " " << gi.v); return (ost << gi.trignum << " " << gi.u << " " << gi.v);
} }
inline istream & operator>> (istream & ist, PointGeomInfo & gi) inline istream & operator>> (istream & ist, PointGeomInfo & gi)
{ {
return (ist >> gi.trignum >> gi.u >> gi.v); return (ist >> gi.trignum >> gi.u >> gi.v);
} }
#define MULTIPOINTGEOMINFO_MAX 100 #define MULTIPOINTGEOMINFO_MAX 100
class MultiPointGeomInfo class MultiPointGeomInfo
{ {
int cnt; int cnt;
PointGeomInfo mgi[MULTIPOINTGEOMINFO_MAX]; PointGeomInfo mgi[MULTIPOINTGEOMINFO_MAX];
public: public:
MultiPointGeomInfo () { cnt = 0; } MultiPointGeomInfo () { cnt = 0; }
int AddPointGeomInfo (const PointGeomInfo & gi); int AddPointGeomInfo (const PointGeomInfo & gi);
void Init () { cnt = 0; } void Init () { cnt = 0; }
@ -73,18 +77,18 @@ public:
int GetNPGI () const { return cnt; } int GetNPGI () const { return cnt; }
const PointGeomInfo & GetPGI (int i) const { return mgi[i-1]; } const PointGeomInfo & GetPGI (int i) const { return mgi[i-1]; }
}; };
class EdgePointGeomInfo class EdgePointGeomInfo
{ {
public: public:
int edgenr; int edgenr;
int body; // for ACIS int body; // for ACIS
double dist; // for 2d meshing double dist; // for 2d meshing
double u, v; // for OCC Meshing double u, v; // for OCC Meshing
public: public:
EdgePointGeomInfo () EdgePointGeomInfo ()
: edgenr(0), body(0), dist(0.0), u(0.0), v(0.0) { ; } : edgenr(0), body(0), dist(0.0), u(0.0), v(0.0) { ; }
@ -97,22 +101,22 @@ public:
u = gi2.u; v = gi2.v; u = gi2.u; v = gi2.v;
return *this; return *this;
} }
}; };
inline ostream & operator<< (ostream & ost, const EdgePointGeomInfo & gi) inline ostream & operator<< (ostream & ost, const EdgePointGeomInfo & gi)
{ {
ost << "epgi: edgnr=" << gi.edgenr << ", dist=" << gi.dist; ost << "epgi: edgnr=" << gi.edgenr << ", dist=" << gi.dist;
return ost; return ost;
} }
class PointIndex class PointIndex
{ {
int i; int i;
public: public:
PointIndex () { ; } PointIndex () { ; }
PointIndex (int ai) : i(ai) { ; } PointIndex (int ai) : i(ai) { ; }
PointIndex & operator= (const PointIndex &ai) { i = ai.i; return *this; } PointIndex & operator= (const PointIndex &ai) { i = ai.i; return *this; }
@ -127,25 +131,25 @@ public:
#else #else
enum { BASE = 1 }; enum { BASE = 1 };
#endif #endif
}; };
inline istream & operator>> (istream & ist, PointIndex & pi) inline istream & operator>> (istream & ist, PointIndex & pi)
{ {
int i; ist >> i; pi = i; return ist; int i; ist >> i; pi = i; return ist;
} }
inline ostream & operator<< (ostream & ost, const PointIndex & pi) inline ostream & operator<< (ostream & ost, const PointIndex & pi)
{ {
return (ost << pi.GetInt()); return (ost << pi.GetInt());
} }
class ElementIndex class ElementIndex
{ {
int i; int i;
public: public:
ElementIndex () { ; } ElementIndex () { ; }
ElementIndex (int ai) : i(ai) { ; } ElementIndex (int ai) : i(ai) { ; }
ElementIndex & operator= (const ElementIndex & ai) { i = ai.i; return *this; } ElementIndex & operator= (const ElementIndex & ai) { i = ai.i; return *this; }
@ -153,23 +157,23 @@ public:
operator int () const { return i; } operator int () const { return i; }
ElementIndex & operator++ (int) { i++; return *this; } ElementIndex & operator++ (int) { i++; return *this; }
ElementIndex & operator-- (int) { i--; return *this; } ElementIndex & operator-- (int) { i--; return *this; }
}; };
inline istream & operator>> (istream & ist, ElementIndex & pi) inline istream & operator>> (istream & ist, ElementIndex & pi)
{ {
int i; ist >> i; pi = i; return ist; int i; ist >> i; pi = i; return ist;
} }
inline ostream & operator<< (ostream & ost, const ElementIndex & pi) inline ostream & operator<< (ostream & ost, const ElementIndex & pi)
{ {
return (ost << int(pi)); return (ost << int(pi));
} }
class SurfaceElementIndex class SurfaceElementIndex
{ {
int i; int i;
public: public:
SurfaceElementIndex () { ; } SurfaceElementIndex () { ; }
SurfaceElementIndex (int ai) : i(ai) { ; } SurfaceElementIndex (int ai) : i(ai) { ; }
SurfaceElementIndex & operator= (const SurfaceElementIndex & ai) SurfaceElementIndex & operator= (const SurfaceElementIndex & ai)
@ -178,22 +182,22 @@ public:
operator int () const { return i; } operator int () const { return i; }
SurfaceElementIndex & operator++ (int) { i++; return *this; } SurfaceElementIndex & operator++ (int) { i++; return *this; }
SurfaceElementIndex & operator-- (int) { i--; return *this; } SurfaceElementIndex & operator-- (int) { i--; return *this; }
}; };
inline istream & operator>> (istream & ist, SurfaceElementIndex & pi) inline istream & operator>> (istream & ist, SurfaceElementIndex & pi)
{ {
int i; ist >> i; pi = i; return ist; int i; ist >> i; pi = i; return ist;
} }
inline ostream & operator<< (ostream & ost, const SurfaceElementIndex & pi) inline ostream & operator<< (ostream & ost, const SurfaceElementIndex & pi)
{ {
return (ost << int(pi)); return (ost << int(pi));
} }
class SegmentIndex class SegmentIndex
{ {
int i; int i;
public: public:
SegmentIndex () { ; } SegmentIndex () { ; }
SegmentIndex (int ai) : i(ai) { ; } SegmentIndex (int ai) : i(ai) { ; }
SegmentIndex & operator= (const SegmentIndex & ai) SegmentIndex & operator= (const SegmentIndex & ai)
@ -202,27 +206,27 @@ public:
operator int () const { return i; } operator int () const { return i; }
SegmentIndex & operator++ (int) { i++; return *this; } SegmentIndex & operator++ (int) { i++; return *this; }
SegmentIndex & operator-- (int) { i--; return *this; } SegmentIndex & operator-- (int) { i--; return *this; }
}; };
inline istream & operator>> (istream & ist, SegmentIndex & pi) inline istream & operator>> (istream & ist, SegmentIndex & pi)
{ {
int i; ist >> i; pi = i; return ist; int i; ist >> i; pi = i; return ist;
} }
inline ostream & operator<< (ostream & ost, const SegmentIndex & pi) inline ostream & operator<< (ostream & ost, const SegmentIndex & pi)
{ {
return (ost << int(pi)); return (ost << int(pi));
} }
/** /**
Point in the mesh. Point in the mesh.
Contains layer (a new feature in 4.3 for overlapping meshes. Contains layer (a new feature in 4.3 for overlapping meshes.
*/ */
class MeshPoint : public Point<3> class MeshPoint : public Point<3>
{ {
int layer; int layer;
double singular; // singular factor for hp-refinement double singular; // singular factor for hp-refinement
POINTTYPE type; POINTTYPE type;
@ -231,14 +235,14 @@ class MeshPoint : public Point<3>
bool isghost; bool isghost;
#endif #endif
public: public:
MeshPoint () MeshPoint ()
{ {
#ifdef PARALLEL #ifdef PARALLEL
isghost = 0; isghost = 0;
#endif #endif
; ;
} }
MeshPoint (const Point<3> & ap, int alayer = 1, POINTTYPE apt = INNERPOINT) MeshPoint (const Point<3> & ap, int alayer = 1, POINTTYPE apt = INNERPOINT)
: Point<3> (ap), layer(alayer), singular(0.),type(apt) : Point<3> (ap), layer(alayer), singular(0.),type(apt)
@ -273,25 +277,25 @@ public:
void SetGhost ( bool aisghost ) { isghost = aisghost; } void SetGhost ( bool aisghost ) { isghost = aisghost; }
#endif #endif
}; };
inline ostream & operator<<(ostream & s, const MeshPoint & pt) inline ostream & operator<<(ostream & s, const MeshPoint & pt)
{ {
return (s << Point<3> (pt)); return (s << Point<3> (pt));
} }
typedef Array<MeshPoint, PointIndex::BASE> T_POINTS; typedef Array<MeshPoint, PointIndex::BASE> T_POINTS;
/** /**
Triangle element for surface mesh generation. Triangle element for surface mesh generation.
*/ */
class Element2d class Element2d
{ {
/// point numbers /// point numbers
PointIndex pnum[ELEMENT2D_MAXPOINTS]; PointIndex pnum[ELEMENT2D_MAXPOINTS];
/// geom info of points /// geom info of points
@ -325,7 +329,7 @@ class Element2d
/// a linked list for all segments in the same face /// a linked list for all segments in the same face
SurfaceElementIndex next; SurfaceElementIndex next;
public: public:
/// ///
Element2d (); Element2d ();
/// ///
@ -509,23 +513,23 @@ public:
#else #else
bool IsGhost () const { return false; } bool IsGhost () const { return false; }
#endif #endif
}; };
ostream & operator<<(ostream & s, const Element2d & el); ostream & operator<<(ostream & s, const Element2d & el);
class IntegrationPointData class IntegrationPointData
{ {
public: public:
Point<3> p; Point<3> p;
double weight; double weight;
Vector shape; Vector shape;
DenseMatrix dshape; DenseMatrix dshape;
}; };
@ -534,12 +538,12 @@ public:
/** /**
Volume element Volume element
*/ */
class Element class Element
{ {
private: private:
/// point numbers /// point numbers
PointIndex pnum[ELEMENT_MAXPOINTS]; PointIndex pnum[ELEMENT_MAXPOINTS];
/// ///
@ -579,7 +583,7 @@ private:
bool isghost; bool isghost;
#endif #endif
public: public:
flagstruct flags; flagstruct flags;
/// ///
@ -782,21 +786,21 @@ public:
#endif #endif
// friend class Mesh; // friend class Mesh;
}; };
ostream & operator<<(ostream & s, const Element & el); ostream & operator<<(ostream & s, const Element & el);
/** /**
Edge segment. Edge segment.
*/ */
class Segment class Segment
{ {
public: public:
/// ///
Segment(); Segment();
Segment (const Segment& other); Segment (const Segment& other);
@ -836,10 +840,10 @@ public:
/// ///
int meshdocval; int meshdocval;
private: private:
string* bcname; string* bcname;
public: public:
/* /*
PointIndex operator[] (int i) const PointIndex operator[] (int i) const
{ return (i == 0) ? p1 : p2; } { return (i == 0) ? p1 : p2; }
@ -885,19 +889,19 @@ public:
PointIndex & operator[] (int i) { return pnums[i]; } PointIndex & operator[] (int i) { return pnums[i]; }
const PointIndex & operator[] (int i) const { return pnums[i]; } const PointIndex & operator[] (int i) const { return pnums[i]; }
}; };
ostream & operator<<(ostream & s, const Segment & seg); ostream & operator<<(ostream & s, const Segment & seg);
// class Surface; // class Surface;
// class FaceDescriptor; // class FaceDescriptor;
/// ///
class FaceDescriptor class FaceDescriptor
{ {
/// which surface, 0 if not available /// which surface, 0 if not available
int surfnr; int surfnr;
/// domain nr inside /// domain nr inside
@ -922,7 +926,7 @@ class FaceDescriptor
double domin_singular; double domin_singular;
double domout_singular; double domout_singular;
public: public:
FaceDescriptor(); FaceDescriptor();
FaceDescriptor(int surfnri, int domini, int domouti, int tlosurfi); FaceDescriptor(int surfnri, int domini, int domouti, int tlosurfi);
FaceDescriptor(const Segment & seg); FaceDescriptor(const Segment & seg);
@ -962,16 +966,16 @@ public:
SurfaceElementIndex FirstElement() { return firstelement; } SurfaceElementIndex FirstElement() { return firstelement; }
// friend ostream & operator<<(ostream & s, const FaceDescriptor & fd); // friend ostream & operator<<(ostream & s, const FaceDescriptor & fd);
friend class Mesh; friend class Mesh;
}; };
ostream & operator<< (ostream & s, const FaceDescriptor & fd); ostream & operator<< (ostream & s, const FaceDescriptor & fd);
class EdgeDescriptor class EdgeDescriptor
{ {
int tlosurf; int tlosurf;
int surfnr[2]; int surfnr[2];
public: public:
EdgeDescriptor () EdgeDescriptor ()
: tlosurf(-1) : tlosurf(-1)
{ surfnr[0] = surfnr[1] = -1; } { surfnr[0] = surfnr[1] = -1; }
@ -981,13 +985,13 @@ public:
int TLOSurface() const { return tlosurf; } int TLOSurface() const { return tlosurf; }
void SetTLOSurface (int nr) { tlosurf = nr; } void SetTLOSurface (int nr) { tlosurf = nr; }
}; };
class MeshingParameters class MeshingParameters
{ {
public: public:
/** /**
3d optimization strategy: 3d optimization strategy:
// m .. move nodes // m .. move nodes
@ -1093,13 +1097,13 @@ public:
void Print (ostream & ost) const; void Print (ostream & ost) const;
void CopyFrom(const MeshingParameters & other); void CopyFrom(const MeshingParameters & other);
}; };
class DebugParameters class DebugParameters
{ {
public: public:
/// ///
int debugoutput; int debugoutput;
/// use slow checks /// use slow checks
@ -1128,24 +1132,24 @@ public:
int haltfacenr; int haltfacenr;
/// ///
DebugParameters (); DebugParameters ();
}; };
inline void Element2d :: Invert() inline void Element2d :: Invert()
{ {
if (typ == TRIG) if (typ == TRIG)
Swap (PNum(2), PNum(3)); Swap (PNum(2), PNum(3));
else else
Invert2(); Invert2();
} }
inline void Element2d :: NormalizeNumbering () inline void Element2d :: NormalizeNumbering ()
{ {
if (GetNP() == 3) if (GetNP() == 3)
{ {
if (PNum(1) < PNum(2) && PNum(1) < PNum(3)) if (PNum(1) < PNum(2) && PNum(1) < PNum(3))
@ -1170,18 +1174,18 @@ inline void Element2d :: NormalizeNumbering ()
} }
else else
NormalizeNumbering2(); NormalizeNumbering2();
} }
static const int gftetfacesa[4][3] = static const int gftetfacesa[4][3] =
{ { 1, 2, 3 }, { { 1, 2, 3 },
{ 2, 0, 3 }, { 2, 0, 3 },
{ 0, 1, 3 }, { 0, 1, 3 },
{ 1, 0, 2 } }; { 1, 0, 2 } };
inline void Element :: GetFace (int i, Element2d & face) const inline void Element :: GetFace (int i, Element2d & face) const
{ {
if (typ == TET) if (typ == TET)
{ {
face.SetType(TRIG); face.SetType(TRIG);
@ -1191,7 +1195,7 @@ inline void Element :: GetFace (int i, Element2d & face) const
} }
else else
GetFace2 (i, face); GetFace2 (i, face);
} }
@ -1199,16 +1203,16 @@ inline void Element :: GetFace (int i, Element2d & face) const
/** /**
Identification of periodic surfaces, close surfaces, etc. Identification of periodic surfaces, close surfaces, etc.
*/ */
class Identifications class Identifications
{ {
public: public:
enum ID_TYPE { UNDEFINED = 1, PERIODIC = 2, CLOSESURFACES = 3, CLOSEEDGES = 4}; enum ID_TYPE { UNDEFINED = 1, PERIODIC = 2, CLOSESURFACES = 3, CLOSEEDGES = 4};
private: private:
class Mesh & mesh; class Mesh & mesh;
/// identify points (thin layers, periodic b.c.) /// identify points (thin layers, periodic b.c.)
@ -1225,7 +1229,7 @@ private:
/// number of identifications (or, actually used identifications ?) /// number of identifications (or, actually used identifications ?)
int maxidentnr; int maxidentnr;
public: public:
/// ///
Identifications (class Mesh & amesh); Identifications (class Mesh & amesh);
/// ///
@ -1290,10 +1294,10 @@ public:
void SetMaxPointNr (int maxpnum); void SetMaxPointNr (int maxpnum);
void Print (ostream & ost) const; void Print (ostream & ost) const;
}; };
}

View File

@ -8,45 +8,49 @@
/**************************************************************************/ /**************************************************************************/
extern void PrintDot(char ch = '.'); namespace netgen
{
extern void PrintDot(char ch = '.');
//Message Pipeline: //Message Pipeline:
//importance: importance of message: 1=very important, 3=middle, 5=low, 7=unimportant //importance: importance of message: 1=very important, 3=middle, 5=low, 7=unimportant
extern void PrintMessage(int importance, extern void PrintMessage(int importance,
const MyStr& s1, const MyStr& s2=MyStr()); const MyStr& s1, const MyStr& s2=MyStr());
extern void PrintMessage(int importance, extern void PrintMessage(int importance,
const MyStr& s1, const MyStr& s2, const MyStr& s3, const MyStr& s4=MyStr()); const MyStr& s1, const MyStr& s2, const MyStr& s3, const MyStr& s4=MyStr());
extern void PrintMessage(int importance, extern void PrintMessage(int importance,
const MyStr& s1, const MyStr& s2, const MyStr& s3, const MyStr& s4, const MyStr& s1, const MyStr& s2, const MyStr& s3, const MyStr& s4,
const MyStr& s5, const MyStr& s6=MyStr(), const MyStr& s7=MyStr(), const MyStr& s8=MyStr()); const MyStr& s5, const MyStr& s6=MyStr(), const MyStr& s7=MyStr(), const MyStr& s8=MyStr());
// CR without line-feed // CR without line-feed
extern void PrintMessageCR(int importance, extern void PrintMessageCR(int importance,
const MyStr& s1, const MyStr& s2="", const MyStr& s3="", const MyStr& s4="", const MyStr& s1, const MyStr& s2="", const MyStr& s3="", const MyStr& s4="",
const MyStr& s5="", const MyStr& s6="", const MyStr& s7="", const MyStr& s8=""); const MyStr& s5="", const MyStr& s6="", const MyStr& s7="", const MyStr& s8="");
extern void PrintFnStart(const MyStr& s1, const MyStr& s2="", const MyStr& s3="", const MyStr& s4="", extern void PrintFnStart(const MyStr& s1, const MyStr& s2="", const MyStr& s3="", const MyStr& s4="",
const MyStr& s5="", const MyStr& s6="", const MyStr& s7="", const MyStr& s8=""); const MyStr& s5="", const MyStr& s6="", const MyStr& s7="", const MyStr& s8="");
extern void PrintWarning(const MyStr& s1, const MyStr& s2="", const MyStr& s3="", const MyStr& s4="", extern void PrintWarning(const MyStr& s1, const MyStr& s2="", const MyStr& s3="", const MyStr& s4="",
const MyStr& s5="", const MyStr& s6="", const MyStr& s7="", const MyStr& s8=""); const MyStr& s5="", const MyStr& s6="", const MyStr& s7="", const MyStr& s8="");
extern void PrintError(const MyStr& s1, const MyStr& s2="", const MyStr& s3="", const MyStr& s4="", extern void PrintError(const MyStr& s1, const MyStr& s2="", const MyStr& s3="", const MyStr& s4="",
const MyStr& s5="", const MyStr& s6="", const MyStr& s7="", const MyStr& s8=""); const MyStr& s5="", const MyStr& s6="", const MyStr& s7="", const MyStr& s8="");
extern void PrintFileError(const MyStr& s1, const MyStr& s2="", const MyStr& s3="", const MyStr& s4="", extern void PrintFileError(const MyStr& s1, const MyStr& s2="", const MyStr& s3="", const MyStr& s4="",
const MyStr& s5="", const MyStr& s6="", const MyStr& s7="", const MyStr& s8=""); const MyStr& s5="", const MyStr& s6="", const MyStr& s7="", const MyStr& s8="");
extern void PrintSysError(const MyStr& s1, const MyStr& s2="", const MyStr& s3="", const MyStr& s4="", extern void PrintSysError(const MyStr& s1, const MyStr& s2="", const MyStr& s3="", const MyStr& s4="",
const MyStr& s5="", const MyStr& s6="", const MyStr& s7="", const MyStr& s8=""); const MyStr& s5="", const MyStr& s6="", const MyStr& s7="", const MyStr& s8="");
extern void PrintUserError(const MyStr& s1, const MyStr& s2="", const MyStr& s3="", const MyStr& s4="", extern void PrintUserError(const MyStr& s1, const MyStr& s2="", const MyStr& s3="", const MyStr& s4="",
const MyStr& s5="", const MyStr& s6="", const MyStr& s7="", const MyStr& s8=""); const MyStr& s5="", const MyStr& s6="", const MyStr& s7="", const MyStr& s8="");
extern void PrintTime(const MyStr& s1="", const MyStr& s2="", const MyStr& s3="", const MyStr& s4="", extern void PrintTime(const MyStr& s1="", const MyStr& s2="", const MyStr& s3="", const MyStr& s4="",
const MyStr& s5="", const MyStr& s6="", const MyStr& s7="", const MyStr& s8=""); const MyStr& s5="", const MyStr& s6="", const MyStr& s7="", const MyStr& s8="");
extern void SetStatMsg(const MyStr& s); extern void SetStatMsg(const MyStr& s);
extern void PushStatus(const MyStr& s); extern void PushStatus(const MyStr& s);
extern void PushStatusF(const MyStr& s); extern void PushStatusF(const MyStr& s);
extern void PopStatus(); extern void PopStatus();
extern void SetThreadPercent(double percent); extern void SetThreadPercent(double percent);
extern void GetStatus(MyStr & s, double & percentage); extern void GetStatus(MyStr & s, double & percentage);
}
#endif #endif

View File

@ -1,12 +1,13 @@
#ifndef FILE_PARALLELTOP #ifndef FILE_PARALLELTOP
#define FILE_PARALLELTOP #define FILE_PARALLELTOP
#include <meshing.hpp> namespace netgen
extern int ntasks;
class ParallelMeshTopology
{ {
extern int ntasks;
class ParallelMeshTopology
{
const Mesh & mesh; const Mesh & mesh;
// number of local elements, vertices, points (?), edges, faces // number of local elements, vertices, points (?), edges, faces
@ -36,7 +37,7 @@ class ParallelMeshTopology
bool coarseupdate; bool coarseupdate;
int overlap; int overlap;
public: public:
ParallelMeshTopology (const Mesh & amesh); ParallelMeshTopology (const Mesh & amesh);
~ParallelMeshTopology (); ~ParallelMeshTopology ();
@ -228,8 +229,8 @@ public:
bool IsGhostEdge ( int ednum ) const { return isghostedge.Test(ednum-1); } bool IsGhostEdge ( int ednum ) const { return isghostedge.Test(ednum-1); }
bool IsGhostVert ( int pnum ) const { return mesh.Point(pnum).IsGhost(); } bool IsGhostVert ( int pnum ) const { return mesh.Point(pnum).IsGhost(); }
// inline void SetGhostVert ( const int pnum ) // inline void SetGhostVert ( const int pnum )
// { isghostvert.Set(pnum-1); } // { isghostvert.Set(pnum-1); }
void SetGhostEdge ( int ednum ) void SetGhostEdge ( int ednum )
{ isghostedge.Set(ednum-1); } { isghostedge.Set(ednum-1); }
@ -258,10 +259,10 @@ public:
int GetNVGlob () { return nvglob; } int GetNVGlob () { return nvglob; }
int GetNEGlob () { return neglob; } int GetNEGlob () { return neglob; }
}; };
}

View File

@ -1,17 +1,21 @@
#ifndef VALIDATE_HPP #ifndef VALIDATE_HPP
#define VALIDATE_HPP #define VALIDATE_HPP
namespace netgen
{
void GetPureBadness(Mesh & mesh, Array<double> & pure_badness,
void GetPureBadness(Mesh & mesh, Array<double> & pure_badness,
const BitArray & isnewpoint); const BitArray & isnewpoint);
double Validate(const Mesh & mesh, Array<ElementIndex> & bad_elements, double Validate(const Mesh & mesh, Array<ElementIndex> & bad_elements,
const Array<double> & pure_badness, const Array<double> & pure_badness,
double max_worsening, const bool uselocalworsening, double max_worsening, const bool uselocalworsening,
Array<double> * quality_loss = NULL); Array<double> * quality_loss = NULL);
void RepairBisection(Mesh & mesh, Array<ElementIndex> & bad_elements, const BitArray & isnewpoint, const Refinement & refinement, void RepairBisection(Mesh & mesh, Array<ElementIndex> & bad_elements,
const BitArray & isnewpoint, const Refinement & refinement,
const Array<double> & pure_badness, const Array<double> & pure_badness,
double max_worsening, const bool uselocalworsening, double max_worsening, const bool uselocalworsening,
const Array< Array<int,PointIndex::BASE>* > & idmaps); const Array< Array<int,PointIndex::BASE>* > & idmaps);
}
#endif // VALIDATE_HPP #endif // VALIDATE_HPP

View File

@ -5,7 +5,7 @@ dist_pkgdata_DATA = boxcyl.geo circle_on_cube.geo cone.geo cube.geo \
cylsphere.geo ellipsoid.geo ellipticcyl.geo extrusion.geo fichera.geo lshape3d.geo \ cylsphere.geo ellipsoid.geo ellipticcyl.geo extrusion.geo fichera.geo lshape3d.geo \
manyholes.geo manyholes2.geo matrix.geo ortho.geo period.geo revolution.geo \ manyholes.geo manyholes2.geo matrix.geo ortho.geo period.geo revolution.geo \
sculpture.geo shaft.geo shell.geo sphere.geo sphereincube.geo torus.geo trafo.geo \ sculpture.geo shaft.geo shell.geo sphere.geo sphereincube.geo torus.geo trafo.geo \
twobricks.geo twocubes.geo twocyl.geo \ twobricks.geo twocubes.geo twocyl.geo boundarycondition.geo \
hinge.stl part1.stl frame.step screw.step \ hinge.stl part1.stl frame.step screw.step \
squarehole.in2d squarecircle.in2d square.in2d squarehole.in2d squarecircle.in2d square.in2d

View File

@ -0,0 +1,16 @@
algebraic3d
solid p1 = plane (0.5, 0, 0; 1, 0, 0);
# since surfaces of both bricks are identic they get the same bc id:
solid brick1 = orthobrick (0,0,0; 1,1,1) and p1 -bc=1;
solid brick2 = orthobrick (0,0,-1; 1,1,0) and p1 -bc=2;
tlo brick1;
tlo brick2;
# override bc number:
# all faces of solid p1 belonging to the boundary of tlo brick1 get bc=3
boundarycondition p1 brick1 3;