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::twoDPointCorrector
29 Class applies a two-dimensional correction to mesh motion point field.
31 The correction guarantees that the mesh does not get twisted during motion
32 and thus introduce a third dimension into a 2-D problem.
34 The operation is performed by looping through all edges approximately
35 normal to the plane and enforcing their orthoginality onto the plane by
36 adjusting points on their ends.
41 \*---------------------------------------------------------------------------*/
43 #ifndef twoDPointCorrector_H
44 #define twoDPointCorrector_H
46 #include "pointField.H"
47 #include "labelList.H"
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
55 // Forward class declarations
58 /*---------------------------------------------------------------------------*\
59 Class twoDPointCorrector Declaration
60 \*---------------------------------------------------------------------------*/
62 class twoDPointCorrector
66 //- Reference to moving mesh
67 const polyMesh& mesh_;
69 //- Is 2D correction required, i.e. is the mesh
72 //- 2-D plane unit normal
73 mutable vector* planeNormalPtr_;
75 //- Indices of edges normal to plane
76 mutable labelList* normalEdgeIndicesPtr_;
79 // Private Member Functions
81 //- Disallow default bitwise copy construct
82 twoDPointCorrector(const twoDPointCorrector&);
84 //- Disallow default bitwise assignment
85 void operator=(const twoDPointCorrector&);
88 //- Calculate addressing
89 void calcAddressing() const;
92 void clearAddressing() const;
95 // Static data members
97 //- Edge orthogonality tolerance
98 static const scalar edgeOrthogonalityTol;
105 //- Construct from components
106 twoDPointCorrector(const polyMesh& mesh);
111 ~twoDPointCorrector();
116 //- Is 2D correction required, i.e. is the mesh a wedge or slab
117 bool required() const
122 //- Return plane normal
123 const vector& planeNormal() const;
125 //- Return indices of normal edges.
126 const labelList& normalEdgeIndices() const;
128 //- Return direction normal to plane
129 direction normalDir() const;
131 //- Correct motion points
132 void correctPoints(pointField& p) const;
139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 } // End namespace Foam
143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147 // ************************************************************************* //