1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend 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 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
25 Foam::twoDPointCorrector
28 Class applies a two-dimensional correction to mesh motion point field.
30 The correction guarantees that the mesh does not get twisted during motion
31 and thus introduce a third dimension into a 2-D problem.
33 The operation is performed by looping through all edges approximately
34 normal to the plane and enforcing their orthoginality onto the plane by
35 adjusting points on their ends.
40 \*---------------------------------------------------------------------------*/
42 #ifndef twoDPointCorrector_H
43 #define twoDPointCorrector_H
45 #include "pointField.H"
46 #include "labelList.H"
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 // Forward class declarations
57 /*---------------------------------------------------------------------------*\
58 Class twoDPointCorrector Declaration
59 \*---------------------------------------------------------------------------*/
61 class twoDPointCorrector
65 //- Reference to moving mesh
66 const polyMesh& mesh_;
68 //- Is 2D correction required, i.e. is the mesh
71 //- 2-D plane unit normal
72 mutable vector* planeNormalPtr_;
74 //- Indices of edges normal to plane
75 mutable labelList* normalEdgeIndicesPtr_;
78 // Private Member Functions
80 //- Disallow default bitwise copy construct
81 twoDPointCorrector(const twoDPointCorrector&);
83 //- Disallow default bitwise assignment
84 void operator=(const twoDPointCorrector&);
87 //- Calculate addressing
88 void calcAddressing() const;
91 void clearAddressing() const;
94 // Static data members
96 //- Edge orthogonality tolerance
97 static const scalar edgeOrthogonalityTol;
104 //- Construct from components
105 twoDPointCorrector(const polyMesh& mesh);
110 ~twoDPointCorrector();
115 //- Is 2D correction required, i.e. is the mesh a wedge or slab
116 bool required() const
121 //- Return plane normal
122 const vector& planeNormal() const;
124 //- Return indices of normal edges.
125 const labelList& normalEdgeIndices() const;
127 //- Return direction normal to plane
128 direction normalDir() const;
130 //- Correct motion points
131 void correctPoints(pointField& p) const;
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140 } // End namespace Foam
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 // ************************************************************************* //