Overture  Version 25
Ugen.h
Go to the documentation of this file.
1 #ifndef KKC_UGEN
2 
3 #include "AdvancingFront.h"
4 #include "TriangleWrapper.h"
5 #include "MappingInformation.h"
6 //#include "PlotStuff.h"
8 #include "AbstractException.h"
9 #include "Ogen.h"
10 
11 class Ugen
12 {
13 
14 public:
15 
16  // helps keep track of which mesh generator is currently being used
20  };
21 
22  Ugen();
24 
25  ~Ugen();
26 
27  // build a hybrid grid interactively
28  void updateHybrid(CompositeGrid & cg, MappingInformation & mapInfo );
29 
30  // build a hybrid grid automatically
31  void updateHybrid(CompositeGrid & cg);
32 
34  CompositeGrid &cg,
35  Ugen::GeneratorType genWith,
36  intArray * & gridIndex2UnstructuredVertex,
37  intArray & unstructuredVertex2GridIndex,
38  intArray * & gridVertex2UnstructuredVertex,
39  intArray & initialFaceZones);
40 
42  {
43 
44  intArray elementList;
45  elementList = ((AdvancingFront &)advancingFront).generateElementList();
46 
48 
50 
51  if ( elementList.getLength(0) )
52  {
54  um->setNodesAndConnectivity(xyz,elementList);
55  return um;
56  }
57  else
58  return (UnstructuredMapping *)NULL;
59 
60  }
61 
62 protected:
63 
64  int initialize();
65 
66  void plot(const aString & title, CompositeGrid &cg, bool plotComponentGrids, bool plotTriangle, bool plotAdvFront);
67 
68  // void buildHybridInterfaceMappings(CompositeGrid &cg);
69 
71 
72  void initializeGeneration(CompositeGrid &cg, intArray *vertexIndex,
73  intArray &numberOfVertices, intArray *vertexIDMap,
74  intArray &vertexGridIndexMap, intArray *gridIndexVertexMap,
75  intArray &initialFaces, intArray &initialFaceZones,
76  realArray & xyz_initial);
77 
78 
80 
81  void buildHybridVertexMappings(CompositeGrid &cg, intArray *vertexIndex, intArray &numberOfVertices, intArray *vertexIDMap, intArray &vertexGridIndexMap, intArray *gridIndexVertexMap, realArray & xyz_initial);
82 
83  //void generateInitialFaceList(CompositeGrid &cg, intArray *vertexIndex, intArray &numberOfVertices, intArray *vertexIDMap, intArray &vertexGridIJKMap, intArray &initialFaces);
84  void generateInitialFaceList(CompositeGrid &cg, intArray *vertexIndex,
85  intArray &numberOfVertices, intArray *vertexIDMap,
86  intArray &vertexGridIndexMap, intArray *gridIndexVertexMap,
87  intArray &initialFaces, intArray &initialFaceZones);
88 
89  //void generateBoundaryMappings(CompositeGrid &cg);
90 
91  void computeZoneMasks(CompositeGrid &cg, intArray * &zoneMasks, intArray &numberOfMaskedZones);
92 
93  void generateSpacingControlMesh(CompositeGrid &cg, const intArray & initialFaceZones, const realArray & xyz_initial);
94  void generateSpacingControlMeshForSurface(const intArray & initialFaces, const realArray &initial_vertices);
95 
96  void enlargeHole(CompositeGrid &cg, intArray &vertexGridIndexMap, int egrd=-1);
97  void generateHoleLists(CompositeGrid &cg, intArray * vertexIndex, intArray &numberOfVertices);
98 
99  void sealHoles( CompositeGrid &cg, intArray *gridIndexVertexMap, intArray &initialFaces, realArray &xyz_initial, intArray &initialSurfaceMapping);
100 
102  void generateWithTriangle();
103 
104  void sealHoles3D( CompositeGrid &cg, intArray *gridIndexVertexMap, intArray &boundaryHoleVertices,
105  intArray &initialFaces, realArray &xyz_initial );
106 
110 
113 
114 };
115 
116 
118 {
119 public:
120  virtual void debug_print() const { cerr << "\nUnstructuredGeneratorError"; }
121 };
122 
124 {
125 public:
126  void debug_print() const
127  {
128  cerr<<": PreProcessingError : problems were found pre-processing the CompositeGrid";
129  }
130 };
131 
132 #endif