faceBitSet.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 "faceBitSet.H"
29 #include "polyMesh.H"
30 #include "mapPolyMesh.H"
31 #include "syncTools.H"
32 #include "mapDistributePolyMesh.H"
33 
34 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
35 
36 namespace Foam
37 {
39 }
40 
41 
42 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
43 
45 :
46  faceBitSet(mesh, false)
47 {}
48 
49 
51 :
52  topoBitSet(mesh, "faceBitSet", mesh.nFaces(), val)
53 {}
54 
55 
57 (
58  const polyMesh& mesh,
59  const bitSet& bits
60 )
61 :
62  topoBitSet(mesh, "faceBitSet", mesh.nFaces(), bits)
63 {}
64 
65 
67 (
68  const polyMesh& mesh,
69  bitSet&& bits
70 )
71 :
72  topoBitSet(mesh, "faceBitSet", mesh.nFaces(), std::move(bits))
73 {}
74 
75 
76 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
77 
79 {
81 }
82 
83 
84 Foam::label Foam::faceBitSet::maxSize(const polyMesh& mesh) const
85 {
86  return mesh.nFaces();
87 }
88 
89 
90 void Foam::faceBitSet::updateMesh(const mapPolyMesh& morphMap)
91 {
92  updateLabels(morphMap.reverseFaceMap());
93 }
94 
95 
97 {
98  bitSet& labels = selected_;
99 
100  boolList contents(labels.values());
101 
102  map.distributeFaceData(contents);
103 
104  // The new length is contents.size();
105  labels.assign(contents);
106 }
107 
108 
110 (
111  Ostream& os,
112  const primitiveMesh& mesh,
113  const label maxLen
114 ) const
115 {
117 }
118 
119 
120 // ************************************************************************* //
Foam::topoSet::writeDebug
void writeDebug(Ostream &os, const label maxElem, topoSet::const_iterator &iter, label &elemI) const
Definition: topoSet.C:217
Foam::faceBitSet::writeDebug
virtual void writeDebug(Ostream &os, const primitiveMesh &mesh, const label maxLen) const
Definition: faceBitSet.C:103
Foam::bitSet
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
Definition: bitSet.H:59
mapPolyMesh.H
Foam::orEqOp
Definition: ops.H:80
Foam::faceBitSet::updateMesh
virtual void updateMesh(const mapPolyMesh &morphMap)
Definition: faceBitSet.C:83
polyMesh.H
syncTools.H
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:73
Foam::faceBitSet::sync
virtual void sync(const polyMesh &mesh)
Definition: faceBitSet.C:71
mapDistributePolyMesh.H
Foam::syncTools::syncFaceList
static void syncFaceList(const polyMesh &mesh, UList< T > &faceValues, const CombineOp &cop)
Definition: syncTools.H:392
Foam::faceBitSet
A special purpose topoSet with the face labels stored as a bitSet. It does not correspond to a faceSe...
Definition: faceBitSet.H:47
Foam::faceBitSet::distribute
virtual void distribute(const mapDistributePolyMesh &map)
Definition: faceBitSet.C:89
Foam::bitSet::assign
void assign(const UList< bool > &bools)
Definition: bitSet.C:321
faceBitSet.H
Foam::faceBitSet::maxSize
virtual label maxSize(const polyMesh &mesh) const
Definition: faceBitSet.C:77
os
OBJstream os(runTime.globalPath()/outputName)
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::mapDistributePolyMesh::distributeFaceData
void distributeFaceData(List< T > &lst) const
Definition: mapDistributePolyMesh.H:245
Foam
Definition: atmBoundaryLayer.C:26
Foam::mapPolyMesh::reverseFaceMap
const labelList & reverseFaceMap() const
Definition: mapPolyMesh.H:497
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: BitOps.H:58
Foam::topoBitSet
Base for a special purpose topoSet using labels stored as a bitSet.
Definition: topoBitSet.H:47
Foam::primitiveMesh::faceCentres
const vectorField & faceCentres() const
Definition: primitiveMeshFaceCentresAndAreas.C:71
Foam::faceBitSet::faceBitSet
faceBitSet(const polyMesh &mesh)
Definition: faceBitSet.C:37
Foam::mapPolyMesh
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:157
Foam::primitiveMesh::nFaces
label nFaces() const noexcept
Definition: primitiveMeshI.H:83
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:52
Foam::mapDistributePolyMesh
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Definition: mapDistributePolyMesh.H:62
Foam::defineTypeNameAndDebug
defineTypeNameAndDebug(combustionModel, 0)
Foam::bitSet::values
List< bool > values() const
Definition: bitSet.C:559
Foam::primitiveMesh
Cell-face mesh analysis engine.
Definition: primitiveMesh.H:74