bos #42143 [CEA] Structured CGNS: wrong groups exported from savec hdf

This commit is contained in:
Esukhareva 2024-11-22 14:51:32 +00:00
parent e60bcaf4a9
commit ed432ffceb
2 changed files with 18 additions and 9 deletions

View File

@ -57,6 +57,7 @@ class MESHDRIVER_EXPORT Driver_Mesh
// 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
};

View File

@ -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<SMESHDS_Mesh*>( 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");