From 22e83bf2941fd54ba3d8a7b3cae7403d6c1d719a Mon Sep 17 00:00:00 2001 From: Joachim Schoeberl Date: Wed, 25 Feb 2009 16:06:34 +0000 Subject: [PATCH] added missing file --- libsrc/csg/csgeom.cpp | 15 +++++++++++++++ libsrc/csg/genmesh.cpp | 6 ------ libsrc/csg/surface.hpp | 27 +++++++++++++++++++++++---- libsrc/meshing/meshclass.cpp | 5 ++--- libsrc/meshing/meshfunc.cpp | 4 +++- libsrc/occ/Makefile.am | 2 +- libsrc/visualization/vssolution.cpp | 3 ++- ng/ng.tcl | 4 ++-- 8 files changed, 48 insertions(+), 18 deletions(-) diff --git a/libsrc/csg/csgeom.cpp b/libsrc/csg/csgeom.cpp index 363cf888..0506aabb 100644 --- a/libsrc/csg/csgeom.cpp +++ b/libsrc/csg/csgeom.cpp @@ -329,6 +329,7 @@ namespace netgen const OneSurfacePrimitive * sp = dynamic_cast< const OneSurfacePrimitive * > (GetSurface(i)); const ExtrusionFace * ef = dynamic_cast< const ExtrusionFace * > (GetSurface(i)); const RevolutionFace * rf = dynamic_cast< const RevolutionFace * > (GetSurface(i)); + const DummySurface * dummyf = dynamic_cast< const DummySurface * > (GetSurface(i)); if(sp) @@ -347,6 +348,11 @@ namespace netgen out << "revolutionface "; rf->GetRawData(coeffs); } + else if(dummyf) + { + out << "dummy "; + coeffs.SetSize(0); + } else throw NgException ("Cannot write csg surface. Please, contact developers!"); @@ -438,6 +444,15 @@ namespace netgen AddSurface(rf); delete_them.Append(rf); } + + else if(classname == "dummy") + { + Surface * surf = new DummySurface(); + + AddSurface(surf); + delete_them.Append(surf); + } + } } diff --git a/libsrc/csg/genmesh.cpp b/libsrc/csg/genmesh.cpp index 722b42b6..bf6ce7db 100644 --- a/libsrc/csg/genmesh.cpp +++ b/libsrc/csg/genmesh.cpp @@ -664,14 +664,8 @@ namespace netgen perfstepsstart = MESHCONST_MESHVOLUME; } - - if (perfstepsstart <= MESHCONST_ANALYSE) { - /* - delete mesh; - mesh = new Mesh(); - */ if (mesh) mesh -> DeleteMesh(); else diff --git a/libsrc/csg/surface.hpp b/libsrc/csg/surface.hpp index 42a77bfe..1bad84aa 100644 --- a/libsrc/csg/surface.hpp +++ b/libsrc/csg/surface.hpp @@ -189,10 +189,6 @@ public: const Box<3> & /* boundingbox */, double /* facets */ ) const { }; -#ifdef MYGRAPH - /// - virtual void Plot (const class ROT3D & /* rot */) const { }; -#endif string GetBCName() const { return bcname; } @@ -214,6 +210,29 @@ INSOLID_TYPE; +class DummySurface : public Surface +{ + virtual double CalcFunctionValue (const Point<3> & point) const + { return 0; } + + virtual void CalcGradient (const Point<3> & point, Vec<3> & grad) const + { grad = Vec<3> (0,0,0); } + + virtual Point<3> GetSurfacePoint () const + { return Point<3> (0,0,0); } + + virtual double HesseNorm () const + { return 0; } + + virtual void Project (Point<3> & p) const + { ; } + + virtual void Print (ostream & ost) const + { ost << "dummy surface"; } +}; + + + class Primitive { diff --git a/libsrc/meshing/meshclass.cpp b/libsrc/meshing/meshclass.cpp index d9ab935a..217fbf2e 100644 --- a/libsrc/meshing/meshclass.cpp +++ b/libsrc/meshing/meshclass.cpp @@ -2477,8 +2477,7 @@ namespace netgen GetNSE(), " Surface Elements"); - int i; - for (i = 0; i < GetNSE(); i++) + for (int i = 0; i < GetNSE(); i++) { const Element2d & el = surfelements[i]; int j; @@ -2532,7 +2531,7 @@ namespace netgen } } - for (i = 0; i < GetNSeg(); i++) + for (int i = 0; i < GetNSeg(); i++) { const Segment & seg = segments[i]; const Point3d & p1 = points[seg.p1]; diff --git a/libsrc/meshing/meshfunc.cpp b/libsrc/meshing/meshfunc.cpp index 406aa53e..8732c047 100644 --- a/libsrc/meshing/meshfunc.cpp +++ b/libsrc/meshing/meshfunc.cpp @@ -22,6 +22,8 @@ namespace netgen Array connectednodes; + if (&mesh3d.LocalHFunction() == NULL) mesh3d.CalcLocalH(); + mesh3d.Compress(); // mesh3d.PrintMemInfo (cout); @@ -157,7 +159,7 @@ namespace netgen mesh3d.VolumeElement(i).SetIndex (k); (*testout) - << "mesh has " << mesh3d.GetNE() << " prism/pyramid elements" << endl; + << "mesh has " << mesh3d.GetNE() << " prism/pyramid elements" << endl; mesh3d.FindOpenElements(k); } diff --git a/libsrc/occ/Makefile.am b/libsrc/occ/Makefile.am index 99cd5caa..2473ed4d 100644 --- a/libsrc/occ/Makefile.am +++ b/libsrc/occ/Makefile.am @@ -4,7 +4,7 @@ Partition_Loop3d.hxx Partition_Spliter.hxx Partition_Inter2d.ixx \ Partition_Loop2d.ixx Partition_Loop.ixx Partition_Inter3d.ixx \ Partition_Loop3d.ixx Partition_Spliter.ixx Partition_Inter2d.jxx \ Partition_Loop2d.jxx Partition_Loop.jxx Partition_Inter3d.jxx \ -Partition_Loop3d.jxx Partition_Spliter.jxx +Partition_Loop3d.jxx Partition_Spliter.jxx utilities.h AM_CPPFLAGS = -I$(top_srcdir)/libsrc/include $(OCCFLAGS) diff --git a/libsrc/visualization/vssolution.cpp b/libsrc/visualization/vssolution.cpp index c13787c4..d6e9ef75 100644 --- a/libsrc/visualization/vssolution.cpp +++ b/libsrc/visualization/vssolution.cpp @@ -1188,7 +1188,7 @@ namespace netgen for (int iy = 0, ii = 0; iy <= n; iy++) for (int ix = 0; ix <= n; ix++, ii++) - pref[ii] = Point<2> (double(ix)/n, double(iy/n)); + pref[ii] = Point<2> (double(ix)/n, double(iy)/n); int npt = (n+1)*(n+1); if (curved) @@ -1217,6 +1217,7 @@ namespace netgen nvs[ii] = nv; } + if (sol && sol->draw_surface) { if (usetexture == 2) diff --git a/ng/ng.tcl b/ng/ng.tcl index 67e9e0f2..c08f91c7 100644 --- a/ng/ng.tcl +++ b/ng/ng.tcl @@ -286,8 +286,8 @@ catch { if { [catch { load libngsolve.so ngsolve } result ] } { -# puts "cannot load ngsolve" -# puts "error: $result" + puts "cannot load ngsolve" + puts "error: $result" } { catch { source ${ngdir}/ngsolve.tcl } }