diff --git a/libsrc/core/archive.hpp b/libsrc/core/archive.hpp index 6db37a07..d7546060 100644 --- a/libsrc/core/archive.hpp +++ b/libsrc/core/archive.hpp @@ -57,6 +57,17 @@ namespace ngcore }; + + + template + class has_shallow_archive : public std::false_type {}; + + template + class has_shallow_archive> + : public std::is_same {}; + + + #ifdef NETGEN_PYTHON pybind11::object CastAnyToPy(const std::any& a); #endif // NETGEN_PYTHON @@ -501,7 +512,7 @@ namespace ngcore template Archive& operator & (std::shared_ptr& ptr) { - if constexpr(has_shared_from_this2::value) + if constexpr(has_shallow_archive::value) if (shallow_to_python) { Shallow (ptr); diff --git a/libsrc/meshing/hprefinement.cpp b/libsrc/meshing/hprefinement.cpp index bb250aee..2c59be5d 100644 --- a/libsrc/meshing/hprefinement.cpp +++ b/libsrc/meshing/hprefinement.cpp @@ -678,7 +678,7 @@ namespace netgen // prepare new points - fac1 = max(0.001,min(0.33,fac1)); + // fac1 = max(0.001,min(0.33,fac1)); PrintMessage(3, " in HP-REFINEMENT with fac1 ", fac1); *testout << " in HP-REFINEMENT with fac1 " << fac1 << endl; diff --git a/libsrc/occ/occ_edge.cpp b/libsrc/occ/occ_edge.cpp index 0c907d78..4805bb17 100644 --- a/libsrc/occ/occ_edge.cpp +++ b/libsrc/occ/occ_edge.cpp @@ -61,7 +61,12 @@ namespace netgen void OCCEdge::ProjectPoint(Point<3>& p, EdgePointGeomInfo* gi) const { auto pnt = ng2occ(p); - GeomAPI_ProjectPointOnCurve proj(pnt, curve, s0, s1); + // extend the projection parameter range, else projection might fail + // for an endpoint + // see discussion here: https://forum.ngsolve.org/t/how-to-apply-occidentification-correctly/2555 + // I do not see a better way using occ tolerances? + double eps = 1e-7 * (s1-s0); + GeomAPI_ProjectPointOnCurve proj(pnt, curve, s0-eps, s1+eps); pnt = proj.NearestPoint(); if(gi) gi->dist = (proj.LowerDistanceParameter() - s0)/(s1-s0);