FreeFOAM The Cross-Platform CFD Toolkit
facePointPatch.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
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.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "facePointPatch.H"
28 #include <OpenFOAM/pointMesh.H>
30 #include <OpenFOAM/boolList.H>
32 
33 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
34 
35 namespace Foam
36 {
37 
38 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
39 
40 defineTypeNameAndDebug(facePointPatch, 0);
41 defineRunTimeSelectionTable(facePointPatch, polyPatch);
42 
44 (
45  facePointPatch,
46  facePointPatch,
47  polyPatch
48 );
49 
50 
51 // * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
52 
54 {
58 }
59 
60 
62 {}
63 
64 
66 {}
67 
68 
70 {}
71 
72 
74 {
76 }
77 
78 
80 {}
81 
82 
83 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
84 
85 facePointPatch::facePointPatch
86 (
87  const polyPatch& p,
88  const pointBoundaryMesh& bm
89 )
90 :
91  pointPatch(bm),
92  polyPatch_(p)
93 {}
94 
95 
96 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
97 
99 {
100  if (meshPoints_.size())
101  {
102  return meshPoints_;
103  }
104  else
105  {
106  return polyPatch_.meshPoints();
107  }
108 }
109 
110 
112 {
113  if (meshPoints_.size())
114  {
115  if (localPoints_.size() != meshPoints_.size())
116  {
117  const labelList& meshPts = meshPoints();
118 
119  localPoints_.setSize(meshPts.size());
120  const pointField& points = polyPatch_.points();
121 
122  forAll (meshPts, pointi)
123  {
124  localPoints_[pointi] = points[meshPts[pointi]];
125  }
126  }
127 
128  return localPoints_;
129  }
130  else
131  {
132  return polyPatch_.localPoints();
133  }
134 }
135 
136 
138 {
139  if (pointNormals_.size())
140  {
141  return pointNormals_;
142  }
143  else
144  {
145  return polyPatch_.pointNormals();
146  }
147 }
148 
149 
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151 
152 } // End namespace Foam
153 
154 // ************************ vim: set sw=4 sts=4 et: ************************ //