manifoldCellsMeshObject.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) 2022 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::manifoldCellsMeshObject
28 
29 Description
30  Provides cell-to-faces ('cells()') with duplicate faces removed.
31 
32  Useful for postprocessing.
33 
34 SourceFiles
35  manifoldCellsMeshObject.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef Foam_manifoldCellsMeshObject_H
40 #define Foam_manifoldCellsMeshObject_H
41 
42 #include "MeshObject.H"
43 #include "polyMesh.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class manifoldCellsMeshObject Declaration
52 \*---------------------------------------------------------------------------*/
53 
55 :
56  public MeshObject<polyMesh, UpdateableMeshObject, manifoldCellsMeshObject>
57 {
58  // Private Data
59 
60  //- The adjusted cells list
61  mutable refPtr<cellList> cellsPtr_;
62 
63  //- The number of globally corrected cells (-1 for uninitialized)
64  mutable label nCorrected_;
65 
66 
67  // Private Member Functions
68 
69  //- Calculate cellList with all duplicate faces removed.
70  //- Is reference to input mesh if no duplicates
71  static refPtr<cellList> filter
72  (
73  const polyMesh& mesh,
74  label& nCellsCorrected
75  );
76 
77  //- No copy construct
79 
80  //- No copy assignment
81  void operator=(const manifoldCellsMeshObject&) = delete;
82 
83 
84 public:
85 
86  //- Declare name of the class, no debug
87  ClassNameNoDebug("manifoldCellsMeshObject");
88 
89 
90  // Constructors
91 
92  //- Construct from mesh
94 
95 
96  //- Destructor
97  virtual ~manifoldCellsMeshObject() = default;
98 
99 
100  // Member Functions
101 
102  //- Calculate cellList with all duplicate faces removed.
103  //- Is reference to input mesh if no duplicates
104  static refPtr<cellList> filter(const polyMesh& mesh);
105 
106  //- True if any manifold cells detected (globally)
107  //- Triggers demand-driven filtering if required.
108  bool manifold() const;
109 
110  //- Return the (optionally compacted) cell list
111  //- Triggers demand-driven filtering if required.
112  const cellList& cells() const;
113 
114  //- Mesh motion
115  virtual bool movePoints()
116  {
117  return false;
118  }
119 
120  //- Mesh changes
121  virtual void updateMesh(const mapPolyMesh&);
122 };
123 
124 
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126 
127 } // End namespace Foam
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 #endif
132 
133 // ************************************************************************* //
virtual bool movePoints()
Mesh motion.
virtual ~manifoldCellsMeshObject()=default
Destructor.
A class for managing references or pointers (no reference counting)
Definition: HashPtrTable.H:49
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:157
Templated abstract base-class for optional mesh objects used to automate their allocation to the mesh...
Definition: MeshObject.H:84
Provides cell-to-faces (&#39;cells()&#39;) with duplicate faces removed.
virtual void updateMesh(const mapPolyMesh &)
Mesh changes.
bool manifold() const
True if any manifold cells detected (globally) Triggers demand-driven filtering if required...
ClassNameNoDebug("manifoldCellsMeshObject")
Declare name of the class, no debug.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:73
const cellList & cells() const
Return the (optionally compacted) cell list Triggers demand-driven filtering if required.
Namespace for OpenFOAM.