RINGMesh  Version 5.0.0
A programming library for geological model meshes
geomodel_builder_remove.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 
49 namespace RINGMesh
50 {
51  FORWARD_DECLARATION_DIMENSION_CLASS( GeoModelBuilderBase );
52  FORWARD_DECLARATION_DIMENSION_CLASS( GeoModelBuilder );
53 } // namespace RINGMesh
54 
55 namespace RINGMesh
56 {
60  template < index_t DIMENSION >
61  class RINGMESH_API GeoModelBuilderRemovalBase
62  {
65 
66  public:
67  virtual ~GeoModelBuilderRemovalBase() = default;
68 
78  void remove_mesh_entities( const std::set< gmme_id >& entities );
79 
89  void remove_geological_entities( const std::set< gmge_id >& entities );
90 
94  void remove_entities_and_dependencies(
95  const std::set< gmme_id >& entities_to_remove );
96 
97  protected:
99  GeoModel< DIMENSION >& geomodel );
100 
102  {
103  update_mesh_entity_index( ME );
104  update_mesh_entity_boundaries( ME );
105  delete_invalid_boundaries( ME );
106 
107  update_mesh_entity_incident_entity( ME );
108  delete_invalid_incident_entity( ME );
109  }
110 
111  // --- High level functions ----------
113  const std::set< gmme_id >& mesh_entities_to_remove )
114  {
115  nb_mesh_entity_types_ =
116  geomodel_.entity_type_manager()
117  .mesh_entity_manager.nb_mesh_entity_types();
118  nb_geological_entity_types_ =
119  geomodel_.nb_geological_entity_types();
120  nb_entity_types_ =
121  nb_geological_entity_types_ + nb_mesh_entity_types_;
122  nb_removed_mesh_entities_.resize( nb_mesh_entity_types_, 0 );
123  nb_removed_geological_entities_.resize(
124  nb_geological_entity_types_, 0 );
125  fill_entity_type_to_index_map();
126  fill_nb_initial_entities();
127  initialize_costly_storage();
128  fill_nb_children_vector();
129 
130  check_if_entities_are_meshed( mesh_entities_to_remove );
131  fill_to_erase_vectors( mesh_entities_to_remove );
132  fill_removed_entities_and_mapping();
133  }
135  {
136  for( auto i : range( nb_mesh_entity_types_ ) )
137  {
138  for( auto j : range( nb_initial_mesh_entities_[i] ) )
139  {
140  if( mesh_entity_to_erase_[i][j] )
141  {
142  const MeshEntityType& type_name =
143  index_to_mesh_entity_type( i );
144  for( auto p :
145  range( geomodel_.mesh_entity( type_name, j )
146  .nb_parents() ) )
147  {
148  gmge_id parent =
149  geomodel_.mesh_entity( type_name, j )
150  .parent_gmge( p );
151  nb_childs_[geological_entity_type_to_index(
152  parent.type() )][parent.index()]--;
153  }
154 
155  delete_mesh_entity( i, j );
156  }
157  }
158  clear_null_mesh_entities( i );
159  }
160  }
161  void do_delete_flagged_geological_entities();
162 
164  const std::set< gmme_id >& mesh_entities_to_remove )
165  {
166  for( const gmme_id& it : mesh_entities_to_remove )
167  {
168  if( !geomodel_.entity_type_manager()
169  .mesh_entity_manager.is_valid_type( it.type() ) )
170  {
171  throw RINGMeshException( "REMOVE", "You try to remove a "
172  "Geological Entity "
173  "using mesh removal." );
174  }
175  }
176  }
177 
179  {
180  mesh_entity_to_erase_.resize( nb_mesh_entity_types_ );
181 
182  old_2_new_mesh_entity_.resize( nb_mesh_entity_types_ );
183  old_2_new_geological_entity_.resize( nb_geological_entity_types_ );
184  nb_childs_.resize( nb_geological_entity_types_ );
185  for( auto i : range( nb_mesh_entity_types_ ) )
186  {
187  index_t size = geomodel_.nb_mesh_entities(
188  index_to_mesh_entity_type( i ) );
189  mesh_entity_to_erase_[i].resize( size, false );
190  old_2_new_mesh_entity_[i].resize( size, 0 );
191  }
192 
193  for( auto i : range( nb_geological_entity_types_ ) )
194  {
195  index_t size = geomodel_.nb_geological_entities(
196  index_to_geological_entity_type( i ) );
197  old_2_new_geological_entity_[i].resize( size, 0 );
198  nb_childs_[i].resize( size, 0 );
199  }
200  }
201  void delete_mesh_entity( index_t type, index_t index );
202 
203  void clear_null_mesh_entities( index_t type )
204  {
205  const MeshEntityType& type_name = index_to_mesh_entity_type( type );
206  std::vector< std::unique_ptr< GeoModelMeshEntity< DIMENSION > > >&
207  store = geomodel_access_.modifiable_mesh_entities( type_name );
208  store.erase(
209  std::remove( store.begin(), store.end(),
210  static_cast< std::
211  unique_ptr< GeoModelMeshEntity< DIMENSION > > >(
212  nullptr ) ),
213  store.end() );
214 
215  // QC
216  ringmesh_assert( geomodel_.nb_mesh_entities( type_name )
217  == nb_initial_mesh_entities_[type]
218  - nb_removed_mesh_entities_[type] );
219  }
220 
221  void clear_null_geological_entities( index_t type )
222  {
223  const GeologicalEntityType& type_name =
224  index_to_geological_entity_type( type );
225  std::vector< std::
226  unique_ptr< GeoModelGeologicalEntity< DIMENSION > > >&
227  store = geomodel_access_.modifiable_geological_entities(
228  type_name );
229  store.erase(
230  std::remove( store.begin(), store.end(),
231  static_cast< std::
232  unique_ptr< GeoModelGeologicalEntity< DIMENSION > > >(
233  nullptr ) ),
234  store.end() );
235 
236  // QC
237  ringmesh_assert( geomodel_.nb_geological_entities( type_name )
238  == nb_initial_geological_entities_[type]
239  - nb_removed_geological_entities_[type] );
240  }
242  {
243  for( auto i : range( nb_mesh_entity_types_ ) )
244  {
245  const MeshEntityType& entity_type =
246  index_to_mesh_entity_type( i );
247  for( auto j :
248  range( geomodel_.nb_mesh_entities( entity_type ) ) )
249  {
250  gmme_id new_id( entity_type, j );
252  geomodel_access_.modifiable_mesh_entity( new_id );
253  update_mesh_entity( ME );
254  }
255  }
256  }
257 
259  {
260  for( auto i : range( nb_geological_entity_types_ ) )
261  {
262  const GeologicalEntityType& entity_type =
263  index_to_geological_entity_type( i );
264  for( auto j :
265  range( geomodel_.nb_geological_entities( entity_type ) ) )
266  {
267  gmge_id new_id( entity_type, j );
269  geomodel_access_.modifiable_geological_entity( new_id );
270  update_geological_entity_index( GE );
271  update_geological_entity_children( GE );
272  delete_invalid_children( GE );
273  }
274  }
275 
276  for( auto i : range( nb_mesh_entity_types_ ) )
277  {
278  const MeshEntityType& entity_type =
279  index_to_mesh_entity_type( i );
280  for( auto j :
281  range( geomodel_.nb_mesh_entities( entity_type ) ) )
282  {
283  gmme_id new_id( entity_type, j );
285  geomodel_access_.modifiable_mesh_entity( new_id );
286  update_mesh_entity_parents( ME );
287  delete_invalid_parents( ME );
288  }
289  }
290  }
291 
292  // void remove_dependencies()
293  // {
294  // std::set< gme_id > new_gmme_to_remove ;
295  // for( index_t me = 0;
296  // me < geomodel().nb_mesh_entities( starting_dependency_
297  // ); me++ ) {
298  // const GeoModelMeshEntity& cur_gmme =
299  // geomodel().mesh_entity(
300  // starting_dependency_, me ) ;
301  // if( cur_gmme.incident_entity( 0 ).index() == NO_ID
302  // && cur_gmme.nb_incident_entities() == 1 ) {
303  // new_gmme_to_remove.insert( cur_gmme.gme_id() ) ;
304  // }
305  // }
306  // if( starting_dependency_ != Corner::type_name_static() ) {
307  // starting_dependency_ =
308  // EntityTypeManager::boundary_type(
309  // starting_dependency_ ) ;
310  // remove_mesh_entities_with_dependencies(
311  // new_gmme_to_remove ) ;
312  // }
313  // }
314 
315  //------ Initialization -------
317  {
318  for( auto i : range( nb_mesh_entity_types_ ) )
319  {
320  for( auto j : range( nb_initial_mesh_entities_[i] ) )
321  {
322  if( mesh_entity_to_erase_[i][j] )
323  {
324  nb_removed_mesh_entities_[i]++;
325  old_2_new_mesh_entity_[i][j] = NO_ID;
326  }
327  else
328  {
329  old_2_new_mesh_entity_[i][j] =
330  j - nb_removed_mesh_entities_[i];
331  }
332  }
333  }
334  }
336  const std::set< gmme_id >& mesh_entities_to_remove )
337  {
338  for( const gmme_id& cur : mesh_entities_to_remove )
339  {
340  index_t type_index = mesh_entity_type_to_index( cur.type() );
341  mesh_entity_to_erase_[type_index][cur.index()] = true;
342  }
343  }
344 
345  void fill_nb_children_vector();
346 
348  {
349  nb_initial_mesh_entities_.resize( nb_mesh_entity_types_, 0 );
350  for( auto i : range( nb_mesh_entity_types_ ) )
351  {
352  const MeshEntityType& type = index_to_mesh_entity_type( i );
353  nb_initial_mesh_entities_[i] =
354  geomodel_.nb_mesh_entities( type );
355  }
356 
357  nb_initial_geological_entities_.resize(
358  nb_geological_entity_types_, 0 );
359  for( auto i : range( nb_geological_entity_types_ ) )
360  {
361  const GeologicalEntityType& type =
362  index_to_geological_entity_type( i );
363  nb_initial_geological_entities_[i] =
364  geomodel_.nb_geological_entities( type );
365  }
366  }
368  {
369  const EntityTypeManager< DIMENSION >& manager =
370  geomodel_.entity_type_manager();
371  mesh_entity_types_.insert( mesh_entity_types_.end(),
372  manager.mesh_entity_manager.mesh_entity_types().begin(),
373  manager.mesh_entity_manager.mesh_entity_types().end() );
374 
375  if( nb_geological_entity_types_ != 0 )
376  {
377  geological_entity_types_.insert( geological_entity_types_.end(),
378  manager.geological_entity_manager.geological_entity_types()
379  .begin(),
380  manager.geological_entity_manager.geological_entity_types()
381  .end() );
382  }
383  }
384 
385  // ---- Easier access to relationships between EntityTypes
387  const GeoModelMeshEntity< DIMENSION >& E ) const
388  {
389  const MeshEntityType& type = E.type_name();
390  return mesh_entity_type_to_index( type );
391  }
392 
393  index_t geological_entity_type_index(
394  const GeoModelGeologicalEntity< DIMENSION >& E ) const;
395 
396  index_t children_type_index( const GeologicalEntityType& type ) const
397  {
398  const MeshEntityType& child_type = children_type( type );
399  return mesh_entity_type_to_index( child_type );
400  }
401 
403  const GeologicalEntityType& type ) const
404  {
405  const RelationshipManager& family =
406  geomodel_.entity_type_manager().relationship_manager;
407  return family.child_type( type );
408  }
409 
410  index_t boundary_type_index( const MeshEntityType& type ) const
411  {
412  const MeshEntityType& b_type = boundary_entity_type( type );
413  if( !geomodel_.entity_type_manager()
414  .mesh_entity_manager.is_valid_type( b_type ) )
415  {
416  return NO_ID;
417  }
418  return mesh_entity_type_to_index( b_type );
419  }
420 
422  const MeshEntityType& type ) const
423  {
424  const MeshEntityTypeManager< DIMENSION >& family =
425  geomodel_.entity_type_manager().mesh_entity_manager;
426  return family.boundary_entity_type( type );
427  }
428 
431  const MeshEntityType& type ) const
432  {
433  const MeshEntityType& in_ent_type = incident_entity_type( type );
434  if( !geomodel_.entity_type_manager()
435  .mesh_entity_manager.is_valid_type( in_ent_type ) )
436  {
437  return NO_ID;
438  }
439  return mesh_entity_type_to_index( in_ent_type );
440  }
441 
443  const MeshEntityType& type ) const
444  {
445  const MeshEntityTypeManager< DIMENSION >& family =
446  geomodel_.entity_type_manager().mesh_entity_manager;
447  return family.incident_entity_type( type );
448  }
449 
450  bool is_mesh_entity( index_t i ) const
451  {
452  return i < nb_mesh_entity_types_;
453  }
454 
455  bool is_geological_entity( index_t i ) const
456  {
457  return !is_mesh_entity( i );
458  }
459 
460  // ---- Update connectivity functions ------
461 
463  {
464  for( auto i : range( nb_childs_.size() ) )
465  {
466  for( auto j : range( nb_childs_[i].size() ) )
467  {
468  if( nb_childs_[i][j] == 0 )
469  {
470  nb_removed_geological_entities_[i]++;
471  old_2_new_geological_entity_[i][j] = NO_ID;
472  }
473  else
474  {
475  old_2_new_geological_entity_[i][j] =
476  j - nb_removed_geological_entities_[i];
477  }
478  }
479  }
480  }
481 
482  void set_mesh_entity_index(
483  GeoModelMeshEntity< DIMENSION >& mesh_entity,
484  index_t new_index_in_geomodel );
485  void set_geological_entity_index(
486  GeoModelGeologicalEntity< DIMENSION >& geological_entity,
487  index_t new_index_in_geomodel );
488 
489  void update_mesh_entity_index(
490  GeoModelMeshEntity< DIMENSION >& mesh_entity );
491  void update_geological_entity_index(
492  GeoModelGeologicalEntity< DIMENSION >& geological_entity );
493  void update_mesh_entity_boundaries(
494  GeoModelMeshEntity< DIMENSION >& mesh_entity );
495 
497  Region3D& region, index_t boundary_index, bool new_side )
498  {
499  ringmesh_assert( boundary_index < region.nb_boundaries() );
501  geomodel_access_.modifiable_mesh_entity( region.gmme() ) );
502  region_access.modifiable_sides()[boundary_index] = new_side;
503  }
504 
505  void update_mesh_entity_incident_entity(
506  GeoModelMeshEntity< DIMENSION >& mesh_entity );
507  void update_mesh_entity_parents(
508  GeoModelMeshEntity< DIMENSION >& mesh_entity );
509  void update_geological_entity_children(
510  GeoModelGeologicalEntity< DIMENSION >& geological_entity );
511 
512  // --- Deletion of some values the GeoModel storage
513  template < typename TEST, typename THINGS_TO_DELETE >
515  std::vector< THINGS_TO_DELETE >& vector, const TEST& test )
516  {
517  auto new_end = std::remove_if( vector.begin(), vector.end(), test );
518  if( new_end == vector.begin() )
519  {
520  // Clear instead of erase, because the behavior would be
521  // undefined.
522  vector.clear();
523  }
524  else if( new_end < vector.end() )
525  {
526  vector.erase( new_end, vector.end() );
527  }
528  }
529 
531  {
532  if( E.nb_children() == 0 )
533  {
534  return;
535  }
537  const RelationshipManager& manager =
538  E.geomodel().entity_type_manager().relationship_manager;
539  const MeshEntityType& child_type = children_type( E.entity_type() );
540  gmme_id invalid_child( child_type, NO_ID );
541  remove_invalid_values( gmge_access.modifiable_children(),
542  [&invalid_child, &manager]( index_t i ) {
543  return manager.child_of_gmge( i ) == invalid_child;
544  } );
545  }
546 
548  {
549  const MeshEntityType& b_type =
550  boundary_entity_type( E.mesh_entity_type() );
551  gmme_id invalid( b_type, NO_ID );
552  if( !geomodel_.entity_type_manager()
553  .mesh_entity_manager.is_valid_type( b_type ) )
554  {
555  return;
556  }
557  GeoModelMeshEntityAccess< DIMENSION > gmme_access( E );
558  const RelationshipManager& manager =
559  E.geomodel().entity_type_manager().relationship_manager;
560  remove_invalid_values( gmme_access.modifiable_boundaries(),
561  [&invalid, &manager]( index_t i ) {
562  return manager.boundary_gmme( i ) == invalid;
563  } );
564  }
565 
568  {
569  const MeshEntityType& in_ent_type =
570  incident_entity_type( E.mesh_entity_type() );
571  gmme_id invalid( in_ent_type, NO_ID );
572  if( !geomodel_.entity_type_manager()
573  .mesh_entity_manager.is_valid_type( in_ent_type ) )
574  {
575  return;
576  }
577  GeoModelMeshEntityAccess< DIMENSION > gmme_access( E );
578  const RelationshipManager& manager =
579  E.geomodel().entity_type_manager().relationship_manager;
580  remove_invalid_values( gmme_access.modifiable_incident_entities(),
581  [&invalid, &manager]( index_t i ) {
582  return manager.incident_entity_gmme( i ) == invalid;
583  } );
584  }
585 
587  {
588  GeoModelMeshEntityAccess< DIMENSION > gmme_access( E );
589  const RelationshipManager& manager =
590  E.geomodel().entity_type_manager().relationship_manager;
591  remove_invalid_values(
592  gmme_access.modifiable_parents(), [&manager]( index_t i ) {
593  return manager.parent_of_gmme( i ).index() == NO_ID;
594  } );
595  }
596 
597  index_t mesh_entity_type_to_index( const MeshEntityType& type ) const
598  {
599  return find( mesh_entity_types_, type );
600  }
601 
603  const GeologicalEntityType& type ) const
604  {
605  return find( geological_entity_types_, type );
606  }
607  const MeshEntityType& index_to_mesh_entity_type( index_t index ) const
608  {
609  return mesh_entity_types_[index];
610  }
611 
613  index_t index ) const
614  {
615  return geological_entity_types_[index];
616  }
617 
618  protected:
622 
626 
627  std::vector< index_t > nb_initial_mesh_entities_;
628  std::vector< index_t > nb_initial_geological_entities_;
629 
630  std::vector< index_t > nb_removed_mesh_entities_;
631  std::vector< index_t > nb_removed_geological_entities_;
632 
635  std::vector< std::vector< bool > > mesh_entity_to_erase_;
638  std::vector< std::vector< index_t > > old_2_new_mesh_entity_;
639  std::vector< std::vector< index_t > > nb_childs_;
640 
641  std::vector< std::vector< index_t > > old_2_new_geological_entity_;
642 
643  // std::map< EntityType, index_t > entity_type_to_index_ ;
644  // std::map< index_t, EntityType > index_to_entity_type_ ;
645  // std::vector< EntityType > all_entity_types_ ;
646 
647  std::vector< MeshEntityType > mesh_entity_types_;
648  std::vector< GeologicalEntityType > geological_entity_types_;
649  };
650 
652 
653  template < index_t DIMENSION >
654  class RINGMESH_API GeoModelBuilderRemoval
655  : public GeoModelBuilderRemovalBase< DIMENSION >
656  {
657  friend class GeoModelBuilderBase< DIMENSION >;
658  friend class GeoModelBuilder< DIMENSION >;
659 
660  private:
662  GeoModel< DIMENSION >& geomodel );
663  };
664 
665  template <>
666  class RINGMESH_API GeoModelBuilderRemoval< 3 >
667  : public GeoModelBuilderRemovalBase< 3 >
668  {
669  friend class GeoModelBuilderBase< 3 >;
670  friend class GeoModelBuilder< 3 >;
672 
673  private:
675  GeoModelBuilder3D& builder, GeoModel3D& geomodel );
676 
677  void update_mesh_entity( GeoModelMeshEntity3D& ME ) override;
678 
680  Region3D& R, index_t boundary_index, bool new_side )
681  {
682  ringmesh_assert( boundary_index < R.nb_boundaries() );
683  GeoModelMeshEntityAccess3D region_access(
684  geomodel_access_.modifiable_mesh_entity( R.gmme() ) );
685  region_access.modifiable_sides()[boundary_index] = new_side;
686  }
687 
688  void update_region_boundary_signs( Region3D& R )
689  {
690  const MeshEntityType& surface_type =
691  boundary_entity_type( R.mesh_entity_type() );
692  gmme_id invalid_value( surface_type, NO_ID );
693 
694  index_t offset = 0;
695  for( index_t i = 0; i + offset < R.nb_boundaries(); ++i )
696  {
697  if( R.boundary_gmme( i ) == invalid_value )
698  {
699  offset++;
700  }
701  else
702  {
703  bool new_side = R.side( i + offset );
704  set_boundary_side( R, i, new_side );
705  }
706  }
707  }
708 
709  void delete_invalid_signs( Region3D& R )
710  {
711  GeoModelMeshEntityAccess3D region_access(
712  geomodel_access_.modifiable_mesh_entity( R.gmme() ) );
713  region_access.modifiable_sides().resize( R.nb_boundaries() );
714  }
715  };
716 } // namespace RINGMesh
std::vector< index_t > & modifiable_boundaries()
#define ringmesh_disable_copy_and_move(Class)
Definition: common.h:76
std::vector< index_t > nb_initial_geological_entities_
void delete_invalid_incident_entity(GeoModelMeshEntity< DIMENSION > &E)
const GeoModel< DIMENSION > & geomodel() const
virtual MeshEntityType type_name() const =0
Abstract base class for GeoModelMeshEntity.
void fill_to_erase_vectors(const std::set< gmme_id > &mesh_entities_to_remove)
GeologicalTypeManager geological_entity_manager
const MeshEntityType & boundary_entity_type(const MeshEntityType &type) const
const MeshEntityType & incident_entity_type(const MeshEntityType &type) const
The GeologicalEntityType described the type of the Geological entities User can defined there own Geo...
Definition: entity_type.h:137
index_t mesh_entity_type_to_index(const MeshEntityType &type) const
Base class to build or edit a GeoModel.
void set_boundary_side(Region3D &region, index_t boundary_index, bool new_side)
const GeologicalEntityType & index_to_geological_entity_type(index_t index) const
#define ringmesh_template_assert_2d_or_3d(type)
Definition: common.h:80
ALIAS_2D_AND_3D(Box)
std::vector< std::vector< index_t > > old_2_new_mesh_entity_
const gmme_id & boundary_gmme(index_t relation_id) const
void set_boundary_side(Region3D &R, index_t boundary_index, bool new_side)
Entity_type_template type() const
Definition: entity_type.h:202
index_t mesh_entity_type_index(const GeoModelMeshEntity< DIMENSION > &E) const
std::vector< MeshEntityType > mesh_entity_types_
std::vector< std::vector< bool > > mesh_entity_to_erase_
MeshEntityTypeManager< DIMENSION > mesh_entity_manager
index_t incident_entity_type_to_index(const MeshEntityType &type) const
TODO unused function. To handle during removal refactoring BC.
const MeshEntityType child_type(const GeologicalEntityType &parent_type) const
void delete_invalid_boundaries(GeoModelMeshEntity< DIMENSION > &E)
virtual void update_mesh_entity(GeoModelMeshEntity< DIMENSION > &ME)
const gmge_id & parent_of_gmme(index_t relation_id) const
index_t boundary_type_index(const MeshEntityType &type) const
GeoModelAccess< DIMENSION > geomodel_access_
void remove_invalid_values(std::vector< THINGS_TO_DELETE > &vector, const TEST &test)
std::vector< std::vector< index_t > > old_2_new_geological_entity_
index_t find(const container &in, const T &value)
Returns the position of the first entity matching.
Definition: algorithm.h:55
const MeshEntityType & index_to_mesh_entity_type(index_t index) const
std::vector< index_t > nb_removed_geological_entities_
const gmme_id & child_of_gmge(index_t relation_id) const
GeoModelBuilder< DIMENSION > & builder_
Global entity manager which could be associated to a geomodel to give access to different manager to ...
std::vector< index_t > & modifiable_parents()
Builder tools to remove entities from a GeoModel.
void delete_invalid_parents(GeoModelMeshEntity< DIMENSION > &E)
#define ringmesh_assert(x)
std::vector< std::vector< index_t > > nb_childs_
const MeshEntityType & incident_entity_type(const MeshEntityType &mesh_entity_type) const
const MeshEntityType children_type(const GeologicalEntityType &type) const
const MeshEntityType & boundary_entity_type(const MeshEntityType &mesh_entity_type) const
The MeshEntityType described the type of the meshed entities There are 4 MeshEntityTypes correspondin...
Definition: entity_type.h:117
index_t children_type_index(const GeologicalEntityType &type) const
index_t geological_entity_type_to_index(const GeologicalEntityType &type) const
This template is a specialization of a gme_id to the GeoModelGeologicalEntity.
Definition: entity_type.h:262
this class contains methods to manage relations between Geological and Mesh entities. For instance: A "Contact" can be the parent of one or more "Line" An "Interface" can the parent of one or more "Surface" A "Layer" can be the parent of one or more "Region"
std::vector< GeologicalEntityType > geological_entity_types_
Classes to build GeoModel from various inputs.
Definition: algorithm.h:48
void delete_invalid_children(GeoModelGeologicalEntity< DIMENSION > &E)
void initialize_for_removal(const std::set< gmme_id > &mesh_entities_to_remove)
index_t index() const
Definition: entity_type.h:197
void check_if_entities_are_meshed(const std::set< gmme_id > &mesh_entities_to_remove)
std::vector< index_t > & modifiable_incident_entities()
This template is a specialization of a gme_id to the GeoModelMeshEntity.
Definition: entity_type.h:285
FORWARD_DECLARATION_DIMENSION_CLASS(GeoModelMeshEntityAccess)
MeshEntityType mesh_entity_type() const
const gmme_id & incident_entity_gmme(index_t relation_id) const