invert.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) 2025 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::zoneGenerators::invert
26 
27 Description
28  A zoneGenerator which initially selects all the elements in the zones and
29  then removes the elements from the given list of zoneGenerators
30 
31  This is equivalent to using the zoneGenerator::difference with
32  \c all as the first zoneGenerator in the list.
33 
34 Usage
35  \table
36  Property | Description | Required | Default value
37  type | Type: invert | yes |
38  name | Name of the zone | no | zoneGenerator name
39  zoneType | Type of zone | no | all the zone types
40  moveUpdate | Switch to update after mesh motion | no | false
41  \endtable
42  These options are followed by a list of any number of zoneGenerators which
43  can either generate the zones locally or return zones from the lists of
44  zones held by the mesh using the zoneGenerators::lookup zoneGenerator.
45 
46  Each zoneGenerator returns a zoneSet containing a pointZone and/or a
47  cellZone and/or a faceZone, the zoneGenerators::invert operation
48  combines each of the zone types unless the \c zoneType is specified in which
49  case only the zones of that type are combined.
50 
51  A cellZone named \c notConeOrAnnulus containing all the cells mesh except
52  those with centres inside the predefined \c cone1 cellZone which is
53  looked-up from the cellZoneList or the locally defined annulus is be
54  generated by
55  \verbatim
56  notConeOrAnnulus
57  {
58  type invert;
59 
60  cone1
61  {
62  zoneType cell;
63  }
64 
65  annulus1
66  {
67  type annulus;
68  zoneType cell;
69 
70  point1 (-0.0075 0 -1);
71  point2 (-0.003 0.0025 1);
72  outerRadius 0.002;
73  innerRadius 0.001;
74  }
75  }
76  \endverbatim
77 
78 See also
79  zoneGenerators::Union
80  zoneGenerators::difference
81  zoneGenerators::intersection
82  zoneGeneratorList
83 
84 SourceFiles
85  invert.C
86 
87 \*---------------------------------------------------------------------------*/
88 
89 #ifndef invert_zoneGenerator_H
90 #define invert_zoneGenerator_H
91 
92 #include "zoneGeneratorList.H"
93 #include "union.H"
94 
95 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
96 
97 namespace Foam
98 {
99 namespace zoneGenerators
100 {
101 
102 /*---------------------------------------------------------------------------*\
103  Class invert Declaration
104 \*---------------------------------------------------------------------------*/
105 
106 class invert
107 :
108  public Union
109 {
110 
111 public:
112 
113  //- Runtime type information
114  TypeName("invert");
115 
116 
117  // Constructors
118 
119  //- Construct from dictionary
120  invert
121  (
122  const word& name,
123  const polyMesh& mesh,
124  const dictionary& dict
125  );
126 
127 
128  //- Destructor
129  virtual ~invert();
130 
131 
132  // Member Functions
133 
134  virtual zoneSet generate() const;
135 };
136 
137 
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 
140 } // End namespace zoneGenerators
141 } // End namespace Foam
142 
143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144 
145 #endif
146 
147 // ************************************************************************* //
const word & name() const
invert(const word &name, const polyMesh &mesh, const dictionary &dict)
Construct from dictionary.
Definition: invert.C:45
virtual zoneSet generate() const
Generate and return the zoneSet.
Definition: invert.C:63
TypeName("invert")
Runtime type information.
virtual ~invert()
Destructor.
Definition: invert.C:57
Zone container returned by zoneGenerator::generate.
Definition: zoneSet.H:94
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
Namespace for OpenFOAM.
labelList invert(const label len, const labelUList &)
Invert one-to-one map. Unmapped elements will be -1.
Definition: ListOps.C:37
dictionary dict