From: Esukhareva Date: Fri, 22 Nov 2024 14:51:32 +0000 (+0000) Subject: bos #42143 [CEA] Structured CGNS: wrong groups exported from savec hdf X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ed432ffceb8bc51a7b4be79cfcd7e1e042e4252e;p=modules%2Fsmesh.git bos #42143 [CEA] Structured CGNS: wrong groups exported from savec hdf --- diff --git a/src/Driver/Driver_Mesh.h b/src/Driver/Driver_Mesh.h index 7293e2284..6f429d22e 100644 --- a/src/Driver/Driver_Mesh.h +++ b/src/Driver/Driver_Mesh.h @@ -52,13 +52,14 @@ class MESHDRIVER_EXPORT Driver_Mesh enum Status { DRS_OK, - DRS_EMPTY, // a file contains no mesh with the given name - DRS_WARN_RENUMBER, // a file has overlapped ranges of element numbers, - // so the numbers from the file are ignored - DRS_WARN_SKIP_ELEM, // some elements were skipped due to incorrect file data - DRS_WARN_DESCENDING, // some elements were skipped due to descending connectivity - DRS_FAIL, // general failure (exception etc.) - DRS_TOO_LARGE_MESH // mesh is too large for export + DRS_EMPTY, // a file contains no mesh with the given name + DRS_WARN_RENUMBER, // a file has overlapped ranges of element numbers, + // so the numbers from the file are ignored + DRS_WARN_SKIP_ELEM, // some elements were skipped due to incorrect file data + DRS_WARN_DESCENDING, // some elements were skipped due to descending connectivity + DRS_WARN_NO_STRUCT_GRID, // have no filled structured grid, probably loaded from the hdf file, need recompute + DRS_FAIL, // general failure (exception etc.) + DRS_TOO_LARGE_MESH // mesh is too large for export }; void SetMeshId(int theMeshId); diff --git a/src/SMESH/SMESH_Mesh.cxx b/src/SMESH/SMESH_Mesh.cxx index 8d545cc58..3d6aa6873 100644 --- a/src/SMESH/SMESH_Mesh.cxx +++ b/src/SMESH/SMESH_Mesh.cxx @@ -1702,8 +1702,10 @@ void SMESH_Mesh::ExportStructuredCGNS(const char * file, const SMESHDS_Mesh* mes #ifdef WITH_CGNS auto myMesh = meshPart ? (SMESHDS_Mesh*) meshPart : _meshDS; - if ( myMesh->HasSomeStructuredGridFilled() ) - { + if ( !myMesh->HasSomeStructuredGridFilled() ){ + res = Driver_Mesh::DRS_WARN_NO_STRUCT_GRID; + } + else{ DriverStructuredCGNS_Write writer; writer.SetFile( file ); writer.SetMesh( const_cast( myMesh )); @@ -1728,6 +1730,12 @@ void SMESH_Mesh::ExportStructuredCGNS(const char * file, const SMESHDS_Mesh* mes std::cout << "\n\n\n Going into too large mesh file path\n\n\n\n"; throw TooLargeForExport("CGNS"); } + else if( res == Driver_Mesh::DRS_WARN_NO_STRUCT_GRID ) + { + throw SALOME_Exception("The mesh does not contain a structured grid. If you are attempting to export " + "a quadrilateral mesh loaded from an HDF file, please perform a Clean + Compute operation before exporting. " + "This step is necessary due to a current limitation."); + } if ( res != Driver_Mesh::DRS_OK ) throw SALOME_Exception("Export failed");