1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2010 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
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 Constructs plane through mesh.
30 No attempt at resolving degenerate cases. Since the cut faces are
31 usually quite ugly, they will always be triangulated.
34 When the cutting plane coincides with a mesh face, the cell edge on the
35 positive side of the plane is taken.
40 \*---------------------------------------------------------------------------*/
42 #ifndef cuttingPlane_H
43 #define cuttingPlane_H
46 #include "pointField.H"
48 #include "MeshedSurface.H"
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
57 /*---------------------------------------------------------------------------*\
58 Class cuttingPlane Declaration
59 \*---------------------------------------------------------------------------*/
64 public MeshedSurface<face>
66 //- Private typedefs for convenience
67 typedef MeshedSurface<face> MeshStorage;
71 //- List of cells cut by the plane
74 // Private Member Functions
76 //- Determine cut cells, possibly restricted to a list of cells
80 const scalarField& dotProducts,
81 const UList<label>& cellIdLabels = UList<label>::null()
84 //- Determine intersection points (cutPoints).
88 const scalarField& dotProducts,
89 List<label>& edgePoint
92 //- Walk circumference of cell, starting from startEdgeI crossing
93 // only cut edges. Record cutPoint labels in faceVerts.
97 const UList<label>& edgePoint,
99 const label startEdgeI,
100 DynamicList<label>& faceVerts
103 //- Determine cuts for all cut cells.
106 const primitiveMesh& mesh,
107 const UList<label>& edgePoint
115 //- Construct plane description without cutting
116 cuttingPlane(const plane&);
118 // Protected Member Functions
120 //- recut mesh with existing planeDesc, restricted to a list of cells
123 const primitiveMesh&,
124 const UList<label>& cellIdLabels = UList<label>::null()
127 //- remap action on triangulation or cleanup
128 virtual void remapFaces(const UList<label>& faceMap);
134 //- Construct from plane and mesh reference,
135 // possibly restricted to a list of cells
139 const primitiveMesh&,
140 const UList<label>& cellIdLabels = UList<label>::null()
146 //- Return plane used
147 const plane& planeDesc() const
149 return static_cast<const plane&>(*this);
152 //- Return List of cells cut by the plane
153 const labelList& cutCells() const
158 //- Return true or false to question: have any cells been cut?
161 return cutCells_.size();
164 //- Sample the cell field
166 tmp<Field<Type> > sample(const Field<Type>&) const;
169 tmp<Field<Type> > sample(const tmp<Field<Type> >&) const;
174 void operator=(const cuttingPlane&);
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 } // End namespace Foam
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 # include "cuttingPlaneTemplates.C"
188 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 // ************************************************************************* //