From 4a1d3cdcb2002b93de58a1c0689aa9cd488ba754 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 27 Oct 2020 07:57:17 +0100 Subject: [PATCH 1/2] save/load mesh bbbnd --- libsrc/meshing/meshclass.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/libsrc/meshing/meshclass.cpp b/libsrc/meshing/meshclass.cpp index 401cd20f..572547b9 100644 --- a/libsrc/meshing/meshclass.cpp +++ b/libsrc/meshing/meshclass.cpp @@ -677,6 +677,18 @@ namespace netgen outfile << endl << endl; } + int cntcd3names = 0; + for (int ii = 0; ii> n; + NgArray cd3nrs(n); + SetNCD3Names(n); + for( i=1; i<=n; i++) + { + string nextcd3name; + infile >> cd3nrs[i-1] >> nextcd3name; + cd3names[cd3nrs[i-1]-1] = new string(nextcd3name); + } + if (GetDimension() < 3) + { + throw NgException("co dim 3 elements not implemented for dimension < 3"); + } + } + if (strcmp (str, "singular_points") == 0) { infile >> n; From 10c0fd350a5b6f3e570c3f7e0b7ee72a411ddaca Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 30 Oct 2020 15:28:00 +0100 Subject: [PATCH 2/2] save/load pointelements --- libsrc/meshing/meshclass.cpp | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/libsrc/meshing/meshclass.cpp b/libsrc/meshing/meshclass.cpp index 572547b9..85b37419 100644 --- a/libsrc/meshing/meshclass.cpp +++ b/libsrc/meshing/meshclass.cpp @@ -602,7 +602,20 @@ namespace netgen outfile << (*this)[pi](1)/scale << " "; outfile.width(22); outfile << (*this)[pi](2)/scale << "\n"; - } + } + + outfile << "\n" << "\n"; + outfile << "# pnum index" << "\n"; + outfile << "pointelements" << "\n"; + outfile << pointelements.Size() << "\n"; + + for (i = 0; i < pointelements.Size(); i++) + { + outfile.width(8); + outfile << pointelements[i].pnum << " "; + outfile.width(8); + outfile << pointelements[i].index << "\n"; + } if (ident -> GetMaxNr() > 0) { @@ -1083,6 +1096,19 @@ namespace netgen PrintMessage (3, n, " points done"); } + if (strcmp (str, "pointelements") == 0) + { + infile >> n; + PrintMessage (3, n, " pointelements"); + for (i = 1; i <= n; i++) + { + Element0d el; + infile >> el.pnum >> el.index; + pointelements.Append (el); + } + PrintMessage (3, n, " pointelements done"); + } + if (strcmp (str, "identifications") == 0) { infile >> n;