commit netgen for openSUSE:Factory
Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package netgen for openSUSE:Factory checked in at 2022-10-25 11:20:17 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/netgen (Old) and /work/SRC/openSUSE:Factory/.netgen.new.2275 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "netgen" Tue Oct 25 11:20:17 2022 rev:9 rq:1030983 version:6.2.2204 Changes: -------- --- /work/SRC/openSUSE:Factory/netgen/netgen.changes 2022-09-13 15:11:06.448932875 +0200 +++ /work/SRC/openSUSE:Factory/.netgen.new.2275/netgen.changes 2022-10-25 11:20:42.254229313 +0200 @@ -1,0 +2,15 @@ +Thu Oct 20 20:07:36 UTC 2022 - Stefan Br��ns <stefan.bruens@rwth-aachen.de> + +- Use Catch2 < 3.0. Unfortunately Catch2 3.x is API + incompatible with Catch2 2.x. +- Add 0001-fix-building-with-new-ffmpeg.patch + +------------------------------------------------------------------- +Tue Sep 13 21:47:18 UTC 2022 - Stefan Br��ns <stefan.bruens@rwth-aachen.de> + +- update to version 6.2.2204 + * no changelog provided +- Split nggui library package, to avoid pulling in otherwise + unneeded dependencies. + +------------------------------------------------------------------- Old: ---- netgen-6.2.2203.tar.gz New: ---- 0001-fix-building-with-new-ffmpeg.patch netgen-6.2.2204.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ netgen.spec ++++++ --- /var/tmp/diff_new_pack.SsKkSm/_old 2022-10-25 11:20:42.866230670 +0200 +++ /var/tmp/diff_new_pack.SsKkSm/_new 2022-10-25 11:20:42.870230679 +0200 @@ -23,7 +23,7 @@ %bcond_with pytest Name: netgen -Version: 6.2.2203 +Version: 6.2.2204 Release: 0 Summary: Automatic 3D tetrahedral mesh generator License: LGPL-2.1-only @@ -48,8 +48,11 @@ Patch10: 0001-Fix-netgen-executable-and-library-RUNPATHs.patch # PATCH-FIX-OPENSUSE Patch11: 0001-Ignore-invalid-unknown-types-in-pybind11-docstrings.patch +# PATCH-FIX-UPSTREAM +Patch12: 0001-fix-building-with-new-ffmpeg.patch %if %{with opencascade} BuildRequires: occt-devel +BuildRequires: (pkgconfig(catch2) >= 2.13.4 with pkgconfig(catch2) < 3) BuildRequires: pkgconfig(fontconfig) BuildRequires: pkgconfig(xi) %endif @@ -66,7 +69,6 @@ BuildRequires: python3-pytest BuildRequires: python3-pytest-check %endif -BuildRequires: pkgconfig(catch2) BuildRequires: pkgconfig(gl) BuildRequires: pkgconfig(glu) BuildRequires: pkgconfig(icu-uc) @@ -81,12 +83,10 @@ BuildRequires: openmpi-devel %endif %if %{with ffmpeg} -# Limit to ffmpeg-4 and older, see upstream issue -# https://github.com/NGSolve/netgen/issues/112 -BuildRequires: pkgconfig(libavcodec) <= 58.134.100 -BuildRequires: pkgconfig(libavformat) <= 58.76.100 -BuildRequires: pkgconfig(libavutil) <= 56.70.100 -BuildRequires: pkgconfig(libswscale) <= 5.9.100 +BuildRequires: pkgconfig(libavcodec) +BuildRequires: pkgconfig(libavformat) +BuildRequires: pkgconfig(libavutil) +BuildRequires: pkgconfig(libswscale) %endif BuildRequires: xz # x86 (32bit) is no longer supported upstream. Also exclude other 32 bit archs @@ -110,6 +110,15 @@ %description -n netgen-libs NETGEN mesh generator shared libraries. +%package -n netgen-gui-libs +Summary: NETGEN mesher library - GUI part +Group: System/Libraries +Conflicts: netgen-libs < 6.2.2204 +Provides: %{name}:%{_libdir}/netgen/libnggui.so + +%description -n netgen-gui-libs +GUI support for NETGEN mesh generator shared libraries. + %package devel Summary: Development files for netgen # Should not depend on the netgen binary, but the cmake config is broken @@ -213,7 +222,11 @@ %files -n netgen-libs %dir %{_libdir}/netgen -%{_libdir}/netgen/*.so +%{_libdir}/netgen/libngcore.so +%{_libdir}/netgen/libnglib.so + +%files -n netgen-gui-libs +%{_libdir}/netgen/libnggui.so %files -n python3-%{name} %{python3_sitearch}/netgen ++++++ 0001-fix-building-with-new-ffmpeg.patch ++++++ From 1cf85fa3e79524cea3bcf7743a95584ae95a3bda Mon Sep 17 00:00:00 2001 From: Christopher Lackner <clackner@cerbsim.com> Date: Wed, 14 Sep 2022 10:14:08 +0200 Subject: [PATCH] fix building with new ffmpeg --- ng/encoding.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ng/encoding.hpp b/ng/encoding.hpp index 66261989..9ea2ffb5 100644 --- a/ng/encoding.hpp +++ b/ng/encoding.hpp @@ -5,6 +5,7 @@ extern "C" { #include <libavutil/avassert.h> +#include <libavcodec/avcodec.h> #include <libavutil/channel_layout.h> #include <libavutil/opt.h> #include <libavutil/mathematics.h> @@ -137,11 +138,11 @@ class Mpeg { // oc->preload= (int)(0.5*AV_TIME_BASE); oc->max_delay= (int)(0.7*AV_TIME_BASE); - fmt = oc->oformat; + fmt = (AVOutputFormat*) oc->oformat; if (fmt->video_codec != AV_CODEC_ID_NONE) { /* find the encoder */ - video_codec = avcodec_find_encoder(fmt->video_codec); + video_codec = (AVCodec*) avcodec_find_encoder(fmt->video_codec); if (!(video_codec)) { cerr << "Could not find encoder for '" << avcodec_get_name(fmt->video_codec) << "'" << endl; return 1; -- 2.37.3 ++++++ netgen-6.2.2203.tar.gz -> netgen-6.2.2204.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netgen-6.2.2203/CMakeLists.txt new/netgen-6.2.2204/CMakeLists.txt --- old/netgen-6.2.2203/CMakeLists.txt 2022-05-07 20:40:40.000000000 +0200 +++ new/netgen-6.2.2204/CMakeLists.txt 2022-08-10 09:03:10.000000000 +0200 @@ -248,7 +248,7 @@ if(USE_GUI) target_include_directories(nggui PRIVATE ${ZLIB_INCLUDE_DIRS}) endif(USE_GUI) -target_link_libraries(nglib PUBLIC ${ZLIB_LIBRARIES}) +target_link_libraries(nglib PRIVATE ${ZLIB_LIBRARIES}) ####################################################################### if(WIN32) @@ -407,9 +407,9 @@ endif() endif() message(STATUS "OCC DIRS ${OpenCASCADE_INCLUDE_DIR}") - if(WIN32) + if(WIN32 AND USE_GUI) target_link_libraries(nggui PRIVATE ${OCC_LIBRARIES}) - endif(WIN32) + endif(WIN32 AND USE_GUI) endif (USE_OCC) ####################################################################### diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netgen-6.2.2203/libsrc/core/python_ngcore_export.cpp new/netgen-6.2.2204/libsrc/core/python_ngcore_export.cpp --- old/netgen-6.2.2203/libsrc/core/python_ngcore_export.cpp 2022-05-07 20:40:40.000000000 +0200 +++ new/netgen-6.2.2204/libsrc/core/python_ngcore_export.cpp 2022-08-10 09:03:10.000000000 +0200 @@ -240,7 +240,10 @@ class ParallelContextManager { int num_threads; public: - ParallelContextManager() : num_threads(0) {}; + ParallelContextManager() : num_threads(0) { + TaskManager::SetPajeTrace(0); + PajeTrace::SetMaxTracefileSize(0); + }; ParallelContextManager(size_t pajesize) : num_threads(0) { TaskManager::SetPajeTrace(pajesize > 0); PajeTrace::SetMaxTracefileSize(pajesize); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netgen-6.2.2203/libsrc/csg/csgeom.cpp new/netgen-6.2.2204/libsrc/csg/csgeom.cpp --- old/netgen-6.2.2203/libsrc/csg/csgeom.cpp 2022-05-07 20:40:40.000000000 +0200 +++ new/netgen-6.2.2204/libsrc/csg/csgeom.cpp 2022-08-10 09:03:10.000000000 +0200 @@ -417,7 +417,7 @@ & identpoints & boundingbox & isidenticto & ideps & filename & spline_surfaces & splinecurves2d & splinecurves3d & surf2prim; if(archive.Input()) - FindIdenticSurfaces(1e-6); + FindIdenticSurfaces(1e-8 * MaxSize()); } void CSGeometry :: SaveSurfaces (ostream & out) const @@ -949,6 +949,7 @@ { int inv; int nsurf = GetNSurf(); + identicsurfaces.DeleteData(); isidenticto.SetSize(nsurf); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netgen-6.2.2203/libsrc/csg/python_csg.cpp new/netgen-6.2.2204/libsrc/csg/python_csg.cpp --- old/netgen-6.2.2203/libsrc/csg/python_csg.cpp 2022-05-07 20:40:40.000000000 +0200 +++ new/netgen-6.2.2204/libsrc/csg/python_csg.cpp 2022-08-10 09:03:10.000000000 +0200 @@ -676,7 +676,7 @@ .def("Draw", FunctionPointer ([] (shared_ptr<CSGeometry> self) { - self->FindIdenticSurfaces(1e-6); + self->FindIdenticSurfaces(1e-8 * self->MaxSize()); self->CalcTriangleApproximation(0.01, 20); ng_geometry = self; }) @@ -706,8 +706,8 @@ auto surf = csg_geo->GetSurface(i); surfnames.push_back(surf->GetBCName()); } - csg_geo->FindIdenticSurfaces(1e-6); - csg_geo->CalcTriangleApproximation(0.01,100); + csg_geo->FindIdenticSurfaces(1e-8 * csg_geo->MaxSize()); + csg_geo->CalcTriangleApproximation(0.01,20); auto nto = csg_geo->GetNTopLevelObjects(); size_t np = 0; size_t ntrig = 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netgen-6.2.2203/libsrc/gprim/spline.hpp new/netgen-6.2.2204/libsrc/gprim/spline.hpp --- old/netgen-6.2.2203/libsrc/gprim/spline.hpp 2022-05-07 20:40:40.000000000 +0200 +++ new/netgen-6.2.2204/libsrc/gprim/spline.hpp 2022-08-10 09:03:10.000000000 +0200 @@ -188,12 +188,12 @@ mutable double proj_latest_t; public: /// - SplineSeg3 (const GeomPoint<D> & ap1, + DLL_HEADER SplineSeg3 (const GeomPoint<D> & ap1, const GeomPoint<D> & ap2, const GeomPoint<D> & ap3, string bcname="default", double maxh=1e99); - SplineSeg3 (const GeomPoint<D> & ap1, + DLL_HEADER SplineSeg3 (const GeomPoint<D> & ap1, const GeomPoint<D> & ap2, const GeomPoint<D> & ap3, double aweight, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netgen-6.2.2203/libsrc/meshing/basegeom.cpp new/netgen-6.2.2204/libsrc/meshing/basegeom.cpp --- old/netgen-6.2.2203/libsrc/meshing/basegeom.cpp 2022-05-07 20:40:40.000000000 +0200 +++ new/netgen-6.2.2204/libsrc/meshing/basegeom.cpp 2022-08-10 09:03:10.000000000 +0200 @@ -785,6 +785,8 @@ { auto & face = *faces[k]; FaceDescriptor fd(k+1, face.domin+1, face.domout+1, k+1); + if(face.properties.col) + fd.SetSurfColour(*face.properties.col); mesh.AddFaceDescriptor(fd); mesh.SetBCName(k, face.properties.GetName()); if(face.primary == &face) @@ -974,6 +976,12 @@ } xbool do_invert = maybe; + if(dst.identifications[0].type == Identifications::PERIODIC) + { + auto other = static_cast<GeometryFace*>(dst.primary); + if(dst.domin != other->domout && dst.domout != other->domin) + do_invert = true; + } // now insert mapped surface elements for(auto sei : mesh.SurfaceElements().Range()) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netgen-6.2.2203/libsrc/meshing/boundarylayer.cpp new/netgen-6.2.2204/libsrc/meshing/boundarylayer.cpp --- old/netgen-6.2.2203/libsrc/meshing/boundarylayer.cpp 2022-05-07 20:40:40.000000000 +0200 +++ new/netgen-6.2.2204/libsrc/meshing/boundarylayer.cpp 2022-08-10 09:03:10.000000000 +0200 @@ -194,7 +194,8 @@ ArrayMem<Point<3>, 4> BoundaryLayerTool :: GetMappedFace( SurfaceElementIndex sei, int face ) { - if(face == -1) return GetMappedFace(sei); + if(face == -1) return GetFace(sei); + if(face == -2) return GetMappedFace(sei); const auto & sel = mesh[sei]; auto np = sel.GetNP(); auto pi0 = sel[face % np]; @@ -210,23 +211,25 @@ Vec<3> BoundaryLayerTool :: getEdgeTangent(PointIndex pi, int edgenr) { Vec<3> tangent = 0.0; + ArrayMem<PointIndex,2> pts; for(auto segi : topo.GetVertexSegments(pi)) { auto & seg = mesh[segi]; - if(seg.edgenr != edgenr) + if(seg.edgenr != edgenr+1) continue; PointIndex other = seg[0]+seg[1]-pi; - tangent += mesh[other] - mesh[pi]; + if(!pts.Contains(other)) + pts.Append(other); } + if(pts.Size() != 2) + throw Exception("Something went wrong in getEdgeTangent!"); + tangent = mesh[pts[1]] - mesh[pts[0]]; return tangent.Normalize(); } void BoundaryLayerTool :: LimitGrowthVectorLengths() { static Timer tall("BoundaryLayerTool::LimitGrowthVectorLengths"); RegionTimer rtall(tall); - height = 0.0; - for (auto h : params.heights) - height += h; limits.SetSize(np); limits = 1.0; @@ -320,7 +323,7 @@ const auto & sel = mesh[sei]; if(sel.PNums().Contains(pi)) return false; - auto face = GetFace(sei); + auto face = GetMappedFace(sei, -2); double lam_ = 999; bool is_bl_sel = params.surfid.Contains(sel.GetIndex()); @@ -464,6 +467,8 @@ auto np = mesh.GetNP(); BitArray is_point_on_bl_surface(np+1); is_point_on_bl_surface.Clear(); + BitArray is_point_on_other_surface(np+1); + is_point_on_other_surface.Clear(); Array<Vec<3>, PointIndex> normals(np); for(auto pi : Range(growthvectors)) normals[pi] = growthvectors[pi]; @@ -474,20 +479,33 @@ { auto facei = mesh[sei].GetIndex(); if(facei < nfd_old && !params.surfid.Contains(facei)) - continue; - for(auto pi : mesh[sei].PNums()) - if(mesh[pi].Type() == SURFACEPOINT) + { + for(auto pi : mesh[sei].PNums()) + if(mesh[pi].Type() == SURFACEPOINT) + is_point_on_other_surface.SetBitAtomic(pi); + } + else + { + for(auto pi : mesh[sei].PNums()) + if(mesh[pi].Type() == SURFACEPOINT) is_point_on_bl_surface.SetBitAtomic(pi); + } } }); Array<PointIndex> points; for(PointIndex pi : mesh.Points().Range()) + { if(is_point_on_bl_surface[pi]) { points.Append(pi); growthvectors[pi] = 0.0; } + if(is_point_on_other_surface[pi]) + { + points.Append(pi); + } + } // smooth tangential part of growth vectors from edges to surface elements RegionTimer rtsmooth(tsmooth); @@ -511,7 +529,10 @@ auto gw_other = growthvectors[pi1]; auto normal_other = getNormal(mesh[sei]); auto tangent_part = gw_other - (gw_other*normal_other)*normal_other; - new_gw += tangent_part; + if(is_point_on_bl_surface[pi]) + new_gw += tangent_part; + else + new_gw += gw_other; } } @@ -533,6 +554,10 @@ //for(auto & seg : mesh.LineSegments()) //seg.edgenr = seg.epgeominfo[1].edgenr; + height = 0.0; + for (auto h : params.heights) + height += h; + max_edge_nr = -1; for(const auto& seg : mesh.LineSegments()) if(seg.edgenr > max_edge_nr) @@ -777,7 +802,7 @@ // interpolate tangential component of growth vector along edge for(auto edgenr : Range(max_edge_nr)) { - if(!is_edge_moved[edgenr+1]) continue; + // if(!is_edge_moved[edgenr+1]) continue; // build sorted list of edge Array<PointIndex> points; @@ -785,6 +810,9 @@ double edge_len = 0.; auto is_end_point = [&] (PointIndex pi) { + // if(mesh[pi].Type() == FIXEDPOINT) + // return true; + // return false; auto segs = topo.GetVertexSegments(pi); auto first_edgenr = mesh[segs[0]].edgenr; for(auto segi : segs) @@ -792,17 +820,31 @@ return true; return false; }; + + bool any_grows = false; + for(const auto& seg : segments) { - if(seg.edgenr-1 == edgenr && is_end_point(seg[0])) + if(seg.edgenr-1 == edgenr) { - points.Append(seg[0]); - points.Append(seg[1]); - edge_len += (mesh[seg[1]] - mesh[seg[0]]).Length(); - break; + if(growthvectors[seg[0]].Length2() != 0 || + growthvectors[seg[1]].Length2() != 0) + any_grows = true; + if(points.Size() == 0 && is_end_point(seg[0])) + { + points.Append(seg[0]); + points.Append(seg[1]); + edge_len += (mesh[seg[1]] - mesh[seg[0]]).Length(); + } } } + if(!any_grows) + continue; + + if(!points.Size()) + throw Exception("Could not find startpoint for edge " + ToString(edgenr)); + while(true) { bool point_found = false; @@ -831,17 +873,28 @@ break; if(!point_found) { - cout << "points = " << points << endl; throw Exception(string("Could not find connected list of line segments for edge ") + edgenr); } } + if(growthvectors[points[0]].Length2() == 0 && + growthvectors[points.Last()].Length2() == 0) + continue; + // tangential part of growth vectors auto t1 = (mesh[points[1]]-mesh[points[0]]).Normalize(); auto gt1 = growthvectors[points[0]] * t1 * t1; auto t2 = (mesh[points.Last()]-mesh[points[points.Size()-2]]).Normalize(); auto gt2 = growthvectors[points.Last()] * t2 * t2; + if(!is_edge_moved[edgenr+1]) + { + if(growthvectors[points[0]] * (mesh[points[1]] - mesh[points[0]]) < 0) + gt1 = 0.; + if(growthvectors[points.Last()] * (mesh[points[points.Size()-2]] - mesh[points.Last()]) < 0) + gt2 = 0.; + } + double len = 0.; for(size_t i = 1; i < points.Size()-1; i++) { @@ -1262,7 +1315,9 @@ auto in_surface_direction = ProjectGrowthVectorsOnSurface(); InterpolateGrowthVectors(); - LimitGrowthVectorLengths(); + + if(params.limit_growth_vectors) + LimitGrowthVectorLengths(); FixVolumeElements(); InsertNewElements(segmap, in_surface_direction); SetDomInOut(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netgen-6.2.2203/libsrc/meshing/boundarylayer.hpp new/netgen-6.2.2204/libsrc/meshing/boundarylayer.hpp --- old/netgen-6.2.2203/libsrc/meshing/boundarylayer.hpp 2022-05-07 20:40:40.000000000 +0200 +++ new/netgen-6.2.2204/libsrc/meshing/boundarylayer.hpp 2022-08-10 09:03:10.000000000 +0200 @@ -18,6 +18,7 @@ BitArray domains; bool outside = false; // set the boundary layer on the outside bool grow_edges = false; + bool limit_growth_vectors = true; Array<size_t> project_boundaries; }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netgen-6.2.2203/libsrc/meshing/meshclass.cpp new/netgen-6.2.2204/libsrc/meshing/meshclass.cpp --- old/netgen-6.2.2203/libsrc/meshing/meshclass.cpp 2022-05-07 20:40:40.000000000 +0200 +++ new/netgen-6.2.2204/libsrc/meshing/meshclass.cpp 2022-08-10 09:03:10.000000000 +0200 @@ -1660,10 +1660,6 @@ clusters -> Update(); } - auto geo = geometryregister.LoadFromMeshFile (infile); - if(geo) - geometry = geo; - SetNextMajorTimeStamp(); // PrintMemInfo (cout); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netgen-6.2.2203/libsrc/meshing/meshclass.hpp new/netgen-6.2.2204/libsrc/meshing/meshclass.hpp --- old/netgen-6.2.2203/libsrc/meshing/meshclass.hpp 2022-05-07 20:40:40.000000000 +0200 +++ new/netgen-6.2.2204/libsrc/meshing/meshclass.hpp 2022-08-10 09:03:10.000000000 +0200 @@ -384,7 +384,7 @@ DLL_HEADER int GetNDomains() const; /// int GetDimension() const { return dimension; } - void SetDimension (int dim); // { dimension = dim; } + DLL_HEADER void SetDimension (int dim); // { dimension = dim; } /// sets internal tables DLL_HEADER void CalcSurfacesOfNode (); @@ -478,7 +478,7 @@ return lochfunc[0]; return lochfunc[layer-1]; } - void SetLocalH(shared_ptr<LocalH> loch, int layer=1); + DLL_HEADER void SetLocalH(shared_ptr<LocalH> loch, int layer=1); /// bool LocalHFunctionGenerated(int layer=1) const { return (lochfunc[layer-1] != NULL); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netgen-6.2.2203/libsrc/meshing/meshfunc.cpp new/netgen-6.2.2204/libsrc/meshing/meshfunc.cpp --- old/netgen-6.2.2203/libsrc/meshing/meshfunc.cpp 2022-05-07 20:40:40.000000000 +0200 +++ new/netgen-6.2.2204/libsrc/meshing/meshfunc.cpp 2022-08-10 09:03:10.000000000 +0200 @@ -201,6 +201,7 @@ return; NgArray<int, PointIndex::BASE> map; + std::set<std::tuple<int,int,int>> hex_faces; for(auto identnr : Range(1,nmax+1)) { if(identifications.GetType(identnr) != Identifications::CLOSESURFACES) @@ -211,6 +212,15 @@ for(auto & sel : mesh.OpenElements()) { + // For quads: check if this open element is already closed by a hex + // this happends when we have identifications in two directions + if(sel.GetNP() == 4) + { + Element2d face = sel; + face.NormalizeNumbering(); + if(hex_faces.count({face[0], face[1], face[2]})) + continue; + } bool is_mapped = true; for(auto pi : sel.PNums()) if(!PointIndex(map[pi]).IsValid()) @@ -235,21 +245,26 @@ if(pis.size() < 2*np) continue; - bool is_domout = md.domain == mesh.GetFaceDescriptor(sel.GetIndex()).DomainOut(); - // check if new element is inside current domain auto p0 = mesh[sel[0]]; - Vec<3> n = Cross(mesh[sel[1]] - p0, mesh[sel[2]] - p0 ); - n = is_domout ? n : -n; + Vec<3> n = -Cross(mesh[sel[1]] - p0, mesh[sel[2]] - p0 ); if(n*(mesh[el[np]]-p0) < 0.0) continue; - if(is_domout) - el.Invert(); - el.SetIndex(md.domain); mesh.AddVolumeElement(el); + if(el.NP()==8) + { + // remember all adjacent faces of the new hex (to skip corresponding openelements accordingly) + for(auto facei : Range(1,7)) + { + Element2d face; + el.GetFace(facei, face); + face.NormalizeNumbering(); + hex_faces.insert({face[0], face[1], face[2]}); + } + } } } } @@ -571,17 +586,25 @@ auto md = DivideMesh(mesh3d, mp); + try + { ParallelFor( md.Range(), [&](int i) { if (mp.checkoverlappingboundary) if (md[i].mesh->CheckOverlappingBoundary()) throw NgException ("Stop meshing since boundary mesh is overlapping"); - + if(md[i].mesh->GetGeometry()->GetGeomType() == Mesh::GEOM_OCC) - FillCloseSurface( md[i] ); + FillCloseSurface( md[i] ); CloseOpenQuads( md[i] ); MeshDomain(md[i]); }, md.Size()); + } + catch(...) + { + MergeMeshes(mesh3d, md); + return MESHING3_GIVEUP; + } MergeMeshes(mesh3d, md); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netgen-6.2.2203/libsrc/meshing/meshtype.hpp new/netgen-6.2.2204/libsrc/meshing/meshtype.hpp --- old/netgen-6.2.2203/libsrc/meshing/meshtype.hpp 2022-05-07 20:40:40.000000000 +0200 +++ new/netgen-6.2.2204/libsrc/meshing/meshtype.hpp 2022-08-10 09:03:10.000000000 +0200 @@ -1172,7 +1172,7 @@ void SetDomainIn (int di) { domin = di; } void SetDomainOut (int dom) { domout = dom; } void SetBCProperty (int bc) { bcprop = bc; } - void SetBCName (string * bcn); // { bcname = bcn; } + DLL_HEADER void SetBCName (string * bcn); // { bcname = bcn; } void SetBCName (const string & bcn) { bcname = bcn; } // Philippose - 06/07/2009 // Set the surface colour diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netgen-6.2.2203/libsrc/meshing/netrule3.cpp new/netgen-6.2.2204/libsrc/meshing/netrule3.cpp --- old/netgen-6.2.2203/libsrc/meshing/netrule3.cpp 2022-05-07 20:40:40.000000000 +0200 +++ new/netgen-6.2.2204/libsrc/meshing/netrule3.cpp 2022-08-10 09:03:10.000000000 +0200 @@ -77,6 +77,7 @@ fzbox.SetPoint (transfreezone.Elem(1)); for (i = 2; i <= freezone.Size(); i++) fzbox.AddPoint (transfreezone.Elem(i)); + fzbox.IncreaseRel(1e-8); // MARK(setfz3); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netgen-6.2.2203/libsrc/meshing/python_mesh.cpp new/netgen-6.2.2204/libsrc/meshing/python_mesh.cpp --- old/netgen-6.2.2203/libsrc/meshing/python_mesh.cpp 2022-05-07 20:40:40.000000000 +0200 +++ new/netgen-6.2.2204/libsrc/meshing/python_mesh.cpp 2022-08-10 09:03:10.000000000 +0200 @@ -1196,14 +1196,16 @@ string material, variant<string, int> domain, bool outside, optional<string> project_boundaries, - bool grow_edges) + bool grow_edges, bool limit_growth_vectors) { BoundaryLayerParameters blp; + BitArray boundaries(self.GetNFD()+1); + boundaries.Clear(); if(int* bc = get_if<int>(&boundary); bc) { for (int i = 1; i <= self.GetNFD(); i++) if(self.GetFaceDescriptor(i).BCProperty() == *bc) - blp.surfid.Append (i); + boundaries.SetBit(i); } else { @@ -1213,19 +1215,29 @@ auto& fd = self.GetFaceDescriptor(i); if(regex_match(fd.GetBCName(), pattern)) { + boundaries.SetBit(i); auto dom_pattern = get_if<string>(&domain); // only add if adjacent to domain if(dom_pattern) { regex pattern(*dom_pattern); - if((fd.DomainIn() > 0 && regex_match(self.GetMaterial(fd.DomainIn()), pattern)) || (fd.DomainOut() > 0 && regex_match(self.GetMaterial(fd.DomainOut()), pattern))) - blp.surfid.Append(i); + bool mat1_match = fd.DomainIn() > 0 && regex_match(self.GetMaterial(fd.DomainIn()), pattern); + bool mat2_match = fd.DomainOut() > 0 && regex_match(self.GetMaterial(fd.DomainOut()), pattern); + // if boundary is inner or outer remove from list + if(mat1_match == mat2_match) + boundaries.Clear(i); + // if((fd.DomainIn() > 0 && regex_match(self.GetMaterial(fd.DomainIn()), pattern)) || (fd.DomainOut() > 0 && regex_match(self.GetMaterial(fd.DomainOut()), pattern))) + // boundaries.Clear(i); + // blp.surfid.Append(i); } - else - blp.surfid.Append(i); + // else + // blp.surfid.Append(i); } } } + for(int i = 1; i<=self.GetNFD(); i++) + if(boundaries.Test(i)) + blp.surfid.Append(i); blp.new_mat = material; if(project_boundaries.has_value()) @@ -1265,12 +1277,13 @@ blp.outside = outside; blp.grow_edges = grow_edges; + blp.limit_growth_vectors = limit_growth_vectors; GenerateBoundaryLayer (self, blp); self.UpdateTopology(); }, py::arg("boundary"), py::arg("thickness"), py::arg("material"), py::arg("domains") = ".*", py::arg("outside") = false, - py::arg("project_boundaries")=nullopt, py::arg("grow_edges")=true, + py::arg("project_boundaries")=nullopt, py::arg("grow_edges")=true, py::arg("limit_growth_vectors") = true, R"delimiter( Add boundary layer to mesh. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netgen-6.2.2203/libsrc/occ/occgeom.cpp new/netgen-6.2.2204/libsrc/occ/occgeom.cpp --- old/netgen-6.2.2203/libsrc/occ/occgeom.cpp 2022-05-07 20:40:40.000000000 +0200 +++ new/netgen-6.2.2204/libsrc/occ/occgeom.cpp 2022-08-10 09:03:10.000000000 +0200 @@ -1589,7 +1589,11 @@ if(ar.Output()) { std::stringstream ss; +#if OCC_VERSION_HEX < 0x070600 BRepTools::Write(shape, ss); +#else + BRepTools::Write(shape, ss, false, false, TopTools_FormatVersion_VERSION_1); +#endif ar << ss.str(); } else diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netgen-6.2.2203/libsrc/occ/python_occ.cpp new/netgen-6.2.2204/libsrc/occ/python_occ.cpp --- old/netgen-6.2.2203/libsrc/occ/python_occ.cpp 2022-05-07 20:40:40.000000000 +0200 +++ new/netgen-6.2.2204/libsrc/occ/python_occ.cpp 2022-08-10 09:03:10.000000000 +0200 @@ -26,6 +26,7 @@ namespace netgen { extern std::shared_ptr<NetgenGeometry> ng_geometry; + extern std::shared_ptr<Mesh> mesh; } static string occparameter_description = R"delimiter( @@ -272,7 +273,10 @@ SetGlobalMesh(mesh); auto result = geo->GenerateMesh(mesh, mp); if(result != 0) - throw Exception("Meshing failed!"); + { + netgen::mesh = mesh; // keep mesh for debugging + throw Exception("Meshing failed!"); + } ng_geometry = geo; if (comm.Size() > 1) mesh->Distribute(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netgen-6.2.2203/libsrc/occ/python_occ_basic.cpp new/netgen-6.2.2204/libsrc/occ/python_occ_basic.cpp --- old/netgen-6.2.2203/libsrc/occ/python_occ_basic.cpp 2022-05-07 20:40:40.000000000 +0200 +++ new/netgen-6.2.2204/libsrc/occ/python_occ_basic.cpp 2022-08-10 09:03:10.000000000 +0200 @@ -76,6 +76,8 @@ .def_property("x", [](gp_Vec&p) { return p.X(); }, [](gp_Vec&p,double x) { p.SetX(x); }) .def_property("y", [](gp_Vec&p) { return p.Y(); }, [](gp_Vec&p,double y) { p.SetY(y); }) .def_property("z", [](gp_Vec&p) { return p.Z(); }, [](gp_Vec&p,double z) { p.SetZ(z); }) + .def("Norm", [](const gp_Vec& v) + { return v.Magnitude(); }) .def("__str__", [] (const gp_Vec & p) { stringstream str; str << "(" << p.X() << ", " << p.Y() << ", " << p.Z() << ")"; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netgen-6.2.2203/libsrc/occ/python_occ_shapes.cpp new/netgen-6.2.2204/libsrc/occ/python_occ_shapes.cpp --- old/netgen-6.2.2203/libsrc/occ/python_occ_shapes.cpp 2022-05-07 20:40:40.000000000 +0200 +++ new/netgen-6.2.2204/libsrc/occ/python_occ_shapes.cpp 2022-08-10 09:03:10.000000000 +0200 @@ -769,7 +769,7 @@ trafo.SetTranslation(v); BRepBuilderAPI_Transform builder(shape, trafo, true); PropagateProperties(builder, shape, occ2ng(trafo)); - return builder.Shape(); + return CastShape(builder.Shape()); // version 2: change location // ... }, py::arg("v"), "copy shape, and translate copy by vector 'v'") @@ -1177,15 +1177,18 @@ std::vector<double> p[3]; std::vector<double> n[3]; - py::list names, colors; + py::list names, colors, solid_names; + std::vector<std::vector<int>> solid_face_map; int index = 0; Box<3> box(Box<3>::EMPTY_BOX); + TopTools_IndexedMapOfShape fmap; for (TopExp_Explorer e(shape, TopAbs_FACE); e.More(); e.Next()) { TopoDS_Face face = TopoDS::Face(e.Current()); // Handle(TopoDS_Face) face = e.Current(); + fmap.Add(face); ExtractFaceData(face, index, p, n, box); auto & props = OCCGeometry::global_shape_properties[face.TShape()]; if(props.col) @@ -1204,6 +1207,19 @@ index++; } + for(auto& solid : GetSolids(shape)) + { + std::vector<int> faces; + for(auto& face : GetFaces(solid)) + faces.push_back(fmap.FindIndex(face)-1); + solid_face_map.push_back(move(faces)); + auto& props = OCCGeometry::global_shape_properties[solid.TShape()]; + if(props.name) + solid_names.append(*props.name); + else + solid_names.append(""); + } + std::vector<double> edge_p[2]; py::list edge_names, edge_colors; index = 0; @@ -1263,6 +1279,7 @@ data["autoscale"] = false; data["colors"] = colors; data["names"] = names; + data["solid_names"] = solid_names; py::list edges; edges.append(edge_p[0]); @@ -1270,6 +1287,7 @@ data["edges"] = edges; data["edge_names"] = edge_names; data["edge_colors"] = edge_colors; + data["solid_face_map"] = solid_face_map; return data; }) ; @@ -1544,6 +1562,7 @@ }; py::class_<ListOfShapes> (m, "ListOfShapes") + .def(py::init<vector<TopoDS_Shape>>()) .def("__iter__", [](ListOfShapes &s) { return py::make_iterator(ListOfShapesIterator(&*s.begin()), ListOfShapesIterator(&*s.end())); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netgen-6.2.2203/libsrc/stlgeom/meshstlsurface.cpp new/netgen-6.2.2204/libsrc/stlgeom/meshstlsurface.cpp --- old/netgen-6.2.2203/libsrc/stlgeom/meshstlsurface.cpp 2022-05-07 20:40:40.000000000 +0200 +++ new/netgen-6.2.2204/libsrc/stlgeom/meshstlsurface.cpp 2022-08-10 09:03:10.000000000 +0200 @@ -106,7 +106,7 @@ << ", trig2 = " << trig2 << ", trig2b = " << trig2b << endl; - if (trig1 <= 0 || trig2 <= 0 || trig1b <= 0 || trig2b <= 0) + if (trig1 <= 0 || trig2 < 0 || trig1b <= 0 || trig2b < 0) { cout << "negative trigs, " << ", trig1 = " << trig1 @@ -177,10 +177,13 @@ mesh.AddSegment (seg); + if(trig2 != 0) + { Segment seg2; seg2[0] = p2 + PointIndex::BASE-1;; seg2[1] = p1 + PointIndex::BASE-1;; seg2.si = geom.GetTriangle(trig2).GetFaceNum(); + seg2.edgenr = i; seg2.epgeominfo[0].edgenr = i; @@ -219,8 +222,8 @@ (*testout) << "Get GeomInfo PROBLEM" << endl; } */ - mesh.AddSegment (seg2); + } } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netgen-6.2.2203/libsrc/stlgeom/python_stl.cpp new/netgen-6.2.2204/libsrc/stlgeom/python_stl.cpp --- old/netgen-6.2.2203/libsrc/stlgeom/python_stl.cpp 2022-05-07 20:40:40.000000000 +0200 +++ new/netgen-6.2.2204/libsrc/stlgeom/python_stl.cpp 2022-08-10 09:03:10.000000000 +0200 @@ -9,7 +9,7 @@ using namespace netgen; namespace netgen { - //extern shared_ptr<Mesh> mesh; + extern shared_ptr<Mesh> mesh; extern shared_ptr<NetgenGeometry> ng_geometry; } @@ -125,11 +125,12 @@ { py::class_<STLGeometry,shared_ptr<STLGeometry>, NetgenGeometry> (m,"STLGeometry") .def(py::init<>()) - .def(py::init<>([](const string& filename) + .def(py::init<>([](const string& filename, bool surface) { ifstream ist(filename); - return shared_ptr<STLGeometry>(STLGeometry::Load(ist)); - }), py::arg("filename"), + return shared_ptr<STLGeometry>(STLGeometry::Load(ist, + surface)); + }), py::arg("filename"), py::arg("surface")=false, py::call_guard<py::gil_scoped_release>()) .def(NGSPickle<STLGeometry>()) .def("_visualizationData", [](shared_ptr<STLGeometry> stl_geo) @@ -203,7 +204,10 @@ SetGlobalMesh(mesh); auto result = STLMeshingDummy(geo.get(), mesh, mp, stlparam); if(result != 0) - throw Exception("Meshing failed!"); + { + netgen::mesh = mesh; + throw Exception("Meshing failed!"); + } return mesh; }, py::arg("mp") = nullptr, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netgen-6.2.2203/libsrc/stlgeom/stlgeom.cpp new/netgen-6.2.2204/libsrc/stlgeom/stlgeom.cpp --- old/netgen-6.2.2203/libsrc/stlgeom/stlgeom.cpp 2022-05-07 20:40:40.000000000 +0200 +++ new/netgen-6.2.2204/libsrc/stlgeom/stlgeom.cpp 2022-08-10 09:03:10.000000000 +0200 @@ -2578,7 +2578,7 @@ for (int i = 1; i <= GetNTE(); i++) { STLTopEdge & edge = GetTopEdge (i); - double cosang = + double cosang = edge.TrigNum(2) == 0 ? 1. : GetTriangle(edge.TrigNum(1)).Normal() * GetTriangle(edge.TrigNum(2)).Normal(); edge.SetCosAngle (cosang); @@ -2611,6 +2611,8 @@ for (int i = 1; i <= edgedata->Size(); i++) { STLTopEdge & sed = edgedata->Elem(i); + if(sed.TrigNum(2) == 0) + sed.SetStatus(ED_CONFIRMED); if (sed.GetStatus() == ED_CANDIDATE || sed.GetStatus() == ED_UNDEFINED) { @@ -3187,7 +3189,7 @@ ng1 = trig.GeomNormal(points); ng1 /= (ng1.Length() + 1e-24); - for (int j = 1; j <= 3; j++) + for (int j = 1; j <= NONeighbourTrigs(i); j++) { int nbt = NeighbourTrig (i, j); @@ -3261,7 +3263,7 @@ STLTrigId t = chart.GetChartTrig1(j); const STLTriangle& tt = GetTriangle(t); - for (int k = 1; k <= 3; k++) + for (int k = 1; k <= NONeighbourTrigs(t); k++) { STLTrigId nt = NeighbourTrig(t,k); if (GetChartNr(nt) != i && !TrigIsInOC(nt,i)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netgen-6.2.2203/libsrc/stlgeom/stlgeomchart.cpp new/netgen-6.2.2204/libsrc/stlgeom/stlgeomchart.cpp --- old/netgen-6.2.2203/libsrc/stlgeom/stlgeomchart.cpp 2022-05-07 20:40:40.000000000 +0200 +++ new/netgen-6.2.2204/libsrc/stlgeom/stlgeomchart.cpp 2022-08-10 09:03:10.000000000 +0200 @@ -238,7 +238,7 @@ */ //find overlapping charts exacter (fast, too): - for (int k = 1; k <= 3; k++) + for (int k = 1; k <= NONeighbourTrigs(nt); k++) { int nnt = NeighbourTrig(nt,k); if (GetMarker(nnt) != chartnum) @@ -387,7 +387,7 @@ // NgProfiler::StartTimer (timer4a); if (spiralcheckon && !isdirtytrig) - for (int k = 1; k <= 3; k++) + for (int k = 1; k <= NONeighbourTrigs(nt); k++) { // NgProfiler::StartTimer (timer4b); STLTrigId nnt = NeighbourTrig(nt,k); @@ -695,7 +695,7 @@ { STLTrigId t = chart.GetChartTrig1(j); const STLTriangle& tt = GetTriangle(t); - for (int k = 1; k <= 3; k++) + for (int k = 1; k <= NONeighbourTrigs(t); k++) { STLTrigId nt = NeighbourTrig(t,k); if (GetChartNr(nt) != chartnum) @@ -756,7 +756,7 @@ STLTrigId t = chart.GetChartTrig1(j); const STLTriangle& tt = GetTriangle(t); - for (int k = 1; k <= 3; k++) + for (int k = 1; k <= NONeighbourTrigs(t); k++) { STLTrigId nt = NeighbourTrig(t,k); if (GetChartNr(nt) != chartnum && outercharttrigs[nt] != chartnum) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netgen-6.2.2203/libsrc/stlgeom/stlgeommesh.cpp new/netgen-6.2.2204/libsrc/stlgeom/stlgeommesh.cpp --- old/netgen-6.2.2203/libsrc/stlgeom/stlgeommesh.cpp 2022-05-07 20:40:40.000000000 +0200 +++ new/netgen-6.2.2204/libsrc/stlgeom/stlgeommesh.cpp 2022-08-10 09:03:10.000000000 +0200 @@ -1169,7 +1169,7 @@ { int t = chart.GetChartTrig1(j); tt = GetTriangle(t); - for (int k = 1; k <= 3; k++) + for (int k = 1; k <= NONeighbourTrigs(t); k++) { int nt = NeighbourTrig(t,k); if (GetChartNr(nt) != chartnum) @@ -1495,6 +1495,9 @@ if (multithread.terminate) return 0; + if(stlgeometry->IsSurfaceSTL()) + return 0; + if (mparam.perfstepsstart <= MESHCONST_MESHVOLUME && mparam.perfstepsend >= MESHCONST_MESHVOLUME) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netgen-6.2.2203/libsrc/stlgeom/stltopology.cpp new/netgen-6.2.2204/libsrc/stlgeom/stltopology.cpp --- old/netgen-6.2.2203/libsrc/stlgeom/stltopology.cpp 2022-05-07 20:40:40.000000000 +0200 +++ new/netgen-6.2.2204/libsrc/stlgeom/stltopology.cpp 2022-08-10 09:03:10.000000000 +0200 @@ -338,7 +338,7 @@ } -STLGeometry * STLTopology ::Load (istream & ist) +STLGeometry * STLTopology ::Load (istream & ist, bool surface) { // Check if the file starts with "solid". If not, the file is binary { @@ -457,6 +457,7 @@ PrintWarning("File has normal vectors which differ extremely from geometry->correct with stldoctor!!!"); } + geom->surface = surface; geom->InitSTLGeometry(readtrigs); return geom; } @@ -650,6 +651,7 @@ } } + if(!surface) for (int i = 1; i <= ne; i++) { const STLTopEdge & edge = GetTopEdge (i); @@ -668,9 +670,12 @@ const STLTriangle & t = GetTriangle (i); for (int j = 1; j <= 3; j++) { - const STLTriangle & nbt = GetTriangle (t.NBTrigNum(j)); - if (!t.IsNeighbourFrom (nbt)) - orientation_ok = 0; + if(t.NBTrigNum(j) != 0) + { + const STLTriangle & nbt = GetTriangle (t.NBTrigNum(j)); + if (!t.IsNeighbourFrom (nbt)) + orientation_ok = 0; + } } } } @@ -801,7 +806,8 @@ neighbourtrigs.SetSize(GetNT()); for (int i = 1; i <= GetNT(); i++) for (int k = 1; k <= 3; k++) - AddNeighbourTrig (i, GetTriangle(i).NBTrigNum(k)); + if(GetTriangle(i).NBTrigNum(k) != 0) + AddNeighbourTrig (i, GetTriangle(i).NBTrigNum(k)); } else { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netgen-6.2.2203/libsrc/stlgeom/stltopology.hpp new/netgen-6.2.2204/libsrc/stlgeom/stltopology.hpp --- old/netgen-6.2.2203/libsrc/stlgeom/stltopology.hpp 2022-05-07 20:40:40.000000000 +0200 +++ new/netgen-6.2.2204/libsrc/stlgeom/stltopology.hpp 2022-08-10 09:03:10.000000000 +0200 @@ -120,7 +120,12 @@ STLTriangle (const STLPointId * apts); - STLTriangle () {pts[0]=0;pts[1]=0;pts[2]=0;} + STLTriangle () + { + pts[0]=0;pts[1]=0;pts[2]=0; + nbtrigs[0][0] = nbtrigs[0][1] = nbtrigs[0][2] = 0.; + nbtrigs[1][0] = nbtrigs[1][1] = nbtrigs[1][2] = 0.; + } void DoArchive(Archive& ar) { @@ -282,6 +287,7 @@ Array<STLTriangle, STLTrigId> trias; NgArray<STLTopEdge> topedges; Array<Point<3>, STLPointId> points; + bool surface = false; // mapping of sorted pair of points to topedge INDEX_2_HASHTABLE<int> * ht_topedges; @@ -313,13 +319,15 @@ virtual ~STLTopology(); static STLGeometry * LoadNaomi (istream & ist); - static STLGeometry * Load (istream & ist); + static STLGeometry * Load (istream & ist, bool surface=false); static STLGeometry * LoadBinary (istream & ist); void Save (const filesystem::path & filename) const; void SaveBinary (const filesystem::path & filename, const char* aname) const; void SaveSTLE (const filesystem::path & filename) const; // stores trigs and edges + bool IsSurfaceSTL() const { return surface; } + virtual void DoArchive(Archive& ar) { ar & trias & points & boundingbox & pointtol; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netgen-6.2.2203/libsrc/visualization/vsfieldlines.cpp new/netgen-6.2.2204/libsrc/visualization/vsfieldlines.cpp --- old/netgen-6.2.2203/libsrc/visualization/vsfieldlines.cpp 2022-05-07 20:40:40.000000000 +0200 +++ new/netgen-6.2.2204/libsrc/visualization/vsfieldlines.cpp 2022-08-10 09:03:10.000000000 +0200 @@ -260,7 +260,7 @@ double phaser=1.0; double phasei=0.0; - std::function eval_func = [&](int elnr, const double * lami, Vec<3> & vec) + std::function<bool(int, const double *, Vec<3> &)> eval_func = [&](int elnr, const double * lami, Vec<3> & vec) { double values[6] = {0., 0., 0., 0., 0., 0.}; bool drawelem; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netgen-6.2.2203/libsrc/visualization/vssolution.cpp new/netgen-6.2.2204/libsrc/visualization/vssolution.cpp --- old/netgen-6.2.2203/libsrc/visualization/vssolution.cpp 2022-05-07 20:40:40.000000000 +0200 +++ new/netgen-6.2.2204/libsrc/visualization/vssolution.cpp 2022-08-10 09:03:10.000000000 +0200 @@ -795,12 +795,24 @@ static double oldrad = 0; mesh->GetBox (pmin, pmax, -1); - center = Center (pmin, pmax); + if(vispar.use_center_coords && zoomall == 2) + { + center.X() = vispar.centerx; + center.Y() = vispar.centery; + center.Z() = vispar.centerz; + } + else if(selpoint >= 1 && zoomall == 2) + center = mesh->Point(selpoint); + else if(vispar.centerpoint >= 1 && zoomall == 2) + center = mesh->Point(vispar.centerpoint); + else + center = Center (pmin, pmax); rad = 0.5 * Dist (pmin, pmax); + if(rad == 0) rad = 1e-6; glEnable (GL_NORMALIZE); - if (rad > 1.5 * oldrad || + if (rad > 1.2 * oldrad || mesh->GetMajorTimeStamp() > surfeltimestamp || zoomall) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netgen-6.2.2203/ng/occgeom.tcl new/netgen-6.2.2204/ng/occgeom.tcl --- old/netgen-6.2.2203/ng/occgeom.tcl 2022-05-07 20:40:40.000000000 +0200 +++ new/netgen-6.2.2204/ng/occgeom.tcl 2022-08-10 09:03:10.000000000 +0200 @@ -101,7 +101,7 @@ set nrfaces [expr [llength $faces]] if {$nrfaces >= 2} { #$hlist add ErrorFaces -itemtype text -text "Faces with surface meshing error" - $w.tree insert {} -id ErrorFaces -text "Faces with surface meshing error" + $w.tree insert {} end -id "ErrorFaces" -text "Faces with surface meshing error" #$w.mtre open ErrorFaces $w.tree item ErrorFaces -open true set i [expr 0] @@ -109,12 +109,12 @@ set entity [lindex $faces [expr $i]] set myroot [string range $entity 0 [string last / $entity]-1] if { [string length $myroot] == 0 } { - set myroot ErrorFaces - } + set myroot "ErrorFaces" + } incr i 1 set entityname [lindex $faces [expr $i]] #$hlist add ErrorFaces/$entity -text $entityname -data $entityname - $w.tree insert {myroot} end -id $entity -text $entityname -value 0 + $w.tree insert $myroot end -id $entity -text $entityname -value 0 incr i 1 } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netgen-6.2.2203/ng/onetcl.cpp new/netgen-6.2.2204/ng/onetcl.cpp --- old/netgen-6.2.2203/ng/onetcl.cpp 2022-05-07 20:40:40.000000000 +0200 +++ new/netgen-6.2.2204/ng/onetcl.cpp 2022-08-10 09:03:10.000000000 +0200 @@ -3992,18 +3992,18 @@ ,"set faces [Ng_OCCCommand getunmeshedfaceinfo]\n" ,"set nrfaces [expr [llength $faces]]\n" ,"if {$nrfaces >= 2} {\n" -,"$w.tree insert {} -id ErrorFaces -text \"Faces with surface meshing error\"\n" +,"$w.tree insert {} end -id \"ErrorFaces\" -text \"Faces with surface meshing error\"\n" ,"$w.tree item ErrorFaces -open true\n" ,"set i [expr 0]\n" ,"while {$i < $nrfaces} {\n" ,"set entity [lindex $faces [expr $i]]\n" ,"set myroot [string range $entity 0 [string last / $entity]-1]\n" ,"if { [string length $myroot] == 0 } {\n" -,"set myroot ErrorFaces\n" +,"set myroot \"ErrorFaces\"\n" ,"}\n" ,"incr i 1\n" ,"set entityname [lindex $faces [expr $i]]\n" -,"$w.tree insert {myroot} end -id $entity -text $entityname -value 0\n" +,"$w.tree insert $myroot end -id $entity -text $entityname -value 0\n" ,"incr i 1\n" ,"}\n" ,"}\n" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netgen-6.2.2203/python/__init__.py new/netgen-6.2.2204/python/__init__.py --- old/netgen-6.2.2203/python/__init__.py 2022-05-07 20:40:40.000000000 +0200 +++ new/netgen-6.2.2204/python/__init__.py 2022-08-10 09:03:10.000000000 +0200 @@ -6,7 +6,8 @@ _netgen_lib_dir=os.path.realpath(os.path.join(os.path.dirname(__file__),'..',config.NETGEN_PYTHON_RPATH)) if sys.platform.startswith('win'): - if sys.version >= '3.8': + v = sys.version_info + if v.major == 3 and v.minor >= 8: os.add_dll_directory(_netgen_bin_dir) else: os.environ['PATH'] += ';'+_netgen_bin_dir diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netgen-6.2.2203/python/gui.py new/netgen-6.2.2204/python/gui.py --- old/netgen-6.2.2203/python/gui.py 2022-05-07 20:40:40.000000000 +0200 +++ new/netgen-6.2.2204/python/gui.py 2022-08-10 09:03:10.000000000 +0200 @@ -30,6 +30,13 @@ win.tk.eval( netgen.libngpy._meshing._ngscript) + try: + from IPython import get_ipython + ipython = get_ipython() + ipython.magic('gui tk') + except: + pass + def _Redraw(*args, **kwargs): if libngpy._meshing._Redraw(*args, **kwargs): import netgen diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netgen-6.2.2203/rules/pyramidrules2.rls new/netgen-6.2.2204/rules/pyramidrules2.rls --- old/netgen-6.2.2203/rules/pyramidrules2.rls 2022-05-07 20:40:40.000000000 +0200 +++ new/netgen-6.2.2204/rules/pyramidrules2.rls 2022-08-10 09:03:10.000000000 +0200 @@ -163,6 +163,69 @@ endrule +rule "pyramid with one trig, left" + +quality 20 + +mappoints +(0, 0, 0); +(1, 0, 0); +(1, 1, 0); +(0, 1, 0); +(0.5, 0.5, -0.5); + +mapfaces +(1, 2, 3, 4) del; +(3, 2, 5) del; + +newpoints + +newfaces +(1, 2, 5); +(3, 4, 5); +(4, 1, 5); + +elements +(1, 2, 3, 4, 5); + +freezone2 +{ 1 P1 }; +{ 1 P2 }; +{ 1 P3 }; +{ 1 P4 }; +{ 1 P5 }; +{ 0.34 P1, 0.34 P2, 0.34 P5, -0.01 P3 }; +{ 0.34 P3, 0.34 P4, 0.34 P5, -0.02 P1 }; +{ 0.34 P1, 0.34 P4, 0.34 P5, -0.02 P2 }; + +freezonelimit +{ 1 P1 }; +{ 1 P2 }; +{ 1 P3 }; +{ 1 P4 }; +{ 1 P5 }; +{ 0.333 P1, 0.333 P2, 0.334 P5, 0 P3 }; +{ 0.333 P3, 0.333 P4, 0.334 P5, 0 P1 }; +{ 0.333 P1, 0.333 P4, 0.334 P5, 0 P2 }; + +orientations +(1, 2, 3, 5); +(1, 3, 4, 5); + + +freeset +1 2 3 5; +freeset +1 3 4 5; +freeset +1 2 5 6; +freeset +3 4 5 7; +freeset +1 4 5 8; +endrule + + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netgen-6.2.2203/tests/build_pip.sh new/netgen-6.2.2204/tests/build_pip.sh --- old/netgen-6.2.2203/tests/build_pip.sh 2022-05-07 20:40:40.000000000 +0200 +++ new/netgen-6.2.2204/tests/build_pip.sh 2022-08-10 09:03:10.000000000 +0200 @@ -14,12 +14,12 @@ $PYDIR/pip install -U pytest-check numpy wheel scikit-build rm -rf _skbuild - $PYDIR/pip wheel --use-feature=in-tree-build . + $PYDIR/pip wheel . auditwheel repair netgen_mesher*-cp${pyversion}-*.whl rm netgen_mesher-*.whl rm -rf _skbuild - NETGEN_ARCH=avx2 $PYDIR/pip wheel --use-feature=in-tree-build . + NETGEN_ARCH=avx2 $PYDIR/pip wheel . auditwheel repair netgen_mesher_avx2*-cp${pyversion}-*.whl rm netgen_mesher_avx2-*.whl diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netgen-6.2.2203/tests/pytest/test_boundarylayer.py new/netgen-6.2.2204/tests/pytest/test_boundarylayer.py --- old/netgen-6.2.2203/tests/pytest/test_boundarylayer.py 2022-05-07 20:40:40.000000000 +0200 +++ new/netgen-6.2.2204/tests/pytest/test_boundarylayer.py 2022-08-10 09:03:10.000000000 +0200 @@ -124,8 +124,9 @@ assert ngs.Integrate(1, mesh.Materials("layer")) == pytest.approx(0.0016) assert ngs.Integrate(1, mesh.Materials("air")) == pytest.approx(0.9664 if outside else 0.968) +# not working yet @pytest.mark.parametrize("outside", [True, False]) -def test_with_inner_corner(outside, capfd): +def _test_with_inner_corner(outside, capfd): geo = CSGeometry() core_thickness = 0.1
participants (1)
-
Source-Sync