From 1d093942567e959ecc9ffb880b3e6ee967b94ac2 Mon Sep 17 00:00:00 2001
From: Eric Bechet <eric.bechet@ulg.ac.be>
Date: Thu, 28 Oct 2010 13:14:08 +0000
Subject: [PATCH]

---
 CMakeLists.txt             | 2 +-
 Post/PViewData.h           | 2 +-
 Post/PViewDataGModel.h     | 2 +-
 Post/PViewDataGModelIO.cpp | 4 ++--
 Post/PViewDataIO.cpp       | 2 +-
 Post/PViewDataList.h       | 2 +-
 Post/PViewDataListIO.cpp   | 3 +--
 7 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6166aa58ef..9e96b81ec6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -618,7 +618,7 @@ if(ENABLE_PETSC)
       endforeach(VAR)
     endif (PETSC_PACKAGES_INCLUDES)
     # find libraries
-    set(PETSC_LIBS_REQUIRED petscksp petscdm petscmat petscvec petsc)
+    set(PETSC_LIBS_REQUIRED petsc)
     find_all_libraries(PETSC_LIBS PETSC_LIBS_REQUIRED 
                        ${ENV_PETSC_DIR}/${ENV_PETSC_ARCH}/lib "")
     # petsc 3.1 create only one library : libpetsc
diff --git a/Post/PViewData.h b/Post/PViewData.h
index f2bf9ccbc9..9157122f14 100644
--- a/Post/PViewData.h
+++ b/Post/PViewData.h
@@ -221,7 +221,7 @@ class PViewData {
   virtual bool writeTXT(std::string fileName);
   virtual bool writePOS(std::string fileName, bool binary=false, bool parsed=true,
                         bool append=false);
-  virtual bool writeMSH(std::string fileName, bool binary=false);
+  virtual bool writeMSH(std::string fileName, bool binary=false, bool savemesh=true);
   virtual bool writeMED(std::string fileName);
 
   static void registerBindings(binding *b);
diff --git a/Post/PViewDataGModel.h b/Post/PViewDataGModel.h
index c741374972..f7836cae7b 100644
--- a/Post/PViewDataGModel.h
+++ b/Post/PViewDataGModel.h
@@ -239,7 +239,7 @@ class PViewDataGModel : public PViewData {
   bool readMSH(std::string fileName, int fileIndex, FILE *fp, bool binary, 
                bool swap, int step, double time, int partition, 
                int numComp, int numNodes);
-  bool writeMSH(std::string fileName, bool binary=false);
+  bool writeMSH(std::string fileName, bool binary=false, bool savemesh=true);
   bool readMED(std::string fileName, int fileIndex);
   bool writeMED(std::string fileName);
 };
diff --git a/Post/PViewDataGModelIO.cpp b/Post/PViewDataGModelIO.cpp
index 9e8526776e..1ac5bf2c64 100644
--- a/Post/PViewDataGModelIO.cpp
+++ b/Post/PViewDataGModelIO.cpp
@@ -118,7 +118,7 @@ bool PViewDataGModel::readMSH(std::string fileName, int fileIndex, FILE *fp,
   return true;
 }
 
-bool PViewDataGModel::writeMSH(std::string fileName, bool binary)
+bool PViewDataGModel::writeMSH(std::string fileName, bool binary, bool savemesh)
 {
   if(_steps.empty()) return true;
 
@@ -129,7 +129,7 @@ bool PViewDataGModel::writeMSH(std::string fileName, bool binary)
 
   GModel *model = _steps[0]->getModel();
 
-  bool writeNodesAndElements = false;
+  bool writeNodesAndElements = savemesh;
   FILE *fp;
   if(writeNodesAndElements){
     if(!model->writeMSH(fileName, 2.0, binary)) return false;
diff --git a/Post/PViewDataIO.cpp b/Post/PViewDataIO.cpp
index 940cf96b6c..c7ad930b3f 100644
--- a/Post/PViewDataIO.cpp
+++ b/Post/PViewDataIO.cpp
@@ -106,7 +106,7 @@ bool PViewData::writePOS(std::string fileName, bool binary, bool parsed, bool ap
   return false; 
 }
 
-bool PViewData::writeMSH(std::string fileName, bool binary)
+bool PViewData::writeMSH(std::string fileName, bool binary, bool savemesh)
 { 
   Msg::Error("MSH export not implemented for this view type");
   return false; 
diff --git a/Post/PViewDataList.h b/Post/PViewDataList.h
index b98dcbf567..1bb7207d0a 100644
--- a/Post/PViewDataList.h
+++ b/Post/PViewDataList.h
@@ -110,7 +110,7 @@ class PViewDataList : public PViewData {
   bool readPOS(FILE *fp, double version, bool binary);
   bool writePOS(std::string fileName, bool binary=false, bool parsed=true,
                 bool append=false);
-  bool writeMSH(std::string fileName, bool binary=false);
+  virtual bool writeMSH(std::string fileName, bool binary=false, bool savemesh=true);
 };
 
 #endif
diff --git a/Post/PViewDataListIO.cpp b/Post/PViewDataListIO.cpp
index 596665eda6..942c90852f 100644
--- a/Post/PViewDataListIO.cpp
+++ b/Post/PViewDataListIO.cpp
@@ -544,7 +544,7 @@ static void writeElementsMSH(FILE *fp, int nbelm, std::vector<double> &list,
   }
 }
 
-bool PViewDataList::writeMSH(std::string fileName, bool binary)
+bool PViewDataList::writeMSH(std::string fileName, bool binary, bool savemesh)
 {
   if(_adaptive){
     Msg::Warning("Writing adapted dataset (will only export current time step)");
@@ -590,7 +590,6 @@ bool PViewDataList::writeMSH(std::string fileName, bool binary)
   getNodeMSH(NbSY, SY, 5, 1, NbTimeStep, &nodes, &numelm);
   getNodeMSH(NbVY, VY, 5, 3, NbTimeStep, &nodes, &numelm);
   getNodeMSH(NbTY, TY, 5, 9, NbTimeStep, &nodes, &numelm);
-
   fprintf(fp, "$MeshFormat\n2 0 8\n$EndMeshFormat\n");
   fprintf(fp, "$Nodes\n");
   fprintf(fp, "%d\n", (int)nodes.size());
-- 
GitLab