cellBitSet.C
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 \*---------------------------------------------------------------------------*/
27 
28 #include "cellBitSet.H"
29 #include "polyMesh.H"
30 
31 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
32 
33 namespace Foam
34 {
35  defineTypeNameAndDebug(cellBitSet, 0);
36 }
37 
38 
39 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
40 
42 :
43  cellBitSet(mesh, false)
44 {}
45 
46 
48 :
49  topoBitSet(mesh, "cellBitSet", mesh.nCells(), val)
50 {}
51 
52 
54 (
55  const polyMesh& mesh,
56  const bitSet& bits
57 )
58 :
59  topoBitSet(mesh, "cellBitSet", mesh.nCells(), bits)
60 {}
61 
62 
64 (
65  const polyMesh& mesh,
66  bitSet&& bits
67 )
68 :
69  topoBitSet(mesh, "cellBitSet", mesh.nCells(), std::move(bits))
70 {}
71 
72 
73 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
74 
75 Foam::label Foam::cellBitSet::maxSize(const polyMesh& mesh) const
76 {
77  return mesh.nCells();
78 }
79 
80 
82 (
83  Ostream& os,
84  const primitiveMesh& mesh,
85  const label maxLen
86 ) const
87 {
89 }
90 
91 
92 // ************************************************************************* //
Foam::topoSet::writeDebug
void writeDebug(Ostream &os, const label maxElem, topoSet::const_iterator &iter, label &elemI) const
Write part of contents nicely formatted. Prints labels only.
Definition: topoSet.C:224
cellBitSet.H
Foam::bitSet
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
Definition: bitSet.H:63
polyMesh.H
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::primitiveMesh::nCells
label nCells() const noexcept
Number of mesh cells.
Definition: primitiveMeshI.H:96
Foam::cellBitSet::maxSize
virtual label maxSize(const polyMesh &mesh) const
Return max index+1.
Definition: cellBitSet.C:75
os
OBJstream os(runTime.globalPath()/outputName)
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::primitiveMesh::cellCentres
const vectorField & cellCentres() const
Definition: primitiveMeshCellCentresAndVols.C:84
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::topoBitSet
Base for a special purpose topoSet using labels stored as a bitSet.
Definition: topoBitSet.H:51
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::defineTypeNameAndDebug
defineTypeNameAndDebug(combustionModel, 0)
Foam::cellBitSet::cellBitSet
cellBitSet(const polyMesh &mesh)
Construct with nCells elements, all elements unset.
Definition: cellBitSet.C:41
Foam::primitiveMesh
Cell-face mesh analysis engine.
Definition: primitiveMesh.H:78