initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / OpenFOAM / meshes / pointMesh / pointPatches / facePointPatch / facePointPatch.C
blob25c91dd398769b9fd5c0c333b0b5fa39c97c7f9e
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
11     OpenFOAM is free software; you can redistribute it and/or modify it
12     under the terms of the GNU General Public License as published by the
13     Free Software Foundation; either version 2 of the License, or (at your
14     option) any later version.
16     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
19     for more details.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 \*---------------------------------------------------------------------------*/
27 #include "facePointPatch.H"
28 #include "pointBoundaryMesh.H"
29 #include "pointMesh.H"
30 #include "demandDrivenData.H"
31 #include "boolList.H"
32 #include "addToRunTimeSelectionTable.H"
34 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
36 namespace Foam
39 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
41 defineTypeNameAndDebug(facePointPatch, 0);
42 defineRunTimeSelectionTable(facePointPatch, polyPatch);
44 addToRunTimeSelectionTable
46     facePointPatch,
47     facePointPatch,
48     polyPatch
52 // * * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * //
54 void facePointPatch::initGeometry()
56     meshPoints_.setSize(0);
57     localPoints_.setSize(0);
58     pointNormals_.setSize(0);
62 void facePointPatch::calcGeometry()
66 void facePointPatch::initMovePoints(const pointField&)
70 void facePointPatch::movePoints(const pointField&)
74 void facePointPatch::initUpdateMesh()
76     facePointPatch::initGeometry();
80 void facePointPatch::updateMesh()
84 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
86 facePointPatch::facePointPatch
88     const polyPatch& p,
89     const pointBoundaryMesh& bm
92     pointPatch(bm),
93     polyPatch_(p)
97 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
99 const labelList& facePointPatch::meshPoints() const
101     if (meshPoints_.size())
102     {
103         return meshPoints_;
104     }
105     else
106     {
107         return polyPatch_.meshPoints();
108     }
112 const pointField& facePointPatch::localPoints() const
114     if (meshPoints_.size())
115     {
116         if (localPoints_.size() != meshPoints_.size())
117         {
118             const labelList& meshPts = meshPoints();
120             localPoints_.setSize(meshPts.size());
121             const pointField& points = polyPatch_.points();
123             forAll (meshPts, pointi)
124             {
125                 localPoints_[pointi] = points[meshPts[pointi]];
126             }
127         }
129         return localPoints_;
130     }
131     else
132     {
133         return polyPatch_.localPoints();
134     }
138 const vectorField& facePointPatch::pointNormals() const
140     if (pointNormals_.size())
141     {
142         return pointNormals_;
143     }
144     else
145     {
146         return polyPatch_.pointNormals();
147     }
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 } // End namespace Foam
155 // ************************************************************************* //