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

View File

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

View File

@ -8,176 +8,180 @@
/**************************************************************************/
/// box for grading
class GradingBox
namespace netgen
{
/// xmid
float xmid[3];
/// half edgelength
float h2;
///
GradingBox * childs[8];
///
GradingBox * father;
///
double hopt;
///
public:
struct
/// box for grading
class GradingBox
{
unsigned int cutboundary:1;
unsigned int isinner:1;
unsigned int oldcell:1;
unsigned int pinner:1;
} flags;
/// xmid
float xmid[3];
/// half edgelength
float h2;
///
GradingBox * childs[8];
///
GradingBox * father;
///
double hopt;
///
public:
///
GradingBox (const double * ax1, const double * ax2);
///
void DeleteChilds();
///
struct
{
unsigned int cutboundary:1;
unsigned int isinner:1;
unsigned int oldcell:1;
unsigned int pinner:1;
} flags;
Point<3> PMid() const { return Point<3> (xmid[0], xmid[1], xmid[2]); }
double H2() const { return h2; }
///
GradingBox (const double * ax1, const double * ax2);
///
void DeleteChilds();
///
friend class LocalH;
Point<3> PMid() const { return Point<3> (xmid[0], xmid[1], xmid[2]); }
double H2() const { return h2; }
static BlockAllocator ball;
void * operator new(size_t);
void operator delete (void *);
};
friend class LocalH;
static BlockAllocator ball;
void * operator new(size_t);
void operator delete (void *);
};
/**
Control of 3D mesh grading
*/
class LocalH
{
///
GradingBox * root;
///
double grading;
///
Array<GradingBox*> boxes;
///
Box3d boundingbox;
public:
///
LocalH (const Point3d & pmin, const Point3d & pmax, double grading);
///
LocalH (const Box<3> & box, double grading);
///
~LocalH();
///
void Delete();
///
void SetGrading (double agrading) { grading = agrading; }
///
void SetH (const Point3d & x, double h);
///
double GetH (const Point3d & x) const;
/// minimal h in box (pmin, pmax)
double GetMinH (const Point3d & pmin, const Point3d & pmax) const;
/**
Control of 3D mesh grading
*/
class LocalH
{
///
GradingBox * root;
///
double grading;
///
Array<GradingBox*> boxes;
///
Box3d boundingbox;
public:
///
LocalH (const Point3d & pmin, const Point3d & pmax, double grading);
///
LocalH (const Box<3> & box, double grading);
///
~LocalH();
///
void Delete();
///
void SetGrading (double agrading) { grading = agrading; }
///
void SetH (const Point3d & x, double h);
///
double GetH (const Point3d & x) const;
/// minimal h in box (pmin, pmax)
double GetMinH (const Point3d & pmin, const Point3d & pmax) const;
/// mark boxes intersecting with boundary-box
// void CutBoundary (const Point3d & pmin, const Point3d & pmax)
// { CutBoundaryRec (pmin, pmax, root); }
void CutBoundary (const Box<3> & box)
{ CutBoundaryRec (box.PMin(), box.PMax(), root); }
/// mark boxes intersecting with boundary-box
// void CutBoundary (const Point3d & pmin, const Point3d & pmax)
// { CutBoundaryRec (pmin, pmax, root); }
void CutBoundary (const Box<3> & box)
{ CutBoundaryRec (box.PMin(), box.PMax(), root); }
/// find inner boxes
void FindInnerBoxes (class AdFront3 * adfront,
int (*testinner)(const Point3d & p1));
/// find inner boxes
void FindInnerBoxes (class AdFront3 * adfront,
int (*testinner)(const Point3d & p1));
void FindInnerBoxes (class AdFront2 * adfront,
int (*testinner)(const Point<2> & p1));
void FindInnerBoxes (class AdFront2 * adfront,
int (*testinner)(const Point<2> & p1));
/// clears all flags
void ClearFlags ()
/// clears all flags
void ClearFlags ()
{ ClearFlagsRec(root); }
/// widen refinement zone
void WidenRefinement ();
/// widen refinement zone
void WidenRefinement ();
/// get points in inner elements
void GetInnerPoints (Array<Point<3> > & points);
/// get points in inner elements
void GetInnerPoints (Array<Point<3> > & points);
/// get points in outer closure
void GetOuterPoints (Array<Point<3> > & points);
/// get points in outer closure
void GetOuterPoints (Array<Point<3> > & points);
///
void Convexify ();
///
int GetNBoxes () { return boxes.Size(); }
const Box3d & GetBoundingBox () const
{ return boundingbox; }
///
void PrintMemInfo (ostream & ost) const;
private:
///
double GetMinHRec (const Point3d & pmin, const Point3d & pmax,
const GradingBox * box) const;
///
void CutBoundaryRec (const Point3d & pmin, const Point3d & pmax,
GradingBox * box);
///
void Convexify ();
///
int GetNBoxes () { return boxes.Size(); }
const Box3d & GetBoundingBox () const
{ return boundingbox; }
///
void PrintMemInfo (ostream & ost) const;
private:
///
double GetMinHRec (const Point3d & pmin, const Point3d & pmax,
const GradingBox * box) const;
///
void CutBoundaryRec (const Point3d & pmin, const Point3d & pmax,
GradingBox * box);
///
void FindInnerBoxesRec ( int (*inner)(const Point3d & p),
GradingBox * box);
///
void FindInnerBoxesRec ( int (*inner)(const Point3d & p),
GradingBox * box);
///
void FindInnerBoxesRec2 (GradingBox * box,
class AdFront3 * adfront,
Array<Box3d> & faceboxes,
Array<int> & finds, int nfinbox);
///
void FindInnerBoxesRec2 (GradingBox * box,
class AdFront3 * adfront,
Array<Box3d> & faceboxes,
Array<int> & finds, int nfinbox);
void FindInnerBoxesRec ( int (*inner)(const Point<2> & p),
GradingBox * box);
void FindInnerBoxesRec ( int (*inner)(const Point<2> & p),
GradingBox * box);
///
void FindInnerBoxesRec2 (GradingBox * box,
class AdFront2 * adfront,
Array<Box<3> > & faceboxes,
Array<int> & finds, int nfinbox);
///
void FindInnerBoxesRec2 (GradingBox * box,
class AdFront2 * adfront,
Array<Box<3> > & faceboxes,
Array<int> & finds, int nfinbox);
///
void SetInnerBoxesRec (GradingBox * box);
///
void SetInnerBoxesRec (GradingBox * box);
///
void ClearFlagsRec (GradingBox * box);
///
void ClearFlagsRec (GradingBox * box);
///
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)
{
ost << "gradbox, pmid = " << box.PMid() << ", h2 = " << box.H2()
<< " cutbound = " << box.flags.cutboundary << " isinner = " << box.flags.isinner
<< endl;
return ost;
}
inline ostream & operator<< (ostream & ost, const GradingBox & box)
{
ost << "gradbox, pmid = " << box.PMid() << ", h2 = " << box.H2()
<< " cutbound = " << box.flags.cutboundary << " isinner = " << box.flags.isinner
<< endl;
return ost;
}
inline ostream & operator<< (ostream & ost, const LocalH & loch)
{
for (int i = 0; i < loch.boxes.Size(); i++)
ost << "box[" << i << "] = " << *(loch.boxes[i]);
return ost;
}
inline ostream & operator<< (ostream & ost, const LocalH & loch)
{
for (int i = 0; i < loch.boxes.Size(); i++)
ost << "box[" << i << "] = " << *(loch.boxes[i]);
return ost;
}
#endif

File diff suppressed because it is too large Load Diff

View File

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

File diff suppressed because it is too large Load Diff

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
extern void PrintMessage(int importance,
const MyStr& s1, const MyStr& s2=MyStr());
extern void PrintMessage(int importance,
const MyStr& s1, const MyStr& s2, const MyStr& s3, const MyStr& s4=MyStr());
extern void PrintMessage(int importance,
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());
//importance: importance of message: 1=very important, 3=middle, 5=low, 7=unimportant
extern void PrintMessage(int importance,
const MyStr& s1, const MyStr& s2=MyStr());
extern void PrintMessage(int importance,
const MyStr& s1, const MyStr& s2, const MyStr& s3, const MyStr& s4=MyStr());
extern void PrintMessage(int importance,
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());
// CR without line-feed
extern void PrintMessageCR(int importance,
const MyStr& s1, const MyStr& s2="", const MyStr& s3="", const MyStr& s4="",
// CR without line-feed
extern void PrintMessageCR(int importance,
const MyStr& s1, const MyStr& s2="", const MyStr& s3="", const MyStr& s4="",
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="",
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 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="");
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="");
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="");
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="");
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="");
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="");
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="");
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="");
extern void SetStatMsg(const MyStr& s);
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="");
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="");
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="");
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="");
extern void SetStatMsg(const MyStr& s);
extern void PushStatus(const MyStr& s);
extern void PushStatusF(const MyStr& s);
extern void PopStatus();
extern void SetThreadPercent(double percent);
extern void GetStatus(MyStr & s, double & percentage);
extern void PushStatus(const MyStr& s);
extern void PushStatusF(const MyStr& s);
extern void PopStatus();
extern void SetThreadPercent(double percent);
extern void GetStatus(MyStr & s, double & percentage);
}
#endif

View File

@ -1,267 +1,268 @@
#ifndef FILE_PARALLELTOP
#define FILE_PARALLELTOP
#include <meshing.hpp>
extern int ntasks;
class ParallelMeshTopology
namespace netgen
{
const Mesh & mesh;
// number of local elements, vertices, points (?), edges, faces
int ne, nv, np, ned, nfa;
extern int ntasks;
// number of local segments and surface elements
int nseg, nsurfel;
// number of global elements, vertices, ???, faces
int neglob, nvglob;
int nparel;
int nfaglob;
/**
mapping from local to distant vertex number
each row of the table corresponds to one vertex
each row contains a list of pairs (procnr, dist_vnum)
*/
TABLE<int,PointIndex::BASE> loc2distvert;
TABLE<int,0> loc2distedge, loc2distface, loc2distel;
TABLE<int,0> loc2distsegm, loc2distsurfel;
BitArray * isexchangeface, * isexchangevert, * isexchangeedge, * isexchangeel;
BitArray isghostedge, isghostface;
bool coarseupdate;
int overlap;
public:
ParallelMeshTopology (const Mesh & amesh);
~ParallelMeshTopology ();
/// set number of local vertices, reset sizes of loc2dist_vert, isexchangevert...
void SetNV ( int anv );
void SetNE ( int ane );
void SetNSE ( int anse );
void SetNSegm ( int anseg );
void Reset ();
void SetLoc2Glob_Vert ( int locnum, int globnum ) { loc2distvert[locnum][0] = globnum; }
void SetLoc2Glob_VolEl ( int locnum, int globnum ) { loc2distel[locnum-1][0] = globnum; }
void SetLoc2Glob_SurfEl ( int locnum, int globnum ) { loc2distsurfel[locnum-1][0] = globnum; }
void SetLoc2Glob_Segm ( int locnum, int globnum ) { loc2distsegm[locnum-1][0] = globnum; }
int GetLoc2Glob_Vert ( int locnum ) const { return loc2distvert[locnum][0]; }
int GetLoc2Glob_VolEl ( int locnum ) const { return loc2distel[locnum-1][0]; }
void GetVertNeighbours ( int vnum, Array<int> & dests ) const;
int Glob2Loc_SurfEl ( int globnum );
int Glob2Loc_VolEl ( int globnum );
int Glob2Loc_Segm ( int globnum );
int Glob2Loc_Vert ( int globnum );
int GetNDistantPNums ( int locpnum ) const { return loc2distvert[locpnum].Size() / 2 + 1; }
int GetNDistantFaceNums ( int locfacenum ) const { return loc2distface[locfacenum-1].Size() / 2 + 1; }
int GetNDistantEdgeNums ( int locedgenum ) const { return loc2distedge[locedgenum-1].Size() / 2 + 1; }
int GetNDistantElNums ( int locelnum ) const { return loc2distel[locelnum-1].Size() / 2 + 1; }
int GetDistantPNum ( int proc, int locpnum ) const;
int GetDistantEdgeNum ( int proc, int locedgenum ) const;
int GetDistantFaceNum ( int proc, int locedgenum ) const;
int GetDistantElNum ( int proc, int locelnum ) const;
int GetDistantPNums ( int locpnum, int * distpnums ) const;
int GetDistantEdgeNums ( int locedgenum, int * distedgenums ) const;
int GetDistantFaceNums ( int locedgenum, int * distfacenums ) const;
int GetDistantElNums ( int locelnum, int * distfacenums ) const;
void Print() const;
void SetExchangeFace ( int fnr ) { isexchangeface->Set( (fnr-1)*(ntasks+1) ); }
void SetExchangeVert ( int vnum ) { isexchangevert->Set( (vnum-1)*(ntasks+1) ); }
void SetExchangeElement ( int elnum ) { isexchangeel->Set((elnum-1)*(ntasks+1) ); }
void SetExchangeEdge ( int ednum ) { isexchangeedge->Set ((ednum-1)*(ntasks+1)); }
// fuer diese Fkts kann man ja O(N) - bitarrays lassen
bool IsExchangeVert ( PointIndex vnum ) const
class ParallelMeshTopology
{
return loc2distvert[vnum].Size() > 1;
// return isexchangevert->Test((vnum-1)*(ntasks+1));
}
const Mesh & mesh;
bool IsExchangeEdge ( int ednum ) const
{
/*
if ( isexchangeedge->Test( (ednum-1)*(ntasks+1) ) !=
( loc2distedge[ednum-1].Size() > 1) )
{
// number of local elements, vertices, points (?), edges, faces
int ne, nv, np, ned, nfa;
// number of local segments and surface elements
int nseg, nsurfel;
// number of global elements, vertices, ???, faces
int neglob, nvglob;
int nparel;
int nfaglob;
/**
mapping from local to distant vertex number
each row of the table corresponds to one vertex
each row contains a list of pairs (procnr, dist_vnum)
*/
TABLE<int,PointIndex::BASE> loc2distvert;
TABLE<int,0> loc2distedge, loc2distface, loc2distel;
TABLE<int,0> loc2distsegm, loc2distsurfel;
BitArray * isexchangeface, * isexchangevert, * isexchangeedge, * isexchangeel;
BitArray isghostedge, isghostface;
bool coarseupdate;
int overlap;
public:
ParallelMeshTopology (const Mesh & amesh);
~ParallelMeshTopology ();
/// set number of local vertices, reset sizes of loc2dist_vert, isexchangevert...
void SetNV ( int anv );
void SetNE ( int ane );
void SetNSE ( int anse );
void SetNSegm ( int anseg );
void Reset ();
void SetLoc2Glob_Vert ( int locnum, int globnum ) { loc2distvert[locnum][0] = globnum; }
void SetLoc2Glob_VolEl ( int locnum, int globnum ) { loc2distel[locnum-1][0] = globnum; }
void SetLoc2Glob_SurfEl ( int locnum, int globnum ) { loc2distsurfel[locnum-1][0] = globnum; }
void SetLoc2Glob_Segm ( int locnum, int globnum ) { loc2distsegm[locnum-1][0] = globnum; }
int GetLoc2Glob_Vert ( int locnum ) const { return loc2distvert[locnum][0]; }
int GetLoc2Glob_VolEl ( int locnum ) const { return loc2distel[locnum-1][0]; }
void GetVertNeighbours ( int vnum, Array<int> & dests ) const;
int Glob2Loc_SurfEl ( int globnum );
int Glob2Loc_VolEl ( int globnum );
int Glob2Loc_Segm ( int globnum );
int Glob2Loc_Vert ( int globnum );
int GetNDistantPNums ( int locpnum ) const { return loc2distvert[locpnum].Size() / 2 + 1; }
int GetNDistantFaceNums ( int locfacenum ) const { return loc2distface[locfacenum-1].Size() / 2 + 1; }
int GetNDistantEdgeNums ( int locedgenum ) const { return loc2distedge[locedgenum-1].Size() / 2 + 1; }
int GetNDistantElNums ( int locelnum ) const { return loc2distel[locelnum-1].Size() / 2 + 1; }
int GetDistantPNum ( int proc, int locpnum ) const;
int GetDistantEdgeNum ( int proc, int locedgenum ) const;
int GetDistantFaceNum ( int proc, int locedgenum ) const;
int GetDistantElNum ( int proc, int locelnum ) const;
int GetDistantPNums ( int locpnum, int * distpnums ) const;
int GetDistantEdgeNums ( int locedgenum, int * distedgenums ) const;
int GetDistantFaceNums ( int locedgenum, int * distfacenums ) const;
int GetDistantElNums ( int locelnum, int * distfacenums ) const;
void Print() const;
void SetExchangeFace ( int fnr ) { isexchangeface->Set( (fnr-1)*(ntasks+1) ); }
void SetExchangeVert ( int vnum ) { isexchangevert->Set( (vnum-1)*(ntasks+1) ); }
void SetExchangeElement ( int elnum ) { isexchangeel->Set((elnum-1)*(ntasks+1) ); }
void SetExchangeEdge ( int ednum ) { isexchangeedge->Set ((ednum-1)*(ntasks+1)); }
// fuer diese Fkts kann man ja O(N) - bitarrays lassen
bool IsExchangeVert ( PointIndex vnum ) const
{
return loc2distvert[vnum].Size() > 1;
// return isexchangevert->Test((vnum-1)*(ntasks+1));
}
bool IsExchangeEdge ( int ednum ) const
{
/*
if ( isexchangeedge->Test( (ednum-1)*(ntasks+1) ) !=
( loc2distedge[ednum-1].Size() > 1) )
{
cerr << "isexedge differs, id = " << id << ", ednum = " << ednum << endl;
}
*/
// return loc2distedge[ednum-1].Size() > 1;
int i = (ednum-1)*(ntasks+1);
return isexchangeedge->Test(i);
}
}
*/
// return loc2distedge[ednum-1].Size() > 1;
int i = (ednum-1)*(ntasks+1);
return isexchangeedge->Test(i);
}
bool IsExchangeFace ( int fnum ) const
{
/*
if ( isexchangeface->Test( (fnum-1)*(ntasks+1) ) !=
( loc2distface[fnum-1].Size() > 1) )
{
bool IsExchangeFace ( int fnum ) const
{
/*
if ( isexchangeface->Test( (fnum-1)*(ntasks+1) ) !=
( loc2distface[fnum-1].Size() > 1) )
{
cerr << "it differs, id = " << id << ", fnum = " << fnum << endl;
}
*/
// nur hier funktioniert's so nicht ???? (JS)
// return loc2distface[fnum-1].Size() > 1;
return isexchangeface->Test( (fnum-1)*(ntasks+1) );
}
}
*/
// nur hier funktioniert's so nicht ???? (JS)
// return loc2distface[fnum-1].Size() > 1;
return isexchangeface->Test( (fnum-1)*(ntasks+1) );
}
bool IsExchangeElement ( int elnum ) const
{
// return loc2distel[elnum-1].Size() > 1;
return isexchangeel->Test((elnum-1)*(ntasks+1));
}
bool IsExchangeElement ( int elnum ) const
{
// return loc2distel[elnum-1].Size() > 1;
return isexchangeel->Test((elnum-1)*(ntasks+1));
}
bool IsExchangeSEl ( int selnum ) const
{
return loc2distsurfel[selnum-1].Size() > 1;
}
bool IsExchangeSEl ( int selnum ) const
{
return loc2distsurfel[selnum-1].Size() > 1;
}
void SetExchangeFace (int dest, int fnr )
{
// isexchangeface->Set((fnr-1)*(ntasks+1) + (dest+1));
}
void SetExchangeFace (int dest, int fnr )
{
// isexchangeface->Set((fnr-1)*(ntasks+1) + (dest+1));
}
void SetExchangeVert (int dest, int vnum )
{
// isexchangevert->Set((vnum-1)*(ntasks+1) + (dest+1) );
}
void SetExchangeVert (int dest, int vnum )
{
// isexchangevert->Set((vnum-1)*(ntasks+1) + (dest+1) );
}
void SetExchangeElement (int dest, int vnum )
{
isexchangeel->Set( (vnum-1)*(ntasks+1) + (dest+1) );
}
void SetExchangeElement (int dest, int vnum )
{
isexchangeel->Set( (vnum-1)*(ntasks+1) + (dest+1) );
}
void SetExchangeEdge (int dest, int ednum )
{
// isexchangeedge->Set ( (ednum-1)*(ntasks+1) + (dest+1) );
}
void SetExchangeEdge (int dest, int ednum )
{
// isexchangeedge->Set ( (ednum-1)*(ntasks+1) + (dest+1) );
}
bool IsExchangeVert (int dest, int vnum ) const
{
FlatArray<int> exchange = loc2distvert[vnum];
for (int i = 1; i < exchange.Size(); i += 2)
if (exchange[i] == dest) return true;
return false;
// return isexchangevert->Test((vnum-1)*(ntasks+1) + (dest+1) );
}
bool IsExchangeVert (int dest, int vnum ) const
{
FlatArray<int> exchange = loc2distvert[vnum];
for (int i = 1; i < exchange.Size(); i += 2)
if (exchange[i] == dest) return true;
return false;
// return isexchangevert->Test((vnum-1)*(ntasks+1) + (dest+1) );
}
bool IsExchangeEdge (int dest, int ednum ) const
{
FlatArray<int> exchange = loc2distedge[ednum-1];
for (int i = 1; i < exchange.Size(); i += 2)
if (exchange[i] == dest) return true;
return false;
bool IsExchangeEdge (int dest, int ednum ) const
{
FlatArray<int> exchange = loc2distedge[ednum-1];
for (int i = 1; i < exchange.Size(); i += 2)
if (exchange[i] == dest) return true;
return false;
// return isexchangeedge->Test((ednum-1)*(ntasks+1) + (dest+1));
}
// return isexchangeedge->Test((ednum-1)*(ntasks+1) + (dest+1));
}
bool IsExchangeFace (int dest, int fnum ) const
{
FlatArray<int> exchange = loc2distface[fnum-1];
for (int i = 1; i < exchange.Size(); i += 2)
if (exchange[i] == dest) return true;
return false;
bool IsExchangeFace (int dest, int fnum ) const
{
FlatArray<int> exchange = loc2distface[fnum-1];
for (int i = 1; i < exchange.Size(); i += 2)
if (exchange[i] == dest) return true;
return false;
// return isexchangeface->Test((fnum-1)*(ntasks+1) + (dest+1) );
}
// return isexchangeface->Test((fnum-1)*(ntasks+1) + (dest+1) );
}
bool IsExchangeElement (int dest, int elnum ) const
{
// das geht auch nicht
/*
FlatArray<int> exchange = loc2distel[elnum-1];
for (int i = 1; i < exchange.Size(); i += 2)
if (exchange[i] == dest) return true;
return false;
*/
return isexchangeel->Test((elnum-1)*(ntasks+1) + (dest+1));
}
bool IsExchangeElement (int dest, int elnum ) const
{
// das geht auch nicht
/*
FlatArray<int> exchange = loc2distel[elnum-1];
for (int i = 1; i < exchange.Size(); i += 2)
if (exchange[i] == dest) return true;
return false;
*/
return isexchangeel->Test((elnum-1)*(ntasks+1) + (dest+1));
}
int Overlap() const
{ return overlap; }
int Overlap() const
{ return overlap; }
int IncreaseOverlap ()
{ overlap++; return overlap; }
int IncreaseOverlap ()
{ overlap++; return overlap; }
void Update();
void Update();
void UpdateCoarseGrid();
void UpdateCoarseGridOverlap();
void UpdateRefinement ();
void UpdateTopology ();
void UpdateExchangeElements();
void UpdateCoarseGrid();
void UpdateCoarseGridOverlap();
void UpdateRefinement ();
void UpdateTopology ();
void UpdateExchangeElements();
void UpdateCoarseGridGlobal();
void UpdateCoarseGridGlobal();
bool DoCoarseUpdate() const
{ return !coarseupdate; }
bool DoCoarseUpdate() const
{ return !coarseupdate; }
void SetDistantFaceNum ( int dest, int locnum, int distnum );
void SetDistantPNum ( int dest, int locnum, int distnum );
void SetDistantEdgeNum ( int dest, int locnum, int distnum );
void SetDistantEl ( int dest, int locnum, int distnum );
void SetDistantSurfEl ( int dest, int locnum, int distnum );
void SetDistantSegm ( int dest, int locnum, int distnum );
void SetDistantFaceNum ( int dest, int locnum, int distnum );
void SetDistantPNum ( int dest, int locnum, int distnum );
void SetDistantEdgeNum ( int dest, int locnum, int distnum );
void SetDistantEl ( int dest, int locnum, int distnum );
void SetDistantSurfEl ( int dest, int locnum, int distnum );
void SetDistantSegm ( int dest, int locnum, int distnum );
bool IsGhostEl ( int elnum ) const { return mesh.VolumeElement(elnum).IsGhost(); }
bool IsGhostFace ( int fanum ) const { return isghostface.Test(fanum-1); }
bool IsGhostEdge ( int ednum ) const { return isghostedge.Test(ednum-1); }
bool IsGhostVert ( int pnum ) const { return mesh.Point(pnum).IsGhost(); }
bool IsGhostEl ( int elnum ) const { return mesh.VolumeElement(elnum).IsGhost(); }
bool IsGhostFace ( int fanum ) const { return isghostface.Test(fanum-1); }
bool IsGhostEdge ( int ednum ) const { return isghostedge.Test(ednum-1); }
bool IsGhostVert ( int pnum ) const { return mesh.Point(pnum).IsGhost(); }
// inline void SetGhostVert ( const int pnum )
// { isghostvert.Set(pnum-1); }
// inline void SetGhostVert ( const int pnum )
// { isghostvert.Set(pnum-1); }
void SetGhostEdge ( int ednum )
{ isghostedge.Set(ednum-1); }
void SetGhostEdge ( int ednum )
{ isghostedge.Set(ednum-1); }
void ClearGhostEdge ( int ednum )
{ isghostedge.Clear(ednum-1); }
void ClearGhostEdge ( int ednum )
{ isghostedge.Clear(ednum-1); }
void SetGhostFace ( int fanum )
{ isghostface.Set(fanum-1); }
void SetGhostFace ( int fanum )
{ isghostface.Set(fanum-1); }
void ClearGhostFace ( int fanum )
{ isghostface.Clear(fanum-1); }
void ClearGhostFace ( int fanum )
{ isghostface.Clear(fanum-1); }
bool IsElementInPartition ( int elnum, int dest ) const
{
return IsExchangeElement ( dest, elnum);
}
bool IsElementInPartition ( int elnum, int dest ) const
{
return IsExchangeElement ( dest, elnum);
}
void SetElementInPartition ( int elnum, int dest )
{
SetExchangeElement ( dest, elnum );
}
void SetElementInPartition ( int elnum, int dest )
{
SetExchangeElement ( dest, elnum );
}
void SetNVGlob ( int anvglob ) { nvglob = anvglob; }
void SetNEGlob ( int aneglob ) { neglob = aneglob; }
void SetNVGlob ( int anvglob ) { nvglob = anvglob; }
void SetNEGlob ( int aneglob ) { neglob = aneglob; }
int GetNVGlob () { return nvglob; }
int GetNEGlob () { return neglob; }
};
int GetNVGlob () { return nvglob; }
int GetNEGlob () { return neglob; }
};
}

View File

@ -1,17 +1,21 @@
#ifndef VALIDATE_HPP
#define VALIDATE_HPP
namespace netgen
{
void GetPureBadness(Mesh & mesh, Array<double> & pure_badness,
const BitArray & isnewpoint);
double Validate(const Mesh & mesh, Array<ElementIndex> & bad_elements,
const Array<double> & pure_badness,
double max_worsening, const bool uselocalworsening,
Array<double> * quality_loss = NULL);
void RepairBisection(Mesh & mesh, Array<ElementIndex> & bad_elements,
const BitArray & isnewpoint, const Refinement & refinement,
const Array<double> & pure_badness,
double max_worsening, const bool uselocalworsening,
const Array< Array<int,PointIndex::BASE>* > & idmaps);
void GetPureBadness(Mesh & mesh, Array<double> & pure_badness,
const BitArray & isnewpoint);
double Validate(const Mesh & mesh, Array<ElementIndex> & bad_elements,
const Array<double> & pure_badness,
double max_worsening, const bool uselocalworsening,
Array<double> * quality_loss = NULL);
void RepairBisection(Mesh & mesh, Array<ElementIndex> & bad_elements, const BitArray & isnewpoint, const Refinement & refinement,
const Array<double> & pure_badness,
double max_worsening, const bool uselocalworsening,
const Array< Array<int,PointIndex::BASE>* > & idmaps);
}
#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 \
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 \
twobricks.geo twocubes.geo twocyl.geo \
twobricks.geo twocubes.geo twocyl.geo boundarycondition.geo \
hinge.stl part1.stl frame.step screw.step \
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;