ENH: autoLayerDriver: better layering information message
[OpenFOAM-2.0.x.git] / src / edgeMesh / extendedFeatureEdgeMesh / extendedFeatureEdgeMeshI.H
blob62b0cc08ca8f3445143c9ac3f461be4733c1d4f6
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
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
13     the Free Software Foundation, either version 3 of the License, or
14     (at your 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, see <http://www.gnu.org/licenses/>.
24 \*---------------------------------------------------------------------------*/
26 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
28 inline Foam::label Foam::extendedFeatureEdgeMesh::convexStart() const
30     return convexStart_;
34 inline Foam::label Foam::extendedFeatureEdgeMesh::concaveStart() const
36     return concaveStart_;
40 inline Foam::label Foam::extendedFeatureEdgeMesh::mixedStart() const
42     return mixedStart_;
46 inline Foam::label Foam::extendedFeatureEdgeMesh::nonFeatureStart() const
48     return nonFeatureStart_;
52 inline Foam::label Foam::extendedFeatureEdgeMesh::externalStart() const
54     return externalStart_;
58 inline Foam::label Foam::extendedFeatureEdgeMesh::internalStart() const
60     return internalStart_;
64 inline Foam::label Foam::extendedFeatureEdgeMesh::flatStart() const
66     return flatStart_;
70 inline Foam::label Foam::extendedFeatureEdgeMesh::openStart() const
72     return openStart_;
76 inline Foam::label Foam::extendedFeatureEdgeMesh::multipleStart() const
78     return multipleStart_;
82 inline bool Foam::extendedFeatureEdgeMesh::featurePoint(label ptI) const
84     return ptI < nonFeatureStart_;
88 inline const Foam::vectorField& Foam::extendedFeatureEdgeMesh::normals() const
90     return normals_;
93 inline const Foam::vectorField& Foam::extendedFeatureEdgeMesh::edgeDirections()
94 const
96     return edgeDirections_;
100 inline Foam::vector Foam::extendedFeatureEdgeMesh::edgeDirection
102     label edgeI,
103     label ptI
104 ) const
106     const edge& e = edges()[edgeI];
108     if (ptI == e.start())
109     {
110         return edgeDirections()[edgeI];
111     }
112     else if (ptI == e.end())
113     {
114         return -edgeDirections()[edgeI];
115     }
116     else
117     {
118         FatalErrorIn("Foam::extendedFeatureEdgeMesh::edgedirection")
119             << "Requested ptI " << ptI << " is not a point on the requested "
120             << "edgeI " << edgeI << ". edgeI start and end: "
121             << e.start() << " " << e.end()
122             << exit(FatalError);
124         return vector::zero;
125     }
129 inline const Foam::labelListList& Foam::extendedFeatureEdgeMesh::edgeNormals()
130 const
132     return edgeNormals_;
136 inline Foam::vectorField Foam::extendedFeatureEdgeMesh::edgeNormals
138     const labelList& edgeNormIs
139 ) const
141     vectorField norms(edgeNormIs.size());
143     forAll(edgeNormIs, i)
144     {
145         norms[i] = normals_[edgeNormIs[i]];
146     }
148     return norms;
152 inline Foam::vectorField Foam::extendedFeatureEdgeMesh::edgeNormals(label edgeI)
153 const
155     return edgeNormals(edgeNormals_[edgeI]);
159 inline const Foam::labelListList&
160 Foam::extendedFeatureEdgeMesh::featurePointNormals() const
162     return featurePointNormals_;
166 inline Foam::vectorField Foam::extendedFeatureEdgeMesh::featurePointNormals
168     label ptI
169 ) const
171     if (!featurePoint(ptI))
172     {
173         WarningIn("vectorField extendedFeatureEdgeMesh::featurePointNormals")
174             << "Requesting the normals of a non-feature point. "
175             << "Returned zero length vectorField."
176             << endl;
178         return vectorField(0);
179     }
181     labelList featPtNormIs(featurePointNormals_[ptI]);
183     vectorField norms(featPtNormIs.size());
185     forAll(featPtNormIs, i)
186     {
187         norms[i] = normals_[featPtNormIs[i]];
188     }
190     return norms;
194 inline const Foam::labelList& Foam::extendedFeatureEdgeMesh::regionEdges() const
196     return regionEdges_;
200 inline Foam::extendedFeatureEdgeMesh::pointStatus
201 Foam::extendedFeatureEdgeMesh::getPointStatus
203     label ptI
204 ) const
206     if (ptI < concaveStart_)
207     {
208         return CONVEX;
209     }
210     else if (ptI < mixedStart_)
211     {
212         return CONCAVE;
213     }
214     else if (ptI < nonFeatureStart_)
215     {
216         return MIXED;
217     }
218     else
219     {
220         return NONFEATURE;
221     }
225 inline Foam::extendedFeatureEdgeMesh::edgeStatus
226 Foam::extendedFeatureEdgeMesh::getEdgeStatus
228     label edgeI
229 ) const
231     if (edgeI < internalStart_)
232     {
233         return EXTERNAL;
234     }
235     else if (edgeI < flatStart_)
236     {
237         return INTERNAL;
238     }
239     else if (edgeI < openStart_)
240     {
241         return FLAT;
242     }
243     else if (edgeI < multipleStart_)
244     {
245         return OPEN;
246     }
247     else
248     {
249         return MULTIPLE;
250     }
254 // ************************************************************************* //