RINGMesh  Version 5.0.0
A programming library for geological model meshes
geomodel_builder_topology.cpp
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 
37 
40 
47 namespace
48 {
49  using namespace RINGMesh;
50 
51  template < index_t DIMENSION >
52  gmme_id find_corner(
53  const GeoModel< DIMENSION >& geomodel, const vecn< DIMENSION >& point )
54  {
55  for( const auto& corner : geomodel.corners() )
56  {
57  if( corner.vertex( 0 ) == point )
58  {
59  return corner.gmme();
60  }
61  }
62  return gmme_id();
63  }
64 
65  template < index_t DIMENSION >
66  gmme_id find_corner(
67  const GeoModel< DIMENSION >& geomodel, index_t geomodel_point_id )
68  {
69  const auto& geomodel_vertices = geomodel.mesh.vertices;
70  const auto& vertices =
71  geomodel_vertices.gme_vertices( geomodel_point_id );
72  for( const auto& vertex : vertices )
73  {
74  if( vertex.gmme.type() == Corner< DIMENSION >::type_name_static() )
75  {
76  return vertex.gmme;
77  }
78  }
79  return gmme_id();
80  }
81 
88  template < index_t DIMENSION >
89  bool line_equal( const Line< DIMENSION >& line,
90  const std::vector< vecn< DIMENSION > >& rhs_vertices )
91  {
92  if( line.nb_vertices() != rhs_vertices.size() )
93  {
94  return false;
95  }
96  bool equal = true;
97  for( auto v : range( line.nb_vertices() ) )
98  {
99  if( rhs_vertices[v] != line.vertex( v ) )
100  {
101  equal = false;
102  break;
103  }
104  }
105  if( equal )
106  {
107  return true;
108  }
109 
110  equal = true;
111  for( auto v : range( line.nb_vertices() ) )
112  {
113  if( rhs_vertices[v] != line.vertex( line.nb_vertices() - v - 1 ) )
114  {
115  equal = false;
116  break;
117  }
118  }
119  return equal;
120  }
121 
122  template < index_t DIMENSION >
123  std::vector< index_t > get_sorted_incident_surfaces(
125  {
126  std::vector< index_t > incident_surfaces;
127  index_t nb{ E.nb_incident_entities() };
128  incident_surfaces.resize( nb );
129  for( auto i : range( nb ) )
130  {
131  incident_surfaces[i] = E.incident_entity_gmme( i ).index();
132  }
133  std::sort( incident_surfaces.begin(), incident_surfaces.end() );
134  return incident_surfaces;
135  }
136 
137  template < index_t DIMENSION >
138  index_t add_to_set_children_of_geological_entities(
139  const GeoModel< DIMENSION >& geomodel,
140  const std::set< gmge_id >& geological_entities,
141  std::set< gmme_id >& mesh_entities )
142  {
143  const auto old_number_of_entities = static_cast< index_t >(
144  mesh_entities.size() + geological_entities.size() );
145  for( const auto& cur_gmge_id : geological_entities )
146  {
147  const auto& cur_geol_entity =
148  geomodel.geological_entity( cur_gmge_id );
149  for( auto child_i : range( cur_geol_entity.nb_children() ) )
150  {
151  mesh_entities.insert( cur_geol_entity.child_gmme( child_i ) );
152  }
153  }
154  const auto new_number_of_entities = static_cast< index_t >(
155  mesh_entities.size() + geological_entities.size() );
156  ringmesh_assert( new_number_of_entities >= old_number_of_entities );
157  return new_number_of_entities - old_number_of_entities;
158  }
159 
160  template < index_t DIMENSION >
161  index_t add_to_set_geological_entities_which_have_no_child(
162  const GeoModel< DIMENSION >& geomodel,
163  const std::set< gmme_id >& mesh_entities,
164  std::set< gmge_id >& geological_entities )
165  {
166  const auto old_number_of_entities = static_cast< index_t >(
167  mesh_entities.size() + geological_entities.size() );
168  const auto nb_geological_entity_types =
169  geomodel.entity_type_manager()
170  .geological_entity_manager.nb_geological_entity_types();
171  for( auto geol_entity_type_i : range( nb_geological_entity_types ) )
172  {
173  const auto& geol_type =
174  geomodel.entity_type_manager()
175  .geological_entity_manager.geological_entity_type(
176  geol_entity_type_i );
177 
178  for( auto geol_entity_i :
179  range( geomodel.nb_geological_entities( geol_type ) ) )
180  {
181  bool no_child{ true };
182  const auto& cur_geol_entity =
183  geomodel.geological_entity( geol_type, geol_entity_i );
184  for( auto child_i : range( cur_geol_entity.nb_children() ) )
185  {
186  if( mesh_entities.count(
187  cur_geol_entity.child_gmme( child_i ) )
188  == 0 )
189  {
190  no_child = false;
191  break;
192  }
193  }
194  if( no_child )
195  {
196  geological_entities.insert( cur_geol_entity.gmge() );
197  }
198  }
199  }
200  const auto new_number_of_entities = static_cast< index_t >(
201  mesh_entities.size() + geological_entities.size() );
202  ringmesh_assert( new_number_of_entities >= old_number_of_entities );
203  return new_number_of_entities - old_number_of_entities;
204  }
205 
206  template < index_t DIMENSION >
207  index_t add_to_set_mesh_entities_being_boundaries_of_no_mesh_entity(
208  const GeoModel< DIMENSION >& geomodel,
209  std::set< gmme_id >& mesh_entities )
210  {
211  const auto old_number_of_entities =
212  static_cast< index_t >( mesh_entities.size() );
213  for( const auto& mesh_type :
214  geomodel.entity_type_manager()
215  .mesh_entity_manager.mesh_entity_types() )
216  {
217  if( mesh_type == Region3D::type_name_static() )
218  {
219  // A Region3D cannot be a boundary.
220  continue;
221  }
222  for( auto mesh_entity_i :
223  range( geomodel.nb_mesh_entities( mesh_type ) ) )
224  {
225  bool no_incident{ true };
226  const auto& cur_mesh_entity =
227  geomodel.mesh_entity( mesh_type, mesh_entity_i );
228  for( auto incident_entity_i :
229  range( cur_mesh_entity.nb_incident_entities() ) )
230  {
231  if( mesh_entities.count(
232  cur_mesh_entity.incident_entity_gmme(
233  incident_entity_i ) )
234  == 0 )
235  {
236  no_incident = false;
237  break;
238  }
239  }
240  if( no_incident )
241  {
242  mesh_entities.insert( cur_mesh_entity.gmme() );
243  }
244  }
245  }
246  const auto new_number_of_entities =
247  static_cast< index_t >( mesh_entities.size() );
248  ringmesh_assert( new_number_of_entities >= old_number_of_entities );
249  return new_number_of_entities - old_number_of_entities;
250  }
251 
252 } // namespace
253 
254 namespace RINGMesh
255 {
256  template < index_t DIMENSION >
259  : builder_( builder ),
260  geomodel_( geomodel ),
261  geomodel_access_( geomodel )
262  {
263  }
264 
265  template < index_t DIMENSION >
266  void
268  const GeoModel< DIMENSION >& from )
269  {
270  copy_mesh_entity_topology< Corner >( from );
271  copy_mesh_entity_topology< Line >( from );
272  copy_mesh_entity_topology< Surface >( from );
273  }
274 
275  template < index_t DIMENSION >
277  const GeoModel< DIMENSION >& from )
278  {
279  copy_all_mesh_entity_topology( from );
280 
281  geomodel_access_.modifiable_epsilon() = from.epsilon();
282  geomodel_access_.modifiable_entity_type_manager().relationship_manager =
283  from.entity_type_manager().relationship_manager;
284  }
285 
286  template < index_t DIMENSION >
288  std::set< gmme_id >& mesh_entities,
289  std::set< gmge_id >& geological_entities ) const
290  {
291  auto nb_added = add_to_set_children_of_geological_entities(
292  geomodel_, geological_entities, mesh_entities );
293  nb_added += add_to_set_geological_entities_which_have_no_child(
294  geomodel_, mesh_entities, geological_entities );
295  nb_added += add_to_set_mesh_entities_being_boundaries_of_no_mesh_entity(
296  geomodel_, mesh_entities );
297 
298  // Recursive call till nothing is added
299  if( nb_added > 0 )
300  {
301  return get_dependent_entities( mesh_entities, geological_entities );
302  }
303  return false;
304  }
305 
306  template < index_t DIMENSION >
308  const vecn< DIMENSION >& point )
309  {
310  gmme_id result{ find_corner( geomodel_, point ) };
311  if( !result.is_defined() )
312  {
313  result = create_mesh_entity< Corner >();
314  builder_.geometry.set_corner( result.index(), point );
315  }
316  return result;
317  }
318 
319  template < index_t DIMENSION >
321  index_t geomodel_point_id )
322  {
323  gmme_id result{ find_corner( geomodel_, geomodel_point_id ) };
324  if( !result.is_defined() )
325  {
326  result = create_mesh_entity< Corner >();
327  builder_.geometry.set_corner( result.index(), geomodel_point_id );
328  }
329  return result;
330  }
331 
332  template < index_t DIMENSION >
334  const std::vector< vecn< DIMENSION > >& vertices )
335  {
336  gmme_id result;
337  for( const auto& line : geomodel_.lines() )
338  {
339  if( line_equal( line, vertices ) )
340  {
341  result = line.gmme();
342  }
343  }
344  if( !result.is_defined() )
345  {
346  result = create_mesh_entity< Line >();
347  builder_.geometry.set_line( result.index(), vertices );
348 
349  // Finds the indices of the corner at both extremities
350  // Both must be defined to have a valid LINE
351  add_mesh_entity_boundary_relation(
352  result, find_or_create_corner( vertices.front() ) );
353  add_mesh_entity_boundary_relation(
354  result, find_or_create_corner( vertices.back() ) );
355  }
356  return result;
357  }
358 
359  template < index_t DIMENSION >
361  const std::vector< index_t >& sorted_adjacent_surfaces,
362  const gmme_id& first_corner,
363  const gmme_id& second_corner )
364  {
365  for( const auto& line : geomodel_.lines() )
366  {
367  const auto& c0 = line.boundary_gmme( 0 );
368  const auto& c1 = line.boundary_gmme( 1 );
369 
370  if( ( c0 == first_corner && c1 == second_corner )
371  || ( c0 == second_corner && c1 == first_corner ) )
372  {
373  std::vector< index_t > cur_adjacent_surfaces{
374  get_sorted_incident_surfaces( line )
375  };
376  if( cur_adjacent_surfaces.size()
377  == sorted_adjacent_surfaces.size()
378  && std::equal( cur_adjacent_surfaces.begin(),
379  cur_adjacent_surfaces.end(),
380  sorted_adjacent_surfaces.begin() ) )
381  {
382  return line.gmme();
383  }
384  }
385  }
386  return create_mesh_entity< Line >();
387  }
388 
389  template < index_t DIMENSION >
392  const gmme_id& incident_entity, const gmme_id& boundary )
393  {
394  auto& manager = geomodel_access_.modifiable_entity_type_manager()
395  .relationship_manager;
396  index_t relation_id{ manager.find_boundary_relationship(
397  incident_entity, boundary ) };
398  if( relation_id == NO_ID )
399  {
400  throw RINGMeshException( "Entity",
401  "No boundary relation found between ", boundary, " and ",
402  incident_entity );
403  }
405  geomodel_access_.modifiable_mesh_entity( boundary ) );
406  auto& incident_entities =
407  boundary_access.modifiable_incident_entities();
408  std::remove_if( incident_entities.begin(), incident_entities.end(),
409  [relation_id](
410  index_t relation ) { return relation == relation_id; } );
411  GeoModelMeshEntityAccess< DIMENSION > incident_entity_access(
412  geomodel_access_.modifiable_mesh_entity( incident_entity ) );
413  auto& boundaries = incident_entity_access.modifiable_boundaries();
414  std::remove_if( boundaries.begin(), boundaries.end(),
415  [relation_id](
416  index_t relation ) { return relation == relation_id; } );
417  }
418 
419  template < index_t DIMENSION >
420  template < template < index_t > class ENTITY >
422  const MeshType& mesh_type )
423  {
424  const auto& entity_type = ENTITY< DIMENSION >::type_name_static();
425  index_t nb_entities{ geomodel_.nb_mesh_entities( entity_type ) };
426  index_t new_id{ nb_entities };
427  geomodel_access_.modifiable_mesh_entities( entity_type )
429  template create_entity< ENTITY >(
430  geomodel_, new_id, mesh_type ) );
431  return geomodel_access_.modifiable_mesh_entities( entity_type )
432  .back()
433  ->gmme();
434  }
435 
436  template < index_t DIMENSION >
437  template < template < index_t > class ENTITY >
439  index_t nb_additionnal_entities, const MeshType& type )
440  {
441  const auto& entity_type = ENTITY< DIMENSION >::type_name_static();
442  auto& store = geomodel_access_.modifiable_mesh_entities( entity_type );
443  index_t old_size{ static_cast< index_t >( store.size() ) };
444  index_t new_size{ old_size + nb_additionnal_entities };
445  store.reserve( new_size );
446  for( auto i : range( old_size, new_size ) )
447  {
448  store.emplace_back( GeoModelMeshEntityAccess< DIMENSION >::
449  template create_entity< ENTITY >( geomodel_, i, type ) );
450  }
451  return true;
452  }
453 
454  template < index_t DIMENSION >
457  const gmme_id& incident_entity, const gmme_id& boundary )
458  {
459  const auto& incident_entity_mesh_entity =
460  geomodel_.mesh_entity( incident_entity );
461  for( auto in_ent :
462  range( incident_entity_mesh_entity.nb_incident_entities() ) )
463  {
464  if( incident_entity_mesh_entity.incident_entity_gmme( in_ent )
465  == boundary )
466  {
468  incident_entity_mesh_entity );
469  return entity_access.incident_entity_relation_ids()[in_ent];
470  }
471  }
472  return NO_ID;
473  }
474  template < index_t DIMENSION >
476  add_mesh_entity_boundary_relation( const gmme_id& incident_entity_id,
477  const gmme_id& boundary_id,
478  bool side )
479  {
480  ringmesh_unused( side );
481  const auto& incident_entity_type =
482  geomodel_.entity_type_manager()
483  .mesh_entity_manager.incident_entity_type( boundary_id.type() );
484  if( incident_entity_id.type() != incident_entity_type )
485  {
486  throw RINGMeshException( "Entity",
487  "Wrong incident entity type in the boundary relation between ",
488  boundary_id, " and ", incident_entity_id );
489  }
490  const auto& boundary_type =
491  geomodel_.entity_type_manager()
492  .mesh_entity_manager.boundary_entity_type(
493  incident_entity_id.type() );
494  if( boundary_id.type() != boundary_type )
495  {
496  throw RINGMeshException( "Entity",
497  "Wrong boundary type in the boundary relation between ",
498  boundary_id, " and ", incident_entity_id );
499  }
500  index_t relation_id{
501  check_if_boundary_incident_entity_relation_already_exists(
502  incident_entity_id, boundary_id )
503  };
504  auto& manager = geomodel_access_.modifiable_entity_type_manager()
505  .relationship_manager;
506  if( relation_id == NO_ID )
507  {
508  relation_id = manager.add_boundary_relationship(
509  incident_entity_id, boundary_id );
510  }
511  auto& boundary_entity =
512  geomodel_access_.modifiable_mesh_entity( boundary_id );
514  boundary_entity );
515  boundary_access.modifiable_incident_entities().push_back( relation_id );
516  auto& incident_entity =
517  geomodel_access_.modifiable_mesh_entity( incident_entity_id );
518  GeoModelMeshEntityAccess< DIMENSION > incident_entity_access(
519  incident_entity );
520  incident_entity_access.modifiable_boundaries().push_back( relation_id );
521  }
522 
523  template < index_t DIMENSION >
525  const gmme_id& gmme, index_t id, index_t boundary_id, bool side )
526  {
527  ringmesh_unused( side );
528  ringmesh_assert( id < geomodel_.mesh_entity( gmme ).nb_boundaries() );
529  auto& mesh_entity = geomodel_access_.modifiable_mesh_entity( gmme );
530  const auto& b_type =
531  geomodel_.entity_type_manager()
532  .mesh_entity_manager.boundary_entity_type( gmme.type() );
533  gmme_id boundary( b_type, boundary_id );
534  GeoModelMeshEntityAccess< DIMENSION > gme_access( mesh_entity );
535  index_t relation_id{ gme_access.modifiable_boundaries()[id] };
536  auto& manager = geomodel_access_.modifiable_entity_type_manager()
537  .relationship_manager;
538  manager.set_boundary_to_boundary_relationship( relation_id, boundary );
539  }
540 
541  template < index_t DIMENSION >
544  const gmme_id& gmme, index_t id, index_t incident_entity_id )
545  {
548  auto& mesh_entity = geomodel_access_.modifiable_mesh_entity( gmme );
549  ringmesh_assert( id < mesh_entity.nb_incident_entities() );
550  const auto& in_ent_type =
551  geomodel_.entity_type_manager()
552  .mesh_entity_manager.incident_entity_type( gmme.type() );
553  gmme_id incident_entity( in_ent_type, incident_entity_id );
554  GeoModelMeshEntityAccess< DIMENSION > gme_access( mesh_entity );
555  index_t relation_id{ gme_access.modifiable_incident_entities()[id] };
556  auto& manager = geomodel_access_.modifiable_entity_type_manager()
557  .relationship_manager;
558  manager.set_incident_entity_to_boundary_relationship(
559  relation_id, incident_entity );
560  }
561 
562  template < index_t DIMENSION >
564  const MeshEntityType& type, index_t index )
565  {
566  geomodel_access_.modifiable_mesh_entities( type )[index].reset();
567  }
568 
569  template < index_t DIMENSION >
571  const MeshEntityType& type )
572  {
573  const auto& manager =
574  geomodel_.entity_type_manager().mesh_entity_manager;
575  if( manager.is_corner( type ) )
576  {
577  return this->create_mesh_entity< Corner >();
578  }
579  if( manager.is_line( type ) )
580  {
581  return create_mesh_entity< Line >();
582  }
583  if( manager.is_surface( type ) )
584  {
585  return create_mesh_entity< Surface >();
586  }
588  return gmme_id();
589  }
590 
591  template < index_t DIMENSION >
593  const MeshEntityType& type, index_t nb_additional_entities )
594  {
595  const auto& manager =
596  geomodel_.entity_type_manager().mesh_entity_manager;
597  if( manager.is_corner( type ) )
598  {
599  return this->create_mesh_entities< Corner >(
600  nb_additional_entities );
601  }
602  if( manager.is_line( type ) )
603  {
604  return create_mesh_entities< Line >( nb_additional_entities );
605  }
606  if( manager.is_surface( type ) )
607  {
608  return create_mesh_entities< Surface >( nb_additional_entities );
609  }
611  return false;
612  }
613 
615  const MeshEntityType& type )
616  {
617  const auto& manager =
618  geomodel_.entity_type_manager().mesh_entity_manager;
619  if( manager.is_region( type ) )
620  {
621  return GeoModelBuilderTopologyBase3D::
622  create_mesh_entity< Region >();
623  }
624  return GeoModelBuilderTopologyBase3D::create_mesh_entity( type );
625  }
627  const MeshEntityType& type, index_t nb_additional_entities )
628  {
629  const auto& manager =
630  geomodel_.entity_type_manager().mesh_entity_manager;
631  if( manager.is_region( type ) )
632  {
633  return GeoModelBuilderTopologyBase3D::
634  create_mesh_entities< Region >( nb_additional_entities );
635  }
636  return GeoModelBuilderTopologyBase3D::create_mesh_entities(
637  type, nb_additional_entities );
638  }
640  const GeoModel3D& from )
641  {
642  GeoModelBuilderTopologyBase3D::copy_all_mesh_entity_topology( from );
643  copy_mesh_entity_topology< Region >( from );
644  }
645 
647  const gmme_id& gmme, index_t id, index_t boundary_id, bool side )
648  {
649  GeoModelBuilderTopologyBase2D::set_mesh_entity_boundary(
650  gmme, id, boundary_id );
651 
652  auto& mesh_entity = geomodel_access_.modifiable_mesh_entity( gmme );
653  GeoModelMeshEntityAccess2D gme_access( mesh_entity );
654  if( gmme.type() == Surface2D::type_name_static() )
655  {
656  gme_access.modifiable_sides()[id] = side;
657  }
658  }
659 
661  const gmme_id& incident_entity_id,
662  const gmme_id& boundary_id,
663  bool side )
664  {
665  GeoModelBuilderTopologyBase2D::add_mesh_entity_boundary_relation(
666  incident_entity_id, boundary_id );
667 
668  auto& incident_entity =
669  geomodel_access_.modifiable_mesh_entity( incident_entity_id );
670  GeoModelMeshEntityAccess2D incident_entity_access( incident_entity );
671  if( incident_entity_id.type() == Surface2D::type_name_static() )
672  {
673  incident_entity_access.modifiable_sides().push_back( side );
674  }
675  }
676 
678  const gmme_id& gmme, index_t id, index_t boundary_id, bool side )
679  {
680  GeoModelBuilderTopologyBase3D::set_mesh_entity_boundary(
681  gmme, id, boundary_id );
682 
683  auto& mesh_entity = geomodel_access_.modifiable_mesh_entity( gmme );
684  GeoModelMeshEntityAccess3D gme_access( mesh_entity );
685  if( gmme.type() == Region3D::type_name_static() )
686  {
687  gme_access.modifiable_sides()[id] = side;
688  }
689  }
690 
692  const gmme_id& incident_entity_id,
693  const gmme_id& boundary_id,
694  bool side )
695  {
696  GeoModelBuilderTopologyBase3D::add_mesh_entity_boundary_relation(
697  incident_entity_id, boundary_id );
698 
699  auto& incident_entity =
700  geomodel_access_.modifiable_mesh_entity( incident_entity_id );
701  GeoModelMeshEntityAccess3D incident_entity_access( incident_entity );
702  if( incident_entity_id.type() == Region3D::type_name_static() )
703  {
704  incident_entity_access.modifiable_sides().push_back( side );
705  }
706  }
707 
708  template gmme_id RINGMESH_API
710  const MeshType& );
711  template gmme_id RINGMESH_API
713  const MeshType& );
714  template gmme_id RINGMESH_API
716  const MeshType& );
717  template class RINGMESH_API GeoModelBuilderTopologyBase< 2 >;
718 
719  template gmme_id RINGMESH_API
721  const MeshType& );
722  template gmme_id RINGMESH_API
724  const MeshType& );
725  template gmme_id RINGMESH_API
727  const MeshType& );
728  template gmme_id RINGMESH_API
730  const MeshType& );
731  template class RINGMESH_API GeoModelBuilderTopologyBase< 3 >;
732 } // namespace RINGMesh
std::vector< index_t > & modifiable_boundaries()
GeoModelMesh< DIMENSION > mesh
Definition: geomodel.h:241
Abstract base class for GeoModelMeshEntity.
GEO::vecng< DIMENSION, double > vecn
Definition: types.h:74
const EntityTypeManager< DIMENSION > & entity_type_manager() const
Gets the EntityTypeManager associated to the GeoModel.
Definition: geomodel.h:119
const vecn< DIMENSION > & vertex(index_t vertex_index) const
Coordinates of the vertex_index.
virtual const GeoModelMeshEntity< DIMENSION > & mesh_entity(const gmme_id &id) const
Generic access to a meshed entity.
Definition: geomodel.cpp:131
void ringmesh_unused(const T &)
Definition: common.h:105
GeoModelBuilderTopologyBase(GeoModelBuilder< DIMENSION > &builder, GeoModel< DIMENSION > &geomodel)
A GeoModelEntity of type CORNER.
const gmme_id & boundary_gmme(index_t x) const
Entity_type_template type() const
Definition: entity_type.h:202
double epsilon() const
Definition: geomodel.cpp:208
std::string MeshType
Definition: mesh.h:69
static MeshEntityType type_name_static()
const gmme_id & incident_entity_gmme(index_t x) const
#define ringmesh_assert(x)
A GeoModelEntity of type REGION.
The MeshEntityType described the type of the meshed entities There are 4 MeshEntityTypes correspondin...
Definition: entity_type.h:117
corner_range< DIMENSION > corners() const
Definition: geomodel.h:329
Classes to build GeoModel from various inputs.
Definition: algorithm.h:48
const GeoModelGeologicalEntity< DIMENSION > & geological_entity(gmge_id id) const
Returns a const reference the identified GeoModelGeologicalEntity.
Definition: geomodel.h:165
A GeoModelEntity of type LINE.
const std::vector< index_t > & incident_entity_relation_ids() const
virtual index_t nb_mesh_entities(const MeshEntityType &type) const
Returns the number of mesh entities of the given type.
Definition: geomodel.cpp:108
index_t index() const
Definition: entity_type.h:197
std::vector< index_t > & modifiable_incident_entities()
This template is a specialization of a gme_id to the GeoModelMeshEntity.
Definition: entity_type.h:285
index_t nb_geological_entities(const GeologicalEntityType &type) const
Returns the number of geological entities of the given type.
Definition: geomodel.h:136
bool is_defined() const
Definition: entity_type.h:299
#define ringmesh_assert_not_reached