1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 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, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29 Constructs plane through mesh.
31 No attempt at resolving degenerate cases. Since the cut faces are
32 usually quite ugly, they will always be triangulated.
35 When the cutting plane coincides with a mesh face, the cell edge on the
36 positive side of the plane is taken.
41 \*---------------------------------------------------------------------------*/
43 #ifndef cuttingPlane_H
44 #define cuttingPlane_H
47 #include "pointField.H"
49 #include "MeshedSurface.H"
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
58 /*---------------------------------------------------------------------------*\
59 Class cuttingPlane Declaration
60 \*---------------------------------------------------------------------------*/
65 public MeshedSurface<face>
67 //- Private typedefs for convenience
68 typedef MeshedSurface<face> MeshStorage;
72 //- List of cells cut by the plane
75 // Private Member Functions
77 //- Determine cut cells, possibly restricted to a list of cells
81 const scalarField& dotProducts,
82 const UList<label>& cellIdLabels = UList<label>::null()
85 //- Determine intersection points (cutPoints).
89 const scalarField& dotProducts,
90 List<label>& edgePoint
93 //- Walk circumference of cell, starting from startEdgeI crossing
94 // only cut edges. Record cutPoint labels in faceVerts.
98 const UList<label>& edgePoint,
100 const label startEdgeI,
101 DynamicList<label>& faceVerts
104 //- Determine cuts for all cut cells.
107 const primitiveMesh& mesh,
108 const UList<label>& edgePoint
116 //- Construct plane description without cutting
117 cuttingPlane(const plane&);
119 // Protected Member Functions
121 //- recut mesh with existing planeDesc, restricted to a list of cells
124 const primitiveMesh&,
125 const UList<label>& cellIdLabels = UList<label>::null()
128 //- remap action on triangulation or cleanup
129 virtual void remapFaces(const UList<label>& faceMap);
135 //- Construct from plane and mesh reference,
136 // possibly restricted to a list of cells
140 const primitiveMesh&,
141 const UList<label>& cellIdLabels = UList<label>::null()
147 //- Return plane used
148 const plane& planeDesc() const
150 return static_cast<const plane&>(*this);
153 //- Return List of cells cut by the plane
154 const labelList& cutCells() const
159 //- Return true or false to question: have any cells been cut?
162 return cutCells_.size();
165 //- Sample the cell field
167 tmp<Field<Type> > sample(const Field<Type>&) const;
170 tmp<Field<Type> > sample(const tmp<Field<Type> >&) const;
175 void operator=(const cuttingPlane&);
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 } // End namespace Foam
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 # include "cuttingPlaneTemplates.C"
189 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193 // ************************************************************************* //