cuttingSurface.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) 2018-2021 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::cuttingSurface
28
29Description
30 Constructs a cutting surface through a mesh.
31
32 No attempt at resolving degenerate cases.
33 Since the cut faces can be quite ugly, they will often be triangulated.
34
35SourceFiles
36 cuttingSurface.C
37
38\*---------------------------------------------------------------------------*/
39
40#ifndef cuttingSurface_H
41#define cuttingSurface_H
42
43#include "searchableSurface.H"
44#include "cuttingSurfaceBase.H"
45
46// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47
48namespace Foam
49{
50
51/*---------------------------------------------------------------------------*\
52 Class cuttingSurface Declaration
53\*---------------------------------------------------------------------------*/
56:
58{
59 // Private Data
60
61 //- The surface
62 const autoPtr<searchableSurface> surfPtr_;
63
64
65 // Private Member Functions
66
67 //- Determine the cut cells, possibly restricted to a list of cells
68 //
69 // \param pointDist [out] For each mesh point, the (signed) distance
70 // to the surface.
71 // \param cellCuts [in,out] On input an empty set (ie, no restriction)
72 // or subsetted cells. On output, the cells cut according to the
73 // planeSides detection.
74 void calcCellCuts
75 (
76 const fvMesh& fvm,
77 scalarField& pointDist,
79 );
80
81
82protected:
83
84 // Protected Member Functions
85
86 //- Cut mesh, restricted to a list of cells
88
89 //- Cut mesh, restricted to a list of cells
90 // Reclaim memory for cellSelectionMask
91 virtual void performCut
92 (
93 const primitiveMesh& mesh,
94 const bool triangulate,
95 bitSet&& cellIdLabels
96 );
97
98
99public:
100
101 // Constructors
102
103 //- Construct from components
105 (
106 const polyMesh& mesh,
107 const word& surfaceType,
108 const word& surfaceName
109 );
110
111 //- Construct from dictionary
113 (
114 const word& defaultSurfaceName,
115 const polyMesh& mesh,
116 const dictionary& dict
117 );
118
119
120 //- Destructor
121 virtual ~cuttingSurface() = default;
122
123
124 // Member Functions
125
126 //- The name of the underlying searchableSurface
127 const word& surfaceName() const
128 {
129 return surfPtr_->name();
130 }
131
132
133 // Output
134
135 //- Print information
136 void print(Ostream& os, int level=0) const;
137};
138
139
140// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141
142} // End namespace Foam
143
144// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145
146#endif
147
148// ************************************************************************* //
virtual label triangulate()
Triangulate in-place, returning the number of triangles added.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
surfaceTopo surfaceType() const
Calculate surface type formed by patch.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
Definition: bitSet.H:66
Description of cuts across cells.
Definition: cellCuts.H:113
Base for creating a MeshedSurface by performing some type of cell cutting/intersection.
virtual void performCut(const primitiveMesh &mesh, const bool triangulate, const labelUList &cellIdLabels)
Cut mesh, restricted to a list of cells.
Constructs a cutting surface through a mesh.
virtual ~cuttingSurface()=default
Destructor.
void print(Ostream &os, int level=0) const
Print information.
virtual void performCut(const primitiveMesh &mesh, const bool triangulate, bitSet &&cellIdLabels)
Cut mesh, restricted to a list of cells.
const word & surfaceName() const
The name of the underlying searchableSurface.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
Cell-face mesh analysis engine.
Definition: primitiveMesh.H:79
A class for handling words, derived from Foam::string.
Definition: word.H:68
dynamicFvMesh & mesh
OBJstream os(runTime.globalPath()/outputName)
Namespace for OpenFOAM.
dictionary dict