Loading...
Searching...
No Matches
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-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::manifoldCellsMeshObject
28
29Description
30 Provides cell-to-faces ('cells()') with duplicate faces removed.
31
32 Useful for postprocessing.
33
34SourceFiles
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
47namespace Foam
48{
50/*---------------------------------------------------------------------------*\
51 Class manifoldCellsMeshObject Declaration
52\*---------------------------------------------------------------------------*/
53
54class manifoldCellsMeshObject
55:
56 public MeshObject<polyMesh, UpdateableMeshObject, manifoldCellsMeshObject>
57{
58 // Private Typedefs
59
60 typedef MeshObject
61 <
64 manifoldCellsMeshObject
65 > MeshObject_type;
66
67
68 // Private Data
69
70 //- The adjusted cells list
71 mutable refPtr<cellList> cellsPtr_;
72
73 //- The number of globally corrected cells (-1 for uninitialized)
74 mutable label nCorrected_;
75
76
77 // Private Member Functions
78
79 //- Calculate cellList with all duplicate faces removed.
80 //- Is reference to input mesh if no duplicates
81 static refPtr<cellList> filter
82 (
83 const polyMesh& mesh,
84 label& nCellsCorrected
85 );
86
87 //- No copy construct
88 manifoldCellsMeshObject(const manifoldCellsMeshObject&) = delete;
89
90 //- No copy assignment
91 void operator=(const manifoldCellsMeshObject&) = delete;
92
93
94public:
95
96 //- Declare name of the class, no debug
97 ClassNameNoDebug("manifoldCellsMeshObject");
98
99
100 // Constructors
101
102 //- Construct from mesh
103 explicit manifoldCellsMeshObject(const polyMesh& mesh);
105
106 //- Destructor
107 virtual ~manifoldCellsMeshObject() = default;
108
109
110 // Member Functions
111
112 //- Calculate cellList with all duplicate faces removed.
113 //- Is reference to input mesh if no duplicates
114 static refPtr<cellList> filter(const polyMesh& mesh);
115
116 //- True if any manifold cells detected (globally)
117 //- Triggers demand-driven filtering if required.
118 bool manifold() const;
119
120 //- Return the (optionally compacted) cell list
121 //- Triggers demand-driven filtering if required.
122 const cellList& cells() const;
123
124 //- Mesh motion
125 virtual bool movePoints()
126 {
127 return false;
128 }
129
130 //- Mesh changes
131 virtual void updateMesh(const mapPolyMesh&);
132};
133
134
135// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136
137} // End namespace Foam
138
139// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140
141#endif
142
143// ************************************************************************* //
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.
virtual bool movePoints()
Mesh motion.
virtual void updateMesh(const mapPolyMesh &)
Mesh changes.
virtual ~manifoldCellsMeshObject()=default
Destructor.
const cellList & cells() const
Return the (optionally compacted) cell list Triggers demand-driven filtering if required.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Mesh consisting of general polyhedral cells.
Definition polyMesh.H:79
A class for managing references or pointers (no reference counting).
Definition refPtr.H:54
#define ClassNameNoDebug(TypeNameString)
Add typeName information from argument TypeNameString to a class.
Definition className.H:39
Namespace for OpenFOAM.
List< cell > cellList
List of cell.
Definition cellListFwd.H:41