cellBitSet.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) 2018 OpenCFD Ltd.
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::cellBitSet
28 
29 Description
30  A special purpose topoSet with the cell labels stored as a bitSet.
31  It does not correspond to a cellSet either (no associated IOobject).
32 
33 SourceFiles
34  cellBitSet.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef cellBitSet_H
39 #define cellBitSet_H
40 
41 #include "topoBitSet.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class cellBitSet Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 class cellBitSet
53 :
54  public topoBitSet
55 {
56 public:
57 
58  //- Runtime type information
59  TypeName("cellBitSet");
60 
61 
62  // Constructors
63 
64  //- Construct with nCells elements, all elements unset
65  explicit cellBitSet(const polyMesh& mesh);
66 
67  //- Construct with nCells elements, using initial val
68  cellBitSet(const polyMesh& mesh, const bool val);
69 
70  //- Copy construct from bitset, resizing to nCells elements as required
71  cellBitSet(const polyMesh& mesh, const bitSet& bits);
72 
73  //- Move construct from bitset, resizing to nCells elements as required
74  cellBitSet(const polyMesh& mesh, bitSet&& bits);
75 
76 
77  //- Destructor
78  virtual ~cellBitSet() = default;
79 
80 
81  // Member Functions
82 
83  //- Sync cellBitSet across coupled patches.
84  virtual void sync(const polyMesh& mesh)
85  {}
86 
87  //- Return max index+1.
88  virtual label maxSize(const polyMesh& mesh) const;
89 
90  //- Update any stored data for new labels.
91  virtual void updateMesh(const mapPolyMesh& morphMap)
92  {}
93 
94  //- Update any stored data for mesh redistribution.
95  virtual void distribute(const mapDistributePolyMesh& map)
96  {}
97 
98  //- Write maxLen items with label and coordinates.
99  virtual void writeDebug
100  (
101  Ostream& os,
102  const primitiveMesh& mesh,
103  const label maxLen
104  ) const;
105 
106 };
107 
108 
109 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
110 
111 } // End namespace Foam
112 
113 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
114 
115 #endif
116 
117 // ************************************************************************* //
Foam::bitSet
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
Definition: bitSet.H:63
Foam::cellBitSet::updateMesh
virtual void updateMesh(const mapPolyMesh &morphMap)
Update any stored data for new labels.
Definition: cellBitSet.H:90
Foam::cellBitSet::writeDebug
virtual void writeDebug(Ostream &os, const primitiveMesh &mesh, const label maxLen) const
Write maxLen items with label and coordinates.
Definition: cellBitSet.C:82
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::cellBitSet::maxSize
virtual label maxSize(const polyMesh &mesh) const
Return max index+1.
Definition: cellBitSet.C:75
Foam::cellBitSet::TypeName
TypeName("cellBitSet")
Runtime type information.
os
OBJstream os(runTime.globalPath()/outputName)
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::cellBitSet
A special purpose topoSet with the cell labels stored as a bitSet. It does not correspond to a cellSe...
Definition: cellBitSet.H:51
Foam::cellBitSet::sync
virtual void sync(const polyMesh &mesh)
Sync cellBitSet across coupled patches.
Definition: cellBitSet.H:83
Foam::cellBitSet::distribute
virtual void distribute(const mapDistributePolyMesh &map)
Update any stored data for mesh redistribution.
Definition: cellBitSet.H:94
Foam::topoBitSet
Base for a special purpose topoSet using labels stored as a bitSet.
Definition: topoBitSet.H:51
Foam::cellBitSet::~cellBitSet
virtual ~cellBitSet()=default
Destructor.
Foam::mapPolyMesh
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:161
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::mapDistributePolyMesh
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Definition: mapDistributePolyMesh.H:66
Foam::cellBitSet::cellBitSet
cellBitSet(const polyMesh &mesh)
Construct with nCells elements, all elements unset.
Definition: cellBitSet.C:41
topoBitSet.H
Foam::primitiveMesh
Cell-face mesh analysis engine.
Definition: primitiveMesh.H:78