Skip to content

Commit 754c1ad

Browse files
committed
Inform user of possible memory issue
CGNS file older than 4.0 release have a high ram memory usage
1 parent 9efe761 commit 754c1ad

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

Common/src/geometry/meshreader/CCGNSMeshReaderFVM.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ void CCGNSMeshReaderFVM::OpenCGNSFile(string val_filename) {
8989
/*--- Check whether the supplied file is truly a CGNS file. ---*/
9090

9191
int file_type;
92+
float file_version;
9293
if (cg_is_cgns(val_filename.c_str(), &file_type) != CG_OK) {
9394
SU2_MPI::Error(val_filename +
9495
string(" was not found or is not a properly formatted") +
@@ -107,7 +108,13 @@ void CCGNSMeshReaderFVM::OpenCGNSFile(string val_filename) {
107108
cout << "Reading the CGNS file: ";
108109
cout << val_filename.c_str() << "." << endl;
109110
}
110-
111+
if (cg_version(cgnsFileID, &file_version))
112+
cg_error_exit();
113+
if (rank == MASTER_NODE) {
114+
if (file_version < 4.0) {
115+
cout << "The file version is too old, please update it with the cgnsupdate tool." << endl;
116+
}
117+
}
111118
}
112119

113120
void CCGNSMeshReaderFVM::ReadCGNSDatabaseMetadata() {

0 commit comments

Comments
 (0)