diff --git a/libsrc/meshing/basegeom.cpp b/libsrc/meshing/basegeom.cpp index de2cd864..6ece1891 100644 --- a/libsrc/meshing/basegeom.cpp +++ b/libsrc/meshing/basegeom.cpp @@ -559,12 +559,13 @@ namespace netgen auto & identifications = mesh.GetIdentifications(); - std::map vert2meshpt; + Array vert2meshpt(vertices.Size()); + vert2meshpt = PointIndex::INVALID; for(auto & vert : vertices) { auto pi = mesh.AddPoint(vert->GetPoint(), vert->properties.layer); tree.Insert(mesh[pi], pi); - vert2meshpt[vert->GetHash()] = pi; + vert2meshpt[vert->nr] = pi; mesh[pi].Singularity(vert->properties.hpref); mesh[pi].SetType(FIXEDPOINT); @@ -576,8 +577,8 @@ namespace netgen for(auto & vert : vertices) for(auto & ident : vert->identifications) - identifications.Add(vert2meshpt[ident.from->GetHash()], - vert2meshpt[ident.to->GetHash()], + identifications.Add(vert2meshpt[ident.from->nr], + vert2meshpt[ident.to->nr], ident.name, ident.type); @@ -591,8 +592,8 @@ namespace netgen auto edge = edges[edgenr].get(); PointIndex startp, endp; // throws if points are not found - startp = vert2meshpt.at(edge->GetStartVertex().GetHash()); - endp = vert2meshpt.at(edge->GetEndVertex().GetHash()); + startp = vert2meshpt[edge->GetStartVertex().nr]; + endp = vert2meshpt[edge->GetEndVertex().nr]; // ignore collapsed edges if(startp == endp && edge->GetLength() < 1e-10 * bounding_box.Diam()) diff --git a/libsrc/meshing/basegeom.hpp b/libsrc/meshing/basegeom.hpp index 67badd6e..765eb884 100644 --- a/libsrc/meshing/basegeom.hpp +++ b/libsrc/meshing/basegeom.hpp @@ -68,7 +68,6 @@ namespace netgen Transformation<3> primary_to_me; virtual ~GeometryShape() {} - virtual size_t GetHash() const = 0; virtual bool IsMappedShape( const GeometryShape & other, const Transformation<3> & trafo, double tolerance ) const; }; @@ -320,13 +319,6 @@ namespace netgen throw Exception("Base geometry get tangent called"); } - virtual size_t GetEdgeIndex(const GeometryEdge& edge) const - { - for(auto i : Range(edges)) - if(edge.GetHash() == edges[i]->GetHash()) - return i; - throw Exception("Couldn't find edge index"); - } virtual void Save (const filesystem::path & filename) const; virtual void SaveToMeshFile (ostream & /* ost */) const { ; } }; diff --git a/libsrc/occ/occ_edge.cpp b/libsrc/occ/occ_edge.cpp index 4805bb17..d0149399 100644 --- a/libsrc/occ/occ_edge.cpp +++ b/libsrc/occ/occ_edge.cpp @@ -53,11 +53,6 @@ namespace netgen throw Exception(ToString("not implemented") + __FILE__ + ":" + ToString(__LINE__)); } - size_t OCCEdge::GetHash() const - { - return edge.HashCode(std::numeric_limits::max()); - } - void OCCEdge::ProjectPoint(Point<3>& p, EdgePointGeomInfo* gi) const { auto pnt = ng2occ(p); diff --git a/libsrc/occ/occ_edge.hpp b/libsrc/occ/occ_edge.hpp index 52629f84..d96b7d8f 100644 --- a/libsrc/occ/occ_edge.hpp +++ b/libsrc/occ/occ_edge.hpp @@ -36,7 +36,6 @@ namespace netgen Point<3> GetCenter() const override; Point<3> GetPoint(double t) const override; double CalcStep(double t, double sag) const override; - size_t GetHash() const override; void ProjectPoint(Point<3>& p, EdgePointGeomInfo* gi) const override; Vec<3> GetTangent(double t) const override; bool IsDegenerated(double) const override { diff --git a/libsrc/occ/occ_face.cpp b/libsrc/occ/occ_face.cpp index 239982aa..23fb17da 100644 --- a/libsrc/occ/occ_face.cpp +++ b/libsrc/occ/occ_face.cpp @@ -30,11 +30,6 @@ namespace netgen return 0; } - size_t OCCFace::GetHash() const - { - return face.HashCode(std::numeric_limits::max()); - } - Point<3> OCCFace::GetCenter() const { return occ2ng( props.CentreOfMass() ); diff --git a/libsrc/occ/occ_face.hpp b/libsrc/occ/occ_face.hpp index 7ecefbe4..0d3a75a8 100644 --- a/libsrc/occ/occ_face.hpp +++ b/libsrc/occ/occ_face.hpp @@ -31,7 +31,6 @@ namespace netgen const TopoDS_Face Shape() const { return face; } - size_t GetHash() const override; Point<3> GetCenter() const override; virtual size_t GetNBoundaries() const override; virtual Array GetBoundary(const Mesh& mesh) const override; diff --git a/libsrc/occ/occ_solid.hpp b/libsrc/occ/occ_solid.hpp index d598de4a..1ce2d50c 100644 --- a/libsrc/occ/occ_solid.hpp +++ b/libsrc/occ/occ_solid.hpp @@ -16,8 +16,6 @@ namespace netgen OCCSolid(TopoDS_Shape dshape) : solid(TopoDS::Solid(dshape)) { } - - size_t GetHash() const override { return solid.HashCode(std::numeric_limits::max()); } }; } diff --git a/libsrc/occ/occ_vertex.cpp b/libsrc/occ/occ_vertex.cpp index 6e83c894..f6ba788b 100644 --- a/libsrc/occ/occ_vertex.cpp +++ b/libsrc/occ/occ_vertex.cpp @@ -16,9 +16,4 @@ namespace netgen { return p; } - - size_t OCCVertex::GetHash() const - { - return vertex.HashCode(std::numeric_limits::max()); - } } diff --git a/libsrc/occ/occ_vertex.hpp b/libsrc/occ/occ_vertex.hpp index 63d9d181..bfd1479d 100644 --- a/libsrc/occ/occ_vertex.hpp +++ b/libsrc/occ/occ_vertex.hpp @@ -24,7 +24,6 @@ namespace netgen OCCVertex( TopoDS_Shape s ); ~OCCVertex() {} Point<3> GetPoint() const override; - size_t GetHash() const override; }; } diff --git a/libsrc/occ/occgeom.cpp b/libsrc/occ/occgeom.cpp index 624db95a..9d71fa77 100644 --- a/libsrc/occ/occgeom.cpp +++ b/libsrc/occ/occgeom.cpp @@ -1710,13 +1710,6 @@ namespace netgen BRepTools::Read(shape, ss, builder); } - /* - // enumerate shapes and archive only integers - auto my_hash = [](const TopoDS_Shape & key) { - auto occ_hash = key.HashCode(1<<31UL); - return std::hash()(occ_hash); - }; - */ TopTools_IndexedMapOfShape shape_map; Array shape_list;