1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 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
39 #include <OpenFOAM/autoPtr.H>
40 #include <OpenFOAM/dictionary.H>
41 #include <meshTools/wallPoint.H>
42 #include <meshTools/searchableSurfaces.H>
43 #include <autoMesh/refinementSurfaces.H>
44 #include <autoMesh/shellSurfaces.H>
45 #include <autoMesh/meshRefinement.H>
46 #include <decompositionMethods/decompositionMethod.H>
47 #include <dynamicMesh/fvMeshDistribute.H>
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 // Class forward declarations
57 /*---------------------------------------------------------------------------*\
58 Class autoHexMeshDriver Declaration
59 \*---------------------------------------------------------------------------*/
61 class autoHexMeshDriver
63 // Static data members
65 //- Extrusion controls
68 NOEXTRUDE, /*!< Do not extrude. No layers added. */
69 EXTRUDE, /*!< Extrude */
70 EXTRUDEREMOVE /*!< Extrude but afterwards remove added */
77 //- Combine operator class for equalizing displacements.
82 void operator()(vector& x, const vector& y) const
84 if (magSqr(y) < magSqr(x))
91 //- Combine operator class to combine normal with other normal.
96 void operator()(vector& x, const vector& y) const
98 if (y != wallPoint::greatPoint)
100 if (x == wallPoint::greatPoint)
116 //- Reference to mesh
120 const dictionary dict_;
126 const scalar mergeDist_;
129 //- All surface based geometry
130 autoPtr<searchableSurfaces> allGeometryPtr_;
132 //- Shells (geometry for inside/outside refinement)
133 autoPtr<shellSurfaces> shellsPtr_;
135 //- Surfaces (geometry for intersection based refinement)
136 autoPtr<refinementSurfaces> surfacesPtr_;
138 //- Per refinement surface region the patch
139 labelList globalToPatch_;
141 //- Mesh refinement engine
142 autoPtr<meshRefinement> meshRefinerPtr_;
144 //- Decomposition engine
145 autoPtr<decompositionMethod> decomposerPtr_;
147 //- Mesh distribution engine
148 autoPtr<fvMeshDistribute> distributorPtr_;
152 // Private Member Functions
154 //- Calculate merge distance. Check against writing tolerance.
155 scalar getMergeDistance(const scalar mergeTol) const;
157 //static void orientOutside(PtrList<searchableSurface>&);
159 //- Disallow default bitwise copy construct
160 autoHexMeshDriver(const autoHexMeshDriver&);
162 //- Disallow default bitwise assignment
163 void operator=(const autoHexMeshDriver&);
167 //- Runtime type information
168 ClassName("autoHexMeshDriver");
173 //- Construct from dictionary and mesh to modify
177 const bool overwrite,
178 const dictionary& meshDict,
179 const dictionary& decomposeDict
187 //- reference to mesh
188 const fvMesh& mesh() const
197 //- Surfaces to base refinement on
198 const refinementSurfaces& surfaces() const
200 return surfacesPtr_();
203 //- Surfaces to volume refinement on
204 const shellSurfaces& shells() const
209 //- Per refinementsurface, per region the patch
210 const labelList& globalToPatch() const
212 return globalToPatch_;
219 void writeMesh(const string&) const;
221 //- Do all : refine, snap, layers
226 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
228 } // End namespace Foam
230 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
234 // ************************ vim: set sw=4 sts=4 et: ************************ //