diff --git a/libsrc/geom2d/CMakeLists.txt b/libsrc/geom2d/CMakeLists.txt index 299157af..754c79fb 100644 --- a/libsrc/geom2d/CMakeLists.txt +++ b/libsrc/geom2d/CMakeLists.txt @@ -19,6 +19,6 @@ endif(USE_GUI) install(FILES geom2dmesh.hpp geometry2d.hpp spline2d.hpp - splinegeometry2.hpp vsgeom2d.hpp + vsgeom2d.hpp DESTINATION ${NG_INSTALL_DIR_INCLUDE}/geom2d COMPONENT netgen_devel ) diff --git a/libsrc/geom2d/splinegeometry2.hpp b/libsrc/geom2d/splinegeometry2.hpp deleted file mode 100644 index 2e63d042..00000000 --- a/libsrc/geom2d/splinegeometry2.hpp +++ /dev/null @@ -1,103 +0,0 @@ - - -OLD IMPLEMENTATION, NOT USED ANYMORE! - - - - -#ifndef FILE_SPLINEGEOMETRY2 -#define FILE_SPLINEGEOMETRY2 - -/**************************************************************************/ -/* File: splinegeometry2.hpp */ -/* Author: Joachim Schoeberl */ -/* Date: 24. Jul. 96 */ -/**************************************************************************/ - -#include "splinegeometry.hpp" - -#ifdef OLDSPLINEGEOMETRY - - -/// -extern void LoadBoundarySplines (const char * filename, - Array & geompoints, - Array & splines, - double & elto0); -/// -extern void PartitionBoundary (const Array & splines, - double h, double elto0, - Mesh & mesh2d); - - -class CSGScanner; - -class SplineGeometry2d -{ - Array geompoints; - Array splines; - double elto0; - - -private: - void AppendSegment(SplineSegment * spline, const int leftdomain, const int rightdomain, - const int bc, - const double reffac, const bool hprefleft, const bool hprefright, - const int copyfrom); - -public: - ~SplineGeometry2d(); - - void Load (const char * filename); - void CSGLoad (CSGScanner & scan); - void PartitionBoundary (double h, Mesh & mesh2d); - - void CopyEdgeMesh (int from, int to, Mesh & mesh2d, Point3dTree & searchtree); - - const Array & GetSplines () const - { return splines; } - - int GetNSplines (void) const { return splines.Size(); } - string GetSplineType (const int i) const { return splines[i]->GetType(); } - SplineSegment & GetSpline (const int i) {return *splines[i];} - const SplineSegment & GetSpline (const int i) const {return *splines[i];} - - void GetBoundingBox (Box<2> & box) const; - - int GetNP () const { return geompoints.Size(); } - const GeomPoint2d & GetPoint(int i) const { return geompoints[i]; } - - void SetGrading (const double grading); - void AppendPoint (const double x, const double y, const double reffac = 1., const bool hpref = false); - - void AppendLineSegment (const int n1, const int n2, - const int leftdomain, const int rightdomain, const int bc = -1, - const double reffac = 1., - const bool hprefleft = false, const bool hprefright = false, - const int copyfrom = -1); - void AppendSplineSegment (const int n1, const int n2, const int n3, - const int leftdomain, const int rightdomain, const int bc = -1, - const double reffac = 1., - const bool hprefleft = false, const bool hprefright = false, - const int copyfrom = -1); - void AppendCircleSegment (const int n1, const int n2, const int n3, - const int leftdomain, const int rightdomain, const int bc = -1, - const double reffac = 1., - const bool hprefleft = false, const bool hprefright = false, - const int copyfrom = -1); - void AppendDiscretePointsSegment (const Array< Point<2> > & points, - const int leftdomain, const int rightdomain, const int bc = -1, - const double reffac = 1., - const bool hprefleft = false, const bool hprefright = false, - const int copyfrom = -1); - -}; - - -void MeshFromSpline2D (SplineGeometry2d & geometry, - shared_ptr & mesh, - MeshingParameters & mp); - -#endif - -#endif diff --git a/libsrc/meshing/basegeom.cpp b/libsrc/meshing/basegeom.cpp index 94558633..1de6af28 100644 --- a/libsrc/meshing/basegeom.cpp +++ b/libsrc/meshing/basegeom.cpp @@ -10,6 +10,17 @@ namespace netgen GeometryRegister :: ~GeometryRegister() { ; } + + shared_ptr GeometryRegisterArray :: LoadFromMeshFile (istream & ist) const + { + for (int i = 0; i < Size(); i++) + { + NetgenGeometry * hgeom = (*this)[i]->LoadFromMeshFile (ist); + if (hgeom) + return shared_ptr(hgeom); + } + return nullptr; + } diff --git a/libsrc/meshing/basegeom.hpp b/libsrc/meshing/basegeom.hpp index eaf12c70..0637e915 100644 --- a/libsrc/meshing/basegeom.hpp +++ b/libsrc/meshing/basegeom.hpp @@ -49,6 +49,8 @@ namespace netgen for (int i = 0; i < Size(); i++) delete (*this)[i]; } + + virtual shared_ptr LoadFromMeshFile (istream & ist) const; }; // extern DLL_HEADER Array geometryregister; diff --git a/libsrc/meshing/meshclass.cpp b/libsrc/meshing/meshclass.cpp index d9a62de8..a89a6ff3 100644 --- a/libsrc/meshing/meshclass.cpp +++ b/libsrc/meshing/meshclass.cpp @@ -1314,6 +1314,23 @@ namespace netgen archive & materials & bcnames & cd2names; archive & *ident; + + + // archive geometry + if (archive.Output()) + { + ostringstream ost; + if (geometry) + geometry -> SaveToMeshFile (ost); + archive << ost.str(); + } + else + { + string str; + archive & str; + istringstream ist(str); + geometry = geometryregister.LoadFromMeshFile (ist); + } if (archive.Input()) { diff --git a/libsrc/meshing/meshtype.cpp b/libsrc/meshing/meshtype.cpp index 6aa708ea..cdfa7c7c 100644 --- a/libsrc/meshing/meshtype.cpp +++ b/libsrc/meshing/meshtype.cpp @@ -154,7 +154,8 @@ namespace netgen & edgenr & singedge_left & singedge_right & si & cd2i & domin & domout & tlosurf & surfnr1 & surfnr2 - & bcname; + & bcname + & epgeominfo[0].edgenr & epgeominfo[1].edgenr; }