diff --git a/libsrc/csg/specpoin.cpp b/libsrc/csg/specpoin.cpp index 7f80c724..24bd33d3 100644 --- a/libsrc/csg/specpoin.cpp +++ b/libsrc/csg/specpoin.cpp @@ -1381,12 +1381,13 @@ namespace netgen if (!apoints.Size()) return; - +#define VERTSORT #ifdef VERTSORT + Vec<3> dir(1.2, 1.7, 0.9); for (int i = 0; i < apoints.Size(); i++) for (int j = 0; j < apoints.Size()-1; j++) - if (apoints[j](2) > apoints[j+1](2)) + if ( (dir * Vec<3> (apoints[j])) > (dir * Vec<3> (apoints[j+1]))) swap (apoints[j], apoints[j+1]); #endif diff --git a/libsrc/meshing/bisect.cpp b/libsrc/meshing/bisect.cpp index f347f1e3..4292b788 100644 --- a/libsrc/meshing/bisect.cpp +++ b/libsrc/meshing/bisect.cpp @@ -3786,7 +3786,7 @@ namespace netgen mesh.ComputeNVertices(); - + mesh.RebuildSurfaceElementLists(); // update identification tables diff --git a/libsrc/meshing/meshclass.cpp b/libsrc/meshing/meshclass.cpp index dfb45cc6..95ffd25f 100644 --- a/libsrc/meshing/meshclass.cpp +++ b/libsrc/meshing/meshclass.cpp @@ -2297,6 +2297,8 @@ namespace netgen } } + RebuildSurfaceElementLists (); + /* for (int i = 0; i < facedecoding.Size(); i++) facedecoding[i].firstelement = -1; for (int i = surfelements.Size()-1; i >= 0; i--) @@ -2305,7 +2307,7 @@ namespace netgen surfelements[i].next = facedecoding[ind-1].firstelement; facedecoding[ind-1].firstelement = i; } - + */ timestamp = NextTimeStamp(); // Compress(); @@ -4978,6 +4980,19 @@ namespace netgen } + + void Mesh :: RebuildSurfaceElementLists () + { + for (int i = 0; i < facedecoding.Size(); i++) + facedecoding[i].firstelement = -1; + for (int i = surfelements.Size()-1; i >= 0; i--) + { + int ind = surfelements[i].GetIndex(); + surfelements[i].next = facedecoding[ind-1].firstelement; + facedecoding[ind-1].firstelement = i; + } + } + void Mesh :: GetSurfaceElementsOfFace (int facenr, Array & sei) const { static int timer = NgProfiler::CreateTimer ("GetSurfaceElementsOfFace"); diff --git a/libsrc/meshing/meshclass.hpp b/libsrc/meshing/meshclass.hpp index 122e17a8..b1d5578d 100644 --- a/libsrc/meshing/meshclass.hpp +++ b/libsrc/meshing/meshclass.hpp @@ -290,6 +290,7 @@ public: { return surfelements[ei]; } + void RebuildSurfaceElementLists (); void GetSurfaceElementsOfFace (int facenr, Array & sei) const; ElementIndex AddVolumeElement (const Element & el); diff --git a/libsrc/meshing/refine.cpp b/libsrc/meshing/refine.cpp index 28fc19aa..7117ba64 100644 --- a/libsrc/meshing/refine.cpp +++ b/libsrc/meshing/refine.cpp @@ -610,6 +610,7 @@ namespace netgen } mesh.ComputeNVertices(); + mesh.RebuildSurfaceElementLists(); return; int cnttrials = 10; diff --git a/libsrc/meshing/secondorder.cpp b/libsrc/meshing/secondorder.cpp index 4ec85074..ccecdbe3 100644 --- a/libsrc/meshing/secondorder.cpp +++ b/libsrc/meshing/secondorder.cpp @@ -287,7 +287,7 @@ namespace netgen } mesh.ComputeNVertices(); - + mesh.RebuildSurfaceElementLists(); // ValidateSecondOrder (mesh); } diff --git a/ng/Makefile.am b/ng/Makefile.am index 8e017a63..a50b7f15 100644 --- a/ng/Makefile.am +++ b/ng/Makefile.am @@ -16,7 +16,7 @@ netgen_LDADD = $(top_builddir)/libsrc/visualization/libvisual.a \ $(top_builddir)/libsrc/gprim/libgprim.la \ $(top_builddir)/libsrc/linalg/libla.la \ $(top_builddir)/libsrc/general/libgeneral.la \ - $(OCCLIBS) -L$(TK_BIN_DIR)/Togl1.7 $(TOGLLIBDIR) -lTogl1.7 $(LIBGLU) $(TK_LIB_SPEC) $(TCL_LIB_SPEC) $(MPI_LIBS) $(FFMPEG_LIBS) $(JPEGLIB_LIBS) $(PKG_LIBS) + $(OCCLIBS) -L$(TK_BIN_DIR)/Togl1.7 $(TOGLLIBDIR) -lTogl1.7 $(LIBGLU) $(TK_LIB_SPEC) $(TCL_LIB_SPEC) $(MPI_LIBS) $(FFMPEG_LIBS) $(JPEGLIB_LIBS) $(PKG_LIBS) # # add for static linkage of ngsolve: # /opt/netgen/lib/libngsolve.a /opt/netgen/lib/libngcomp.a /opt/netgen/lib/libngcomp.a /opt/netgen/lib/libngfemng.a /opt/netgen/lib/libngmg.a /opt/netgen/lib/libngla.a /opt/netgen/lib/libngbla.a /opt/netgen/lib/libngstd.a -llapack diff --git a/ng/ngappinit.cpp b/ng/ngappinit.cpp index 8efc69d0..4f6b3e0f 100644 --- a/ng/ngappinit.cpp +++ b/ng/ngappinit.cpp @@ -40,7 +40,6 @@ namespace netgen - using netgen::parameters; using netgen::ngdir; using netgen::verbose; @@ -348,7 +347,6 @@ extern "C" int Ng_Vis_Init (Tcl_Interp * interp); // extern Tcl_PackageInitProc * Tk_SafeInit; - /* * * Initialize packages