NeoPZ
TPZGmshReader.cpp
Go to the documentation of this file.
1 //
2 // TPZGmshReader.cpp
3 // PZ
4 //
5 // Created by Omar on 2/7/16.
6 //
7 //
8 
9 #include "TPZGmshReader.h"
10 
11 #include "pzgeopoint.h"
12 #include "TPZGeoLinear.h"
13 #include "TPZGeoCube.h"
14 #include "pzgeotetrahedra.h"
15 #include "tpzcube.h"
16 #include "pzgeopyramid.h"
17 
18 
19 #include "tpzquadraticline.h"
20 #include "tpzquadratictrig.h"
21 #include "tpzquadraticquad.h"
22 #include "tpzquadraticcube.h"
23 #include "tpzquadratictetra.h"
24 #include "tpzquadraticprism.h"
25 #include "tpzgeoblend.h"
26 #include "tpzpoint.h"
27 #include "pzrefpoint.h"
28 
29 #include "pzgeoelside.h"
30 #include "tpzgeoblend.h"
31 #include <tpzarc3d.h>
32 
33 #include "TPZRefPattern.h"
34 #include "tpzgeoelrefpattern.h"
35 #include "TPZGeoElement.h"
36 
37 
39 
40  m_format_version = "4.0";
41  m_n_volumes = 0;
42  m_n_surfaces = 0;
43  m_n_curves = 0;
44  m_n_points = 0;
49  m_dimension = 0;
55 
57 
58 }//method
59 
61 
62 }//method
63 
64 TPZGeoMesh * TPZGmshReader::GeometricGmshMesh(std::string file_name, TPZGeoMesh *gmesh_input){
65 
66  if (m_format_version == "3.0" || m_format_version == "3") {
67  return GeometricGmshMesh3(file_name,gmesh_input);
68  }else if(m_format_version == "4.1"){
69  return GeometricGmshMesh4(file_name,gmesh_input);
70  }
71  std::cout << "TPZGmshReader:: Lastest version supported 4.1 " << std::endl;
72  std::cout << "TPZGmshReader:: This reader supports only the lastest version " << std::endl;
73  std::cout << "TPZGmshReader:: Reader no available for the msh file version = " << m_format_version << std::endl;
74  DebugStop();
75  return NULL;
76 }
77 
78 void TPZGmshReader::PrintPartitionSummary(std::ostream & out){
79 
80  out << std::endl;
81  out << "TPZGmshReader geometrical partition summary " << std::endl;
82  out << "File format = " << m_format_version << std::endl;
83  out << "Geometry dimension = " << m_dimension << std::endl;
84  out << "Number of volumes = " << m_n_volumes << std::endl;
85  out << "Number of surfaces = " << m_n_surfaces << std::endl;
86  out << "Number of curves = " << m_n_curves << std::endl;
87  out << "Number of points = " << m_n_points << std::endl;
88  out << "Number of volumes with physical tag = " << m_n_physical_volumes << std::endl;
89  out << "Number of surfaces with physical tag = " << m_n_physical_surfaces << std::endl;
90  out << "Number of curves with physical tag = " << m_n_physical_curves << std::endl;
91  out << "Number of points with physical tag = " << m_n_physical_points << std::endl;
92  out << "Number of elements by type : " << std::endl;
93  out << "Points : " << m_n_point_els << std::endl;
94  out << "Lines : " << m_n_line_els << std::endl;
95  out << "Triangles : " << m_n_triangle_els << std::endl;
96  out << "Quadrilaterals : " << m_n_quadrilateral_els << std::endl;
97  out << "Tetrahera : " << m_n_tetrahedron_els << std::endl;
98  out << "Hexahedra : " << m_n_hexahedron_els << std::endl;
99  out << "Prism : " << m_n_prism_els << std::endl;
100  out << "Pyramids : " << m_n_pyramid_els << std::endl;
102  int n_surf_els = m_n_triangle_els + m_n_quadrilateral_els;
103  out << "Number of elements by dimension : " << std::endl;
104  out << "3D elements : " << n_vols_els << std::endl;
105  out << "2D elements : " << n_surf_els << std::endl;
106  out << "1D elements : " << m_n_line_els << std::endl;
107  out << "0D elements : " << m_n_point_els << std::endl;
108  out << "Characteristic length = " << m_characteristic_lentgh <<std::endl;
109  out << std::endl;
110 
111 }
115  m_n_volumes = other.m_n_volumes;
116  m_n_surfaces = other.m_n_surfaces;
117  m_n_curves = other.m_n_curves;
118  m_n_points = other.m_n_points;
123  m_dimension = other.m_dimension;
130 }
131 
135  if(&other == this){
136  return *this;
137  }
139  m_n_volumes = other.m_n_volumes;
140  m_n_surfaces = other.m_n_surfaces;
141  m_n_curves = other.m_n_curves;
142  m_n_points = other.m_n_points;
147  m_dimension = other.m_dimension;
154  return *this;
155 }
156 
157 TPZGeoMesh * TPZGmshReader::GeometricGmshMesh4(std::string file_name, TPZGeoMesh *gmesh_input){
158 
159  // Mesh Creation
160  TPZGeoMesh * gmesh = gmesh_input;
161  if(!gmesh) gmesh = new TPZGeoMesh;
162 
163  {
164 
165  // reading a general mesh information by filter
166  std::ifstream read (file_name.c_str());
167  if(!read)
168  {
169  std::cout << "Couldn't open the file " << file_name << std::endl;
170  DebugStop();
171  }
172 
173  if (!read) {
174  std::cout << "Gmsh Reader: the mesh file path is wrong " << std::endl;
175  DebugStop();
176  }
177 
178  while(read)
179  {
180  char buf[1024];
181  read.getline(buf, 1024);
182  std::string str(buf);
183 
184  if(str == "$MeshFormat" || str == "$MeshFormat\r")
185  {
186  read.getline(buf, 1024);
187  std::string str(buf);
188  std::cout << "Reading mesh format = " << str << std::endl;
189 
190  }
191 
192  if(str == "$PhysicalNames" || str == "$PhysicalNames\r" )
193  {
194 
195  int64_t n_physical_names;
196  read >> n_physical_names;
197  int max_dimension = 0;
198 
199  int dimension, id;
200  std::string name;
201  std::pair<int, std::string> chunk;
202 
203  for (int64_t i_name = 0; i_name < n_physical_names; i_name++) {
204 
205  read.getline(buf, 1024);
206  read >> dimension;
207  read >> id;
208  read >> name;
209  name.erase(0,1);
210  name.erase(name.end()-1,name.end());
212 
214  {
215  std::cout << "Automatically associating " << name << " with material id " << id << std::endl;
217  }
218  else
219  {
220  int pzmatid = m_dim_name_and_physical_tag[dimension][name];
221  std::cout << "Associating " << name << " with material id " << id <<
222  " with pz material id " << pzmatid << std::endl;
223  }
224 
226 
227  if (max_dimension < dimension) {
228  max_dimension = dimension;
229  }
230  }
231  m_dimension = max_dimension; // for coherence
232  gmesh->SetDimension(max_dimension);
233 
234  char buf_end[1024];
235  read.getline(buf_end, 1024);
236  read.getline(buf_end, 1024);
237  std::string str_end(buf_end);
238  if(str_end == "$EndPhysicalNames" || str_end == "$EndPhysicalNames\r")
239  {
240  std::cout << "Read mesh physical entities = " << n_physical_names << std::endl;
241  }
242  continue;
243  }
244 
245  if(str == "$Entities" || str == "$Entities\r")
246  {
247  read >> m_n_points;
248  read >> m_n_curves;
249  read >> m_n_surfaces;
250  read >> m_n_volumes;
251 
252 
253  int n_physical_tag;
254  std::pair<int, std::vector<int> > chunk;
256  REAL x_min, y_min, z_min;
257  REAL x_max, y_max, z_max;
258  std::vector<int> n_entities = {m_n_points,m_n_curves,m_n_surfaces,m_n_volumes};
259  std::vector<int> n_entities_with_physical_tag = {0,0,0,0};
260 
261 
262  for (int i_dim = 0; i_dim <4; i_dim++) {
263  for (int64_t i_entity = 0; i_entity < n_entities[i_dim]; i_entity++) {
264 
265  read.getline(buf, 1024);
266  read >> chunk.first;
267  read >> x_min;
268  read >> y_min;
269  read >> z_min;
270  if(i_dim > 0)
271  {
272  read >> x_max;
273  read >> y_max;
274  read >> z_max;
275  }
276  read >> n_physical_tag;
277  chunk.second.resize(n_physical_tag);
278  for (int i_data = 0; i_data < n_physical_tag; i_data++) {
279  read >> chunk.second[i_data];
280  }
281  if(i_dim > 0)
282  {
283  size_t n_bounding_points;
284  read >> n_bounding_points;
285  for (int i_data = 0; i_data < n_bounding_points; i_data++) {
286  int point_tag;
287  read >> point_tag;
288  }
289  }
290  n_entities_with_physical_tag[i_dim] += n_physical_tag;
292  }
293  }
294 
295  m_n_physical_points = n_entities_with_physical_tag[0];
296  m_n_physical_curves = n_entities_with_physical_tag[1];
297  m_n_physical_surfaces = n_entities_with_physical_tag[2];
298  m_n_physical_volumes = n_entities_with_physical_tag[3];
299 
300  char buf_end[1024];
301  read.getline(buf_end, 1024);
302  read.getline(buf_end, 1024);
303  std::string str_end(buf_end);
304  if(str_end == "$EndEntities" || str_end == "$EndEntities\r")
305  {
306  std::cout << "Read mesh entities = " << m_n_points + m_n_curves + m_n_surfaces + m_n_volumes << std::endl;
307  std::cout << "Read mesh entities with physical tags = " << m_n_physical_points + m_n_physical_curves + m_n_physical_surfaces + m_n_physical_volumes << std::endl;
308  }
309  continue;
310  }
311 
312  if(str == "$Nodes" || str == "$Nodes\r")
313  {
314 
315  int64_t n_entity_blocks, n_nodes, min_node_tag, max_node_tag;
316  read >> n_entity_blocks;
317  read >> n_nodes;
318  read >> min_node_tag;
319  read >> max_node_tag;
320 
321  int64_t node_id;
322  double nodecoordX , nodecoordY , nodecoordZ ;
323  gmesh -> NodeVec().Resize(max_node_tag);
324  gmesh->SetMaxNodeId(max_node_tag);
325  // needed for node insertion
326  const int64_t Tnodes = max_node_tag;
327  TPZVec <TPZGeoNode> Node(Tnodes);
328 
329  int entity_tag, entity_dim, entity_parametric, entity_nodes;
330  for (int64_t i_block = 0; i_block < n_entity_blocks; i_block++)
331  {
332  read.getline(buf, 1024);
333  read >> entity_dim;
334  read >> entity_tag;
335  read >> entity_parametric;
336  read >> entity_nodes;
337 
338  if (entity_parametric != 0) {
339  std::cout << "TPZGmshReader:: Characteristic not implemented." << std::endl;
340  DebugStop();
341  }
342 
343  TPZManVector<int64_t,10> nodeids(entity_nodes,-1);
344  for (int64_t inode = 0; inode < entity_nodes; inode++) {
345  read >> nodeids[inode];
346  }
347  for (int64_t inode = 0; inode < entity_nodes; inode++) {
348  read >> nodecoordX;
349  read >> nodecoordY;
350  read >> nodecoordZ;
351 
352  Node[nodeids[inode]-1].SetNodeId(nodeids[inode]-1);
353  Node[nodeids[inode]-1].SetCoord(0,nodecoordX/m_characteristic_lentgh);
354  Node[nodeids[inode]-1].SetCoord(1,nodecoordY/m_characteristic_lentgh);
355  Node[nodeids[inode]-1].SetCoord(2,nodecoordZ/m_characteristic_lentgh);
356  gmesh->NodeVec()[nodeids[inode]-1] = Node[nodeids[inode]-1];
357 
358  }
359  }
360 
361  char buf_end[1024];
362  read.getline(buf_end, 1024);
363  read.getline(buf_end, 1024);
364  std::string str_end(buf_end);
365  if(str_end == "$EndNodes" || str_end == "$EndNodes\r")
366  {
367  std::cout << "Read mesh nodes = " << gmesh->NNodes() << std::endl;
368  }
369  continue;
370  }
371 
372  if(str == "$Elements" || str == "$Elements\r")
373  {
374 
375  int64_t n_entity_blocks, n_elements, min_element_tag, max_element_tag;
376  read >> n_entity_blocks;
377  read >> n_elements;
378  read >> min_element_tag;
379  read >> max_element_tag;
380  gmesh->SetMaxElementId(n_elements-1);
381 
382  int entity_tag, entity_dim, entity_el_type, entity_elements;
383  for (int64_t i_block = 0; i_block < n_entity_blocks; i_block++)
384  {
385  read.getline(buf, 1024);
386  read >> entity_dim;
387  read >> entity_tag;
388  read >> entity_el_type;
389  read >> entity_elements;
390 
391  if(entity_elements == 0){
392  std::cout << "The entity with tag " << entity_tag << " does not have elements to insert" << std::endl;
393  }
394 
395  for (int64_t iel = 0; iel < entity_elements; iel++) {
396  int physical_identifier;
397  int n_physical_identifier = 0;
398  if(m_dim_entity_tag_and_physical_tag[entity_dim].find(entity_tag) != m_dim_entity_tag_and_physical_tag[entity_dim].end())
399  {
400  n_physical_identifier = m_dim_entity_tag_and_physical_tag[entity_dim][entity_tag].size();
401  }
402  bool physical_identifier_Q = n_physical_identifier != 0;
403  if(physical_identifier_Q)
404  {
405  int gmsh_physical_identifier = m_dim_entity_tag_and_physical_tag[entity_dim][entity_tag][0];
406  physical_identifier = m_dim_physical_tag_and_physical_tag[entity_dim][gmsh_physical_identifier];
407  if(n_physical_identifier !=1){
408  std::cout << "The entity with tag " << entity_tag << std::endl;
409  std::cout << "Has associated the following physical tags : " << std::endl;
410  for (int i_data = 0; i_data < n_physical_identifier; i_data++) {
411  std::cout << m_dim_entity_tag_and_physical_tag[entity_dim][entity_tag][i_data] << std::endl;
412  }
413 
414  std::cout << "Automatically, the assgined pz physical tag = " << physical_identifier << " is used. The other ones are dropped out." << std::endl;
415  }
416 
417 
418  read.getline(buf, 1024);
419  int el_identifier, n_el_nodes;
420  n_el_nodes = GetNumberofNodes(entity_el_type);
421  read >> el_identifier;
422  std::vector<int> node_identifiers(n_el_nodes);
423  for (int i_node = 0; i_node < n_el_nodes; i_node++) {
424  read >> node_identifiers[i_node];
425  }
427  InsertElement(gmesh, physical_identifier, entity_el_type, el_identifier, node_identifiers);
428 
429  }else{
430  read.getline(buf, 1024);
431  int el_identifier, n_el_nodes;
432  n_el_nodes = GetNumberofNodes(entity_el_type);
433  read >> el_identifier;
434  std::vector<int> node_identifiers(n_el_nodes);
435  for (int i_node = 0; i_node < n_el_nodes; i_node++) {
436  read >> node_identifiers[i_node];
437  }
438  std::cout << "The entity with tag " << entity_tag << " does not have a physical tag, element " << el_identifier << " skipped " << std::endl;
439  }
440 
441  }
442  }
443 
444  char buf_end[1024];
445  read.getline(buf_end, 1024);
446  read.getline(buf_end, 1024);
447  std::string str_end(buf_end);
448  if(str_end == "$EndElements" || str_end == "$EndElements\r")
449  {
450  std::cout << "Read mesh elements = " << gmesh->NElements() << std::endl;
451  }
452  continue;
453  }
454 
455  }
456 
457  }
458 
459  std::cout << "Read General Mesh Data -> done!" << std::endl;
460  std::cout << "Number of elements " << gmesh->NElements() << std::endl;
461  gmesh->BuildConnectivity();
462  std::cout << "Geometric Mesh Connectivity -> done!" << std::endl;
463  return gmesh;
464 
465 }
466 
467 void TPZGmshReader::InsertElement(TPZGeoMesh * gmesh, int & physical_identifier, int & el_type, int & el_identifier, std::vector<int> & node_identifiers){
468 
469  TPZManVector <int64_t,15> Topology;
470  int n_nodes = node_identifiers.size();
471  Topology.Resize(n_nodes, 0);
472  for (int k_node = 0; k_node<n_nodes; k_node++) {
473  Topology[k_node] = node_identifiers[k_node]-1;
474  }
475 
476  el_identifier--;
477  switch (el_type) {
478  case 1:
479  { // Line
480  new TPZGeoElRefPattern< pzgeom::TPZGeoLinear> (el_identifier, Topology, physical_identifier, *gmesh);
481  m_n_line_els++;
482  }
483  break;
484  case 2:
485  {
486  // Triangle
487  new TPZGeoElRefPattern< pzgeom::TPZGeoTriangle> (el_identifier, Topology, physical_identifier, *gmesh);
489 
490  }
491  break;
492  case 3:
493  {
494  // Quadrilateral
495  new TPZGeoElRefPattern< pzgeom::TPZGeoQuad> (el_identifier, Topology, physical_identifier, *gmesh);
497 
498  }
499  break;
500  case 4:
501  {
502  // Tetrahedron
503  new TPZGeoElRefPattern< pzgeom::TPZGeoTetrahedra> (el_identifier, Topology, physical_identifier, *gmesh);
505 
506  }
507  break;
508  case 5:
509  {
510  // Hexahedra
511  new TPZGeoElRefPattern< pzgeom::TPZGeoCube> (el_identifier, Topology, physical_identifier, *gmesh);
513  }
514  break;
515  case 6:
516  {
517  // Prism
518  new TPZGeoElRefPattern< pzgeom::TPZGeoPrism> (el_identifier, Topology, physical_identifier, *gmesh);
519  m_n_prism_els++;
520  }
521  break;
522  case 7:
523  {
524  // Pyramid
525  new TPZGeoElRefPattern< pzgeom::TPZGeoPyramid> (el_identifier, Topology, physical_identifier, *gmesh);
526  m_n_pyramid_els++;
527  }
528  break;
529  case 8:
530  {
531  // Quadratic Line
532  new TPZGeoElRefPattern< pzgeom::TPZQuadraticLine> (el_identifier, Topology, physical_identifier, *gmesh);
533  m_n_line_els++;
534  }
535  break;
536  case 9:
537  {
538  // Triangle
539  new TPZGeoElRefPattern< pzgeom::TPZQuadraticTrig> (el_identifier, Topology, physical_identifier, *gmesh);
541  }
542  break;
543  case 10:
544  {
545  TPZManVector <int64_t,15> Topology_c(n_nodes-1);
546  for (int k_node = 0; k_node < n_nodes-1; k_node++) {
547  Topology_c[k_node] = Topology[k_node];
548  }
549  // Quadrilateral
550  new TPZGeoElRefPattern< pzgeom::TPZQuadraticQuad> (el_identifier, Topology_c, physical_identifier, *gmesh);
552  }
553  break;
554  case 11:
555  {
556  // Tetrahedron
557  new TPZGeoElRefPattern< pzgeom::TPZQuadraticTetra> (el_identifier, Topology, physical_identifier, *gmesh);
559 
560  }
561  break;
562  case 12:
563  {
564  // Hexahedra
565  new TPZGeoElRefPattern< pzgeom::TPZQuadraticCube> (el_identifier, Topology, physical_identifier, *gmesh);
567  }
568  break;
569  case 13:
570  {
571  // Prism
572  new TPZGeoElRefPattern< pzgeom::TPZQuadraticPrism> (el_identifier, Topology, physical_identifier, *gmesh);
573  m_n_pyramid_els++;
574  }
575  break;
576  case 15:{
577  // Point
578  new TPZGeoElement< pzgeom::TPZGeoPoint, pzrefine::TPZRefPoint> (el_identifier, Topology, physical_identifier, *gmesh);
579  m_n_point_els++;
580  }
581  break;
582  default:
583  {
584  std::cout << "Element not impelemented." << std::endl;
585  DebugStop();
586  }
587  break;
588  }
589 
590 }
591 
593 
594  int n_nodes;
595  switch (el_type) {
596  case 1:
597  { // Line
598  n_nodes = 2;
599  }
600  break;
601  case 2:
602  {
603  // Triangle
604  n_nodes = 3;
605  }
606  break;
607  case 3:
608  {
609  // Quadrilateral
610  n_nodes = 4;
611  }
612  break;
613  case 4:
614  {
615  // Tetrahedron
616  n_nodes = 4;
617  }
618  break;
619  case 5:
620  {
621  // Hexahedra
622  n_nodes = 8;
623  }
624  break;
625  case 6:
626  {
627  // Prism
628  n_nodes = 6;
629  }
630  break;
631  case 7:
632  {
633  // Pyramid
634  n_nodes = 5;
635  }
636  break;
637  case 8:
638  {
639  // Quadratic Line
640  n_nodes = 3;
641  }
642  break;
643  case 9:
644  {
645  // Quadratic Triangle
646  n_nodes = 6;
647  }
648  break;
649  case 10:
650  {
651  // Quadratic Quadrilateral
652  n_nodes = 9;
653  }
654  break;
655  case 11:
656  {
657  // Quadratic Tetrahedron
658  n_nodes = 10;
659 
660  }
661  break;
662  case 12:
663  {
664  // Quadratic Hexahedra
665  n_nodes = 20;
666  }
667  break;
668  case 13:
669  {
670  // Quadratic Prism
671  n_nodes = 15;
672  }
673  break;
674  case 15:{
675  // Point
676  n_nodes = 1;
677  }
678  break;
679  default:
680  {
681  std::cout << "Element not impelemented." << std::endl;
682  n_nodes = 0;
683  DebugStop();
684  }
685  break;
686  }
687 
688  return n_nodes;
689 }
690 
691 TPZGeoMesh * TPZGmshReader::GeometricGmshMesh3(std::string file_name, TPZGeoMesh *gmesh_input)
692 {
693 
694  // Mesh Creation
695  TPZGeoMesh * gmesh = gmesh_input;
696  if(!gmesh) gmesh = new TPZGeoMesh;
697  int dimension = 0;
698  gmesh->SetDimension(dimension);
699 
700  {
701 
702  // reading a general mesh information by filter
703  std::ifstream read (file_name.c_str());
704  if(!read)
705  {
706  std::cout << "Couldn't open the file " << file_name << std::endl;
707  DebugStop();
708  }
709 
710  if (!read) {
711  std::cout << "Gmsh Reader: the mesh file path is wrong " << std::endl;
712  DebugStop();
713  }
714 
715  while(read)
716  {
717  char buf[1024];
718  read.getline(buf, 1024);
719  std::string str(buf);
720 
721  if(str == "$MeshFormat" || str == "$MeshFormat\r")
722  {
723  read.getline(buf, 1024);
724  std::string str(buf);
725  std::cout << "Reading mesh format = " << str << std::endl;
726 
727  }
728 
729  if(str == "$PhysicalNames" || str == "$PhysicalNames\r" )
730  {
731 
732  int64_t n_entities;
733  read >> n_entities;
734  int max_dimension = 0;
735 
736  int dimension, id;
737  std::string name;
738  std::pair<int, std::string> chunk;
739 
740  for (int64_t inode = 0; inode < n_entities; inode++) {
741 
742  read.getline(buf, 1024);
743  read >> dimension;
744  read >> id;
745  read >> name;
746  name.erase(0,1);
747  name.erase(name.end()-1,name.end());
749 
751  {
752  std::cout << "Automatically associating " << name << " with material id " << id << std::endl;
754  }
755  else
756  {
757  int pzmatid = m_dim_name_and_physical_tag[dimension][name];
758  std::cout << "Associating " << name << " with material id " << id <<
759  " with pz material id " << pzmatid << std::endl;
760  }
761 
763 
764  if (max_dimension < dimension) {
765  max_dimension = dimension;
766  }
767  }
768  gmesh->SetDimension(max_dimension);
769 
770  char buf_end[1024];
771  read.getline(buf_end, 1024);
772  read.getline(buf_end, 1024);
773  std::string str_end(buf_end);
774  if(str_end == "$EndPhysicalNames" || str_end == "$EndPhysicalNames\r")
775  {
776  std::cout << "Read mesh physical entities = " << n_entities << std::endl;
777  }
778  continue;
779  }
780 
781  if(str == "$Nodes" || str == "$Nodes\r")
782  {
783 
784  int64_t n_nodes;
785  read >> n_nodes;
786 
787  int64_t node_id;
788  double nodecoordX , nodecoordY , nodecoordZ ;
789  gmesh -> NodeVec().Resize(n_nodes);
790  gmesh->SetMaxNodeId(n_nodes-1);
791 
792  // needed for node insertion
793  const int64_t Tnodes = n_nodes;
794  TPZVec <TPZGeoNode> Node(Tnodes);
795 
796  for (int64_t inode = 0; inode < n_nodes; inode++) {
797 
798  read.getline(buf, 1024);
799  read >> node_id;
800  read >> nodecoordX;
801  read >> nodecoordY;
802  read >> nodecoordZ;
803 
804  Node[node_id-1].SetNodeId(node_id-1);
805  Node[node_id-1].SetCoord(0,nodecoordX/m_characteristic_lentgh);
806  Node[node_id-1].SetCoord(1,nodecoordY/m_characteristic_lentgh);
807  Node[node_id-1].SetCoord(2,nodecoordZ/m_characteristic_lentgh);
808  gmesh->NodeVec()[node_id-1] = Node[node_id-1];
809 
810  }
811 
812 
813  char buf_end[1024];
814  read.getline(buf_end, 1024);
815  read.getline(buf_end, 1024);
816  std::string str_end(buf_end);
817  if(str_end == "$EndNodes" || str_end == "$EndNodes\r")
818  {
819  std::cout << "Read mesh nodes = " << gmesh->NNodes() << std::endl;
820  }
821  continue;
822  }
823 
824  if(str == "$Elements" || str == "$Elements\r")
825  {
826 
827  int64_t n_elements;
828  read >> n_elements;
829  gmesh->SetMaxElementId(n_elements-1);
830 
831  for (int64_t iel = 0; iel < n_elements; iel++) {
832  this->InsertElement(gmesh, read);
833  }
834 
835  char buf_end[1024];
836  read.getline(buf_end, 1024);
837  read.getline(buf_end, 1024);
838  std::string str_end(buf_end);
839  if(str_end == "$EndElements" || str_end == "$EndElements\r")
840  {
841  std::cout << "Read mesh elements = " << gmesh->NElements() << std::endl;
842  }
843  continue;
844  }
845 
846  }
847 
848  }
849 
850  std::cout << "Read General Mesh Data -> done!" << std::endl;
851  std::cout << "Number of elements " << gmesh->NElements() << std::endl;
852  gmesh->BuildConnectivity();
853  std::cout << "Geometric Mesh Connectivity -> done!" << std::endl;
854  return gmesh;
855 
856 }// End Method
857 
859 {
860  m_characteristic_lentgh = length;
861 }
862 
863 void TPZGmshReader::SetFormatVersion(std::string format_version)
864 {
865  m_format_version = format_version;
866 }
867 
869 bool TPZGmshReader::InsertElement(TPZGeoMesh * gmesh, std::ifstream & line){
870 
871  // first implementation based on linear elements: http://gmsh.info/doc/texinfo/gmsh.html#File-formats
872  TPZManVector <int64_t,1> TopolPoint(1);
873  TPZManVector <int64_t,2> TopolLine(2);
874  TPZManVector <int64_t,3> TopolTriangle(3);
875  TPZManVector <int64_t,4> TopolQuad(4);
876  TPZManVector <int64_t,4> TopolTet(4);
877  TPZManVector <int64_t,5> TopolPyr(5);
878  TPZManVector <int64_t,6> TopolPrism(6);
879  TPZManVector <int64_t,8> TopolHex(8);
880 
881  TPZManVector <int64_t,2> TopolLineQ(3);
882  TPZManVector <int64_t,6> TopolTriangleQ(6);
883  TPZManVector <int64_t,8> TopolQuadQ(8);
884  TPZManVector <int64_t,10> TopolTetQ(10);
885  TPZManVector <int64_t,5> TopolPyrQ(14);
886  TPZManVector <int64_t,15> TopolPrismQ(15);
887  TPZManVector <int64_t,8> TopolHexQ(20);
888 
889 
890  int64_t element_id, type_id, div_id, physical_id, elementary_id;
891 
892  int dimensions[] = {-1 , 1 , 2 , 2 , 3 , 3 , 3 , 3 , 1 , 2 , 2 , 3 , 3 , 3 , 3 , 0};
893 
894  char buf[1024];
895  buf[0] = 0;
896  line.getline(buf, 1024);
897 
898  line >> element_id;
899  line >> type_id;
900  line >> div_id;
901  line >> physical_id;
902  line >> elementary_id;
903 
904  if (div_id != 2 || type_id > 15) {
905  std::cout << "div_id " << div_id << " type_id " << type_id << std::endl;
906  DebugStop();
907  }
908  int dimension = dimensions[type_id];
909  if (m_dim_physical_tag_and_physical_tag[dimension].find(physical_id) == m_dim_physical_tag_and_physical_tag[dimension].end())
910  {
911  std::cout << __PRETTY_FUNCTION__ << "physical_id " << physical_id << " not found bailing out\n";
912  DebugStop();
913  }
914  int matid = m_dim_physical_tag_and_physical_tag[dimension][physical_id];
915 
916  m_entity_index.Resize(element_id);
917  m_entity_index[element_id-1] = elementary_id;
918  switch (type_id) {
919  case 1:
920  {
921  // Line
922  line >> TopolLine[0]; //node 1
923  line >> TopolLine[1]; //node 2
924  element_id--;
925  TopolLine[0]--;
926  TopolLine[1]--;
927  if(dimension < 1)
928  {
929  gmesh->SetDimension(1);
930  dimension = 1;
931  }
932  new TPZGeoElRefPattern< pzgeom::TPZGeoLinear> (element_id, TopolLine, matid, *gmesh);
933  }
934  break;
935  case 2:
936  {
937  // Triangle
938  line >> TopolTriangle[0]; //node 1
939  line >> TopolTriangle[1]; //node 2
940  line >> TopolTriangle[2]; //node 3
941  element_id--;
942  TopolTriangle[0]--;
943  TopolTriangle[1]--;
944  TopolTriangle[2]--;
945  if (dimension < 2) {
946  gmesh->SetDimension(2);
947  dimension = 2;
948  }
949  new TPZGeoElRefPattern< pzgeom::TPZGeoTriangle> (element_id, TopolTriangle, matid, *gmesh);
950 
951  }
952  break;
953  case 3:
954  {
955  // Quadrilateral
956  line >> TopolQuad[0]; //node 1
957  line >> TopolQuad[1]; //node 2
958  line >> TopolQuad[2]; //node 3
959  line >> TopolQuad[3]; //node 4
960  element_id--;
961  TopolQuad[0]--;
962  TopolQuad[1]--;
963  TopolQuad[2]--;
964  TopolQuad[3]--;
965  if (dimension < 2) {
966  gmesh->SetDimension(2);
967  dimension = 2;
968  }
969  new TPZGeoElRefPattern< pzgeom::TPZGeoQuad> (element_id, TopolQuad, matid, *gmesh);
970 
971  }
972  break;
973  case 4:
974  {
975  // Tetrahedron
976  line >> TopolTet[0]; //node 1
977  line >> TopolTet[1]; //node 2
978  line >> TopolTet[2]; //node 3
979  line >> TopolTet[3]; //node 4
980  element_id--;
981  TopolTet[0]--;
982  TopolTet[1]--;
983  TopolTet[2]--;
984  TopolTet[3]--;
985  if (dimension < 3) {
986  dimension = 3;
987  gmesh->SetDimension(dimension);
988  }
989  new TPZGeoElRefPattern< pzgeom::TPZGeoTetrahedra> (element_id, TopolTet, matid, *gmesh);
990 
991  }
992  break;
993  case 5:
994  {
995  // Hexahedra
996  line >> TopolHex[0]; //node 1
997  line >> TopolHex[1]; //node 2
998  line >> TopolHex[2]; //node 3
999  line >> TopolHex[3]; //node 4
1000  line >> TopolHex[4]; //node 5
1001  line >> TopolHex[5]; //node 6
1002  line >> TopolHex[6]; //node 7
1003  line >> TopolHex[7]; //node 8
1004  element_id--;
1005  TopolHex[0]--;
1006  TopolHex[1]--;
1007  TopolHex[2]--;
1008  TopolHex[3]--;
1009  TopolHex[4]--;
1010  TopolHex[5]--;
1011  TopolHex[6]--;
1012  TopolHex[7]--;
1013  if (dimension < 3) {
1014  dimension = 3;
1015  gmesh->SetDimension(dimension);
1016  }
1017  new TPZGeoElRefPattern< pzgeom::TPZGeoCube> (element_id, TopolHex, matid, *gmesh);
1018  }
1019  break;
1020  case 6:
1021  {
1022  // Prism
1023  line >> TopolPrism[0]; //node 1
1024  line >> TopolPrism[1]; //node 2
1025  line >> TopolPrism[2]; //node 3
1026  line >> TopolPrism[3]; //node 4
1027  line >> TopolPrism[4]; //node 5
1028  line >> TopolPrism[5]; //node 6
1029  element_id--;
1030  TopolPrism[0]--;
1031  TopolPrism[1]--;
1032  TopolPrism[2]--;
1033  TopolPrism[3]--;
1034  TopolPrism[4]--;
1035  TopolPrism[5]--;
1036  if (dimension < 3) {
1037  dimension = 3;
1038  gmesh->SetDimension(dimension);
1039  }
1040 
1041  new TPZGeoElRefPattern< pzgeom::TPZGeoPrism> (element_id, TopolPrism, matid, *gmesh);
1042  }
1043  break;
1044  case 7:
1045  {
1046  // Pyramid
1047  line >> TopolPyr[0]; //node 1
1048  line >> TopolPyr[1]; //node 2
1049  line >> TopolPyr[2]; //node 3
1050  line >> TopolPyr[3]; //node 4
1051  line >> TopolPyr[4]; //node 5
1052  element_id--;
1053  TopolPyr[0]--;
1054  TopolPyr[1]--;
1055  TopolPyr[2]--;
1056  TopolPyr[3]--;
1057  TopolPyr[4]--;
1058  if (dimension < 3) {
1059  dimension = 3;
1060  gmesh->SetDimension(dimension);
1061  }
1062  new TPZGeoElRefPattern< pzgeom::TPZGeoPyramid> (element_id, TopolPyr, matid, *gmesh);
1063  }
1064  break;
1065  case 8:
1066  {
1067  // Quadratic Line
1068  line >> TopolLineQ[0]; //node 1
1069  line >> TopolLineQ[1]; //node 2
1070  line >> TopolLineQ[2]; //node 2
1071  element_id--;
1072  TopolLineQ[0]--;
1073  TopolLineQ[1]--;
1074  TopolLineQ[2]--;
1075  if (dimension < 1) {
1076  dimension = 1;
1077  gmesh->SetDimension(dimension);
1078  }
1079  new TPZGeoElRefPattern< pzgeom::TPZQuadraticLine> (element_id, TopolLineQ, matid, *gmesh);
1080  }
1081  break;
1082  case 9:
1083  {
1084  // Triangle
1085  line >> TopolTriangleQ[0]; //node 1
1086  line >> TopolTriangleQ[1]; //node 2
1087  line >> TopolTriangleQ[2]; //node 3
1088  line >> TopolTriangleQ[3]; //node 4
1089  line >> TopolTriangleQ[4]; //node 5
1090  line >> TopolTriangleQ[5]; //node 6
1091  element_id--;
1092  TopolTriangleQ[0]--;
1093  TopolTriangleQ[1]--;
1094  TopolTriangleQ[2]--;
1095  TopolTriangleQ[3]--;
1096  TopolTriangleQ[4]--;
1097  TopolTriangleQ[5]--;
1098  if (dimension < 2) {
1099  dimension = 2;
1100  gmesh->SetDimension(dimension);
1101  }
1102  new TPZGeoElRefPattern< pzgeom::TPZQuadraticTrig> (element_id, TopolTriangleQ, matid, *gmesh);
1103  }
1104  break;
1105  case 10:
1106  {
1107  // Quadrilateral
1108  line >> TopolQuadQ[0]; //node 1
1109  line >> TopolQuadQ[1]; //node 2
1110  line >> TopolQuadQ[2]; //node 3
1111  line >> TopolQuadQ[3]; //node 4
1112  line >> TopolQuadQ[4]; //node 5
1113  line >> TopolQuadQ[5]; //node 6
1114  line >> TopolQuadQ[6]; //node 7
1115  line >> TopolQuadQ[7]; //node 8
1116  element_id--;
1117  TopolQuadQ[0]--;
1118  TopolQuadQ[1]--;
1119  TopolQuadQ[2]--;
1120  TopolQuadQ[3]--;
1121  TopolQuadQ[4]--;
1122  TopolQuadQ[5]--;
1123  TopolQuadQ[6]--;
1124  TopolQuadQ[7]--;
1125  if (dimension < 2) {
1126  dimension = 2;
1127  gmesh->SetDimension(dimension);
1128  }
1129  new TPZGeoElRefPattern< pzgeom::TPZQuadraticQuad> (element_id, TopolQuadQ, matid, *gmesh);
1130  }
1131  break;
1132  case 11:
1133  {
1134  // Tetrahedron
1135  line >> TopolTetQ[0]; //node 1
1136  line >> TopolTetQ[1]; //node 2
1137  line >> TopolTetQ[2]; //node 3
1138  line >> TopolTetQ[3]; //node 4
1139 
1140  line >> TopolTetQ[4]; //node 4 -> 4
1141  line >> TopolTetQ[5]; //node 5 -> 5
1142  line >> TopolTetQ[6]; //node 6 -> 6
1143  line >> TopolTetQ[7]; //node 7 -> 7
1144  line >> TopolTetQ[9]; //node 9 -> 8
1145  line >> TopolTetQ[8]; //node 8 -> 9
1146 
1147  element_id--;
1148  TopolTetQ[0]--;
1149  TopolTetQ[1]--;
1150  TopolTetQ[2]--;
1151  TopolTetQ[3]--;
1152 
1153  TopolTetQ[4]--;
1154  TopolTetQ[5]--;
1155  TopolTetQ[6]--;
1156  TopolTetQ[7]--;
1157  TopolTetQ[8]--;
1158  TopolTetQ[9]--;
1159  if (dimension < 3) {
1160  dimension = 3;
1161  gmesh->SetDimension(dimension);
1162  }
1163  new TPZGeoElRefPattern< pzgeom::TPZQuadraticTetra> (element_id, TopolTetQ, matid, *gmesh);
1164 
1165  }
1166  break;
1167  case 12:
1168  {
1169  // Hexahedra
1170  line >> TopolHexQ[0]; //node 1
1171  line >> TopolHexQ[1]; //node 2
1172  line >> TopolHexQ[2]; //node 3
1173  line >> TopolHexQ[3]; //node 4
1174  line >> TopolHexQ[4]; //node 5
1175  line >> TopolHexQ[5]; //node 6
1176  line >> TopolHexQ[6]; //node 7
1177  line >> TopolHexQ[7]; //node 8
1178 
1179  line >> TopolHexQ[8]; //node 8 -> 8
1180  line >> TopolHexQ[11]; //node 11 -> 9
1181  line >> TopolHexQ[12]; //node 12 -> 10
1182  line >> TopolHexQ[9]; //node 9 -> 11
1183  line >> TopolHexQ[13]; //node 13 -> 12
1184  line >> TopolHexQ[10]; //node 10 -> 13
1185  line >> TopolHexQ[14]; //node 14 -> 14
1186  line >> TopolHexQ[15]; //node 15 -> 15
1187  line >> TopolHexQ[16]; //node 16 -> 16
1188  line >> TopolHexQ[19]; //node 19 -> 17
1189  line >> TopolHexQ[17]; //node 17 -> 18
1190  line >> TopolHexQ[18]; //node 18 -> 19
1191 
1192  element_id--;
1193  TopolHexQ[0]--;
1194  TopolHexQ[1]--;
1195  TopolHexQ[2]--;
1196  TopolHexQ[3]--;
1197  TopolHexQ[4]--;
1198  TopolHexQ[5]--;
1199  TopolHexQ[6]--;
1200  TopolHexQ[7]--;
1201 
1202  TopolHexQ[8]--;
1203  TopolHexQ[9]--;
1204  TopolHexQ[10]--;
1205  TopolHexQ[11]--;
1206  TopolHexQ[12]--;
1207  TopolHexQ[13]--;
1208  TopolHexQ[14]--;
1209  TopolHexQ[15]--;
1210  TopolHexQ[16]--;
1211  TopolHexQ[17]--;
1212  TopolHexQ[18]--;
1213  TopolHexQ[19]--;
1214  if (dimension < 3) {
1215  dimension = 3;
1216  gmesh->SetDimension(dimension);
1217  }
1218  new TPZGeoElRefPattern< pzgeom::TPZQuadraticCube> (element_id, TopolHexQ, matid, *gmesh);
1219  }
1220  break;
1221  case 13:
1222  {
1223  // Prism
1224  line >> TopolPrismQ[0]; //node 1
1225  line >> TopolPrismQ[1]; //node 2
1226  line >> TopolPrismQ[2]; //node 3
1227  line >> TopolPrismQ[3]; //node 4
1228  line >> TopolPrismQ[4]; //node 5
1229  line >> TopolPrismQ[5]; //node 6
1230 
1231  line >> TopolPrismQ[6]; //node 6 -> 6
1232  line >> TopolPrismQ[8]; //node 8 -> 7
1233  line >> TopolPrismQ[9]; //node 9 -> 8
1234  line >> TopolPrismQ[7]; //node 7 -> 9
1235  line >> TopolPrismQ[10]; //node 11 -> 10
1236  line >> TopolPrismQ[11]; //node 12 -> 11
1237  line >> TopolPrismQ[12]; //node 13 -> 12
1238  line >> TopolPrismQ[14]; //node 14 -> 13
1239  line >> TopolPrismQ[13]; //node 15 -> 14
1240 
1241  element_id--;
1242  TopolPrismQ[0]--;
1243  TopolPrismQ[1]--;
1244  TopolPrismQ[2]--;
1245  TopolPrismQ[3]--;
1246  TopolPrismQ[4]--;
1247  TopolPrismQ[5]--;
1248 
1249  TopolPrismQ[6]--;
1250  TopolPrismQ[7]--;
1251  TopolPrismQ[8]--;
1252  TopolPrismQ[9]--;
1253  TopolPrismQ[10]--;
1254  TopolPrismQ[11]--;
1255  TopolPrismQ[12]--;
1256  TopolPrismQ[13]--;
1257  TopolPrismQ[14]--;
1258  if (dimension < 3) {
1259  dimension = 3;
1260  gmesh->SetDimension(dimension);
1261  }
1262 
1263  new TPZGeoElRefPattern< pzgeom::TPZQuadraticPrism> (element_id, TopolPrismQ, matid, *gmesh);
1264  }
1265  break;
1266  case 15:{
1267  // Point
1268  line >> TopolPoint[0];
1269  TopolPoint[0]--;
1270  element_id--;
1271  new TPZGeoElement< pzgeom::TPZGeoPoint, pzrefine::TPZRefPoint> (element_id, TopolPoint, matid, *gmesh);
1272  }
1273  break;
1274  default:
1275  {
1276  std::cout << "Element not impelemented." << std::endl;
1277  DebugStop();
1278  }
1279  break;
1280  }
1281 
1282  return true;
1283 }
TPZGeoMesh * GeometricGmshMesh4(std::string file_name, TPZGeoMesh *gmesh=NULL)
Convert a Gmsh *.msh file with format 4 to a TPZGeoMesh object.
int m_n_physical_curves
Number of curves with physical tag.
Definition: TPZGmshReader.h:90
int m_n_prism_els
Number of prisms.
Contains the TPZQuadraticPrism class which defines a prism geometric element with quadratic map...
void SetMaxElementId(int64_t id)
Used in patch meshes.
Definition: pzgmesh.h:123
void InsertElement(TPZGeoMesh *gmesh, int &physical_identifier, int &el_type, int &el_identifier, std::vector< int > &node_identifiers)
int m_n_quadrilateral_els
Number of quadrilaterals.
TPZManVector< std::map< int, std::vector< int > >, 4 > m_dim_entity_tag_and_physical_tag
Data structure of both: physical entities and names indexed by dimension.
TPZGeoMesh * GeometricGmshMesh(std::string file_name, TPZGeoMesh *gmesh=NULL)
Convert Gmsh msh files in a TPZGeoMesh object.
Contains declaration of TPZGeoElSide class which represents an element and its side, and TPZGeoElSideIndex class which represents an TPZGeoElSide index.
Implements a vector class which allows to use external storage provided by the user. Utility.
Definition: pzquad.h:16
int m_n_triangle_els
Number of triangles.
clarg::argInt dimension("-d", "Matrices dimension M x M", 1000)
TPZGeoMesh * GeometricGmshMesh3(std::string file_name, TPZGeoMesh *gmesh=NULL)
Convert a Gmsh *.msh file with format 3 to a TPZGeoMesh object.
int m_n_curves
Number of curves.
Definition: TPZGmshReader.h:78
Implements a generic geometric element with a uniform refinement pattern. Geometry.
Definition: TPZGeoElement.h:22
Contains the TPZQuadraticQuad class which defines a quadrilateral geometric element with quadratic ma...
TPZManVector< std::map< int, std::string >, 4 > m_dim_physical_tag_and_name
Structure of both: physical entities and names indexed by dimension.
Contains the TPZPoint class which defines the topology of a point.
TPZVec< int64_t > m_entity_index
Entity index to which the element belongs.
int m_n_volumes
Number of volumes.
Definition: TPZGmshReader.h:72
int64_t NElements() const
Number of elements of the mesh.
Definition: pzgmesh.h:129
int m_n_physical_points
Number of points with physical tag.
Definition: TPZGmshReader.h:93
This class implements a simple vector storage scheme for a templated class T. Utility.
Definition: pzgeopoint.h:19
TPZManVector< std::map< std::string, int >, 4 > m_dim_name_and_physical_tag
Structure of both: names and physical id indexed by dimension.
void SetDimension(int dim)
Set Dimension.
Definition: pzgmesh.h:285
virtual void Resize(const int64_t newsize, const T &object)
Resizes the vector object.
Definition: pzmanvector.h:426
int m_n_line_els
Number of triangles.
int m_n_tetrahedron_els
Number of tetrahedra.
int64_t size() const
Returns the number of elements of the vector.
Definition: pzvec.h:196
virtual void Resize(const int64_t newsize, const T &object)
Resizes the vector object reallocating the necessary storage, copying the existing objects to the new...
Definition: pzvec.h:373
void SetFormatVersion(std::string format_version)
Set the format version.
void PrintPartitionSummary(std::ostream &out)
Print the partition summary after the reading process.
int64_t i_dim(int64_t value_1, int64_t value_2)
Definition: profi1.cpp:102
void SetMaxNodeId(int64_t id)
Used in patch meshes.
Definition: pzgmesh.h:120
Implements a generic geometric element which is refined according to a generic refinement pattern...
Definition: pzgmesh.h:35
int m_dimension
Geometry dimension.
Definition: TPZGmshReader.h:96
Contains the TPZGeoBlend class which implements a blending map from curved boundaries to the interior...
const TPZGmshReader & operator=(const TPZGmshReader &other)
Assignement constructor.
Contains the TPZGeoTetrahedra class which implements the geometry of a tetrahedral element...
#define DebugStop()
Returns a message to user put a breakpoint in.
Definition: pzerror.h:20
int64_t NNodes() const
Number of nodes of the mesh.
Definition: pzgmesh.h:126
def read(filename)
Definition: stats.py:13
int GetNumberofNodes(int &el_type)
TPZGmshReader()
Default constructor.
TPZAdmChunkVector< TPZGeoNode > & NodeVec()
Definition: pzgmesh.h:140
int m_n_physical_surfaces
Number of surfaces with physical tag.
Definition: TPZGmshReader.h:87
Contains declaration of TPZGeoElRefPattern class which implements a generic geometric element which i...
int m_n_surfaces
Number of surfaces.
Definition: TPZGmshReader.h:75
Contains the TPZQuadraticLine class which defines a linear geometric element with quadratic map...
Contains the TPZQuadraticCube class which defines a cube geometric element with quadratic map...
Contains the TPZRefPattern class which defines the topology of the current refinement pattern to a me...
std::string m_format_version
gmsh file format version (supported versions = {3,4})
Definition: TPZGmshReader.h:69
REAL m_characteristic_lentgh
Characteristic length to apply a Scale affine transformation.
Definition: TPZGmshReader.h:99
Contains the TPZGeoCube class which implements the geometry of hexahedra element. ...
Contains the TPZQuadraticTrig class which defines a triangular geometric element with quadratic map...
Implement the interface between TPZGeoMesh and the files produced by Gmsh (version 3...
Definition: TPZGmshReader.h:66
Contains the TPZGeoPoint class which implements the geometry of a point element or 0-D element...
void SetCharacteristiclength(REAL length)
Set the Characteristic length.
int m_n_points
Number of points.
Definition: TPZGmshReader.h:81
void BuildConnectivity()
Build the connectivity of the grid.
Definition: pzgmesh.cpp:967
~TPZGmshReader()
Default destructor.
Contains the TPZArc3D class which implements three dimensional arc.
This class implements a geometric mesh for the pz environment. Geometry.
Definition: pzgmesh.h:48
int m_n_hexahedron_els
Number of hexahedra.
TPZManVector< std::map< int, int >, 4 > m_dim_physical_tag_and_physical_tag
Structure of both: physical id and user defined physical tag indexed by dimension.
int m_n_pyramid_els
Number of pyramids.
Contains the TPZGeoPyramid class which implements the geometry of pyramid element.
int m_n_point_els
Number of points.
Contains the TPZCube class which defines the topology of the hexahedron element.
Contains declaration of TPZGeoElement class which implements a generic geometric element with a unifo...
Contains the TPZQuadraticTetra class which defines a tetrahedral geometric element with quadratic map...
int m_n_physical_volumes
Number of volumes with physical tag.
Definition: TPZGmshReader.h:84
T * end() const
Returns a pointer to the last+1 element.
Definition: pzvec.h:455
Contains the TPZRefPoint class which implements the uniform refinement of a geometric point element...