Forward compatibility: flex
[foam-extend-3.2.git] / src / mesh / cfMesh / utilities / intersectionTools / findCellsIntersectingSurface / findCellsIntersectingSurface.H
blob9b6f65f5d0549bc95bdb3a87f7e7fd05accad6eb
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | cfMesh: A library for mesh generation
4    \\    /   O peration     |
5     \\  /    A nd           | Author: Franjo Juretic (franjo.juretic@c-fields.com)
6      \\/     M anipulation  | Copyright (C) Creative Fields, Ltd.
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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/>.
24 Class
25     findCellsIntersectingSurface
27 Description
28     Finds which cells in the mesh intersect the surface mesh
30 SourceFiles
31     findCellsIntersectingSurface.C
33 \*---------------------------------------------------------------------------*/
35 #ifndef findCellsIntersectingSurface_H
36 #define findCellsIntersectingSurface_H
38 #include "boolList.H"
39 #include "VRWGraph.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 namespace Foam
46 class polyMeshGen;
47 class triSurf;
48 class meshOctree;
50 /*---------------------------------------------------------------------------*\
51                 Class findCellsIntersectingSurface Declaration
52 \*---------------------------------------------------------------------------*/
54 class findCellsIntersectingSurface
56     // Private data
57         //- Reference to the mesh
58         polyMeshGen& mesh_;
60         //- Pointer to the octree
61         meshOctree* octreePtr_;
63         //- check whether the octree was generated or not
64         const bool octreeGenerated_;
66         //- stores information about intersected cells
67         boolList intersectedCells_;
69         //- stores information which surface facets intersect each cell
70         VRWGraph facetsIntersectingCell_;
72     // Private member functions
73         //- generate the octree
74         void generateOctree(const triSurf&);
76         //- check for the intersected cells
77         void findIntersectedCells();
79 public:
81     // Constructors
83         //- Construct from mesh and octree
84         findCellsIntersectingSurface
85         (
86             polyMeshGen& mesh,
87             const meshOctree& octree
88         );
90         //- Construct from mesh and surface
91         findCellsIntersectingSurface
92         (
93             polyMeshGen& mesh,
94             const triSurf& surface
95         );
97     // Destructor
98         ~findCellsIntersectingSurface();
100     // Public member functions
101         //- return the list of intersected cells;
102         const boolList& intersectedCells() const;
104         //- return the graph of facets intersecting each cell
105         const VRWGraph& facetsIntersectingCells() const;
107         //- create a cell subset containing intersected cells
108         void addIntersectedCellsToSubset
109         (
110             const word subsetName = "intersectedCells"
111         );
115 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
117 } // End namespace Foam
119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
121 #endif
123 // ************************************************************************* //