[cig-commits] r22745 - short/3D/PyLith/trunk/libsrc/pylith/topology
brad at geodynamics.org
brad at geodynamics.org
Thu Aug 29 17:30:39 PDT 2013
Author: brad
Date: 2013-08-29 17:30:39 -0700 (Thu, 29 Aug 2013)
New Revision: 22745
Modified:
short/3D/PyLith/trunk/libsrc/pylith/topology/Mesh.cc
Log:
Small improvement to Mesh::view(). Use stdout world viewer if no view option specified.
Modified: short/3D/PyLith/trunk/libsrc/pylith/topology/Mesh.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/topology/Mesh.cc 2013-08-30 00:19:08 UTC (rev 22744)
+++ short/3D/PyLith/trunk/libsrc/pylith/topology/Mesh.cc 2013-08-30 00:30:39 UTC (rev 22745)
@@ -214,15 +214,19 @@
assert(_dmMesh);
- std::ostringstream optionname, optionprefix;
- optionname << "-" << label << "_dm_view";
- optionprefix << label << "_";
-
PetscErrorCode err;
- err = DMSetOptionsPrefix(_dmMesh, optionprefix.str().c_str());PYLITH_CHECK_ERROR(err);
- err = PetscOptionsSetValue(optionname.str().c_str(), viewOption);PYLITH_CHECK_ERROR(err);
- err = DMSetFromOptions(_dmMesh);PYLITH_CHECK_ERROR(err);
+ if (strlen(viewOption) > 0) {
+ std::ostringstream optionname, optionprefix;
+ optionname << "-" << label << "_dm_view";
+ optionprefix << label << "_";
+ err = DMSetOptionsPrefix(_dmMesh, optionprefix.str().c_str());PYLITH_CHECK_ERROR(err);
+ err = PetscOptionsSetValue(optionname.str().c_str(), viewOption);PYLITH_CHECK_ERROR(err);
+ err = DMSetFromOptions(_dmMesh);PYLITH_CHECK_ERROR(err);
+ } else {
+ err = DMView(_dmMesh, PETSC_VIEWER_STDOUT_WORLD);PYLITH_CHECK_ERROR(err);
+ } // if/else
+
PYLITH_METHOD_END;
} // view
More information about the CIG-COMMITS
mailing list