From 36e56e5d6c952164da0b7f345862425552dfc285 Mon Sep 17 00:00:00 2001 From: Christopher Lackner Date: Thu, 24 Oct 2019 13:17:00 +0200 Subject: [PATCH] move some stuff to base geometry --- libsrc/meshing/CMakeLists.txt | 1 + libsrc/meshing/basegeom.cpp | 17 +++++++++++++++++ libsrc/meshing/basegeom.hpp | 4 +++- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/libsrc/meshing/CMakeLists.txt b/libsrc/meshing/CMakeLists.txt index 94268db0..e3b5c562 100644 --- a/libsrc/meshing/CMakeLists.txt +++ b/libsrc/meshing/CMakeLists.txt @@ -37,5 +37,6 @@ install(FILES localh.hpp meshclass.hpp meshfunc.hpp meshing2.hpp meshing3.hpp meshing.hpp meshtool.hpp meshtype.hpp msghandler.hpp paralleltop.hpp ruler2.hpp ruler3.hpp specials.hpp topology.hpp validate.hpp + python_mesh.hpp DESTINATION ${NG_INSTALL_DIR_INCLUDE}/meshing COMPONENT netgen_devel ) diff --git a/libsrc/meshing/basegeom.cpp b/libsrc/meshing/basegeom.cpp index 4868b5a0..93a7c6ca 100644 --- a/libsrc/meshing/basegeom.cpp +++ b/libsrc/meshing/basegeom.cpp @@ -10,6 +10,23 @@ namespace netgen GeometryRegister :: ~GeometryRegister() { ; } + void NetgenGeometry :: Analyse(Mesh& mesh, + const MeshingParameters& mparam) + { + static Timer t1("SetLocalMeshsize"); RegionTimer regt(t1); + mesh.SetGlobalH(mparam.maxh); + mesh.SetMinimalH(mparam.minh); + + mesh.SetLocalH(bounding_box.PMin(), bounding_box.PMax(), + mparam.grading); + + if(mparam.uselocalh) + { + // TODO set local h + } + mesh.LoadLocalMeshSize(mparam.meshsizefilename); + } + void NetgenGeometry :: OptimizeSurface(Mesh& mesh, const MeshingParameters& mparam) { const auto savetask = multithread.task; diff --git a/libsrc/meshing/basegeom.hpp b/libsrc/meshing/basegeom.hpp index f001f9fa..a1c9ef28 100644 --- a/libsrc/meshing/basegeom.hpp +++ b/libsrc/meshing/basegeom.hpp @@ -16,6 +16,8 @@ namespace netgen class DLL_HEADER NetgenGeometry { unique_ptr ref; + protected: + Box<3> bounding_box; public: NetgenGeometry() { @@ -35,7 +37,7 @@ namespace netgen virtual Mesh::GEOM_TYPE GetGeomType() const { return Mesh::NO_GEOM; } virtual void Analyse(Mesh& mesh, - const MeshingParameters& mparam) {} + const MeshingParameters& mparam); virtual void FindEdges(Mesh& mesh, const MeshingParameters& mparam) {} virtual void MeshSurface(Mesh& mesh, const MeshingParameters& mparam) {} virtual void OptimizeSurface(Mesh& mesh, const MeshingParameters& mparam);