1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software; you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 Foam::autoHexMeshDriver
34 \*---------------------------------------------------------------------------*/
36 #ifndef autoHexMeshDriver_H
37 #define autoHexMeshDriver_H
40 #include "dictionary.H"
41 #include "pointField.H"
43 #include "wallPoint.H"
44 #include "searchableSurfaces.H"
45 #include "refinementSurfaces.H"
46 #include "shellSurfaces.H"
47 #include "meshRefinement.H"
48 #include "decompositionMethod.H"
49 #include "fvMeshDistribute.H"
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56 // Class forward declarations
59 /*---------------------------------------------------------------------------*\
60 Class autoHexMeshDriver Declaration
61 \*---------------------------------------------------------------------------*/
63 class autoHexMeshDriver
65 // Static data members
67 //- Extrusion controls
70 NOEXTRUDE, /*!< Do not extrude. No layers added. */
71 EXTRUDE, /*!< Extrude */
72 EXTRUDEREMOVE /*!< Extrude but afterwards remove added */
79 //- Combine operator class for equalizing displacements.
84 void operator()(vector& x, const vector& y) const
86 if (magSqr(y) < magSqr(x))
93 //- Combine operator class to combine normal with other normal.
98 void operator()(vector& x, const vector& y) const
100 if (y != wallPoint::greatPoint)
102 if (x == wallPoint::greatPoint)
118 //- Reference to mesh
122 const dictionary dict_;
128 const scalar mergeDist_;
131 //- All surface based geometry
132 autoPtr<searchableSurfaces> allGeometryPtr_;
134 //- Shells (geometry for inside/outside refinement)
135 autoPtr<shellSurfaces> shellsPtr_;
137 //- Surfaces (geometry for intersection based refinement)
138 autoPtr<refinementSurfaces> surfacesPtr_;
140 //- Per refinement surface region the patch
141 labelList globalToPatch_;
143 //- Mesh refinement engine
144 autoPtr<meshRefinement> meshRefinerPtr_;
146 //- Decomposition engine
147 autoPtr<decompositionMethod> decomposerPtr_;
149 //- Mesh distribution engine
150 autoPtr<fvMeshDistribute> distributorPtr_;
154 // Private Member Functions
156 //- Calculate merge distance. Check against writing tolerance.
157 scalar getMergeDistance(const scalar mergeTol) const;
159 //static void orientOutside(PtrList<searchableSurface>&);
161 //- Disallow default bitwise copy construct
162 autoHexMeshDriver(const autoHexMeshDriver&);
164 //- Disallow default bitwise assignment
165 void operator=(const autoHexMeshDriver&);
169 //- Runtime type information
170 ClassName("autoHexMeshDriver");
175 //- Construct from dictionary and mesh to modify
179 const dictionary& meshDict,
180 const dictionary& decomposeDict
188 //- reference to mesh
189 const fvMesh& mesh() const
198 //- Surfaces to base refinement on
199 const refinementSurfaces& surfaces() const
201 return surfacesPtr_();
204 //- Surfaces to volume refinement on
205 const shellSurfaces& shells() const
210 //- Per refinementsurface, per region the patch
211 const labelList& globalToPatch() const
213 return globalToPatch_;
220 void writeMesh(const string&) const;
222 //- Do all : refine, snap, layers
227 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
229 } // End namespace Foam
231 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
235 // ************************************************************************* //