initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / meshTools / sets / faceSources / cellToFace / cellToFace.H
blob5fad04a9f502310bb241552c3e6424d8398c172b
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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
25 Class
26     Foam::cellToFace
28 Description
29     A topoSetSource to select a faceSet from cells.
31     Either all faces of cell or some other criterion.
32     See implementation.
33     Note: when picking up coupled faces uses cells on neighbouring processors.
35 SourceFiles
36     cellToFace.C
38 \*---------------------------------------------------------------------------*/
40 #ifndef cellToFace_H
41 #define cellToFace_H
43 #include "topoSetSource.H"
44 #include "NamedEnum.H"
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 namespace Foam
51 /*---------------------------------------------------------------------------*\
52                            Class cellToFace Declaration
53 \*---------------------------------------------------------------------------*/
55 class cellToFace
57     public topoSetSource
59 public:
60         //- Enumeration defining the valid options
61         enum cellAction
62         {
63             ALL,
64             BOTH
65         };
68 private:
70         //- Add usage string
71         static addToUsageTable usage_;
73         static const NamedEnum<cellAction, 2> cellActionNames_;
75         //- Name of set to use
76         word setName_;
78         //- Option
79         cellAction option_;
82     // Private Member Functions
84         //- Depending on face to cell option add to or delete from cellSet.
85         void combine(topoSet& set, const bool add) const;
88 public:
90     //- Runtime type information
91     TypeName("cellToFace");
93     // Constructors
95         //- Construct from components
96         cellToFace
97         (
98             const polyMesh& mesh,
99             const word& setName,
100             const cellAction option
101         );
103         //- Construct from dictionary
104         cellToFace
105         (
106             const polyMesh& mesh,
107             const dictionary& dict
108         );
110         //- Construct from Istream
111         cellToFace
112         (
113             const polyMesh& mesh,
114             Istream&
115         );
118     // Destructor
120         virtual ~cellToFace();
123     // Member Functions
125         virtual void applyToSet
126         (
127             const topoSetSource::setAction action,
128             topoSet&
129         ) const;
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136 } // End namespace Foam
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140 #endif
142 // ************************************************************************* //