shapeToCell.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) 2011-2015 OpenFOAM Foundation
9  Copyright (C) 2018 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::shapeToCell
29 
30 Description
31  A topoSetCellSource to select cells based on cell shape.
32 
33  Handles all known ones from static collection in cellModel
34  and splitHex with 10 degrees feature angle.
35 
36  \heading Dictionary parameters
37  \table
38  Property | Description | Required | Default
39  shape | The cell model (hex, ..) | yes |
40  type | Older specification for 'shape' | no |
41  \endtable
42 
43 SourceFiles
44  shapeToCell.C
45 
46 \*---------------------------------------------------------------------------*/
47 
48 #ifndef shapeToCell_H
49 #define shapeToCell_H
50 
51 #include "topoSetCellSource.H"
52 
53 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 
55 namespace Foam
56 {
57 
58 /*---------------------------------------------------------------------------*\
59  Class shapeToCell Declaration
60 \*---------------------------------------------------------------------------*/
61 
62 class shapeToCell
63 :
64  public topoSetCellSource
65 {
66 
67  // Private data
68 
69  //- Add usage string
70  static addToUsageTable usage_;
71 
72  //- Name of cell shape/type
73  word shape_;
74 
75 
76  // Private Member Functions
77 
78  //- Depending on cell type add to or delete from cellSet.
79  void combine(topoSet& set, const bool add) const;
80 
81 
82 public:
83 
84  //- Runtime type information
85  TypeName("shapeToCell");
86 
87 
88  // Static data
89 
90  //- Cos of feature angle for polyHedral to be splitHex
91  static scalar featureCos;
92 
93 
94  // Constructors
95 
96  //- Construct from components
97  shapeToCell(const polyMesh& mesh, const word& shapeName);
98 
99  //- Construct from dictionary
100  shapeToCell(const polyMesh& mesh, const dictionary& dict);
101 
102  //- Construct from Istream
103  shapeToCell(const polyMesh& mesh, Istream& is);
104 
105 
106  //- Destructor
107  virtual ~shapeToCell() = default;
108 
109 
110  // Member Functions
111 
112  virtual void applyToSet
113  (
114  const topoSetSource::setAction action,
115  topoSet& set
116  ) const;
117 
118 };
119 
120 
121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122 
123 } // End namespace Foam
124 
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126 
127 #endif
128 
129 // ************************************************************************* //
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::combine
Definition: FaceCellWave.C:56
Foam::shapeToCell::applyToSet
virtual void applyToSet(const topoSetSource::setAction action, topoSet &set) const
Apply specified action to the topoSet.
Definition: shapeToCell.C:143
Foam::topoSetSource::setAction
setAction
Enumeration defining the valid actions.
Definition: topoSetSource.H:99
Foam::topoSetSource::mesh
const polyMesh & mesh() const
Reference to the mesh.
Definition: topoSetSource.H:333
Foam::shapeToCell
A topoSetCellSource to select cells based on cell shape.
Definition: shapeToCell.H:76
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::shapeToCell::TypeName
TypeName("shapeToCell")
Runtime type information.
Foam::topoSet
General set of labels of mesh quantity (points, cells, faces).
Definition: topoSet.H:66
topoSetCellSource.H
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam::add
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
Definition: FieldFieldFunctions.C:939
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::topoSetCellSource
Base class of a topoSet source for selecting cells.
Definition: topoSetCellSource.H:50
Foam::shapeToCell::~shapeToCell
virtual ~shapeToCell()=default
Destructor.
Foam::shapeToCell::featureCos
static scalar featureCos
Cos of feature angle for polyHedral to be splitHex.
Definition: shapeToCell.H:105
Foam::shapeToCell::shapeToCell
shapeToCell(const polyMesh &mesh, const word &shapeName)
Construct from components.
Definition: shapeToCell.C:97