1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
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
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"
32 #include "addToRunTimeSelectionTable.H"
34 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
39 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
41 defineTypeNameAndDebug(facePointPatch, 0);
42 defineRunTimeSelectionTable(facePointPatch, polyPatch);
44 addToRunTimeSelectionTable
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
89 const pointBoundaryMesh& bm
97 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
99 const labelList& facePointPatch::meshPoints() const
101 if (meshPoints_.size())
107 return polyPatch_.meshPoints();
112 const pointField& facePointPatch::localPoints() const
114 if (meshPoints_.size())
116 if (localPoints_.size() != meshPoints_.size())
118 const labelList& meshPts = meshPoints();
120 localPoints_.setSize(meshPts.size());
121 const pointField& points = polyPatch_.points();
123 forAll (meshPts, pointi)
125 localPoints_[pointi] = points[meshPts[pointi]];
133 return polyPatch_.localPoints();
138 const vectorField& facePointPatch::pointNormals() const
140 if (pointNormals_.size())
142 return pointNormals_;
146 return polyPatch_.pointNormals();
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 } // End namespace Foam
155 // ************************************************************************* //