diff --git a/libsrc/interface/nginterface.cpp b/libsrc/interface/nginterface.cpp index 54df4ff1..125e774b 100644 --- a/libsrc/interface/nginterface.cpp +++ b/libsrc/interface/nginterface.cpp @@ -1096,6 +1096,8 @@ void Ng_HighOrder (int order, bool rational) (&const_cast (ng_geometry -> GetRefinement()), order, rational); */ + if (!mesh->GetGeometry()) + throw NgException ("don't have a geometry for mesh curving"); mesh->BuildCurvedElements (&const_cast (mesh->GetGeometry()->GetRefinement()), order, rational); diff --git a/libsrc/meshing/meshclass.cpp b/libsrc/meshing/meshclass.cpp index fcf72e08..1e5c5b30 100644 --- a/libsrc/meshing/meshclass.cpp +++ b/libsrc/meshing/meshclass.cpp @@ -768,6 +768,9 @@ namespace netgen } } + outfile << endl << endl << "endmesh" << endl << endl; + if (geometry) + geometry -> SaveToMeshFile (outfile); } diff --git a/ng/ngpkg.cpp b/ng/ngpkg.cpp index db3e9a26..a31766db 100644 --- a/ng/ngpkg.cpp +++ b/ng/ngpkg.cpp @@ -305,9 +305,9 @@ namespace netgen outfile = new ofstream (filename.c_str()); mesh -> Save (*outfile); - *outfile << endl << endl << "endmesh" << endl << endl; + // *outfile << endl << endl << "endmesh" << endl << endl; - if (ng_geometry) + if (ng_geometry && !mesh->GetGeometry()) ng_geometry -> SaveToMeshFile (*outfile); delete outfile;