From b84d5357dc8a65fb30de4dcbb7f315f120e87c0c Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Wed, 7 Nov 2001 08:04:30 +0000
Subject: [PATCH] NbXXX mesh options

---
 Common/DefaultOptions.h | 14 ++++++++++++++
 Common/Options.cpp      | 38 +++++++++++++++++++++++++++++++++++++-
 Common/Options.h        |  7 +++++++
 3 files changed, 58 insertions(+), 1 deletion(-)

diff --git a/Common/DefaultOptions.h b/Common/DefaultOptions.h
index 4b6c9292e0..fbd4417fb0 100644
--- a/Common/DefaultOptions.h
+++ b/Common/DefaultOptions.h
@@ -423,6 +423,20 @@ StringXNumber MeshOptions_Number[] = {
     "Allow the generation of degenerated hexahedra or prisms during extrusion" },
   { F, "SaveAll" , opt_mesh_save_all , 0. , 
     "Ignore Physical definitions and save all elements" },
+  { F, "NbNodes" , opt_mesh_nb_nodes , 0. , 
+    "Number of nodes in the current mesh" },
+  { F, "NbTriangles" , opt_mesh_nb_triangles , 0. , 
+    "Number of triangles in the current mesh" },
+  { F, "NbQuadrangles" , opt_mesh_nb_quadrangles , 0. , 
+    "Number of quadrangles in the current mesh" },
+  { F, "NbTetrahedra" , opt_mesh_nb_tetrahedra , 0. , 
+    "Number of tetrahedra in the current mesh" },
+  { F, "NbHexahedra" , opt_mesh_nb_hexahedra , 0. , 
+    "Number of hexahedra in the current mesh" },
+  { F, "NbPrims" , opt_mesh_nb_prisms , 0. , 
+    "Number of prisms in the current mesh" },
+  { F, "NbPyramids" , opt_mesh_nb_pyramids , 0. , 
+    "Number of pyramids in the current mesh" },
   { 0, NULL , NULL , 0. , NULL }
 } ;
 
diff --git a/Common/Options.cpp b/Common/Options.cpp
index d03355e65b..95f32fd55d 100644
--- a/Common/Options.cpp
+++ b/Common/Options.cpp
@@ -1,4 +1,4 @@
-// $Id: Options.cpp,v 1.55 2001-11-05 08:37:43 geuzaine Exp $
+// $Id: Options.cpp,v 1.56 2001-11-07 08:04:30 geuzaine Exp $
 
 #include "Gmsh.h"
 #include "GmshUI.h"
@@ -1596,6 +1596,42 @@ double opt_mesh_color_carousel(OPT_ARGS_NUM){
 #endif
   return CTX.mesh.color_carousel;
 }
+double opt_mesh_nb_nodes(OPT_ARGS_NUM){
+  double  s[50];
+  GetStatistics(s);
+  return s[6]?s[6]:(s[5]?s[5]:s[4]);
+}
+double opt_mesh_nb_triangles(OPT_ARGS_NUM){
+  double  s[50];
+  GetStatistics(s);
+  return s[7]-s[8];
+}
+double opt_mesh_nb_quadrangles(OPT_ARGS_NUM){
+  double  s[50];
+  GetStatistics(s);
+  return s[8];
+}
+double opt_mesh_nb_tetrahedra(OPT_ARGS_NUM){
+  double  s[50];
+  GetStatistics(s);
+  return s[9];
+}
+double opt_mesh_nb_hexahedra(OPT_ARGS_NUM){
+  double  s[50];
+  GetStatistics(s);
+  return s[10];
+}
+double opt_mesh_nb_prisms(OPT_ARGS_NUM){
+  double  s[50];
+  GetStatistics(s);
+  return s[11];
+}
+double opt_mesh_nb_pyramids(OPT_ARGS_NUM){
+  double  s[50];
+  GetStatistics(s);
+  return s[12];
+}
+
 
 
 double opt_solver_getdp_popupmessages(OPT_ARGS_NUM){
diff --git a/Common/Options.h b/Common/Options.h
index eb9ba3b830..eb6337a0aa 100644
--- a/Common/Options.h
+++ b/Common/Options.h
@@ -198,6 +198,13 @@ double opt_mesh_allow_degenerated_extrude(OPT_ARGS_NUM);
 double opt_mesh_save_all(OPT_ARGS_NUM);
 double opt_mesh_color_scheme(OPT_ARGS_NUM);
 double opt_mesh_color_carousel(OPT_ARGS_NUM);
+double opt_mesh_nb_nodes(OPT_ARGS_NUM);
+double opt_mesh_nb_triangles(OPT_ARGS_NUM);
+double opt_mesh_nb_quadrangles(OPT_ARGS_NUM);
+double opt_mesh_nb_tetrahedra(OPT_ARGS_NUM);
+double opt_mesh_nb_hexahedra(OPT_ARGS_NUM);
+double opt_mesh_nb_prisms(OPT_ARGS_NUM);
+double opt_mesh_nb_pyramids(OPT_ARGS_NUM);
 double opt_solver_getdp_popupmessages(OPT_ARGS_NUM);
 double opt_solver_getdp_mergeviews(OPT_ARGS_NUM);
 double opt_post_scales(OPT_ARGS_NUM);
-- 
GitLab