cut.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) 2014 OpenFOAM Foundation
9  Copyright (C) 2016 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::searchableSurfaceModifier::cut
29 
30 Description
31  Patchify triangles based on orientation w.r.t other (triangulated or
32  triangulatable) surfaces
33 
34 SourceFiles
35  cut.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef searchableSurfaceModifiers_cut_H
40 #define searchableSurfaceModifiers_cut_H
41 
43 #include "wordRes.H"
44 #include "faceList.H"
45 #include "pointField.H"
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 
52 // Forward declaration of classes
53 class edgeIntersections;
54 
55 namespace searchableSurfaceModifiers
56 {
57 
58 /*---------------------------------------------------------------------------*\
59  Class cut Declaration
60 \*---------------------------------------------------------------------------*/
61 
62 class cut
63 :
65 {
66  // Private data
67 
68  //- Name of surfaces to cut with
69  const wordRes cutterNames_;
70 
71 
72  // Private Member Functions
73 
74  //- Triangulate faces around 0th vertex
75  void triangulate(const faceList&, pointField&, triSurface&) const;
76 
77  //- Triangulate searchableSurface (currently only supported for
78  // searchableBox and triSurfaceMesh)
79  triSurface& triangulate(const searchableSurface&, triSurface&) const;
80 
81  //- Intersect surfaces. Perturb to avoid degenerates.
82  bool intersectSurfaces
83  (
84  triSurface& surf1,
85  edgeIntersections& edgeCuts1,
86  triSurface& surf2,
87  edgeIntersections& edgeCuts2
88  ) const;
89 
90 
91 public:
92 
93  //- Runtime type information
94  TypeName("cut");
95 
96 
97  // Constructors
98 
99  //- Construct from dictionary
100  cut(const searchableSurfaces&, const dictionary&);
101 
102  //- Clone
104  {
106  return nullptr;
107  }
108 
109 
110  //- Destructor
111  virtual ~cut() = default;
112 
113 
114  // Member Functions
115 
116  //- Apply this selector
117  virtual bool modify(const labelList& regions, searchableSurface&) const;
118 
119 };
120 
121 
122 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
123 
124 } // End namespace searchableSurfaceModifiers
125 } // End namespace Foam
126 
127 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 
129 #endif
130 
131 // ************************************************************************* //
wordRes.H
Foam::searchableSurfaceModifiers::cut
Definition: cut.H:61
Foam::searchableSurfaceModifiers::cut::clone
autoPtr< searchableSurfaceModifier > clone() const
Clone.
Definition: cut.H:102
Foam::searchableSurfaceModifier
Changing a surface.
Definition: searchableSurfaceModifier.H:60
Foam::searchableSurfaceModifiers::cut::modify
virtual bool modify(const labelList &regions, searchableSurface &) const
Apply this selector.
searchableSurfaceModifier.H
faceList.H
NotImplemented
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:517
Foam::Field< vector >
Foam::triSurface
Triangulated surface description with patch information.
Definition: triSurface.H:76
Foam::searchableSurface
Base class of (analytical or triangulated) surface. Encapsulates all the search routines....
Definition: searchableSurface.H:69
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::searchableSurfaceModifiers::cut::cut
cut(const searchableSurfaces &, const dictionary &)
Construct from dictionary.
pointField.H
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::searchableSurfaceModifiers::cut::TypeName
TypeName("cut")
Runtime type information.
Foam::List< face >
Foam::searchableSurfaces
Container for searchableSurfaces. The collection is specified as a dictionary. For example,...
Definition: searchableSurfaces.H:92
Foam::wordRes
A List of wordRe with additional matching capabilities.
Definition: wordRes.H:51
Foam::edgeIntersections
Holder of intersections of edges of a surface with another surface. Optionally shuffles around points...
Definition: edgeIntersections.H:62
Foam::searchableSurfaceModifiers::cut::~cut
virtual ~cut()=default
Destructor.