RINGMesh  Version 5.0.0
A programming library for geological model meshes
geomodel_mesh.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012-2017, Association Scientifique pour la Geologie et ses
3  * Applications (ASGA). All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  * * Redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer.
9  * * Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution.
12  * * Neither the name of ASGA nor the
13  * names of its contributors may be used to endorse or promote products
14  * derived from this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
18  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ASGA BE LIABLE FOR ANY DIRECT,
20  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  *
27  * http://www.ring-team.org
28  *
29  * RING Project
30  * Ecole Nationale Superieure de Geologie - GeoRessources
31  * 2 Rue du Doyen Marcel Roubault - TSA 70605
32  * 54518 VANDOEUVRE-LES-NANCY
33  * FRANCE
34  */
35 
36 #pragma once
37 
38 #include <ringmesh/basic/common.h>
39 
42 
43 #include <ringmesh/mesh/mesh.h>
45 
56 namespace RINGMesh
57 {
58  FORWARD_DECLARATION_DIMENSION_CLASS( GeoModelMeshBase );
59  FORWARD_DECLARATION_DIMENSION_CLASS( GeoModelEntity );
60  FORWARD_DECLARATION_DIMENSION_CLASS( GeoModelMeshEntity );
61  FORWARD_DECLARATION_DIMENSION_CLASS( GeoModelMeshEdges );
62  FORWARD_DECLARATION_DIMENSION_CLASS( GeoModelMeshWells );
63  FORWARD_DECLARATION_DIMENSION_CLASS( GeoModelMeshPolygons );
64  FORWARD_DECLARATION_DIMENSION_CLASS( GeoModelMeshPolygonsBase );
65  FORWARD_DECLARATION_DIMENSION_CLASS( GeoModelMeshCells );
68 
69  ALIAS_3D( GeoModel );
70  ALIAS_3D( GeoModelMesh );
71 } // namespace RINGMesh
72 
73 namespace RINGMesh
74 {
77  template < index_t DIMENSION >
78  class RINGMESH_API GeoModelMeshCommon
79  {
82 
83  protected:
86 
87  virtual ~GeoModelMeshCommon() = default;
88 
90  {
91  mesh_base_ = mesh;
92  }
93 
94  void save_mesh( const std::string& filename ) const
95  {
96  mesh_base_->save_mesh( filename );
97  }
98 
99  protected:
106  };
107 
108  template < index_t DIMENSION >
109  class RINGMESH_API GeoModelMeshVerticesBase
110  : public GeoModelMeshCommon< DIMENSION >
111  {
112  public:
113  friend class GeoModelMeshWells< DIMENSION >;
114  friend class GeoModelMeshEdges< DIMENSION >;
115  friend class GeoModelMeshPolygonsBase< DIMENSION >;
116  friend class GeoModelMeshCells< DIMENSION >;
117 
118  GEO::AttributesManager& attribute_manager() const
119  {
120  return mesh_->vertex_attribute_manager();
121  }
122 
126  bool is_initialized() const;
131  void test_and_initialize() const;
132 
136  index_t nb() const;
137 
142  const vecn< DIMENSION >& vertex( index_t v ) const;
143 
150  index_t index( const vecn< DIMENSION >& p ) const;
151 
161  index_t geomodel_vertex_id(
162  const gmme_id& mesh_entity, index_t entity_vertex_index = 0 ) const;
163 
172  index_t geomodel_vertex_id( const gmme_id& mesh_entity,
173  const ElementLocalVertex& element_local_vertex ) const;
174 
183  std::vector< index_t > mesh_entity_vertex_id(
184  const gmme_id& mesh_entity, index_t geomodel_vertex_id ) const;
185 
192  const std::vector< GMEVertex >& gme_vertices( index_t v ) const;
193 
198  std::vector< GMEVertex > gme_type_vertices(
199  const MeshEntityType& entity_type, index_t vertex ) const;
200 
208  index_t add_vertex( const vecn< DIMENSION >& point );
209  index_t add_vertices( const std::vector< vecn< DIMENSION > >& points );
210 
217  void update_point( index_t v, const vecn< DIMENSION >& point );
218 
219  void update_vertex_mapping( const gmme_id& entity_id,
220  index_t entity_vertex_index,
221  index_t geomodel_vertex_index );
222 
228  virtual void clear();
229 
230  void unbind_geomodel_vertex_map( const gmme_id& mesh_entity_id );
231 
232  void bind_geomodel_vertex_map( const gmme_id& mesh_entity_id );
233 
235  {
236  test_and_initialize();
237  return mesh_->vertex_nn_search();
238  }
239 
243  void remove_colocated();
244 
257  void erase_vertices( std::vector< index_t >& to_delete );
258 
259  private:
266  void initialize();
267 
268  protected:
271  std::unique_ptr< PointSetMesh< DIMENSION > >& mesh );
272 
278  virtual index_t nb_total_vertices() const;
279  virtual index_t fill_vertices();
280  void fill_vertices_for_entity_type( const GeoModel< DIMENSION >& M,
281  const MeshEntityType& entity_type,
282  index_t& count );
283 
284  private:
291  {
293 
294  public:
296  const GeoModel< DIMENSION >& geomodel );
297 
298  ~GeoModelVertexMapper() = default;
299 
314  index_t geomodel_vertex_index( const gmme_id& mesh_entity_id,
315  index_t mesh_entity_vertex_index ) const;
316 
324  const std::vector< GMEVertex >& mesh_entity_vertex_indices(
325  index_t v ) const;
326 
336  std::vector< GMEVertex > mesh_entity_vertex_indices(
337  index_t v, const MeshEntityType& mesh_entity_type ) const;
338 
348  std::vector< index_t > mesh_entity_vertex_indices(
349  index_t v, const gmme_id& mesh_entity_id ) const;
350 
351  const std::vector< index_t >& vertex_map(
352  const gmme_id& mesh_entity_id ) const;
353 
354  std::vector< index_t >& vertex_map( const gmme_id& mesh_entity_id );
355 
370  void set_vertex_map_value( const gmme_id& mesh_entity_id,
371  index_t mesh_entity_vertex_index,
372  index_t geomodel_entity_vertex_index );
373 
374  void add_to_gme_vertices(
375  const GMEVertex& gme_vertex, index_t geomodel_vertex_index );
376 
386  void update_mesh_entity_maps_and_gmes(
387  const std::vector< index_t >& old2new );
388 
398  void resize_geomodel_vertex_gmes( const index_t nb )
399  {
400  gme_vertices_.resize( nb );
401  }
402 
407  void clear_and_resize_geomodel_vertex_gmes( const index_t nb )
408  {
409  gme_vertices_.clear();
410  resize_geomodel_vertex_gmes( nb );
411  }
412 
413  void bind_all_mesh_entity_vertex_maps();
414 
425  void clear();
426 
430  void clear_geomodel_vertex_gmes( index_t v )
431  {
432  ringmesh_assert( v < gme_vertices_.size() );
433  gme_vertices_[v].clear();
434  }
435 
436  void clear_vertex_map( const gmme_id& mesh_entity_id );
437 
438  std::vector< index_t >& resize_vertex_map(
439  const gmme_id& mesh_entity_id );
440 
445  private:
450  void initialize_mesh_entity_vertex_map(
451  const gmme_id& mesh_entity_id );
452 
460  bool test_and_initialize_mesh_entity_vertex_map(
461  const gmme_id& mesh_entity_id );
462 
468  bool is_mesh_entity_vertex_map_initialized(
469  const gmme_id& mesh_entity_id ) const;
470 
474  void clear_all_mesh_entity_vertex_map();
475 
476  void resize_all_mesh_entity_vertex_maps(
477  const MeshEntityType& type );
478 
483  GEO::AttributesManager& mesh_entity_vertex_attribute_manager(
484  const gmme_id& mesh_entity_id ) const;
485 
486  private:
489 
491  std::vector< std::vector< index_t > > corner_vertex_maps_;
492  std::vector< std::vector< index_t > > line_vertex_maps_;
493  std::vector< std::vector< index_t > > surface_vertex_maps_;
494  std::vector< std::vector< index_t > > region_vertex_maps_;
495  std::map< MeshEntityType, std::vector< std::vector< index_t > >* >
497 
499  std::vector< std::vector< GMEVertex > > gme_vertices_;
500  };
501 
502  protected:
504  std::unique_ptr< PointSetMesh< DIMENSION > >& mesh_;
506  GeoModelVertexMapper vertex_mapper_;
507  };
508 
510 
511  template < index_t DIMENSION >
512  class RINGMESH_API GeoModelMeshVertices final
513  : public GeoModelMeshVerticesBase< DIMENSION >
514  {
515  public:
518  std::unique_ptr< PointSetMesh< DIMENSION > >& mesh );
519  };
520 
521  template <>
522  class RINGMESH_API GeoModelMeshVertices< 3 > final
523  : public GeoModelMeshVerticesBase< 3 >
524  {
525  public:
526  GeoModelMeshVertices( GeoModelMesh3D& gmm,
527  GeoModel3D& gm,
528  std::unique_ptr< PointSetMesh3D >& mesh );
529 
530  void clear() override;
531  index_t nb_total_vertices() const override;
532  index_t fill_vertices() override;
533  };
534 
536 
537  template < index_t DIMENSION >
538  class RINGMESH_API GeoModelMeshPolygonsBase
539  : public GeoModelMeshCommon< DIMENSION >
540  {
542  static const std::string surface_att_name;
543  static const std::string polygon_surface_att_name;
544 
545  public:
546  friend class GeoModelMeshBase< DIMENSION >;
547  friend class GeoModelMesh< DIMENSION >;
548 
549  virtual ~GeoModelMeshPolygonsBase();
550 
551  GEO::AttributesManager& attribute_manager() const
552  {
553  return mesh_->polygon_attribute_manager();
554  }
555 
559  bool is_initialized() const;
560  void test_and_initialize() const;
561 
565  index_t nb() const;
566 
572  index_t nb_vertices( index_t polygon ) const;
580  index_t vertex( const ElementLocalVertex& polygon_local_vertex ) const;
586  index_t adjacent( const PolygonLocalEdge& polygon_local_edge ) const;
593  index_t surface( index_t polygon ) const;
601  index_t index_in_surface( index_t polygon ) const;
610  std::tuple< PolygonType, index_t > type( index_t polygon ) const;
611 
617  index_t nb_polygons( PolygonType type = PolygonType::UNDEFINED ) const;
625  index_t nb_polygons(
626  index_t surface, PolygonType type = PolygonType::UNDEFINED ) const;
651  index_t polygon( index_t surface,
652  index_t polygon,
653  PolygonType type = PolygonType::UNDEFINED ) const;
654 
659  index_t nb_triangle() const;
665  index_t nb_triangle( index_t surface ) const;
674  index_t triangle( index_t surface, index_t triangle ) const;
675 
680  index_t nb_quad() const;
686  index_t nb_quad( index_t surface ) const;
695  index_t quad( index_t surface, index_t quad ) const;
696 
701  index_t nb_unclassified_polygon() const;
707  index_t nb_unclassified_polygon( index_t surface ) const;
716  index_t unclassified_polygon( index_t surface, index_t polygon ) const;
717 
721  void clear();
722 
727  vecn< DIMENSION > center( index_t polygon ) const;
732  double area( index_t polygon ) const;
733 
735  {
736  test_and_initialize();
737  return mesh_->polygon_nn_search();
738  }
739 
743  const SurfaceAABBTree< DIMENSION >& aabb() const;
744 
745  private:
753  void initialize();
757  void resize_polygones_data();
761  void clear_polygones_data();
762 
766  void disconnect_along_lines();
767 
775  void sort_polygons();
776 
777  protected:
780  std::unique_ptr< SurfaceMesh< DIMENSION > >& mesh );
781 
782  protected:
784  std::unique_ptr< SurfaceMesh< DIMENSION > >& mesh_;
785 
787  std::vector< index_t > surface_id_;
789  std::vector< index_t > polygon_id_;
790 
798  std::vector< index_t > surface_polygon_ptr_;
799 
801  index_t nb_triangles_{ 0 };
803  index_t nb_quads_{ 0 };
805  index_t nb_unclassified_polygons_{ 0 };
806  };
807 
808  template < index_t DIMENSION >
809  class RINGMESH_API GeoModelMeshPolygons final
810  : public GeoModelMeshPolygonsBase< DIMENSION >
811  {
812  public:
815  std::unique_ptr< SurfaceMesh< DIMENSION > >& mesh );
816  };
817 
818  template <>
819  class GeoModelMeshPolygons< 3 > final : public GeoModelMeshPolygonsBase< 3 >
820  {
821  public:
822  GeoModelMeshPolygons( GeoModelMesh3D& gmm,
823  GeoModel3D& gm,
824  std::unique_ptr< SurfaceMesh3D >& mesh );
825 
830  vec3 normal( index_t p ) const;
831  };
832 
834 
835  template < index_t DIMENSION >
836  class RINGMESH_API GeoModelMeshEdges final
837  : public GeoModelMeshCommon< DIMENSION >
838  {
840  static const std::string line_att_name;
841  static const std::string edge_line_att_name;
842 
843  public:
844  friend class GeoModelMeshBase< DIMENSION >;
845  friend class GeoModelMesh< DIMENSION >;
846 
847  virtual ~GeoModelMeshEdges();
848 
849  GEO::AttributesManager& attribute_manager() const
850  {
851  return mesh_->edge_attribute_manager();
852  }
853 
857  bool is_initialized() const;
858  void test_and_initialize() const;
859 
863  index_t nb() const;
864 
872  index_t vertex( const ElementLocalVertex& edge_local_vertex ) const;
873 
880  index_t line( index_t edge ) const;
888  index_t index_in_line( index_t edge ) const;
889 
895  index_t nb_edges( index_t line ) const;
903  index_t edge( index_t line, index_t edge ) const;
907  void clear();
908 
913  vecn< DIMENSION > center( index_t edge ) const;
918  double length( index_t edge ) const;
919 
921  {
922  test_and_initialize();
923  return mesh_->edge_nn_search();
924  }
925 
929  const LineAABBTree< DIMENSION >& aabb() const;
930 
931  private:
939  void initialize();
943  void resize_edge_data();
947  void clear_edge_data();
948 
949  protected:
952  std::unique_ptr< LineMesh< DIMENSION > >& mesh );
953 
954  protected:
956  std::unique_ptr< LineMesh< DIMENSION > >& mesh_;
957 
959  std::vector< index_t > line_id_;
961  std::vector< index_t > edge_id_;
962 
970  std::vector< index_t > line_edge_ptr_;
971 
973  index_t nb_edges_{ 0 };
974  };
975 
977 
978  template < index_t DIMENSION >
979  class RINGMESH_API GeoModelMeshWells final
980  : public GeoModelMeshCommon< DIMENSION >
981  {
982  public:
985  std::unique_ptr< LineMesh< DIMENSION > >& mesh );
986 
987  GEO::AttributesManager& attribute_manager() const
988  {
989  return mesh_->edge_attribute_manager();
990  }
991 
995  bool is_initialized() const;
999  void test_and_initialize() const;
1000 
1005  index_t nb_wells() const;
1010  index_t nb_edges() const;
1016  index_t nb_edges( index_t well ) const;
1025  index_t vertex( index_t well, index_t edge, index_t vertex ) const;
1029  void clear();
1030 
1034  void initialize();
1035 
1039  const LineAABBTree< DIMENSION >& aabb() const;
1040 
1041  private:
1043  std::unique_ptr< LineMesh< DIMENSION > >& mesh_;
1044 
1049  std::vector< index_t > well_ptr_;
1050  };
1051 
1053 
1054  template < index_t DIMENSION >
1055  class RINGMESH_API GeoModelMeshCells final
1056  : public GeoModelMeshCommon< DIMENSION >
1057  {
1058  static const std::string region_att_name;
1059  static const std::string cell_region_att_name;
1060 
1061  public:
1062  friend class GeoModelMeshBase< DIMENSION >;
1063  friend class GeoModelMesh< DIMENSION >;
1064 
1073  {
1078  };
1079 
1082  std::unique_ptr< VolumeMesh< DIMENSION > >& mesh );
1083 
1084  GEO::AttributesManager& attribute_manager() const
1085  {
1086  return mesh_->cell_attribute_manager();
1087  }
1091  bool is_initialized() const;
1095  bool is_duplication_initialized() const;
1096 
1101  void test_and_initialize() const;
1102 
1106  index_t nb() const;
1111  index_t nb_duplicated_vertices() const;
1117  index_t nb_total_vertices() const;
1127  index_t duplicated_corner_index(
1128  const ElementLocalVertex& cell_local_vertex ) const;
1135  index_t duplicated_vertex( index_t duplicate_vertex_index ) const;
1136 
1142  index_t nb_vertices( index_t cell ) const;
1150  index_t vertex( const ElementLocalVertex& cell_local_vertex ) const;
1155  index_t nb_edges( index_t cell ) const;
1160  index_t nb_facets( index_t cell ) const;
1164  index_t nb_facet_vertices(
1165  const CellLocalFacet& cell_local_facet ) const;
1173  index_t facet_vertex( const CellLocalFacet& cell_local_facet,
1174  index_t local_vertex ) const;
1183  index_t edge_vertex(
1184  index_t cell, index_t local_edge, index_t local_vertex ) const;
1191  index_t adjacent( index_t cell, index_t facet ) const;
1198  index_t region( index_t cell ) const;
1206  index_t index_in_region( index_t cell ) const;
1215  CellType type( index_t cell ) const;
1216 
1222  index_t nb_cells( CellType type = CellType::UNDEFINED ) const;
1230  index_t nb_cells(
1231  index_t region, CellType type = CellType::UNDEFINED ) const;
1250  index_t cell( index_t region,
1251  index_t cell,
1252  CellType type = CellType::UNDEFINED ) const;
1253 
1258  index_t nb_tet() const;
1264  index_t nb_tet( index_t region ) const;
1272  index_t tet( index_t region, index_t tet ) const;
1273 
1278  index_t nb_hex() const;
1284  index_t nb_hex( index_t region ) const;
1292  index_t hex( index_t region, index_t hex ) const;
1293 
1298  index_t nb_prism() const;
1304  index_t nb_prism( index_t region ) const;
1313  index_t prism( index_t region, index_t prism ) const;
1314 
1319  index_t nb_pyramid() const;
1325  index_t nb_pyramid( index_t region ) const;
1333  index_t pyramid( index_t region, index_t pyramid ) const;
1334 
1339  index_t nb_connector() const;
1345  index_t nb_connector( index_t region ) const;
1354  index_t connector( index_t region, index_t connector ) const;
1355 
1359  void clear();
1363  void clear_duplication();
1364 
1376  bool is_cell_facet_on_surface( index_t cell,
1377  index_t facet_index,
1378  index_t& colocated_facet_index,
1379  bool& side ) const;
1380 
1385  vec3 barycenter( index_t cell ) const;
1390  double volume( index_t cell ) const;
1391 
1393  {
1394  test_and_initialize();
1395  return mesh_->cell_nn_search();
1396  }
1398  {
1399  test_and_initialize();
1400  return mesh_->cell_facet_nn_search();
1401  }
1402 
1406  const VolumeAABBTree< DIMENSION >& aabb() const;
1407 
1408  private:
1412  {
1414  SKIP = -2,
1416  TO_PROCESS = -1,
1418  NEG_SIDE = 0,
1420  POS_SIDE = 1
1421  };
1423  using action_on_surface = std::pair< index_t, ActionOnSurface >;
1424 
1429  void initialize();
1430 
1434  void resize_cell_data();
1438  void clear_cell_data();
1439 
1444  void test_and_initialize_duplication() const;
1449  void initialize_duplication();
1455  bool is_surface_to_duplicate( index_t surface ) const;
1456 
1467  bool are_corners_to_duplicate(
1468  const std::vector< action_on_surface >& surfaces,
1469  std::vector< ActionOnSurface >& info );
1474  void test_and_initialize_cell_facet() const;
1478  void initialize_cell_facet();
1479 
1480  void sort_cells();
1481 
1482  private:
1484  std::unique_ptr< VolumeMesh< DIMENSION > >& mesh_;
1485 
1487  std::vector< index_t > region_id_;
1489  std::vector< index_t > cell_id_;
1490 
1499  std::vector< index_t > region_cell_ptr_;
1500 
1502  index_t nb_tets_{ 0 };
1504  index_t nb_hexs_{ 0 };
1506  index_t nb_prisms_{ 0 };
1508  index_t nb_pyramids_{ 0 };
1510  index_t nb_connectors_{ 0 };
1511 
1519  std::vector< index_t > duplicated_vertex_indices_;
1520 
1526  std::vector< index_t > polygon_id_;
1527  };
1528 
1530 
1531  template < index_t DIMENSION >
1532  class RINGMESH_API GeoModelMeshBase
1533  {
1535  ringmesh_template_assert_2d_or_3d( DIMENSION );
1536 
1537  public:
1538  virtual ~GeoModelMeshBase();
1539 
1541  {
1542  return geomodel_;
1543  }
1544 
1548  void remove_colocated_vertices();
1549 
1562  void erase_vertices( std::vector< index_t >& to_delete );
1563 
1568  void erase_invalid_vertices();
1569 
1570  void change_point_set_mesh_data_structure( const MeshType& type );
1571  void change_line_mesh_data_structure( const MeshType& type );
1572  void change_surface_mesh_data_structure( const MeshType& type );
1573 
1574  protected:
1577 
1580 
1581  protected:
1584 
1585  public:
1590  };
1591 
1592  template < index_t DIMENSION >
1593  class RINGMESH_API GeoModelMesh final : public GeoModelMeshBase< DIMENSION >
1594  {
1595  public:
1596  explicit GeoModelMesh( GeoModel< DIMENSION >& geomodel );
1597  };
1598 
1599  template <>
1600  class RINGMESH_API GeoModelMesh< 3 > final : public GeoModelMeshBase< 3 >
1601  {
1603 
1604  public:
1605  explicit GeoModelMesh( GeoModel3D& geomodel );
1606  virtual ~GeoModelMesh();
1607 
1612  void transfer_attributes_from_gmm_to_gm_regions() const;
1613  void transfer_attributes_from_gm_regions_to_gmm() const;
1614  void transfer_cell_attributes_from_gmm_to_gm_regions() const;
1615  void transfer_cell_attributes_from_gm_regions_to_gmm() const;
1616  void transfer_vertex_attributes_from_gmm_to_gm_regions() const;
1617  void transfer_vertex_attributes_from_gm_regions_to_gmm() const;
1618 
1627  GeoModelMeshCells3D::DuplicateMode duplicate_mode() const
1628  {
1629  return mode_;
1630  }
1636  const GeoModelMeshCells3D::DuplicateMode& mode ) const
1637  {
1638  if( mode_ == mode )
1639  return;
1640  mode_ = mode;
1641  const_cast< GeoModelMesh3D* >( this )->cells.clear_duplication();
1642  }
1643 
1648  void change_volume_mesh_data_structure( const MeshType& type );
1649 
1650  private:
1653  mutable GeoModelMeshCells3D::DuplicateMode mode_{
1655  };
1656 
1657  public:
1658  GeoModelMeshCells3D cells;
1659  };
1660 
1662 
1663 } // namespace RINGMesh
#define ringmesh_disable_copy_and_move(Class)
Definition: common.h:76
GeoModelMeshVertices< DIMENSION > vertices
std::unique_ptr< PointSetMesh< DIMENSION > > & mesh_
Attached Mesh.
GEO::vecng< DIMENSION, double > vecn
Definition: types.h:74
void add_vertices(LineMeshBuilder< DIMENSION > *builder, index_t size)
Definition: test-aabb.cpp:69
const NNSearch< DIMENSION > & nn_search() const
GeoModelMesh< DIMENSION > & gmm_
Attached GeoModelMesh.
void clear_and_resize_geomodel_vertex_gmes(const index_t nb)
Clears and resizes the GME_Vertex vectors.
GEO::AttributesManager & attribute_manager() const
GEO::AttributesManager & attribute_manager() const
void set_duplicate_mode(const GeoModelMeshCells3D::DuplicateMode &mode) const
vecn< 3 > vec3
Definition: types.h:76
GeoModelMeshCells3D cells
GeoModel< DIMENSION > & geomodel_
Attached GeoModel.
std::vector< std::vector< index_t > > line_vertex_maps_
GEO::AttributesManager & attribute_manager() const
void set_mesh(MeshBase< DIMENSION > *mesh)
Definition: geomodel_mesh.h:89
void clear_geomodel_vertex_gmes(index_t v)
Clears the GME_Vertices about one geomodel vertex.
ALIAS_3D(GeoModel)
#define ringmesh_template_assert_2d_or_3d(type)
Definition: common.h:80
std::map< MeshEntityType, std::vector< std::vector< index_t > > *> vertex_maps_
ALIAS_2D_AND_3D(Box)
GEO::AttributesManager & attribute_manager() const
std::unique_ptr< VolumeMesh< DIMENSION > > & mesh_
Attached Mesh.
std::unique_ptr< LineMesh< DIMENSION > > & mesh_
Attached Mesh.
static const std::string surface_att_name
std::vector< index_t > region_cell_ptr_
MeshBase< DIMENSION > * mesh_base_
Attached MeshBase.
std::vector< index_t > surface_id_
Vector storing the surface index per polygon.
const NNSearch< DIMENSION > & nn_search() const
static const std::string polygon_surface_att_name
std::vector< index_t > cell_id_
Vector storing the cell index in region per cell.
GeoModelMeshEdges< DIMENSION > edges
GeoModelMeshWells< DIMENSION > wells
void resize_geomodel_vertex_gmes(const index_t nb)
Resizes the GME_Vertex vectors.
CellType
Definition: types.h:89
std::pair< index_t, ActionOnSurface > action_on_surface
Action to do according a surface index.
std::string MeshType
Definition: mesh.h:69
std::vector< index_t > polygon_id_
Vector storing the polygon index in surface per polygon.
std::vector< index_t > duplicated_vertex_indices_
Vector of duplicated vertices.
static const std::string edge_line_att_name
PolygonType
Definition: types.h:105
encapsulate adimensional mesh functionalities in order to provide an API on which we base the RINGMes...
Definition: mesh.h:138
std::vector< std::vector< index_t > > corner_vertex_maps_
Vertex maps.
std::vector< index_t > line_edge_ptr_
std::vector< index_t > region_id_
Vector storing the region index per cell.
std::vector< index_t > edge_id_
Vector storing the edge index in line per edge.
GeoModelVertexMapper vertex_mapper_
Mapper from/to GeoModelMeshEntity vertices.
std::vector< std::vector< GMEVertex > > gme_vertices_
GeoModelEntity Vertices for each geomodel vertex.
static const std::string cell_region_att_name
static const std::string line_att_name
GeoModelMeshVerticesBase< DIMENSION > & geomodel_vertices_
std::vector< std::vector< index_t > > region_vertex_maps_
Vertex in a GeoModelEntity.
#define ringmesh_assert(x)
GeoModelMeshPolygons< DIMENSION > polygons
std::vector< std::vector< index_t > > surface_vertex_maps_
The MeshEntityType described the type of the meshed entities There are 4 MeshEntityTypes correspondin...
Definition: entity_type.h:117
void save_mesh(const std::string &filename) const
Definition: geomodel_mesh.h:94
std::vector< index_t > polygon_id_
Vector storing the colocalised polygon index per cell facet If a cell facet is on a surface...
GeoModelMeshCells3D::DuplicateMode duplicate_mode() const
Classes to build GeoModel from various inputs.
Definition: algorithm.h:48
std::vector< index_t > line_id_
Vector storing the line index per edge.
const GeoModel< DIMENSION > & geomodel() const
std::unique_ptr< SurfaceMesh< DIMENSION > > & mesh_
Attached Mesh.
std::vector< index_t > surface_polygon_ptr_
const NNSearch< DIMENSION > & nn_search() const
GEO::AttributesManager & attribute_manager() const
const NNSearch< DIMENSION > & cell_nn_search() const
MeshSet< DIMENSION > mesh_set_
Mesh storing all the elements.
const GeoModel< DIMENSION > & geomodel_
This template is a specialization of a gme_id to the GeoModelMeshEntity.
Definition: entity_type.h:285
static const std::string region_att_name
std::unique_ptr< LineMesh< DIMENSION > > & mesh_
Attached Mesh.
FORWARD_DECLARATION_DIMENSION_CLASS(GeoModelMeshEntityAccess)
const NNSearch< DIMENSION > & cell_facet_nn_search() const
std::vector< index_t > well_ptr_