OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

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-2009 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     Foam::twoDPointCorrector
00027 
00028 Description
00029     Class applies a two-dimensional correction to mesh motion point field.
00030  
00031     The correction guarantees that the mesh does not get twisted during motion
00032     and thus introduce a third dimension into a 2-D problem.
00033 
00034     The operation is performed by looping through all edges approximately
00035     normal to the plane and enforcing their orthoginality onto the plane by
00036     adjusting points on their ends.
00037 
00038 SourceFiles
00039     twoDPointCorrector.C
00040 
00041 \*---------------------------------------------------------------------------*/
00042 
00043 #ifndef twoDPointCorrector_H
00044 #define twoDPointCorrector_H
00045 
00046 #include "pointField.H"
00047 #include "labelList.H"
00048 #include "vector.H"
00049 
00050 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00051 
00052 namespace Foam
00053 {
00054 
00055 // Forward class declarations
00056 class polyMesh;
00057 
00058 /*---------------------------------------------------------------------------*\
00059                         Class twoDPointCorrector Declaration
00060 \*---------------------------------------------------------------------------*/
00061 
00062 class twoDPointCorrector
00063 {
00064     // Private data
00065 
00066         //- Reference to moving mesh
00067         const polyMesh& mesh_;
00068 
00069         //- Is 2D correction required, i.e. is the mesh
00070         bool required_;
00071 
00072         //- 2-D plane unit normal
00073         mutable vector* planeNormalPtr_;
00074 
00075         //- Indices of edges normal to plane
00076         mutable labelList* normalEdgeIndicesPtr_;
00077 
00078 
00079     // Private Member Functions
00080 
00081         //- Disallow default bitwise copy construct
00082         twoDPointCorrector(const twoDPointCorrector&);
00083 
00084         //- Disallow default bitwise assignment
00085         void operator=(const twoDPointCorrector&);
00086 
00087 
00088         //- Calculate addressing
00089         void calcAddressing() const;
00090 
00091         //- Clear addressing
00092         void clearAddressing() const;
00093 
00094 
00095     // Static data members
00096 
00097         //- Edge orthogonality tolerance
00098         static const scalar edgeOrthogonalityTol;
00099 
00100 
00101 public:
00102 
00103     // Constructors
00104 
00105         //- Construct from components
00106         twoDPointCorrector(const polyMesh& mesh);
00107 
00108 
00109     // Destructor
00110 
00111         ~twoDPointCorrector();
00112 
00113 
00114     // Member Functions
00115 
00116         //- Is 2D correction required, i.e. is the mesh a wedge or slab
00117         bool required() const
00118         {
00119             return required_;
00120         }
00121 
00122         //- Return plane normal
00123         const vector& planeNormal() const;
00124 
00125         //- Return indices of normal edges.
00126         const labelList& normalEdgeIndices() const;
00127 
00128         //- Return direction normal to plane
00129         direction normalDir() const;
00130 
00131         //- Correct motion points
00132         void correctPoints(pointField& p) const;
00133 
00134         //- Update topology
00135         void updateMesh();
00136 };
00137 
00138 
00139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00140 
00141 } // End namespace Foam
00142 
00143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00144 
00145 #endif
00146 
00147 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd