diff --git a/libsrc/csg/csgeom.cpp b/libsrc/csg/csgeom.cpp index 178c3daa..4602d4a0 100644 --- a/libsrc/csg/csgeom.cpp +++ b/libsrc/csg/csgeom.cpp @@ -132,8 +132,24 @@ namespace netgen } + extern int CSGGenerateMesh (CSGeometry & geom, + Mesh *& mesh, int perfstepsstart, int perfstepsend, + const char * optstr); + + int CSGeometry :: GenerateMesh (Mesh*& mesh, + int perfstepsstart, int perfstepsend, char* optstring) + { + return CSGGenerateMesh (*this, mesh, perfstepsstart, perfstepsend, optstring); + } + const Refinement & CSGeometry :: GetRefinement () const + { + // should become class variables + RefinementSurfaces * ref = new RefinementSurfaces(*this); + ref -> Set2dOptimizer(new MeshOptimize2dSurfaces(*this)); + return *ref; + } class WritePrimitivesIt : public SolidIterator { diff --git a/libsrc/csg/csgeom.hpp b/libsrc/csg/csgeom.hpp index 658a7472..c4744f6e 100644 --- a/libsrc/csg/csgeom.hpp +++ b/libsrc/csg/csgeom.hpp @@ -82,6 +82,9 @@ public: }; + + + /** CSGeometry has the whole geometric information */ @@ -303,6 +306,13 @@ public: Array bcmodifications; + virtual int GenerateMesh (Mesh*& mesh, + int perfstepsstart, int perfstepsend, char* optstring); + + virtual const Refinement & GetRefinement () const; }; + + + #endif diff --git a/libsrc/csg/genmesh.cpp b/libsrc/csg/genmesh.cpp index 26f30409..271e4187 100644 --- a/libsrc/csg/genmesh.cpp +++ b/libsrc/csg/genmesh.cpp @@ -662,10 +662,10 @@ namespace netgen - int GenerateMesh (CSGeometry & geom, - Mesh *& mesh, - int perfstepsstart, int perfstepsend, - const char * optstr) + int CSGGenerateMesh (CSGeometry & geom, + Mesh *& mesh, + int perfstepsstart, int perfstepsend, + const char * optstr) { if (mesh && mesh->GetNSE() && !geom.GetNSolids()) diff --git a/libsrc/csg/meshsurf.hpp b/libsrc/csg/meshsurf.hpp index 840600b0..3e3e3241 100644 --- a/libsrc/csg/meshsurf.hpp +++ b/libsrc/csg/meshsurf.hpp @@ -54,8 +54,6 @@ public: - - class RefinementSurfaces : public Refinement { const CSGeometry & geometry; @@ -90,6 +88,5 @@ public: }; - #endif diff --git a/libsrc/csg/revolution.cpp b/libsrc/csg/revolution.cpp index 7b1cbb36..909952b2 100644 --- a/libsrc/csg/revolution.cpp +++ b/libsrc/csg/revolution.cpp @@ -590,7 +590,7 @@ namespace netgen Revolution :: Revolution(const Point<3> & p0_in, const Point<3> & p1_in, - const SplineGeometry2d & spline_in) : + const SplineGeometry<2> & spline_in) : p0(p0_in), p1(p1_in), splinecurve(spline_in), nsplines(spline_in.GetNSplines()) { diff --git a/libsrc/csg/revolution.hpp b/libsrc/csg/revolution.hpp index 344c4526..4ab45906 100644 --- a/libsrc/csg/revolution.hpp +++ b/libsrc/csg/revolution.hpp @@ -91,7 +91,7 @@ class Revolution : public Primitive private: Point<3> p0,p1; Vec<3> v_axis; - const SplineGeometry2d & splinecurve; + const SplineGeometry<2> & splinecurve; const int nsplines; // 1 ... torus-like @@ -106,7 +106,7 @@ private: public: Revolution(const Point<3> & p0_in, const Point<3> & p1_in, - const SplineGeometry2d & spline_in); + const SplineGeometry<2> & spline_in); ~Revolution(); diff --git a/libsrc/general/Makefile.am b/libsrc/general/Makefile.am index 940fda97..ad5d8337 100644 --- a/libsrc/general/Makefile.am +++ b/libsrc/general/Makefile.am @@ -1,4 +1,6 @@ -noinst_HEADERS = array.hpp myadt.hpp optmem.hpp sort.hpp table.hpp autodiff.hpp flags.hpp mystring.hpp spbita2d.hpp template.hpp autoptr.hpp hashtabl.hpp netgenout.hpp profiler.hpp stack.hpp bitarray.hpp seti.hpp symbolta.hpp dynamicmem.hpp moveablemem.hpp parthreads.hpp mpi_interface.hpp +noinst_HEADERS = array.hpp myadt.hpp optmem.hpp sort.hpp table.hpp autodiff.hpp flags.hpp mystring.hpp spbita2d.hpp template.hpp autoptr.hpp hashtabl.hpp netgenout.hpp profiler.hpp stack.hpp bitarray.hpp seti.hpp symbolta.hpp dynamicmem.hpp parthreads.hpp mpi_interface.hpp + +# moveablemem.hpp include_HEADERS = ngexception.hpp @@ -6,5 +8,7 @@ AM_CPPFLAGS = $(MPI_INCLUDES) -I$(top_srcdir)/libsrc/include METASOURCES = AUTO noinst_LTLIBRARIES = libgeneral.la libgeneral_la_SOURCES = array.cpp bitarray.cpp dynamicmem.cpp flags.cpp \ - hashtabl.cpp moveablemem.cpp mystring.cpp ngexception.cpp optmem.cpp parthreads.cpp \ + hashtabl.cpp mystring.cpp ngexception.cpp optmem.cpp parthreads.cpp \ profiler.cpp seti.cpp sort.cpp spbita2d.cpp symbolta.cpp table.cpp + +# moveablemem.cpp diff --git a/libsrc/general/myadt.hpp b/libsrc/general/myadt.hpp index 99443380..100e7a3a 100644 --- a/libsrc/general/myadt.hpp +++ b/libsrc/general/myadt.hpp @@ -19,7 +19,7 @@ #include "ngexception.hpp" #include "parthreads.hpp" -#include "moveablemem.hpp" +// #include "moveablemem.hpp" #include "dynamicmem.hpp" #include "template.hpp" diff --git a/libsrc/geom2d/splinegeometry.cpp b/libsrc/geom2d/splinegeometry.cpp index cf6aff1a..4a2800d2 100644 --- a/libsrc/geom2d/splinegeometry.cpp +++ b/libsrc/geom2d/splinegeometry.cpp @@ -1247,6 +1247,25 @@ string * SplineGeometry :: BCNamePtr( const int bcnr ) return bcnames[bcnr-1]; } +SplineGeometry2d :: ~SplineGeometry2d() +{ + ; +} + + +int SplineGeometry2d :: GenerateMesh (Mesh*& mesh, + int perfstepsstart, int perfstepsend, char* optstring) +{ + cout << "SplineGeometry2d::GenerateMesh : only a dummy" << endl; + return 0; +} + + +const Refinement & SplineGeometry2d :: GetRefinement () const +{ + return * new Refinement2d (*this); +} + template class SplineGeometry<2>; diff --git a/libsrc/geom2d/splinegeometry.hpp b/libsrc/geom2d/splinegeometry.hpp index 578d2d41..3cb17ca4 100644 --- a/libsrc/geom2d/splinegeometry.hpp +++ b/libsrc/geom2d/splinegeometry.hpp @@ -125,6 +125,8 @@ public: string GetBCName ( const int bcnr ) const; string * BCNamePtr ( const int bcnr ); + + }; @@ -134,7 +136,16 @@ void MeshFromSpline2D (SplineGeometry<2> & geometry, -typedef SplineGeometry<2> SplineGeometry2d; +class SplineGeometry2d : public SplineGeometry<2>, public NetgenGeometry +{ +public: + virtual ~SplineGeometry2d(); + + virtual int GenerateMesh (Mesh*& mesh, + int perfstepsstart, int perfstepsend, char* optstring); + + virtual const Refinement & GetRefinement () const; +}; #endif // _FILE_SPLINEGEOMETRY diff --git a/libsrc/meshing/basegeom.hpp b/libsrc/meshing/basegeom.hpp index 66d370c1..709cdb5c 100644 --- a/libsrc/meshing/basegeom.hpp +++ b/libsrc/meshing/basegeom.hpp @@ -12,6 +12,11 @@ class NetgenGeometry { public: virtual ~NetgenGeometry () { ; } + + virtual int GenerateMesh (Mesh*& mesh, + int perfstepsstart, int perfstepsend, char* optstring) = 0; + + virtual const Refinement & GetRefinement () const = 0; }; diff --git a/libsrc/meshing/bisect.hpp b/libsrc/meshing/bisect.hpp index 8f023727..748e0fcd 100644 --- a/libsrc/meshing/bisect.hpp +++ b/libsrc/meshing/bisect.hpp @@ -46,6 +46,7 @@ public: Refinement (); virtual ~Refinement (); + void Refine (Mesh & mesh) const; void Refine (Mesh & mesh); void Bisect (Mesh & mesh, class BisectionOptions & opt, Array * quality_loss = NULL); void MakeSecondOrder (Mesh & mesh); diff --git a/libsrc/meshing/meshing.hpp b/libsrc/meshing/meshing.hpp index 83f25dd4..61b0d168 100644 --- a/libsrc/meshing/meshing.hpp +++ b/libsrc/meshing/meshing.hpp @@ -32,8 +32,6 @@ namespace netgen #include "meshing2.hpp" #include "improve2.hpp" -#include "basegeom.hpp" - #include "geomsearch.hpp" #include "adfront3.hpp" @@ -72,6 +70,8 @@ namespace netgen // #include "../parallel/parallelmesh.hpp" #endif +#include "basegeom.hpp" + } diff --git a/libsrc/meshing/refine.cpp b/libsrc/meshing/refine.cpp index b22e9e51..28fc19aa 100644 --- a/libsrc/meshing/refine.cpp +++ b/libsrc/meshing/refine.cpp @@ -4,6 +4,13 @@ namespace netgen { + + void Refinement :: Refine (Mesh & mesh) const + { + const_cast (*this).Refine(mesh); + } + + void Refinement :: Refine (Mesh & mesh) { // reduce 2nd order diff --git a/libsrc/occ/occgeom.cpp b/libsrc/occ/occgeom.cpp index 340ebc01..5606d4cf 100644 --- a/libsrc/occ/occgeom.cpp +++ b/libsrc/occ/occgeom.cpp @@ -1600,6 +1600,20 @@ namespace netgen return false; } + extern int OCCGenerateMesh (OCCGeometry & occgeometry, Mesh*& mesh, + int perfstepsstart, int perfstepsend, char* optstring); + + int OCCGeometry :: GenerateMesh (Mesh*& mesh, + int perfstepsstart, int perfstepsend, char* optstring) + { + return OCCGenerateMesh (*this, mesh, perfstepsstart, perfstepsend, optstring); + } + + const Refinement & OCCGeometry :: GetRefinement () const + { + return * new OCCRefinementSurfaces (*this); + } + } diff --git a/libsrc/occ/occgeom.hpp b/libsrc/occ/occgeom.hpp index 2c145e71..e12570f7 100644 --- a/libsrc/occ/occgeom.hpp +++ b/libsrc/occ/occgeom.hpp @@ -169,7 +169,7 @@ namespace netgen #define OCCGEOMETRYVISUALIZATIONHALFCHANGE 2 // == redraw - class OCCGeometry + class OCCGeometry : public NetgenGeometry { Point<3> center; @@ -336,6 +336,11 @@ namespace netgen bool ErrorInSurfaceMeshing (); void WriteOCC_STL(char * filename); + + virtual int GenerateMesh (Mesh*& mesh, + int perfstepsstart, int perfstepsend, char* optstring); + + virtual const Refinement & GetRefinement () const; }; void PrintContents (OCCGeometry * geom); diff --git a/libsrc/stlgeom/stlgeom.cpp b/libsrc/stlgeom/stlgeom.cpp index 228ff5b4..c1e2fcca 100644 --- a/libsrc/stlgeom/stlgeom.cpp +++ b/libsrc/stlgeom/stlgeom.cpp @@ -67,6 +67,20 @@ STLGeometry :: ~STLGeometry() delete edgedata; } +int STLGeometry :: GenerateMesh (Mesh*& mesh, + int perfstepsstart, int perfstepsend, char* optstring) +{ + return STLMeshingDummy (this, mesh, perfstepsstart, perfstepsend, optstring); +} + + +const Refinement & STLGeometry :: GetRefinement () const +{ + return * new RefinementSTLGeometry (*this); +} + + + void STLGeometry :: STLInfo(double* data) { data[0] = GetNT(); diff --git a/libsrc/stlgeom/stlgeom.hpp b/libsrc/stlgeom/stlgeom.hpp index 2da96329..2702d080 100644 --- a/libsrc/stlgeom/stlgeom.hpp +++ b/libsrc/stlgeom/stlgeom.hpp @@ -436,12 +436,19 @@ namespace netgen double gh, double fact, double minh); friend class MeshingSTLSurface; + + + virtual int GenerateMesh (Mesh*& mesh, + int perfstepsstart, int perfstepsend, char* optstring); + + virtual const Refinement & GetRefinement () const; }; #include "meshstlsurface.hpp" + extern int STLMeshingDummy (STLGeometry* stlgeometry, Mesh*& mesh, int perfstepsstart, int perfstepsend, char* optstring); diff --git a/ng/ngpkg.cpp b/ng/ngpkg.cpp index a36c5992..543d97d0 100644 --- a/ng/ngpkg.cpp +++ b/ng/ngpkg.cpp @@ -178,7 +178,7 @@ namespace netgen OCCGeometry * occgeometry = NULL; #endif - + NetgenGeometry * ng_geometry; Tcl_Interp * tcl_interp; @@ -396,9 +396,6 @@ namespace netgen const string filename (argv[1]); PrintMessage (1, "Save mesh to file ", filename); - - //mesh -> Save (filename); - ofstream outfile(filename.c_str()); mesh -> Save (outfile); @@ -406,7 +403,6 @@ namespace netgen if (geometry && geometry->GetNSurf()) geometry->SaveSurfaces(outfile); - return TCL_OK; } @@ -639,6 +635,7 @@ namespace netgen extern CSGeometry * ParseCSG (istream & istr); // ifstream infile(lgfilename); CSGeometry * hgeom = ParseCSG (infile); + ng_geometry = hgeom; if (hgeom) geometry.Reset (hgeom); else @@ -668,6 +665,7 @@ namespace netgen // strcpy (geomfilename, lgfilename); PrintMessage (1, "Load stl geometry file ", lgfilename); stlgeometry = STLGeometry :: Load (infile); + ng_geometry = stlgeometry; stlgeometry->edgesfound = 0; } else if ((strcmp (&lgfilename[strlen(lgfilename)-4], "iges") == 0) || @@ -679,6 +677,7 @@ namespace netgen // strcpy (geomfilename, lgfilename); PrintMessage (1, "Load IGES geometry file ", lgfilename); occgeometry = LoadOCC_IGES (lgfilename); + ng_geometry = occgeometry; #else Tcl_SetResult (interp, (char*)"IGES import requires the OpenCascade geometry kernel. " "Please install OpenCascade as described in the Netgen-website", @@ -707,6 +706,7 @@ namespace netgen // strcpy (geomfilename, lgfilename); PrintMessage (1, "Load STEP geometry file ", lgfilename); occgeometry = LoadOCC_STEP (lgfilename); + ng_geometry = occgeometry; #else Tcl_SetResult (interp, (char*)"IGES import requires the OpenCascade geometry kernel. " "Please install OpenCascade as described in the Netgen-website", @@ -723,6 +723,7 @@ namespace netgen // strcpy (geomfilename, lgfilename); PrintMessage (1, "Load BREP geometry file ", lgfilename); occgeometry = LoadOCC_BREP (lgfilename); + ng_geometry = occgeometry; #else Tcl_SetResult (interp, (char*)"BREP import requires the OpenCascade geometry kernel. " "Please install OpenCascade as described in the Netgen-website", @@ -737,6 +738,7 @@ namespace netgen PrintMessage (1, "Load stl geometry file ", lgfilename, " in binary format"); stlgeometry = STLGeometry :: LoadBinary (infile); + ng_geometry = stlgeometry; stlgeometry->edgesfound = 0; } @@ -746,6 +748,7 @@ namespace netgen PrintMessage (1, "Load naomi (F. Kickinger) geometry file ", lgfilename); stlgeometry = STLGeometry :: LoadNaomi (infile); + ng_geometry = stlgeometry; stlgeometry->edgesfound = 0; } @@ -754,6 +757,7 @@ namespace netgen // strcpy (geomfilename, lgfilename); geometry2d.Reset (new SplineGeometry2d()); geometry2d -> Load (lgfilename); + ng_geometry = geometry2d.Ptr(); } } } @@ -1330,7 +1334,6 @@ namespace netgen Tcl_Interp * interp, int argc, tcl_const char *argv[]) { - static char buf[100]; if (argc < 2) return TCL_ERROR; if (strcmp (argv[1], "usedmb") == 0) @@ -1459,7 +1462,7 @@ namespace netgen if (!occgeometry) { - Tcl_SetResult (interp, (char *)"Ng_SurfaceMeshSize currently supports only OCC (STEP/IGES) Files", TCL_STATIC); + Tcl_SetResult (interp, (char *)"Ng_SurfaceMeshSize currently supports only OCC (STEP/IGES) Files", TCL_STATIC); return TCL_ERROR; } @@ -1602,28 +1605,8 @@ namespace netgen return TCL_ERROR; } - - if (stlgeometry) - { - RefinementSTLGeometry ref (*stlgeometry); - ref.Refine (*mesh); - } - - else if (geometry2d) - { - Refinement2d ref (*geometry2d); - ref.Refine (*mesh); - } - -#ifdef OCCGEOMETRY - else if (occgeometry) - { - OCCRefinementSurfaces ref (*occgeometry); - ref.Refine (*mesh); - } -#endif #ifdef ACIS - else if (acisgeometry) + if (acisgeometry) { ACISRefinementSurfaces ref (*acisgeometry); ACISMeshOptimize2dSurfaces opt(*acisgeometry); @@ -1633,10 +1616,7 @@ namespace netgen #endif else { - RefinementSurfaces ref (*geometry); - MeshOptimize2dSurfaces opt(*geometry); - ref.Set2dOptimizer(&opt); - ref.Refine (*mesh); + ng_geometry -> GetRefinement().Refine(*mesh); } return TCL_OK; @@ -1656,29 +1636,8 @@ namespace netgen Tcl_SetResult (interp, err_jobrunning, TCL_STATIC); return TCL_ERROR; } - - if (stlgeometry) - { - RefinementSTLGeometry ref (*stlgeometry); - ref.MakeSecondOrder (*mesh); - } -#ifdef OCCGEOMETRY - else if (occgeometry) - { - OCCRefinementSurfaces ref (*occgeometry); - ref.MakeSecondOrder (*mesh); - } -#endif - else if (geometry2d) - { - Refinement2d ref (*geometry2d); - ref.MakeSecondOrder (*mesh); - } - else - { - RefinementSurfaces ref (*geometry); - ref.MakeSecondOrder (*mesh); - } + + const_cast (ng_geometry -> GetRefinement()).MakeSecondOrder (*mesh); return TCL_OK; } @@ -1689,30 +1648,8 @@ namespace netgen // mparam.elementorder = atoi (Tcl_GetVar (interp, "options.elementorder", 0)); const char * savetask = multithread.task; - Refinement * ref; - - if (stlgeometry) - ref = new RefinementSTLGeometry (*stlgeometry); - else if (geometry2d) - ref = new Refinement2d (*geometry2d); -#ifdef OCCGEOMETRY - else if (occgeometry) - ref = new OCCRefinementSurfaces (*occgeometry); -#endif -#ifdef ACIS - else if (acisgeometry) - { - ref = new ACISRefinementSurfaces(*acisgeometry); - } -#endif - else - { - ref = new RefinementSurfaces (*geometry); - } - - mesh -> GetCurvedElements().BuildCurvedElements (ref, mparam.elementorder); - - delete ref; + Refinement & ref = const_cast (ng_geometry -> GetRefinement()); + mesh -> GetCurvedElements().BuildCurvedElements (&ref, mparam.elementorder); multithread.task = savetask; multithread.running = 0; @@ -1826,21 +1763,8 @@ namespace netgen int levels = atoi (argv[1]); - Refinement * ref; - - if (stlgeometry) - ref = new RefinementSTLGeometry (*stlgeometry); - else if (geometry2d) - ref = new Refinement2d (*geometry2d); -#ifdef OCCGEOMETRY - else if (occgeometry) - ref = new OCCRefinementSurfaces (*occgeometry); -#endif - else - ref = new RefinementSurfaces (*geometry); - - - HPRefinement (*mesh, ref, levels); + Refinement & ref = const_cast (ng_geometry -> GetRefinement()); + HPRefinement (*mesh, &ref, levels); return TCL_OK; } @@ -2157,22 +2081,6 @@ namespace netgen } - - - extern int GenerateMesh (CSGeometry & geom, - Mesh *& mesh, int perfstepsstart, int perfstepsend, - const char * optstr); - - extern int STLMeshingDummy (STLGeometry* stlgeometry, Mesh*& mesh, - int perfstepsstart, int perfstepsend, char* optstring); - -#ifdef OCCGEOMETRY - extern int OCCGenerateMesh (OCCGeometry & occgeometry, Mesh*& mesh, - int perfstepsstart, int perfstepsend, char* optstring); -#endif - - - static int perfstepsstart; static int perfstepsend; static char* optstring = NULL; @@ -2196,116 +2104,56 @@ namespace netgen mparam.Print (*logout); #endif - if (stlgeometry) - { -#ifdef LOG_STREAM - (*logout) << "STL parameters:" << endl; - stlparam.Print (*logout); -#endif - - STLMeshingDummy(stlgeometry, mesh.Ptr(), perfstepsstart, perfstepsend, optstring); - } -#ifdef OCCGEOMETRY - else if (occgeometry) - { - OCCGenerateMesh(*occgeometry, mesh.Ptr(), perfstepsstart, perfstepsend, optstring); - } -#endif #ifdef ACIS - else if (acisgeometry) + if (acisgeometry) { ACISGenerateMesh(*acisgeometry, mesh.Ptr(), perfstepsstart, perfstepsend, optstring); } -#endif - - else if (geometry2d) - { - extern void MeshFromSpline2D (SplineGeometry2d & geometry2d, - Mesh *& mesh, MeshingParameters & mp); - MeshFromSpline2D (*geometry2d, mesh.Ptr(), mparam); - } else +#endif + if (geometry2d) + { + extern void MeshFromSpline2D (SplineGeometry2d & geometry2d, + Mesh *& mesh, MeshingParameters & mp); + MeshFromSpline2D (*geometry2d, mesh.Ptr(), mparam); + } + else + { + int res = ng_geometry -> GenerateMesh (mesh.Ptr(), perfstepsstart, perfstepsend, optstringcsg); + if (res != MESHING3_OK) return 0; + } + + if (mparam.autozrefine && ( (NetgenGeometry*)geometry.Ptr() == ng_geometry)) { - int res = - GenerateMesh (*geometry, mesh.Ptr(), perfstepsstart, perfstepsend, optstringcsg); - if (res != MESHING3_OK) return 0; - - if(mparam.autozrefine) - { - ZRefinementOptions opt; - opt.minref = 5; - ZRefinement (*mesh, geometry.Ptr(), opt); - } + ZRefinementOptions opt; + opt.minref = 5; + ZRefinement (*mesh, geometry.Ptr(), opt); + mesh -> SetNextMajorTimeStamp(); } - - + if (mparam.secondorder) { - if (stlgeometry) - { - RefinementSTLGeometry ref (*stlgeometry); - ref.MakeSecondOrder (*mesh); - } -#ifdef OCCGEOMETRY - else if (occgeometry) - { - OCCRefinementSurfaces ref (*occgeometry); - ref.MakeSecondOrder (*mesh); - } -#endif - else if (geometry2d) - { - Refinement2d ref (*geometry2d); - ref.MakeSecondOrder (*mesh); - } - else - { - RefinementSurfaces ref (*geometry); - ref.MakeSecondOrder (*mesh); - } + const_cast (ng_geometry -> GetRefinement()).MakeSecondOrder (*mesh); + mesh -> SetNextMajorTimeStamp(); } if (mparam.elementorder > 1) { - - Refinement * ref; - - if (stlgeometry) - ref = new RefinementSTLGeometry (*stlgeometry); - else if (geometry2d) - ref = new Refinement2d (*geometry2d); -#ifdef OCCGEOMETRY - else if (occgeometry) - ref = new OCCRefinementSurfaces (*occgeometry); -#endif -#ifdef ACIS - else if (acisgeometry) - ref = new ACISRefinementSurfaces(*acisgeometry); -#endif - else - ref = new RefinementSurfaces (*geometry); - - - mesh -> GetCurvedElements().BuildCurvedElements (ref, mparam.elementorder); - - // cout << "WARNING: Ng_HighOrder! ref is not deleted for edge projection visualization" << endl; - - delete ref; + mesh -> GetCurvedElements().BuildCurvedElements (&const_cast (ng_geometry -> GetRefinement()), + mparam.elementorder); mesh -> SetNextMajorTimeStamp(); - } PrintMessage (1, "Meshing done, time = ", GetTime(), " sec"); -#ifdef LOG_STREAM - (*logout) << "Meshing done, time = " << GetTime() << endl; -#endif } + catch (NgException e) { cout << e.What() << endl; } + multithread.task = savetask; multithread.running = 0; @@ -5306,15 +5154,3 @@ namespace netgen } - -namespace netgen { - extern CSGeometry * ParseCSG (istream & istr); -} - -void Netgen_Test () -{ - ifstream infile ("examples/cube.geo"); - netgen::geometry.Reset (netgen::ParseCSG (infile) ); - netgen:: geometry -> FindIdenticSurfaces(1e-10); - netgen::GenerateMesh (*netgen::geometry.Ptr(), netgen::mesh.Ptr(), 1, 6, ""); -}