Overture  Version 25
CompositeGridHybridConnectivity.h
Go to the documentation of this file.
1 #ifndef __COMPOSITE_GRID_HYBRID_CONNECTIVITY__
2 #define __COMPOSITE_GRID_HYBRID_CONNECTIVITY__
3 
4 //kkc 040415 #include <iostream.h>
5 #include "OvertureDefine.h"
6 #include OV_STD_INCLUDE(iostream)
7 
8 #include "OvertureTypes.h"
9 #include "aString.H"
10 #include "AbstractException.h"
11 
12 
14 //\begin{>CompositeGridHybridConnectivity.tex}{\subsection{Composite Grid Hybrid Connectivities}}
15 //\no function header:
16 // A {\tt CompositeGridHybridConnectivity} manages the mappings between the structured and
17 // unstructured components of hybrid meshes contained in a CompositeGrid. This class
18 // enables a user to iterate through the boundary faces of an unstructured mesh and access
19 // the adjacent structured elements. The inverse is also available where
20 // the user iterates through the elements in a structured grid seeking the adjacent unstructured
21 // elements, if any exist.
22 //\end{CompositeGridHybridConnectivity.tex}
23 {
24 
25 public:
26 
27  //
28  // constructors
29  //
31  CompositeGridHybridConnectivity(const int &grid_,
32  intArray * gridIndex2UVertex_,
33  intArray & uVertex2GridIndex_,
34  intArray * gridVertex2UVertex_,
35  intArray & boundaryFaceMapping_);
36 
37  //
38  // destructor
39  //
41 
42  //
43  // public methods
44  //
45 
46  // set the mapping data structures
47  void setCompositeGridHybridConnectivity(const int &grid_,
48  intArray * gridIndex2UVertex_,
49  intArray & uVertex2GridIndex_,
50  intArray * gridVertex2UVertex_,
51  intArray & boundaryFaceMapping_);
52 
53  // destroy all the connectivity data structures
54  void destroy();
55 
56  // get the vertex id mapping for a particular grid
57  const intArray & getGridIndex2UVertex(int grid_) const;
58 
59  // get vertexIndexMapping (inverse of vertexIDMapping)
60  const intArray & getUVertex2GridIndex() const;
61 
62  // get the indices on a particular grid that are on the structured/unstructured boundary
63  const intArray & getGridVertex2UVertex(int grid_) const;
64 
65  // return the number of vertices on the structured/unstructred interface of a particular grid
66  int getNumberOfInterfaceVertices(int grid_) const;
67 
68  // get the boundary face mapping array dimensioned (nBoundaryFaces, 4) where on the second index :
69  // 0 - unstructured mesh element
70  // 1 - grid number for the adjacent structured zone
71  // 2,3,4 - i1,i2,i3 : the indices for the adjacent zone in the structured grid
72  const intArray & getBoundaryFaceMapping() const;
73 
74  int getUnstructuredGridIndex() const { return grid; }
75 
76  real sizeOf(FILE *file = NULL ) const;
77  //
78  // exceptions
79  //
80  //class CompositeGridHybridConnectivityError;
81 
82 protected:
83 
84 //\begin{>>CompositeGridHybridConnectivity.tex}{\subsection{Connectivity data}}
85 //\no function header:
86 // \itemize
87 // \item gridIndex2UnstructuredVertex : maps a particular grid and index
88 // into an unstructured grid and vertex id
89 // \item unstructuredVertex2GridIndex : maps an unstructured vertex into a grid and index
90 // \item gridVertex2UnstructuredVertex : condensation of vertexIDMapping, contains all the vertices on a particular grid that are on
91 // a hybrid interface
92 // \item boundaryFaceMapping : maps the boundary element of an unstructured mesh into a grid and zone index
93 //\end{itemize}
94 //\end{CompositeGridHybridConnectivity.tex}
95  //
96  // vertex connectivities
97  //
101 
102  //
103  // face/element connectivities
104  //
106 
107 private:
108 
109  //
110  // grid number in cg that holds the unstructured grid referred to in this instance
111  //
112  int grid;
113 
114 };
115 
117 {
118 
119 public:
122  virtual void debug_print() const { cout<<"CompositeGridHybridConnectivityError : "<<message; }
124 };
125 
126 #endif