faceSelection.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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.
20 
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/>.
23 
24 Class
25  Foam::faceSelection
26 
27 Description
28  Face selection method for createBaffles
29 
30 SourceFiles
31  faceSelection.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef faceSelection_H
36 #define faceSelection_H
37 
38 #include "dictionary.H"
39 #include "typeInfo.H"
40 #include "runTimeSelectionTables.H"
41 #include "autoPtr.H"
42 #include "boolList.H"
43 #include "labelList.H"
44 #include "Switch.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 // Forward declaration of classes
52 class fvMesh;
53 
54 /*---------------------------------------------------------------------------*\
55  Class faceSelection Declaration
56 \*---------------------------------------------------------------------------*/
57 
58 class faceSelection
59 {
60 protected:
61 
62  // Protected data
63 
64  //- Name
65  const word name_;
66 
67  //- Reference to mesh
68  const fvMesh& mesh_;
69 
70  //- Input dictionary
71  const dictionary dict_;
72 
73  //- Switch direction?
74  const Switch flip_;
75 
76 public:
77 
78  //- Runtime type information
79  TypeName("faceSelection");
80 
81 
82  // Declare run-time constructor selection table
83 
85  (
86  autoPtr,
88  dictionary,
89  (
90  const word& name,
91  const fvMesh& mesh,
92  const dictionary& dict
93  ),
94  (name, mesh, dict)
95  );
96 
97 
98  // Constructors
99 
100  //- Construct from dictionary
102  (
103  const word& name,
104  const fvMesh& mesh,
105  const dictionary& dict
106  );
107 
108  //- Clone
110  {
112  return autoPtr<faceSelection>(nullptr);
113  }
114 
115 
116  // Selectors
117 
118  //- Return a reference to the selected faceSelection
120  (
121  const word& name,
122  const fvMesh& mesh,
123  const dictionary& dict
124  );
125 
126 
127  //- Destructor
128  virtual ~faceSelection();
129 
130 
131  // Member Functions
133  const word& name() const
134  {
135  return name_;
136  }
138  const dictionary& dict() const
139  {
140  return dict_;
141  }
142 
143  virtual void select(const label, labelList&, boolList&) const = 0;
144 
145 };
146 
147 
148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149 
150 } // End namespace Foam
151 
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 
154 #endif
155 
156 // ************************************************************************* //
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
const fvMesh & mesh_
Reference to mesh.
Definition: faceSelection.H:67
const dictionary & dict() const
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
virtual ~faceSelection()
Destructor.
const word & name() const
A simple wrapper around bool so that it can be read as a word: true/false, on/off, yes/no, y/n, t/f, or none/any.
Definition: Switch.H:60
const word name_
Name.
Definition: faceSelection.H:64
const Switch flip_
Switch direction?
Definition: faceSelection.H:73
autoPtr< faceSelection > clone() const
Clone.
dynamicFvMesh & mesh
A class for handling words, derived from string.
Definition: word.H:59
Face selection method for createBaffles.
Definition: faceSelection.H:57
faceSelection(const word &name, const fvMesh &mesh, const dictionary &dict)
Construct from dictionary.
declareRunTimeSelectionTable(autoPtr, faceSelection, dictionary,(const word &name, const fvMesh &mesh, const dictionary &dict),(name, mesh, dict))
TypeName("faceSelection")
Runtime type information.
static autoPtr< faceSelection > New(const word &name, const fvMesh &mesh, const dictionary &dict)
Return a reference to the selected faceSelection.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
virtual void select(const label, labelList &, boolList &) const =0
const dictionary dict_
Input dictionary.
Definition: faceSelection.H:70
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
Macros to ease declaration of run-time selection tables.
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:366
Namespace for OpenFOAM.