Mesh Oriented datABase  (version 5.6.0)
An array-based unstructured mesh library
Intx2MeshEdges.hpp
Go to the documentation of this file.
1 /*
2  * Intx2MeshEdges.hpp
3  *
4  * Created on: Aug. 4, 2025
5  * Author: iulian
6  */
7 
8 #ifndef INTX2MESHEDGES_HPP_
9 #define INTX2MESHEDGES_HPP_
10 
11 #include "Intx2MeshOnSphere.hpp"
12 #include <iomanip>
13 
14 #ifdef MOAB_HAVE_NETCDF
15 #include <netcdf.h>
16 #define ERRCODE 2
17 #define ERRN( e ) \
18  { \
19  printf( "Error: %s\n", nc_strerror( e ) ); \
20  exit( ERRCODE ); \
21  }
22 #endif
23 
24 #ifdef MOAB_HAVE_PNETCDF
25 #include <pnetcdf.h>
26 #define ERRCODE 2
27 #define ERR( e ) \
28  { \
29  printf( "Error: %s\n", ncmpi_strerror( e ) ); \
30  exit( ERRCODE ); \
31  }
32 #endif
33 
34 namespace moab
35 {
36 
38 {
39  public:
41  virtual ~Intx2MeshEdges();
42 
43  ErrorCode EdgeSplits( double areaTolerance );
44 
45 #ifdef MOAB_HAVE_PNETCDF
46 #ifdef MOAB_HAVE_MPI
47  ErrorCode write_edge_map_parallel( const char* fileName );
48 #endif
49 #endif
50 
51 #ifdef MOAB_HAVE_NETCDF
52  ErrorCode write_edge_map( const char* fileName );
53 #endif
54 
55  private:
56  // local helper
57  ErrorCode orderSubEdges( std::vector< EntityHandle >& subEdges,
58  std::vector< EntityHandle >& VerticesSubEdges,
59  const EntityHandle* connEdge,
60  std::vector< EntityHandle >& chainVertices,
61  std::vector< int >& polygonIds,
62  Tag otherParentTag );
63 
64  // internal map / arrays
65  std::map< EntityHandle, std::vector< EntityHandle > >
66  edgeVertices; // for each recovered edge, the chain of vertices that form subedges
67  std::map< EntityHandle, std::vector< int > >
68  edgePolygons; // for each recovered edge, the list of intersected polygons;
70 };
71 
72 #endif /* INTX2MESHEDGES_HPP_ */
73 }