From d1d3253408766cca3d1980e76d72e632bc35978b Mon Sep 17 00:00:00 2001 From: Christopher Lackner Date: Tue, 26 Jan 2021 11:23:46 +0100 Subject: [PATCH] throw if optimize2d is called without geometry --- libsrc/meshing/python_mesh.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libsrc/meshing/python_mesh.cpp b/libsrc/meshing/python_mesh.cpp index 1b1a35a9..c125c3de 100644 --- a/libsrc/meshing/python_mesh.cpp +++ b/libsrc/meshing/python_mesh.cpp @@ -983,6 +983,8 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m) self.CalcLocalH(0.5); MeshingParameters mp; mp.optsteps2d = 5; + if(!self.GetGeometry()) + throw Exception("Cannot optimize surface mesh without geometry!"); Optimize2d (self, mp); },py::call_guard())