initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / meshTools / twoDPointCorrector / twoDPointCorrector.H
blobec5409f180d5cacb52d9ab39504bd69565dcc28a
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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
25 Class
26     Foam::twoDPointCorrector
28 Description
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.
38 SourceFiles
39     twoDPointCorrector.C
41 \*---------------------------------------------------------------------------*/
43 #ifndef twoDPointCorrector_H
44 #define twoDPointCorrector_H
46 #include "pointField.H"
47 #include "labelList.H"
48 #include "vector.H"
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 namespace Foam
55 // Forward class declarations
56 class polyMesh;
58 /*---------------------------------------------------------------------------*\
59                         Class twoDPointCorrector Declaration
60 \*---------------------------------------------------------------------------*/
62 class twoDPointCorrector
64     // Private data
66         //- Reference to moving mesh
67         const polyMesh& mesh_;
69         //- Is 2D correction required, i.e. is the mesh
70         bool required_;
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;
91         //- Clear addressing
92         void clearAddressing() const;
95     // Static data members
97         //- Edge orthogonality tolerance
98         static const scalar edgeOrthogonalityTol;
101 public:
103     // Constructors
105         //- Construct from components
106         twoDPointCorrector(const polyMesh& mesh);
109     // Destructor
111         ~twoDPointCorrector();
114     // Member Functions
116         //- Is 2D correction required, i.e. is the mesh a wedge or slab
117         bool required() const
118         {
119             return required_;
120         }
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;
134         //- Update topology
135         void updateMesh();
139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 } // End namespace Foam
143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 #endif
147 // ************************************************************************* //