mirror of
https://github.com/NGSolve/netgen.git
synced 2025-04-13 08:37:28 +05:00
* Converted the minimum edge length used for subdividing geometry edges during the meshing phase into a user defined parameter accessible from the GUI
This commit is contained in:
parent
d5ae11a9b1
commit
c7ba1a6dc8
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,451 +1,457 @@
|
|||||||
#ifndef FILE_OCCGEOM
|
#ifndef FILE_OCCGEOM
|
||||||
#define FILE_OCCGEOM
|
#define FILE_OCCGEOM
|
||||||
|
|
||||||
/* *************************************************************************/
|
/* *************************************************************************/
|
||||||
/* File: occgeom.hpp */
|
/* File: occgeom.hpp */
|
||||||
/* Author: Robert Gaisbauer */
|
/* Author: Robert Gaisbauer */
|
||||||
/* Date: 26. May 03 */
|
/* Date: 26. May 03 */
|
||||||
/* *************************************************************************/
|
/* *************************************************************************/
|
||||||
|
|
||||||
#ifdef OCCGEOMETRY
|
#ifdef OCCGEOMETRY
|
||||||
|
|
||||||
#include <meshing.hpp>
|
#include <meshing.hpp>
|
||||||
|
|
||||||
#include "BRep_Tool.hxx"
|
#include "BRep_Tool.hxx"
|
||||||
#include "Geom_Curve.hxx"
|
#include "Geom_Curve.hxx"
|
||||||
#include "Geom2d_Curve.hxx"
|
#include "Geom2d_Curve.hxx"
|
||||||
#include "Geom_Surface.hxx"
|
#include "Geom_Surface.hxx"
|
||||||
#include "GeomAPI_ProjectPointOnSurf.hxx"
|
#include "GeomAPI_ProjectPointOnSurf.hxx"
|
||||||
#include "GeomAPI_ProjectPointOnCurve.hxx"
|
#include "GeomAPI_ProjectPointOnCurve.hxx"
|
||||||
#include "BRepTools.hxx"
|
#include "BRepTools.hxx"
|
||||||
#include "TopExp.hxx"
|
#include "TopExp.hxx"
|
||||||
#include "BRepBuilderAPI_MakeVertex.hxx"
|
#include "BRepBuilderAPI_MakeVertex.hxx"
|
||||||
#include "BRepBuilderAPI_MakeShell.hxx"
|
#include "BRepBuilderAPI_MakeShell.hxx"
|
||||||
#include "BRepBuilderAPI_MakeSolid.hxx"
|
#include "BRepBuilderAPI_MakeSolid.hxx"
|
||||||
#include "BRepOffsetAPI_Sewing.hxx"
|
#include "BRepOffsetAPI_Sewing.hxx"
|
||||||
#include "BRepLProp_SLProps.hxx"
|
#include "BRepLProp_SLProps.hxx"
|
||||||
#include "BRepAdaptor_Surface.hxx"
|
#include "BRepAdaptor_Surface.hxx"
|
||||||
#include "Poly_Triangulation.hxx"
|
#include "Poly_Triangulation.hxx"
|
||||||
#include "Poly_Array1OfTriangle.hxx"
|
#include "Poly_Array1OfTriangle.hxx"
|
||||||
#include "TColgp_Array1OfPnt2d.hxx"
|
#include "TColgp_Array1OfPnt2d.hxx"
|
||||||
#include "Poly_Triangle.hxx"
|
#include "Poly_Triangle.hxx"
|
||||||
#include "GProp_GProps.hxx"
|
#include "GProp_GProps.hxx"
|
||||||
#include "BRepGProp.hxx"
|
#include "BRepGProp.hxx"
|
||||||
#include "Geom_Surface.hxx"
|
#include "Geom_Surface.hxx"
|
||||||
#include "TopExp.hxx"
|
#include "TopExp.hxx"
|
||||||
#include "gp_Pnt.hxx"
|
#include "gp_Pnt.hxx"
|
||||||
#include "TopoDS.hxx"
|
#include "TopoDS.hxx"
|
||||||
#include "TopoDS_Solid.hxx"
|
#include "TopoDS_Solid.hxx"
|
||||||
#include "TopExp_Explorer.hxx"
|
#include "TopExp_Explorer.hxx"
|
||||||
#include "TopTools_ListIteratorOfListOfShape.hxx"
|
#include "TopTools_ListIteratorOfListOfShape.hxx"
|
||||||
#include "BRep_Tool.hxx"
|
#include "BRep_Tool.hxx"
|
||||||
#include "Geom_Curve.hxx"
|
#include "Geom_Curve.hxx"
|
||||||
#include "Geom2d_Curve.hxx"
|
#include "Geom2d_Curve.hxx"
|
||||||
#include "Geom_Surface.hxx"
|
#include "Geom_Surface.hxx"
|
||||||
#include "GeomAPI_ProjectPointOnSurf.hxx"
|
#include "GeomAPI_ProjectPointOnSurf.hxx"
|
||||||
#include "GeomAPI_ProjectPointOnCurve.hxx"
|
#include "GeomAPI_ProjectPointOnCurve.hxx"
|
||||||
#include "TopoDS_Wire.hxx"
|
#include "TopoDS_Wire.hxx"
|
||||||
#include "BRepTools_WireExplorer.hxx"
|
#include "BRepTools_WireExplorer.hxx"
|
||||||
#include "BRepTools.hxx"
|
#include "BRepTools.hxx"
|
||||||
#include "TopTools_IndexedMapOfShape.hxx"
|
#include "TopTools_IndexedMapOfShape.hxx"
|
||||||
#include "TopExp.hxx"
|
#include "TopExp.hxx"
|
||||||
#include "BRepBuilderAPI_MakeVertex.hxx"
|
#include "BRepBuilderAPI_MakeVertex.hxx"
|
||||||
#include "BRepBuilderAPI_MakeShell.hxx"
|
#include "BRepBuilderAPI_MakeShell.hxx"
|
||||||
#include "BRepBuilderAPI_MakeSolid.hxx"
|
#include "BRepBuilderAPI_MakeSolid.hxx"
|
||||||
#include "BRepOffsetAPI_Sewing.hxx"
|
#include "BRepOffsetAPI_Sewing.hxx"
|
||||||
#include "BRepLProp_CLProps.hxx"
|
#include "BRepLProp_CLProps.hxx"
|
||||||
#include "BRepLProp_SLProps.hxx"
|
#include "BRepLProp_SLProps.hxx"
|
||||||
#include "BRepAdaptor_Surface.hxx"
|
#include "BRepAdaptor_Surface.hxx"
|
||||||
#include "BRepAdaptor_Curve.hxx"
|
#include "BRepAdaptor_Curve.hxx"
|
||||||
#include "Poly_Triangulation.hxx"
|
#include "Poly_Triangulation.hxx"
|
||||||
#include "Poly_Array1OfTriangle.hxx"
|
#include "Poly_Array1OfTriangle.hxx"
|
||||||
#include "TColgp_Array1OfPnt2d.hxx"
|
#include "TColgp_Array1OfPnt2d.hxx"
|
||||||
#include "Poly_Triangle.hxx"
|
#include "Poly_Triangle.hxx"
|
||||||
#include "GProp_GProps.hxx"
|
#include "GProp_GProps.hxx"
|
||||||
#include "BRepGProp.hxx"
|
#include "BRepGProp.hxx"
|
||||||
#include "TopoDS_Shape.hxx"
|
#include "TopoDS_Shape.hxx"
|
||||||
#include "TopoDS_Face.hxx"
|
#include "TopoDS_Face.hxx"
|
||||||
#include "IGESToBRep_Reader.hxx"
|
#include "IGESToBRep_Reader.hxx"
|
||||||
#include "Interface_Static.hxx"
|
#include "Interface_Static.hxx"
|
||||||
#include "GeomAPI_ExtremaCurveCurve.hxx"
|
#include "GeomAPI_ExtremaCurveCurve.hxx"
|
||||||
#include "Standard_ErrorHandler.hxx"
|
#include "Standard_ErrorHandler.hxx"
|
||||||
#include "Standard_Failure.hxx"
|
#include "Standard_Failure.hxx"
|
||||||
#include "ShapeUpgrade_ShellSewing.hxx"
|
#include "ShapeUpgrade_ShellSewing.hxx"
|
||||||
#include "ShapeFix_Shape.hxx"
|
#include "ShapeFix_Shape.hxx"
|
||||||
#include "ShapeFix_Wireframe.hxx"
|
#include "ShapeFix_Wireframe.hxx"
|
||||||
#include "BRepMesh.hxx"
|
#include "BRepMesh.hxx"
|
||||||
#include "BRepMesh_IncrementalMesh.hxx"
|
#include "BRepMesh_IncrementalMesh.hxx"
|
||||||
#include "BRepBndLib.hxx"
|
#include "BRepBndLib.hxx"
|
||||||
#include "Bnd_Box.hxx"
|
#include "Bnd_Box.hxx"
|
||||||
#include "ShapeAnalysis.hxx"
|
#include "ShapeAnalysis.hxx"
|
||||||
#include "ShapeBuild_ReShape.hxx"
|
#include "ShapeBuild_ReShape.hxx"
|
||||||
|
|
||||||
|
|
||||||
// Philippose - 29/01/2009
|
// Philippose - 29/01/2009
|
||||||
// OpenCascade XDE Support
|
// OpenCascade XDE Support
|
||||||
// Include support for OpenCascade XDE Features
|
// Include support for OpenCascade XDE Features
|
||||||
#include "TDocStd_Document.hxx"
|
#include "TDocStd_Document.hxx"
|
||||||
#include "Quantity_Color.hxx"
|
#include "Quantity_Color.hxx"
|
||||||
#include "XCAFApp_Application.hxx"
|
#include "XCAFApp_Application.hxx"
|
||||||
#include "XCAFDoc_ShapeTool.hxx"
|
#include "XCAFDoc_ShapeTool.hxx"
|
||||||
#include "XCAFDoc_Color.hxx"
|
#include "XCAFDoc_Color.hxx"
|
||||||
#include "XCAFDoc_ColorTool.hxx"
|
#include "XCAFDoc_ColorTool.hxx"
|
||||||
#include "XCAFDoc_ColorType.hxx"
|
#include "XCAFDoc_ColorType.hxx"
|
||||||
#include "XCAFDoc_LayerTool.hxx"
|
#include "XCAFDoc_LayerTool.hxx"
|
||||||
#include "XCAFDoc_DimTolTool.hxx"
|
#include "XCAFDoc_DimTolTool.hxx"
|
||||||
#include "XCAFDoc_MaterialTool.hxx"
|
#include "XCAFDoc_MaterialTool.hxx"
|
||||||
#include "XCAFDoc_DocumentTool.hxx"
|
#include "XCAFDoc_DocumentTool.hxx"
|
||||||
#include "TDF_Label.hxx"
|
#include "TDF_Label.hxx"
|
||||||
#include "TDF_LabelSequence.hxx"
|
#include "TDF_LabelSequence.hxx"
|
||||||
#include "STEPCAFControl_Reader.hxx"
|
#include "STEPCAFControl_Reader.hxx"
|
||||||
#include "STEPCAFControl_Writer.hxx"
|
#include "STEPCAFControl_Writer.hxx"
|
||||||
#include "IGESCAFControl_Reader.hxx"
|
#include "IGESCAFControl_Reader.hxx"
|
||||||
#include "IGESCAFControl_Writer.hxx"
|
#include "IGESCAFControl_Writer.hxx"
|
||||||
|
|
||||||
#include "IGESControl_Reader.hxx"
|
#include "IGESControl_Reader.hxx"
|
||||||
#include "STEPControl_Reader.hxx"
|
#include "STEPControl_Reader.hxx"
|
||||||
#include "IGESControl_Writer.hxx"
|
#include "IGESControl_Writer.hxx"
|
||||||
#include "STEPControl_Writer.hxx"
|
#include "STEPControl_Writer.hxx"
|
||||||
|
|
||||||
#include "StlAPI_Writer.hxx"
|
#include "StlAPI_Writer.hxx"
|
||||||
#include "STEPControl_StepModelType.hxx"
|
#include "STEPControl_StepModelType.hxx"
|
||||||
|
|
||||||
namespace netgen
|
namespace netgen
|
||||||
{
|
{
|
||||||
#include "occmeshsurf.hpp"
|
#include "occmeshsurf.hpp"
|
||||||
|
|
||||||
extern DLL_HEADER MeshingParameters mparam;
|
extern DLL_HEADER MeshingParameters mparam;
|
||||||
|
|
||||||
#define PROJECTION_TOLERANCE 1e-10
|
#define PROJECTION_TOLERANCE 1e-10
|
||||||
|
|
||||||
#define ENTITYISVISIBLE 1
|
#define ENTITYISVISIBLE 1
|
||||||
#define ENTITYISHIGHLIGHTED 2
|
#define ENTITYISHIGHLIGHTED 2
|
||||||
#define ENTITYISDRAWABLE 4
|
#define ENTITYISDRAWABLE 4
|
||||||
|
|
||||||
#define OCCGEOMETRYVISUALIZATIONNOCHANGE 0
|
#define OCCGEOMETRYVISUALIZATIONNOCHANGE 0
|
||||||
#define OCCGEOMETRYVISUALIZATIONFULLCHANGE 1 // Compute transformation matrices and redraw
|
#define OCCGEOMETRYVISUALIZATIONFULLCHANGE 1 // Compute transformation matrices and redraw
|
||||||
#define OCCGEOMETRYVISUALIZATIONHALFCHANGE 2 // Redraw
|
#define OCCGEOMETRYVISUALIZATIONHALFCHANGE 2 // Redraw
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class EntityVisualizationCode
|
class EntityVisualizationCode
|
||||||
{
|
{
|
||||||
int code;
|
int code;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
EntityVisualizationCode()
|
EntityVisualizationCode()
|
||||||
{ code = ENTITYISVISIBLE + !ENTITYISHIGHLIGHTED + ENTITYISDRAWABLE;}
|
{ code = ENTITYISVISIBLE + !ENTITYISHIGHLIGHTED + ENTITYISDRAWABLE;}
|
||||||
|
|
||||||
int IsVisible ()
|
int IsVisible ()
|
||||||
{ return code & ENTITYISVISIBLE;}
|
{ return code & ENTITYISVISIBLE;}
|
||||||
|
|
||||||
int IsHighlighted ()
|
int IsHighlighted ()
|
||||||
{ return code & ENTITYISHIGHLIGHTED;}
|
{ return code & ENTITYISHIGHLIGHTED;}
|
||||||
|
|
||||||
int IsDrawable ()
|
int IsDrawable ()
|
||||||
{ return code & ENTITYISDRAWABLE;}
|
{ return code & ENTITYISDRAWABLE;}
|
||||||
|
|
||||||
void Show ()
|
void Show ()
|
||||||
{ code |= ENTITYISVISIBLE;}
|
{ code |= ENTITYISVISIBLE;}
|
||||||
|
|
||||||
void Hide ()
|
void Hide ()
|
||||||
{ code &= ~ENTITYISVISIBLE;}
|
{ code &= ~ENTITYISVISIBLE;}
|
||||||
|
|
||||||
void Highlight ()
|
void Highlight ()
|
||||||
{ code |= ENTITYISHIGHLIGHTED;}
|
{ code |= ENTITYISHIGHLIGHTED;}
|
||||||
|
|
||||||
void Lowlight ()
|
void Lowlight ()
|
||||||
{ code &= ~ENTITYISHIGHLIGHTED;}
|
{ code &= ~ENTITYISHIGHLIGHTED;}
|
||||||
|
|
||||||
void SetDrawable ()
|
void SetDrawable ()
|
||||||
{ code |= ENTITYISDRAWABLE;}
|
{ code |= ENTITYISDRAWABLE;}
|
||||||
|
|
||||||
void SetNotDrawable ()
|
void SetNotDrawable ()
|
||||||
{ code &= ~ENTITYISDRAWABLE;}
|
{ code &= ~ENTITYISDRAWABLE;}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Line
|
class Line
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Point<3> p0, p1;
|
Point<3> p0, p1;
|
||||||
|
|
||||||
double Dist (Line l);
|
double Dist (Line l);
|
||||||
|
|
||||||
double Length ();
|
double Length ();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
inline double Det3 (double a00, double a01, double a02,
|
inline double Det3 (double a00, double a01, double a02,
|
||||||
double a10, double a11, double a12,
|
double a10, double a11, double a12,
|
||||||
double a20, double a21, double a22)
|
double a20, double a21, double a22)
|
||||||
{
|
{
|
||||||
return a00*a11*a22 + a01*a12*a20 + a10*a21*a02 - a20*a11*a02 - a10*a01*a22 - a21*a12*a00;
|
return a00*a11*a22 + a01*a12*a20 + a10*a21*a02 - a20*a11*a02 - a10*a01*a22 - a21*a12*a00;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class OCCGeometry : public NetgenGeometry
|
class OCCGeometry : public NetgenGeometry
|
||||||
{
|
{
|
||||||
Point<3> center;
|
Point<3> center;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TopoDS_Shape shape;
|
TopoDS_Shape shape;
|
||||||
TopTools_IndexedMapOfShape fmap, emap, vmap, somap, shmap, wmap;
|
TopTools_IndexedMapOfShape fmap, emap, vmap, somap, shmap, wmap;
|
||||||
Array<bool> fsingular, esingular, vsingular;
|
Array<bool> fsingular, esingular, vsingular;
|
||||||
Box<3> boundingbox;
|
Box<3> boundingbox;
|
||||||
|
|
||||||
// Philippose - 29/01/2009
|
// Philippose - 29/01/2009
|
||||||
// OpenCascade XDE Support
|
// OpenCascade XDE Support
|
||||||
// XCAF Handle to make the face colours available to the rest of
|
// XCAF Handle to make the face colours available to the rest of
|
||||||
// the system
|
// the system
|
||||||
Handle_XCAFDoc_ColorTool face_colours;
|
Handle_XCAFDoc_ColorTool face_colours;
|
||||||
|
|
||||||
mutable int changed;
|
mutable int changed;
|
||||||
Array<int> facemeshstatus;
|
Array<int> facemeshstatus;
|
||||||
|
|
||||||
// Philippose - 15/01/2009
|
// Philippose - 15/01/2009
|
||||||
// Maximum mesh size for a given face
|
// Maximum mesh size for a given face
|
||||||
// (Used to explicitly define mesh size limits on individual faces)
|
// (Used to explicitly define mesh size limits on individual faces)
|
||||||
Array<double> face_maxh;
|
Array<double> face_maxh;
|
||||||
|
|
||||||
// Philippose - 14/01/2010
|
// Philippose - 14/01/2010
|
||||||
// Boolean array to detect whether a face has been explicitly modified
|
// Boolean array to detect whether a face has been explicitly modified
|
||||||
// by the user or not
|
// by the user or not
|
||||||
Array<bool> face_maxh_modified;
|
Array<bool> face_maxh_modified;
|
||||||
|
|
||||||
// Philippose - 15/01/2009
|
// Philippose - 15/01/2009
|
||||||
// Indicates which faces have been selected by the user in geometry mode
|
// Indicates which faces have been selected by the user in geometry mode
|
||||||
// (Currently handles only selection of one face at a time, but an array would
|
// (Currently handles only selection of one face at a time, but an array would
|
||||||
// help to extend this to multiple faces)
|
// help to extend this to multiple faces)
|
||||||
Array<bool> face_sel_status;
|
Array<bool> face_sel_status;
|
||||||
|
|
||||||
Array<EntityVisualizationCode> fvispar, evispar, vvispar;
|
Array<EntityVisualizationCode> fvispar, evispar, vvispar;
|
||||||
|
|
||||||
double tolerance;
|
double tolerance;
|
||||||
bool fixsmalledges;
|
bool fixsmalledges;
|
||||||
bool fixspotstripfaces;
|
bool fixspotstripfaces;
|
||||||
bool sewfaces;
|
bool sewfaces;
|
||||||
bool makesolids;
|
bool makesolids;
|
||||||
bool splitpartitions;
|
bool splitpartitions;
|
||||||
|
|
||||||
OCCGeometry()
|
OCCGeometry()
|
||||||
{
|
{
|
||||||
somap.Clear();
|
somap.Clear();
|
||||||
shmap.Clear();
|
shmap.Clear();
|
||||||
fmap.Clear();
|
fmap.Clear();
|
||||||
wmap.Clear();
|
wmap.Clear();
|
||||||
emap.Clear();
|
emap.Clear();
|
||||||
vmap.Clear();
|
vmap.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
virtual void Save (string filename) const;
|
virtual void Save (string filename) const;
|
||||||
|
|
||||||
|
|
||||||
void BuildFMap();
|
void BuildFMap();
|
||||||
|
|
||||||
Box<3> GetBoundingBox()
|
Box<3> GetBoundingBox()
|
||||||
{ return boundingbox;}
|
{ return boundingbox;}
|
||||||
|
|
||||||
int NrSolids()
|
int NrSolids()
|
||||||
{ return somap.Extent();}
|
{ return somap.Extent();}
|
||||||
|
|
||||||
// Philippose - 17/01/2009
|
// Philippose - 17/01/2009
|
||||||
// Total number of faces in the geometry
|
// Total number of faces in the geometry
|
||||||
int NrFaces()
|
int NrFaces()
|
||||||
{ return fmap.Extent();}
|
{ return fmap.Extent();}
|
||||||
|
|
||||||
void SetCenter()
|
void SetCenter()
|
||||||
{ center = boundingbox.Center();}
|
{ center = boundingbox.Center();}
|
||||||
|
|
||||||
Point<3> Center()
|
Point<3> Center()
|
||||||
{ return center;}
|
{ return center;}
|
||||||
|
|
||||||
void Project (int surfi, Point<3> & p) const;
|
void Project (int surfi, Point<3> & p) const;
|
||||||
bool FastProject (int surfi, Point<3> & ap, double& u, double& v) const;
|
bool FastProject (int surfi, Point<3> & ap, double& u, double& v) const;
|
||||||
|
|
||||||
OCCSurface GetSurface (int surfi)
|
OCCSurface GetSurface (int surfi)
|
||||||
{
|
{
|
||||||
cout << "OCCGeometry::GetSurface using PLANESPACE" << endl;
|
cout << "OCCGeometry::GetSurface using PLANESPACE" << endl;
|
||||||
return OCCSurface (TopoDS::Face(fmap(surfi)), PLANESPACE);
|
return OCCSurface (TopoDS::Face(fmap(surfi)), PLANESPACE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CalcBoundingBox ();
|
void CalcBoundingBox ();
|
||||||
void BuildVisualizationMesh (double deflection);
|
void BuildVisualizationMesh (double deflection);
|
||||||
|
|
||||||
void RecursiveTopologyTree (const TopoDS_Shape & sh,
|
void RecursiveTopologyTree (const TopoDS_Shape & sh,
|
||||||
stringstream & str,
|
stringstream & str,
|
||||||
TopAbs_ShapeEnum l,
|
TopAbs_ShapeEnum l,
|
||||||
bool free,
|
bool free,
|
||||||
const char * lname);
|
const char * lname);
|
||||||
|
|
||||||
void GetTopologyTree (stringstream & str);
|
void GetTopologyTree (stringstream & str);
|
||||||
|
|
||||||
void PrintNrShapes ();
|
void PrintNrShapes ();
|
||||||
|
|
||||||
void CheckIrregularEntities (stringstream & str);
|
void CheckIrregularEntities (stringstream & str);
|
||||||
|
|
||||||
void SewFaces();
|
void SewFaces();
|
||||||
|
|
||||||
void MakeSolid();
|
void MakeSolid();
|
||||||
|
|
||||||
void HealGeometry();
|
void HealGeometry();
|
||||||
|
|
||||||
// Philippose - 15/01/2009
|
// Philippose - 15/01/2009
|
||||||
// Sets the maximum mesh size for a given face
|
// Sets the maximum mesh size for a given face
|
||||||
// (Note: Local mesh size limited by the global max mesh size)
|
// (Note: Local mesh size limited by the global max mesh size)
|
||||||
void SetFaceMaxH(int facenr, double faceh)
|
void SetFaceMaxH(int facenr, double faceh)
|
||||||
{
|
{
|
||||||
if((facenr> 0) && (facenr <= fmap.Extent()))
|
if((facenr> 0) && (facenr <= fmap.Extent()))
|
||||||
{
|
{
|
||||||
face_maxh[facenr-1] = min(mparam.maxh,faceh);
|
face_maxh[facenr-1] = min(mparam.maxh,faceh);
|
||||||
|
|
||||||
// Philippose - 14/01/2010
|
// Philippose - 14/01/2010
|
||||||
// If the face maxh is greater than or equal to the
|
// If the face maxh is greater than or equal to the
|
||||||
// current global maximum, then identify the face as
|
// current global maximum, then identify the face as
|
||||||
// not explicitly controlled by the user any more
|
// not explicitly controlled by the user any more
|
||||||
if(faceh >= mparam.maxh)
|
if(faceh >= mparam.maxh)
|
||||||
{
|
{
|
||||||
face_maxh_modified[facenr-1] = 0;
|
face_maxh_modified[facenr-1] = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
face_maxh_modified[facenr-1] = 1;
|
face_maxh_modified[facenr-1] = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Philippose - 15/01/2009
|
// Philippose - 15/01/2009
|
||||||
// Returns the local mesh size of a given face
|
// Returns the local mesh size of a given face
|
||||||
double GetFaceMaxH(int facenr)
|
double GetFaceMaxH(int facenr)
|
||||||
{
|
{
|
||||||
if((facenr> 0) && (facenr <= fmap.Extent()))
|
if((facenr> 0) && (facenr <= fmap.Extent()))
|
||||||
{
|
{
|
||||||
return face_maxh[facenr-1];
|
return face_maxh[facenr-1];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return 0.0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Philippose - 14/01/2010
|
// Philippose - 14/01/2010
|
||||||
// Returns the flag whether the given face
|
// Returns the flag whether the given face
|
||||||
// has a mesh size controlled by the user or not
|
// has a mesh size controlled by the user or not
|
||||||
bool GetFaceMaxhModified(int facenr)
|
bool GetFaceMaxhModified(int facenr)
|
||||||
{
|
{
|
||||||
return face_maxh_modified[facenr-1];
|
return face_maxh_modified[facenr-1];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Philippose - 17/01/2009
|
// Philippose - 17/01/2009
|
||||||
// Returns the index of the currently selected face
|
// Returns the index of the currently selected face
|
||||||
int SelectedFace()
|
int SelectedFace()
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for(i = 1; i <= fmap.Extent(); i++)
|
for(i = 1; i <= fmap.Extent(); i++)
|
||||||
{
|
{
|
||||||
if(face_sel_status[i-1])
|
if(face_sel_status[i-1])
|
||||||
{
|
{
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Philippose - 17/01/2009
|
// Philippose - 17/01/2009
|
||||||
// Sets the currently selected face
|
// Sets the currently selected face
|
||||||
void SetSelectedFace(int facenr)
|
void SetSelectedFace(int facenr)
|
||||||
{
|
{
|
||||||
face_sel_status = 0;
|
face_sel_status = 0;
|
||||||
|
|
||||||
if((facenr >= 1) && (facenr <= fmap.Extent()))
|
if((facenr >= 1) && (facenr <= fmap.Extent()))
|
||||||
{
|
{
|
||||||
face_sel_status[facenr-1] = 1;
|
face_sel_status[facenr-1] = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LowLightAll()
|
void LowLightAll()
|
||||||
{
|
{
|
||||||
for (int i = 1; i <= fmap.Extent(); i++)
|
for (int i = 1; i <= fmap.Extent(); i++)
|
||||||
fvispar[i-1].Lowlight();
|
fvispar[i-1].Lowlight();
|
||||||
for (int i = 1; i <= emap.Extent(); i++)
|
for (int i = 1; i <= emap.Extent(); i++)
|
||||||
evispar[i-1].Lowlight();
|
evispar[i-1].Lowlight();
|
||||||
for (int i = 1; i <= vmap.Extent(); i++)
|
for (int i = 1; i <= vmap.Extent(); i++)
|
||||||
vvispar[i-1].Lowlight();
|
vvispar[i-1].Lowlight();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GetUnmeshedFaceInfo (stringstream & str);
|
void GetUnmeshedFaceInfo (stringstream & str);
|
||||||
void GetNotDrawableFaces (stringstream & str);
|
void GetNotDrawableFaces (stringstream & str);
|
||||||
bool ErrorInSurfaceMeshing ();
|
bool ErrorInSurfaceMeshing ();
|
||||||
|
|
||||||
void WriteOCC_STL(char * filename);
|
void WriteOCC_STL(char * filename);
|
||||||
|
|
||||||
virtual int GenerateMesh (Mesh*& mesh, MeshingParameters & mparam,
|
virtual int GenerateMesh (Mesh*& mesh, MeshingParameters & mparam,
|
||||||
int perfstepsstart, int perfstepsend);
|
int perfstepsstart, int perfstepsend);
|
||||||
|
|
||||||
virtual const Refinement & GetRefinement () const;
|
virtual const Refinement & GetRefinement () const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class OCCParameters
|
class OCCParameters
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// Factor for meshing close edges
|
/// Factor for meshing close edges
|
||||||
double resthcloseedgefac;
|
double resthcloseedgefac;
|
||||||
|
|
||||||
|
|
||||||
/// Enable / Disable detection of close edges
|
/// Enable / Disable detection of close edges
|
||||||
int resthcloseedgeenable;
|
int resthcloseedgeenable;
|
||||||
|
|
||||||
|
|
||||||
|
/// Minimum edge length to be used for dividing edges to mesh points
|
||||||
/*!
|
double resthminedgelen;
|
||||||
Default Constructor for the OpenCascade
|
|
||||||
Mesh generation parameter set
|
|
||||||
*/
|
/// Enable / Disable use of the minimum edge length (by default use 1e-4)
|
||||||
OCCParameters();
|
int resthminedgelenenable;
|
||||||
|
|
||||||
|
/*!
|
||||||
/*!
|
Default Constructor for the OpenCascade
|
||||||
Dump all the OpenCascade specific meshing parameters
|
Mesh generation parameter set
|
||||||
to console
|
*/
|
||||||
*/
|
OCCParameters();
|
||||||
void Print (ostream & ost) const;
|
|
||||||
};
|
|
||||||
|
/*!
|
||||||
|
Dump all the OpenCascade specific meshing parameters
|
||||||
void PrintContents (OCCGeometry * geom);
|
to console
|
||||||
|
*/
|
||||||
OCCGeometry * LoadOCC_IGES (const char * filename);
|
void Print (ostream & ost) const;
|
||||||
OCCGeometry * LoadOCC_STEP (const char * filename);
|
};
|
||||||
OCCGeometry * LoadOCC_BREP (const char * filename);
|
|
||||||
|
|
||||||
extern OCCParameters occparam;
|
void PrintContents (OCCGeometry * geom);
|
||||||
|
|
||||||
|
OCCGeometry * LoadOCC_IGES (const char * filename);
|
||||||
// Philippose - 31.09.2009
|
OCCGeometry * LoadOCC_STEP (const char * filename);
|
||||||
// External access to the mesh generation functions within the OCC
|
OCCGeometry * LoadOCC_BREP (const char * filename);
|
||||||
// subsystem (Not sure if this is the best way to implement this....!!)
|
|
||||||
extern int OCCGenerateMesh (OCCGeometry & occgeometry, Mesh*& mesh,
|
extern OCCParameters occparam;
|
||||||
MeshingParameters & mparam,
|
|
||||||
int perfstepsstart, int perfstepsend);
|
|
||||||
|
// Philippose - 31.09.2009
|
||||||
extern void OCCSetLocalMeshSize(OCCGeometry & geom, Mesh & mesh);
|
// External access to the mesh generation functions within the OCC
|
||||||
|
// subsystem (Not sure if this is the best way to implement this....!!)
|
||||||
extern void OCCMeshSurface (OCCGeometry & geom, Mesh & mesh, int perfstepsend);
|
extern int OCCGenerateMesh (OCCGeometry & occgeometry, Mesh*& mesh,
|
||||||
|
MeshingParameters & mparam,
|
||||||
extern void OCCFindEdges (OCCGeometry & geom, Mesh & mesh);
|
int perfstepsstart, int perfstepsend);
|
||||||
}
|
|
||||||
|
extern void OCCSetLocalMeshSize(OCCGeometry & geom, Mesh & mesh);
|
||||||
#endif
|
|
||||||
|
extern void OCCMeshSurface (OCCGeometry & geom, Mesh & mesh, int perfstepsend);
|
||||||
#endif
|
|
||||||
|
extern void OCCFindEdges (OCCGeometry & geom, Mesh & mesh);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
@ -43,6 +43,10 @@ namespace netgen
|
|||||||
atof (Tcl_GetVar (interp, "::stloptions.resthcloseedgefac", 0));
|
atof (Tcl_GetVar (interp, "::stloptions.resthcloseedgefac", 0));
|
||||||
occparam.resthcloseedgeenable =
|
occparam.resthcloseedgeenable =
|
||||||
atoi (Tcl_GetVar (interp, "::stloptions.resthcloseedgeenable", 0));
|
atoi (Tcl_GetVar (interp, "::stloptions.resthcloseedgeenable", 0));
|
||||||
|
occparam.resthminedgelen =
|
||||||
|
atof (Tcl_GetVar (interp, "::stloptions.resthminedgelen", 0));
|
||||||
|
occparam.resthminedgelenenable =
|
||||||
|
atoi (Tcl_GetVar (interp, "::stloptions.resthminedgelenenable", 0));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
5253
ng/dialog.tcl
5253
ng/dialog.tcl
File diff suppressed because it is too large
Load Diff
@ -1,46 +1,50 @@
|
|||||||
proc setgranularity { gran } {
|
proc setgranularity { gran } {
|
||||||
#
|
#
|
||||||
# puts "set granularity $gran"
|
# puts "set granularity $gran"
|
||||||
#
|
#
|
||||||
if {$gran == 6} { return }
|
if {$gran == 6} { return }
|
||||||
set gran [expr $gran - 1]
|
set gran [expr $gran - 1]
|
||||||
#
|
#
|
||||||
global options.curvaturesafety
|
global options.curvaturesafety
|
||||||
set surfcurvlist { 1 1.5 2 3 5 }
|
set surfcurvlist { 1 1.5 2 3 5 }
|
||||||
set options.curvaturesafety [lindex $surfcurvlist $gran]
|
set options.curvaturesafety [lindex $surfcurvlist $gran]
|
||||||
|
|
||||||
global options.segmentsperedge
|
global options.segmentsperedge
|
||||||
set spelist { 0.3 0.5 1 2 3 }
|
set spelist { 0.3 0.5 1 2 3 }
|
||||||
set options.segmentsperedge [lindex $spelist $gran]
|
set options.segmentsperedge [lindex $spelist $gran]
|
||||||
|
|
||||||
global stloptions.resthsurfcurvfac
|
global stloptions.resthsurfcurvfac
|
||||||
set surfcurvfaclist { 0.25 0.5 1 1.5 3 }
|
set surfcurvfaclist { 0.25 0.5 1 1.5 3 }
|
||||||
set stloptions.resthsurfcurvfac [lindex $surfcurvfaclist $gran]
|
set stloptions.resthsurfcurvfac [lindex $surfcurvfaclist $gran]
|
||||||
|
|
||||||
global stloptions.resthchartdistfac
|
global stloptions.resthchartdistfac
|
||||||
set chartdistfaclist { 0.8 1 1.5 2 5 }
|
set chartdistfaclist { 0.8 1 1.5 2 5 }
|
||||||
set stloptions.resthchartdistfac [lindex $chartdistfaclist $gran]
|
set stloptions.resthchartdistfac [lindex $chartdistfaclist $gran]
|
||||||
|
|
||||||
global stloptions.resthlinelengthfac
|
global stloptions.resthlinelengthfac
|
||||||
set linelengthfaclist { 0.2 0.35 0.5 1.5 3 }
|
set linelengthfaclist { 0.2 0.35 0.5 1.5 3 }
|
||||||
set stloptions.resthlinelengthfac [lindex $linelengthfaclist $gran]
|
set stloptions.resthlinelengthfac [lindex $linelengthfaclist $gran]
|
||||||
|
|
||||||
global stloptions.resthcloseedgefac
|
global stloptions.resthcloseedgefac
|
||||||
set closeedgefaclist { 0.5 1 2 3.5 5 }
|
set closeedgefaclist { 0.5 1 2 3.5 5 }
|
||||||
set stloptions.resthcloseedgefac [lindex $closeedgefaclist $gran]
|
set stloptions.resthcloseedgefac [lindex $closeedgefaclist $gran]
|
||||||
|
|
||||||
global stloptions.resthedgeanglefac
|
global stloptions.resthminedgelen
|
||||||
set edgeanglefaclist { 0.25 0.5 1 1.5 3 }
|
set minedgelenlist { 0.002 0.02 0.2 1.0 2.0 5.0 10.0 }
|
||||||
set stloptions.resthedgeanglefac [lindex $edgeanglefaclist $gran]
|
set stloptions.resthminedgelen [lindex $minedgelenlist $gran]
|
||||||
|
|
||||||
|
global stloptions.resthedgeanglefac
|
||||||
global stloptions.resthsurfmeshcurvfac
|
set edgeanglefaclist { 0.25 0.5 1 1.5 3 }
|
||||||
set surfmeshcurvlist { 1 1.5 2 3 5 }
|
set stloptions.resthedgeanglefac [lindex $edgeanglefaclist $gran]
|
||||||
set stloptions.resthsurfmeshcurvfac [lindex $surfmeshcurvlist $gran]
|
|
||||||
|
|
||||||
|
global stloptions.resthsurfmeshcurvfac
|
||||||
global options.grading
|
set surfmeshcurvlist { 1 1.5 2 3 5 }
|
||||||
set gradinglist { 0.7 0.5 0.3 0.2 0.1 }
|
set stloptions.resthsurfmeshcurvfac [lindex $surfmeshcurvlist $gran]
|
||||||
set options.grading [lindex $gradinglist $gran]
|
|
||||||
|
|
||||||
}
|
global options.grading
|
||||||
|
set gradinglist { 0.7 0.5 0.3 0.2 0.1 }
|
||||||
|
set options.grading [lindex $gradinglist $gran]
|
||||||
|
|
||||||
|
}
|
||||||
|
1408
ng/variables.tcl
1408
ng/variables.tcl
File diff suppressed because it is too large
Load Diff
2478
nglib/nglib.cpp
2478
nglib/nglib.cpp
File diff suppressed because it is too large
Load Diff
1491
nglib/nglib.h
1491
nglib/nglib.h
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user