OpenFOAM logo
Open Source CFD Toolkit

twoDPointCorrector.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2005 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM; if not, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Class
00026     twoDPointCorrector
00027 
00028 Description
00029     Class applies a two-dimensional correction to mesh motion point field.
00030     The correction guarantees that the mesh does not get twisted during motion
00031     and thus introduce a third dimension into a 2-D problem.
00032 
00033     The operation is performed by looping through all edges approximately
00034     normal to the plane and enforcing their orthoginality onto the plane by
00035     adjusting points on their ends.
00036 
00037 SourceFiles
00038     twoDPointCorrector.C
00039 
00040 \*---------------------------------------------------------------------------*/
00041 
00042 #ifndef twoDPointCorrector_H
00043 #define twoDPointCorrector_H
00044 
00045 #include "polyMesh.H"
00046 
00047 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00048 
00049 namespace Foam
00050 {
00051 
00052 /*---------------------------------------------------------------------------*\
00053                         Class twoDPointCorrector Declaration
00054 \*---------------------------------------------------------------------------*/
00055 
00056 class twoDPointCorrector
00057 {
00058     // Private data
00059 
00060         //- Reference to moving mesh
00061         const polyMesh& mesh_;
00062 
00063         //- 2-D plane unit normal
00064         mutable vector* planeNormalPtr_;
00065 
00066         //- Indices of edges normal to plane
00067         mutable labelList* normalEdgeIndicesPtr_;
00068 
00069 
00070     // Private Member Functions
00071 
00072         //- Disallow default bitwise copy construct
00073         twoDPointCorrector(const twoDPointCorrector&);
00074 
00075         //- Disallow default bitwise assignment
00076         void operator=(const twoDPointCorrector&);
00077 
00078 
00079         //- Calculate addressing
00080         void calcAddressing() const;
00081 
00082         //- Clear addressing
00083         void clearAddressing() const;
00084 
00085 
00086     // Static data members
00087 
00088         //- Edge orthogonality tolerance
00089         static const scalar edgeOrthogonalityTol;
00090 
00091 
00092 public:
00093 
00094     // Constructors
00095 
00096         //- Construct from components
00097         twoDPointCorrector(const polyMesh& mesh);
00098 
00099 
00100     // Member Functions
00101 
00102         //- Return plane normal
00103         const vector& planeNormal() const;
00104 
00105         //- Return indices of normal edges.
00106         const labelList& normalEdgeIndices() const;
00107 
00108         //- Return direction normal to plane
00109         direction normalDir() const;
00110 
00111         //- Correct motion points
00112         void correctPoints(pointField& p) const;
00113 
00114         //- Update topology
00115         void updateMesh();
00116 };
00117 
00118 
00119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00120 
00121 } // End namespace Foam
00122 
00123 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00124 
00125 #endif
00126 
00127 // ************************************************************************* //
For further information go to www.openfoam.org