FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

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-2010 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
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your 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, see <http://www.gnu.org/licenses/>.
00023 
00024 Class
00025     Foam::twoDPointCorrector
00026 
00027 Description
00028     Class applies a two-dimensional correction to mesh motion point field.
00029  
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 <OpenFOAM/pointField.H>
00046 #include <OpenFOAM/labelList.H>
00047 #include <OpenFOAM/vector.H>
00048 
00049 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00050 
00051 namespace Foam
00052 {
00053 
00054 // Forward class declarations
00055 class polyMesh;
00056 
00057 /*---------------------------------------------------------------------------*\
00058                         Class twoDPointCorrector Declaration
00059 \*---------------------------------------------------------------------------*/
00060 
00061 class twoDPointCorrector
00062 {
00063     // Private data
00064 
00065         //- Reference to moving mesh
00066         const polyMesh& mesh_;
00067 
00068         //- Is 2D correction required, i.e. is the mesh
00069         bool required_;
00070 
00071         //- 2-D plane unit normal
00072         mutable vector* planeNormalPtr_;
00073 
00074         //- Indices of edges normal to plane
00075         mutable labelList* normalEdgeIndicesPtr_;
00076 
00077 
00078     // Private Member Functions
00079 
00080         //- Disallow default bitwise copy construct
00081         twoDPointCorrector(const twoDPointCorrector&);
00082 
00083         //- Disallow default bitwise assignment
00084         void operator=(const twoDPointCorrector&);
00085 
00086 
00087         //- Calculate addressing
00088         void calcAddressing() const;
00089 
00090         //- Clear addressing
00091         void clearAddressing() const;
00092 
00093 
00094     // Static data members
00095 
00096         //- Edge orthogonality tolerance
00097         static const scalar edgeOrthogonalityTol;
00098 
00099 
00100 public:
00101 
00102     // Constructors
00103 
00104         //- Construct from components
00105         twoDPointCorrector(const polyMesh& mesh);
00106 
00107 
00108     // Destructor
00109 
00110         ~twoDPointCorrector();
00111 
00112 
00113     // Member Functions
00114 
00115         //- Is 2D correction required, i.e. is the mesh a wedge or slab
00116         bool required() const
00117         {
00118             return required_;
00119         }
00120 
00121         //- Return plane normal
00122         const vector& planeNormal() const;
00123 
00124         //- Return indices of normal edges.
00125         const labelList& normalEdgeIndices() const;
00126 
00127         //- Return direction normal to plane
00128         direction normalDir() const;
00129 
00130         //- Correct motion points
00131         void correctPoints(pointField& p) const;
00132 
00133         //- Update topology
00134         void updateMesh();
00135 };
00136 
00137 
00138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00139 
00140 } // End namespace Foam
00141 
00142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00143 
00144 #endif
00145 
00146 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines