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