OpenFOAM logo
Open Source CFD Toolkit

facePointPatch.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     facePointPatch
00027 
00028 Description
00029     A pointPatch based on a polyPatch
00030 
00031 SourceFiles
00032     facePointPatch.C
00033     facePointPatchM.C
00034     newPointPatch.C
00035 
00036 \*---------------------------------------------------------------------------*/
00037 
00038 #ifndef facePointPatch_H
00039 #define facePointPatch_H
00040 
00041 #include "pointPatch.H"
00042 #include "polyPatch.H"
00043 #include "autoPtr.H"
00044 
00045 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00046 
00047 namespace Foam
00048 {
00049 
00050 /*---------------------------------------------------------------------------*\
00051                   Class facePointPatch Declaration
00052 \*---------------------------------------------------------------------------*/
00053 
00054 class facePointPatch
00055 :
00056     public pointPatch
00057 {
00058     // Private data
00059 
00060         //- Reference to the underlying polyPatch
00061         const polyPatch& polyPatch_;
00062 
00063 
00064     // Private Member Functions
00065 
00066         //- Disallow default bitwise copy construct
00067         facePointPatch(const facePointPatch&);
00068 
00069         //- Disallow default bitwise assignment
00070         void operator=(const facePointPatch&);
00071 
00072 
00073 public:
00074 
00075     typedef pointBoundaryMesh BoundaryMesh;
00076 
00077 
00078     //- Runtime type information
00079     TypeName(polyPatch::typeName_());
00080 
00081     // Declare run-time constructor selection tables
00082 
00083         declareRunTimeSelectionTable
00084         (
00085             autoPtr,
00086             facePointPatch,
00087             polyPatch,
00088             (const polyPatch& patch, const pointBoundaryMesh& bm),
00089             (patch, bm)
00090         );
00091 
00092 
00093     // Constructors
00094 
00095         //- Construct from polyPatch
00096         facePointPatch
00097         (
00098             const polyPatch&,
00099             const pointBoundaryMesh&
00100         );
00101 
00102 
00103     // Selectors
00104 
00105         //- Return a pointer to a new patch created on freestore from polyPatch
00106         static autoPtr<facePointPatch> New
00107         (
00108             const polyPatch&,
00109             const pointBoundaryMesh&
00110         );
00111 
00112 
00113     // Destructor
00114 
00115         virtual ~facePointPatch()
00116         {}
00117 
00118 
00119     // Member Functions
00120 
00121         //- Return the polyPatch
00122         const polyPatch& patch() const
00123         {
00124             return polyPatch_;
00125         }
00126 
00127         //- Return name
00128         virtual const word& name() const
00129         {
00130             return polyPatch_.name();
00131         }
00132 
00133         //- Return size
00134         virtual label size() const
00135         {
00136             return polyPatch_.nPoints();
00137         }
00138 
00139         //- Return number of faces
00140         virtual label nFaces() const
00141         {
00142             return polyPatch_.size();
00143         }
00144 
00145         //- Return the index of this patch in the pointBoundaryMesh
00146         virtual label index() const
00147         {
00148             return polyPatch_.index();
00149         }
00150 
00151 
00152         // Access functions for demand driven data
00153 
00154             //- Return mesh points
00155             virtual const labelList& meshPoints() const
00156             {
00157                 return polyPatch_.meshPoints();
00158             }
00159 
00160             //- Return pointField of points in patch
00161             virtual const pointField& localPoints() const
00162             {
00163                 return polyPatch_.localPoints();
00164             }
00165 
00166             //- Return point unit normals
00167             virtual const vectorField& pointNormals() const
00168             {
00169                 return polyPatch_.pointNormals();
00170             }
00171 
00172             //- Face decomposition into triangle
00173             //  Used for implementation of FEM boundary conditions
00174             virtual triFaceList faceTriangles(const label faceID) const;
00175 };
00176 
00177 
00178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00179 
00180 } // End namespace Foam
00181 
00182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00183 
00184 #endif
00185 
00186 // ************************************************************************* //
For further information go to www.openfoam.org