From e926071bb2f24de87858394a119ddeb6a59a6534 Mon Sep 17 00:00:00 2001 From: Joachim Schoeberl Date: Wed, 1 Jan 2025 16:42:11 +0100 Subject: [PATCH] archiving ngscore::CloseHashTable --- libsrc/core/hashtable.hpp | 6 ++++++ libsrc/meshing/meshtype.cpp | 5 ++--- libsrc/meshing/meshtype.hpp | 10 ++++++++++ libsrc/meshing/secondorder.cpp | 1 - 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/libsrc/core/hashtable.hpp b/libsrc/core/hashtable.hpp index af27155c..555838a0 100644 --- a/libsrc/core/hashtable.hpp +++ b/libsrc/core/hashtable.hpp @@ -834,6 +834,12 @@ namespace ngcore hash = T_HASH(invalid); used = 0; } + + void DoArchive (Archive & ar) + { + ar & hash & cont; + ar & size & mask & used; + } class Iterator { diff --git a/libsrc/meshing/meshtype.cpp b/libsrc/meshing/meshtype.cpp index 2e954f54..839c2bdb 100644 --- a/libsrc/meshing/meshtype.cpp +++ b/libsrc/meshing/meshtype.cpp @@ -2708,10 +2708,9 @@ namespace netgen void Identifications :: DoArchive (Archive & ar) { ar & maxidentnr; - // ar & identifiedpoints & identifiedpoints_nr; -#pragma message( "Archive CloseHadhTable missing " __FILE__ ) - + ar & identifiedpoints & identifiedpoints_nr; ar & idpoints_table; + if (ar.Output()) { size_t s = type.Size(); diff --git a/libsrc/meshing/meshtype.hpp b/libsrc/meshing/meshtype.hpp index 4f988b81..6f70248f 100644 --- a/libsrc/meshing/meshtype.hpp +++ b/libsrc/meshing/meshtype.hpp @@ -292,6 +292,9 @@ namespace netgen constexpr PointIndex operator[] (int i) const { return PointIndex(INDEX_2::operator[](i)); } PointIndex & operator[] (int i) { return reinterpret_cast(INDEX_2::operator[](i)); } + template + void DoArchive(ARCHIVE& ar) { ar.Do(&I1(), 2); } + PointIndex & I1 () { return (*this)[0]; } PointIndex & I2 () { return (*this)[1]; } PointIndex I1 () const { return (*this)[0]; } @@ -314,6 +317,10 @@ namespace netgen constexpr PointIndices (PointIndex i1, PointIndex i2, PointIndex i3) : INDEX_3(i1,i2,i3) { ; } PointIndex operator[] (int i) const { return PointIndex(INDEX_3::operator[](i)); } PointIndex & operator[] (int i) { return reinterpret_cast(INDEX_3::operator[](i)); } + + template + void DoArchive(ARCHIVE& ar) { ar.Do(&I1(), 3); } + PointIndex & I1 () { return (*this)[0]; } PointIndex & I2 () { return (*this)[1]; } PointIndex & I3 () { return (*this)[2]; } @@ -336,6 +343,9 @@ namespace netgen PointIndex operator[] (int i) const { return PointIndex(INDEX_4::operator[](i)); } PointIndex & operator[] (int i) { return reinterpret_cast(INDEX_4::operator[](i)); } + template + void DoArchive(ARCHIVE& ar) { ar.Do(&I1(), 4); } + PointIndex & I1 () { return (*this)[0]; } PointIndex & I2 () { return (*this)[1]; } PointIndex & I3 () { return (*this)[2]; } diff --git a/libsrc/meshing/secondorder.cpp b/libsrc/meshing/secondorder.cpp index a29c1271..611a61f3 100644 --- a/libsrc/meshing/secondorder.cpp +++ b/libsrc/meshing/secondorder.cpp @@ -424,7 +424,6 @@ namespace netgen { PrintMessage (3, "Validate mesh"); int np = mesh.GetNP(); - int ne = mesh.GetNE(); // int i, j; NgArray parents(np);