GEOS
EmbeddedSurfacesParallelSynchronization.hpp
1 /*
2  * ------------------------------------------------------------------------------------------------------------
3  * SPDX-License-Identifier: LGPL-2.1-only
4  *
5  * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC
6  * Copyright (c) 2018-2024 TotalEnergies
7  * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University
8  * Copyright (c) 2023-2024 Chevron
9  * Copyright (c) 2019- GEOS/GEOSX Contributors
10  * All rights reserved
11  *
12  * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
13  * ------------------------------------------------------------------------------------------------------------
14  */
15 
16 
21 #ifndef GEOS_PHYSICSSOLVERS_SURFACEGENERATION_EMBEDDEDSURFACESPARALLELSYNCHRONIZATION_HPP_
22 #define GEOS_PHYSICSSOLVERS_SURFACEGENERATION_EMBEDDEDSURFACESPARALLELSYNCHRONIZATION_HPP_
23 
24 #include "common/DataTypes.hpp"
25 #include "common/StdContainerWrappers.hpp"
26 
27 namespace geos
28 {
29 class MeshLevel;
30 class NeighborCommunicator;
31 
33 {
34  std::set< localIndex > newNodes;
35  std::set< localIndex > newEdges;
36  map< std::pair< localIndex, localIndex >, std::set< localIndex > > newElements;
37 
38  void insert( NewObjectLists const & newObjects )
39  {
40  newNodes.insert( newObjects.newNodes.begin(),
41  newObjects.newNodes.end() );
42 
43  newEdges.insert( newObjects.newEdges.begin(),
44  newObjects.newEdges.end() );
45 
46  for( auto & iter : newObjects.newElements )
47  {
48  std::pair< localIndex, localIndex > const & key = iter.first;
49  std::set< localIndex > const & values = iter.second;
50  newElements[key].insert( values.begin(), values.end() );
51  }
52 
53  }
54 
55 };
56 
57 namespace embeddedSurfacesParallelSynchronization
58 {
59 
60 void synchronizeTopology( MeshLevel & mesh,
62  NewObjectLists & newObjects,
63  int const mpiCommOrder,
64  string const fractureRegionName );
65 }
66 
67 } /* namespace geos */
68 
69 #endif /* GEOS_PHYSICSSOLVERS_SURFACEGENERATION_EMBEDDEDSURFACESPARALLELSYNCHRONIZATION_HPP_ */
Class facilitating the representation of a multi-level discretization of a MeshBody.
Definition: MeshLevel.hpp:42
Base template for ordered and unordered maps.
Definition: DataTypes.hpp:337
std::vector< T, Allocator > stdVector