faceSelection.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2012-2016 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::faceSelection
28 
29 Description
30  Face selection method for createBaffles
31 
32 SourceFiles
33  faceSelection.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef faceSelection_H
38 #define faceSelection_H
39 
40 #include "dictionary.H"
41 #include "typeInfo.H"
42 #include "runTimeSelectionTables.H"
43 #include "autoPtr.H"
44 #include "boolList.H"
45 #include "labelList.H"
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 
52 // Forward declaration of classes
53 class fvMesh;
54 
55 /*---------------------------------------------------------------------------*\
56  Class faceSelection Declaration
57 \*---------------------------------------------------------------------------*/
58 
59 class faceSelection
60 {
61 protected:
62 
63  // Protected data
64 
65  //- Name
66  const word name_;
67 
68  //- Reference to mesh
69  const fvMesh& mesh_;
70 
71  //- Input dictionary
72  const dictionary dict_;
73 
74  //- Switch direction?
75  const bool flip_;
76 
77 public:
78 
79  //- Runtime type information
80  TypeName("faceSelection");
81 
82 
83  // Declare run-time constructor selection table
84 
86  (
87  autoPtr,
89  dictionary,
90  (
91  const word& name,
92  const fvMesh& mesh,
93  const dictionary& dict
94  ),
95  (name, mesh, dict)
96  );
97 
98 
99  // Constructors
100 
101  //- Construct from dictionary
103  (
104  const word& name,
105  const fvMesh& mesh,
106  const dictionary& dict
107  );
108 
109  //- Clone
111  {
113  return nullptr;
114  }
115 
116 
117  // Selectors
118 
119  //- Return a reference to the selected faceSelection
121  (
122  const word& name,
123  const fvMesh& mesh,
124  const dictionary& dict
125  );
126 
127 
128  //- Destructor
129  virtual ~faceSelection();
130 
131 
132  // Member Functions
133 
134  const word& name() const
135  {
136  return name_;
137  }
138 
139  const dictionary& dict() const
140  {
141  return dict_;
142  }
143 
144  virtual void select(const label, labelList&, boolList&) const = 0;
145 
146 };
147 
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 } // End namespace Foam
152 
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154 
155 #endif
156 
157 // ************************************************************************* //
Foam::faceSelection::~faceSelection
virtual ~faceSelection()
Destructor.
Foam::faceSelection::New
static autoPtr< faceSelection > New(const word &name, const fvMesh &mesh, const dictionary &dict)
Return a reference to the selected faceSelection.
boolList.H
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
typeInfo.H
Foam::faceSelection::TypeName
TypeName("faceSelection")
Runtime type information.
Foam::faceSelection::mesh_
const fvMesh & mesh_
Reference to mesh.
Definition: faceSelection.H:68
Foam::faceSelection
Face selection method for createBaffles.
Definition: faceSelection.H:58
NotImplemented
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:436
labelList.H
Foam::faceSelection::faceSelection
faceSelection(const word &name, const fvMesh &mesh, const dictionary &dict)
Construct from dictionary.
Foam::faceSelection::dict_
const dictionary dict_
Input dictionary.
Definition: faceSelection.H:71
Foam::faceSelection::clone
autoPtr< faceSelection > clone() const
Clone.
Definition: faceSelection.H:109
Foam::faceSelection::name_
const word name_
Name.
Definition: faceSelection.H:65
Foam::faceSelection::dict
const dictionary & dict() const
Definition: faceSelection.H:138
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:84
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::faceSelection::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, faceSelection, dictionary,(const word &name, const fvMesh &mesh, const dictionary &dict),(name, mesh, dict))
Foam::faceSelection::select
virtual void select(const label, labelList &, boolList &) const =0
Foam::faceSelection::name
const word & name() const
Definition: faceSelection.H:133
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::faceSelection::flip_
const bool flip_
Switch direction?
Definition: faceSelection.H:74
runTimeSelectionTables.H
Macros to ease declaration of run-time selection tables.
Foam::List< label >
dictionary.H
autoPtr.H