polyMeshGenCells.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | cfMesh: A library for mesh generation
4  \\ / O peration |
5  \\ / A nd | Author: Franjo Juretic (franjo.juretic@c-fields.com)
6  \\/ M anipulation | Copyright (C) Creative Fields, Ltd.
7 -------------------------------------------------------------------------------
8 License
9  This file is part of cfMesh.
10 
11  cfMesh is free software; you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by the
13  Free Software Foundation; either version 3 of the License, or (at your
14  option) any later version.
15 
16  cfMesh 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 cfMesh. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  polyMeshGenCells
26 
27 Description
28  Mesh with geometry and topology information
29 
30 SourceFiles
31  polyMeshGenCells.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef polyMeshGenCells_H
36 #define polyMeshGenCells_H
37 
38 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
39 
40 #include "polyMeshGenFaces.H"
41 #include "cellListPMG.H"
42 
43 namespace Foam
44 {
45 
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 class polyMeshGenCells
51 : public polyMeshGenFaces
52 {
53 protected:
54 
55  // Protected data
56  //- list of cells
58 
59  //- cell subsets
60  std::map<label, meshSubset> cellSubsets_;
61 
62  //- primitive mesh which calculates addressing
64 
65  // Private member functions
66  //- calculate owner and neighbour
67  void calculateOwnersAndNeighbours() const;
68 
69  //- calculate mesh addressing
70  void calculateAddressingData() const;
71 
72  //- clear all pointer data
73  void clearOut() const;
74 
75  // Disallow bitwise assignment
76  void operator=(const polyMeshGenCells&);
77 
79 
80 public:
81 
82  friend class polyMeshGenModifier;
83 
84  // Constructors
85  //- Null constructor
86  polyMeshGenCells(const Time&);
87 
88  //- Construct from components without the boundary
90  (
91  const Time&,
92  const pointField& points,
93  const faceList& faces,
94  const cellList& cells
95  );
96 
97  //- Construct from components with the boundary
99  (
100  const Time&,
101  const pointField& points,
102  const faceList& faces,
103  const cellList& cells,
104  const wordList& patchNames,
105  const labelList& patchStart,
106  const labelList& nFacesInPatch
107  );
108 
109  // Destructor
111 
112  // Member functions
113  //- access to cells
114  inline const cellListPMG& cells() const;
115 
116  //- addressing which may be needed
117  const polyMeshGenAddressing& addressingData() const;
118 
119  //- clear addressing data
120  void clearAddressingData() const;
121 
122  // Subsets
123  label addCellSubset(const word&);
124  void removeCellSubset(const label);
125  word cellSubsetName(const label) const;
126  label cellSubsetIndex(const word&) const;
127  inline void addCellToSubset(const label, const label);
128  inline void removeCellFromSubset(const label, const label);
129  inline void cellInSubsets(const label, DynList<label>&) const;
130  inline void cellSubsetIndices(DynList<label>&) const;
131  template<class ListType>
132  inline void cellsInSubset(const label, ListType&) const;
133  template<class ListType>
134  inline void updateCellSubsets(const ListType&);
135  inline void updateCellSubsets(const VRWGraph&);
136 
137  // Read mesh
138  void read();
139 
140  // Write mesh
141  void write() const;
142 };
143 
144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 
146 } // End namespace Foam
147 
148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149 
150 #include "polyMeshGenCellsI.H"
151 
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 
154 #endif
155 
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Foam::polyMeshGenCells::calculateAddressingData
void calculateAddressingData() const
calculate mesh addressing
Definition: polyMeshGenCells.C:235
Foam::polyMeshGenCells::addressingData
const polyMeshGenAddressing & addressingData() const
addressing which may be needed
Definition: polyMeshGenCells.C:327
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:68
Foam::polyMeshGenCells::~polyMeshGenCells
~polyMeshGenCells()
Definition: polyMeshGenCells.C:319
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::polyMeshGenFaces::patchNames
wordList patchNames() const
return list of patches in the boundary
Definition: polyMeshGenFaces.C:203
Foam::polyMeshGenCells::read
void read()
Definition: polyMeshGenCells.C:414
Foam::polyMeshGenCells::cellInSubsets
void cellInSubsets(const label, DynList< label > &) const
Definition: polyMeshGenCellsI.H:71
Foam::polyMeshGenCells::calculateOwnersAndNeighbours
void calculateOwnersAndNeighbours() const
calculate owner and neighbour
Definition: polyMeshGenCells.C:45
Foam::polyMeshGenPoints::points
const pointFieldPMG & points() const
access to points
Definition: polyMeshGenPointsI.H:44
Foam::polyMeshGenCells::clearOut
void clearOut() const
clear all pointer data
Definition: polyMeshGenCells.C:254
Foam::cellListPMG
Definition: cellListPMG.H:49
Foam::polyMeshGenAddressing
Definition: polyMeshGenAddressing.H:69
Foam::polyMeshGenCells::cellSubsetName
word cellSubsetName(const label) const
Definition: polyMeshGenCells.C:389
Foam::polyMeshGenFaces::faces
const faceListPMG & faces() const
access to faces
Definition: polyMeshGenFacesI.H:43
Foam::polyMeshGenCells::cellSubsets_
std::map< label, meshSubset > cellSubsets_
cell subsets
Definition: polyMeshGenCells.H:59
Foam::polyMeshGenCells::addCellToSubset
void addCellToSubset(const label, const label)
Definition: polyMeshGenCellsI.H:45
Foam::polyMeshGenCells::updateCellSubsets
void updateCellSubsets(const ListType &)
Definition: polyMeshGenCellsI.H:124
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Foam::polyMeshGenCells
Definition: polyMeshGenCells.H:49
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
polyMeshGenAddressing
Cell-face mesh analysis engine.
Foam::polyMeshGenCells::cells
const cellListPMG & cells() const
access to cells
Definition: polyMeshGenCellsI.H:39
Foam::polyMeshGenCells::clearAddressingData
void clearAddressingData() const
clear addressing data
Definition: polyMeshGenCells.C:346
Foam::polyMeshGenCells::addCellSubset
label addCellSubset(const word &)
Definition: polyMeshGenCells.C:351
Foam::polyMeshGenCells::write
void write() const
Definition: polyMeshGenCells.C:475
polyMeshGenCellsI.H
cellListPMG.H
Foam::polyMeshGenCells::addressingDataPtr_
polyMeshGenAddressing * addressingDataPtr_
primitive mesh which calculates addressing
Definition: polyMeshGenCells.H:62
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::DynList< label >
Foam::polyMeshGenModifier
Definition: polyMeshGenModifier.H:52
Foam::polyMeshGenCells::removeCellSubset
void removeCellSubset(const label)
Definition: polyMeshGenCells.C:381
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
Foam::polyMeshGenCells::cells_
cellListPMG cells_
list of cells
Definition: polyMeshGenCells.H:56
Foam::polyMeshGenCells::operator=
void operator=(const polyMeshGenCells &)
Foam::polyMeshGenCells::cellsInSubset
void cellsInSubset(const label, ListType &) const
Definition: polyMeshGenCellsI.H:107
Foam::polyMeshGenCells::polyMeshGenCells
polyMeshGenCells(const polyMeshGenCells &)
polyMeshGenFaces.H
Foam::polyMeshGenFaces
Definition: polyMeshGenFaces.H:50
Foam::VRWGraph
Definition: VRWGraph.H:101
Foam::polyMeshGenCells::removeCellFromSubset
void removeCellFromSubset(const label, const label)
Definition: polyMeshGenCellsI.H:58
Foam::polyMeshGenCells::cellSubsetIndices
void cellSubsetIndices(DynList< label > &) const
Definition: polyMeshGenCellsI.H:91
Foam::polyMeshGenCells::cellSubsetIndex
label cellSubsetIndex(const word &) const
Definition: polyMeshGenCells.C:402