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);
#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 ));
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");