From e3dcd784076deb75f4e31dc59b282dc12fd70608 Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Tue, 12 Aug 2008 23:35:05 +0000
Subject: [PATCH] save elem=numnode to test point datasets

---
 Geo/GModel.cpp           | 6 ++++--
 Post/PViewDataListIO.cpp | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/Geo/GModel.cpp b/Geo/GModel.cpp
index 5ae903f499..99a0931426 100644
--- a/Geo/GModel.cpp
+++ b/Geo/GModel.cpp
@@ -785,8 +785,9 @@ void GModel::_storeVerticesInEntities(std::map<int, MVertex*> &vertices)
     MVertex *v = it->second;
     GEntity *ge = v->onWhat();
     if(ge){
-      if(ge->dim() || ge->mesh_vertices.empty()) // special case for points
+      if(ge->dim() || ge->mesh_vertices.empty()){ // special case for points
 	ge->mesh_vertices.push_back(v);
+      }
     }
     else
       delete v; // we delete all unused vertices
@@ -800,8 +801,9 @@ void GModel::_storeVerticesInEntities(std::vector<MVertex*> &vertices)
     if(v){ // the vector is allowed to have null entries
       GEntity *ge = v->onWhat();
       if(ge) {
-	if(ge->dim() || ge->mesh_vertices.empty()) // special case for points
+	if(ge->dim() || ge->mesh_vertices.empty()){ // special case for points
 	  ge->mesh_vertices.push_back(v);
+	}
       }
       else
         delete v; // we delete all unused vertices
diff --git a/Post/PViewDataListIO.cpp b/Post/PViewDataListIO.cpp
index 21219f312f..ca0cef1ff8 100644
--- a/Post/PViewDataListIO.cpp
+++ b/Post/PViewDataListIO.cpp
@@ -442,7 +442,7 @@ static void writeElementMSH(FILE *fp, int num, int nbnod, pVertex nod[8],
 {
   switch(dim){
   case 0:
-    fprintf(fp, "%d 15 0 %d\n", num, nod[0].Num);
+    fprintf(fp, "%d 15 2 0 %d %d\n", num, num, nod[0].Num);
     break;
   case 1:
     fprintf(fp, "%d 1 0 %d %d\n", num, nod[0].Num, nod[1].Num);
-- 
GitLab