1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
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
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
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/>.
28 Abstract base class. Concrete implementations know how to cut a cell
29 (i.e. determine a loop around the circumference).
31 Loop around the cell is given as the vertices to be cut and edges to
32 be cut (and a weight between 0 and 1 giving where the cut is to be
33 made). Main routine is 'cut' which gets called for every cell and
34 gets the current cut situation and expects to return a loop on the
37 Calling function needs to determine whether cellLooper is compatible with
40 Also contains various utility functions which implementations might want to
46 \*---------------------------------------------------------------------------*/
51 #include "edgeVertex.H"
54 #include "scalarField.H"
55 #include "DynamicList.H"
57 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
62 // Forward declaration of classes
66 /*---------------------------------------------------------------------------*\
67 Class cellLooper Declaration
68 \*---------------------------------------------------------------------------*/
79 // Protected Member Functions
81 //- Get faces (on cell) connected to vertI which are not using edgeI
82 labelList getVertFacesNonEdge
89 //- Get first edge connected to vertI and on faceI
90 label getFirstVertEdge
96 //- Get edges (on cell) connected to vertI which are not on faceI
97 labelList getVertEdgesNonFace
104 //- Return edge from cellEdges that is most perpendicular
105 // to refinement direction.
106 label getMisAlignedEdge(const vector& refDir, const label cellI) const;
110 // Private Member Functions
112 //- Disallow default bitwise copy construct
113 cellLooper(const cellLooper&);
115 //- Disallow default bitwise assignment
116 void operator=(const cellLooper&);
121 //- Runtime type information
122 TypeName("cellLooper");
125 // Declare run-time constructor selection table
127 // For the direct constructor
128 declareRunTimeSelectionTable
142 //- Construct from components
143 cellLooper(const polyMesh& mesh);
146 autoPtr<cellLooper> clone() const
148 notImplemented("autoPtr<tcellLooper> clone() const");
149 return autoPtr<cellLooper>(NULL);
155 //- Return a reference to the selected cellLooper
156 static autoPtr<cellLooper> New
164 virtual ~cellLooper();
169 //- Create cut along circumference of cellI. Gets current mesh cuts
170 // vertIsCut, edgeIsCut, edgeWeight).
171 // Cut along circumference is expressed as cellVertCut,
172 // cellEdgeToWeight. Returns true if succesfull. Still might not
173 // be compatible with existing cuts but this should be handled by
177 const vector& refDir,
179 const boolList& vertIsCut,
180 const boolList& edgeIsCut,
181 const scalarField& edgeWeight,
184 scalarField& loopWeights
187 //- Same but now also base point of cut provided (instead of always
191 const plane& cutPlane,
193 const boolList& vertIsCut,
194 const boolList& edgeIsCut,
195 const scalarField& edgeWeight,
198 scalarField& loopWeights
204 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
206 } // End namespace Foam
208 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
212 // ************************************************************************* //