cellZone.C
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) 2011-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 \*---------------------------------------------------------------------------*/
25 
26 #include "cellZone.H"
27 #include "cellZoneList.H"
28 #include "polyMesh.H"
29 #include "polyTopoChangeMap.H"
30 
31 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
32 
33 namespace Foam
34 {
36 }
37 
38 const char * const Foam::cellZone::labelsName = "cellLabels";
39 
40 
41 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
42 
43 bool Foam::cellZone::checkDefinition(const bool report) const
44 {
46  (
47  zones_.allSize(),
48  report
49  );
50 }
51 
52 
54 {
55  if (!topoUpdate_)
56  {
58  }
59 }
60 
61 
63 {
64  os << nl << name() << nl << token::BEGIN_BLOCK << nl;
65  writeEntry(os, this->labelsName, *this);
66  os << token::END_BLOCK << endl;
67 }
68 
69 
70 // ************************************************************************* //
Foam::cellZoneList.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
void topoChange(const labelList &map, const labelList &reverseMap)
Update the addressing using the maps provided.
Definition: Zone.C:79
bool checkDefinition(const label maxSize, const bool report=false) const
Check zone definition with max size given. Return true if in error.
Definition: Zone.C:261
const cellZoneList & zones_
Reference to zone list.
Definition: Zone.H:78
label allSize() const
Return number of cells in the mesh.
Definition: cellZoneList.C:39
Named list of cell indices representing a sub-set of the mesh.
Definition: cellZone.H:61
bool checkDefinition(const bool report=false) const
Check zone definition. Return true if in error.
Definition: cellZone.C:43
static const char *const labelsName
The name associated with the zone-labels dictionary entry.
Definition: cellZone.H:68
void writeDict(Ostream &) const
Write dictionary.
Definition: cellZone.C:62
void topoChange(const polyTopoChangeMap &map)
Update zone using the given map.
Definition: cellZone.C:53
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
const labelList & cellMap() const
Old cell map.
const labelList & reverseCellMap() const
Reverse cell map.
@ BEGIN_BLOCK
Definition: token.H:113
@ END_BLOCK
Definition: token.H:114
Namespace for OpenFOAM.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:258
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
Definition: HashTableIO.C:96
defineTypeNameAndDebug(combustionModel, 0)
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
static const char nl
Definition: Ostream.H:267