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

wedgePolyPatch.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::wedgePolyPatch
00026 
00027 Description
00028     Wedge front and back plane patch.
00029 
00030 SourceFiles
00031     wedgePolyPatch.C
00032 
00033 \*---------------------------------------------------------------------------*/
00034 
00035 #ifndef wedgePolyPatch_H
00036 #define wedgePolyPatch_H
00037 
00038 #include <OpenFOAM/polyPatch.H>
00039 
00040 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00041 
00042 namespace Foam
00043 {
00044 
00045 /*---------------------------------------------------------------------------*\
00046                       Class wedgePolyPatch Declaration
00047 \*---------------------------------------------------------------------------*/
00048 
00049 class wedgePolyPatch
00050 :
00051     public polyPatch
00052 {
00053     // Private data
00054 
00055         //- Axis of the wedge
00056         vector axis_;
00057 
00058         //- Centre normal between the wedge boundaries
00059         vector centreNormal_;
00060 
00061         //- Normal to the patch
00062         vector patchNormal_;
00063 
00064         //- Face transformation tensor
00065         tensor faceT_;
00066 
00067         //- Neighbour-cell transformation tensor
00068         tensor cellT_;
00069 
00070         //- Calculate the above tensors
00071         void initTransforms();
00072 
00073 
00074 public:
00075 
00076     //- Runtime type information
00077     TypeName("wedge");
00078 
00079 
00080     // Constructors
00081 
00082         //- Construct from components
00083         wedgePolyPatch
00084         (
00085             const word& name,
00086             const label size,
00087             const label start,
00088             const label index,
00089             const polyBoundaryMesh& bm
00090         );
00091 
00092         //- Construct from dictionary
00093         wedgePolyPatch
00094         (
00095             const word& name,
00096             const dictionary& dict,
00097             const label index,
00098             const polyBoundaryMesh& bm
00099         );
00100 
00101         //- Construct as copy, resetting the boundary mesh
00102         wedgePolyPatch(const wedgePolyPatch&, const polyBoundaryMesh&);
00103 
00104         //- Construct given the original patch and resetting the
00105         //  face list and boundary mesh information
00106         wedgePolyPatch
00107         (
00108             const wedgePolyPatch& pp,
00109             const polyBoundaryMesh& bm,
00110             const label index,
00111             const label newSize,
00112             const label newStart
00113         );
00114 
00115         //- Construct and return a clone, resetting the boundary mesh
00116         virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
00117         {
00118             return autoPtr<polyPatch>(new wedgePolyPatch(*this, bm));
00119         }
00120 
00121         //- Construct and return a clone, resetting the face list
00122         //  and boundary mesh
00123         virtual autoPtr<polyPatch> clone
00124         (
00125             const polyBoundaryMesh& bm,
00126             const label index,
00127             const label newSize,
00128             const label newStart
00129         ) const
00130         {
00131             return autoPtr<polyPatch>
00132             (
00133                 new wedgePolyPatch(*this, bm, index, newSize, newStart)
00134             );
00135         }
00136 
00137 
00138     // Member functions
00139 
00140         // Access
00141 
00142             //- Return axis of the wedge
00143             const vector& axis() const
00144             {
00145                 return axis_;
00146             }
00147 
00148             //- Return plane normal between the wedge boundaries
00149             const vector& centreNormal() const
00150             {
00151                 return centreNormal_;
00152             }
00153 
00154             //- Return the normal to the patch
00155             const vector& patchNormal() const
00156             {
00157                 return patchNormal_;
00158             }
00159 
00160             //- Return face transformation tensor
00161             const tensor& faceT() const
00162             {
00163                 return faceT_;
00164             }
00165 
00166             //- Return neighbour-cell transformation tensor
00167             const tensor& cellT() const
00168             {
00169                 return cellT_;
00170             }
00171 };
00172 
00173 
00174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00175 
00176 } // End namespace Foam
00177 
00178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00179 
00180 #endif
00181 
00182 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines