[MOAB-dev] commit/MOAB: iulian07: inform the user about changing the writer
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Wed Nov 20 16:32:37 CST 2013
1 new commit in MOAB:
https://bitbucket.org/fathomteam/moab/commits/3d09037e2348/
Changeset: 3d09037e2348
Branch: master
User: iulian07
Date: 2013-11-20 23:27:45
Summary: inform the user about changing the writer
this commit was triggered by trying to convert to an exodus file
The writer failed in some particular case, but then moab switched to a
default writer (usually hdf5, for a typical configuration) that worked fine.
The file is saved though with the original extension, and mbsize fails to
read it back.
Affected #: 1 file
diff --git a/src/Core.cpp b/src/Core.cpp
index a6e6cfd..0bd882f 100644
--- a/src/Core.cpp
+++ b/src/Core.cpp
@@ -69,16 +69,20 @@
# ifdef HDF5_PARALLEL
# include "WriteHDF5Parallel.hpp"
typedef moab::WriteHDF5Parallel DefaultWriter;
+# define DefaultWriterName "WriteHDF5Parallel"
# else
# include "WriteHDF5.hpp"
typedef moab::WriteHDF5 DefaultWriter;
+# define DefaultWriterName "WriteHDF5"
# endif
#elif defined(NETCDF_FILE)
# include "WriteNCDF.hpp"
typedef moab::WriteNCDF DefaultWriter;
+# define DefaultWriterName "WriteNCDF"
#else
# include "WriteVtk.hpp"
typedef moab::WriteVtk DefaultWriter;
+# define DefaultWriterName "WriteVtk"
#endif
#include "MBTagConventions.hpp"
#include "ExoIIUtil.hpp"
@@ -727,7 +731,10 @@ ErrorCode Core::write_file( const char* file_name,
rval = writer->write_file(file_name, overwrite, opts, list_ptr, list.size(), qa_records,
tag_list, num_tags );
if (rval != MB_SUCCESS)
+ {
mError->set_last_error( "Writer for file type \"%s\" was unsuccessful", file_type);
+ printf("Writer with name %s for file %s using extension %s was unsuccessful\n",i->name().c_str(), file_name, ext.c_str());
+ }
delete writer;
}
}
@@ -737,6 +744,7 @@ ErrorCode Core::write_file( const char* file_name,
else if (MB_SUCCESS != rval) {
DefaultWriter writer(this);
+ printf("Using default writer %s for file %s \n", DefaultWriterName, file_name);
rval = writer.write_file(file_name, overwrite, opts, list_ptr, list.size(), qa_records,
tag_list, num_tags );
}
Repository URL: https://bitbucket.org/fathomteam/moab/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the moab-dev
mailing list