1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | cfMesh: A library for mesh generation
5 \\ / A nd | Author: Franjo Juretic (franjo.juretic@c-fields.com)
6 \\/ M anipulation | Copyright (C) Creative Fields, Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of cfMesh.
11 cfMesh 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 3 of the License, or (at your
14 option) any later version.
16 cfMesh 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 cfMesh. If not, see <http://www.gnu.org/licenses/>.
27 \*---------------------------------------------------------------------------*/
30 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
35 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
37 inline label extrudeLayer::addressingCalculator::origFaceLabel
42 return extrudedFaces_[extrudedI].second();
45 inline label extrudeLayer::addressingCalculator::positionInFace
47 const label extrudedI,
51 const face& f = faces_[extrudedFaces_[extrudedI].first()];
53 return f.which(pointI);
56 inline label extrudeLayer::addressingCalculator::origPointLabel
58 const label extrudedI,
62 const face& of = faces_[extrudedFaces_[extrudedI].second()];
64 if( pairOrientation_[extrudedI] )
70 return of[(of.size()-pos)%of.size()];
75 "label extrudeLayer::addressingCalculator::origPointLabel"
76 "(const label, const label) const"
77 ) << "Cannot find point for the given position" << abort(FatalError);
82 inline label extrudeLayer::addressingCalculator::origPoint
84 const label extrudedI,
88 const face& f = faces_[extrudedFaces_[extrudedI].first()];
89 const face& of = faces_[extrudedFaces_[extrudedI].second()];
90 const label pos = f.which(pointI);
92 if( pairOrientation_[extrudedI] )
98 return of[(of.size()-pos)%of.size()];
103 "label extrudeLayer::addressingCalculator::origPoint"
104 "(const label, const label) const"
105 ) << "Cannot find point for the given position" << abort(FatalError);
110 inline label extrudeLayer::addressingCalculator::faceSharingEdge
112 const label extrudedI,
116 const face& f = faces_[extrudedFaces_[extrudedI].first()];
118 const label pointI = f[eI];
119 const label nextI = f.nextLabel(eI);
122 forAllRow(pointExtruded_, pointI, pfI)
124 const label currFaceI = pointExtruded_(pointI, pfI);
126 if( currFaceI == extrudedI )
129 if( pointExtruded_.contains(nextI, currFaceI) )
131 if( otherFace != -1 )
134 "label extrudeLayer::addressingCalculator::faceSharingEdge"
135 "(const label, const label) const"
136 ) << "Expected only one such face"
137 << abort(FatalError);
139 otherFace = currFaceI;
146 inline void extrudeLayer::addressingCalculator::facesSharingEdge
150 DynList<label>& edgeFaces
155 forAllRow(pointExtruded_, start, pfI)
157 const label currFaceI = pointExtruded_(start, pfI);
159 if( pointExtruded_.contains(end, currFaceI) )
160 edgeFaces.append(currFaceI);
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 } // End namespace Foam
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //