sweepFace.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2026 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM 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 OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::blockFaces::sweepFace
26 
27 Description
28  This curved face sweeps the points of an opposing pair of the face's four
29  edges over the surface of the face. Each row of points is constructed by
30  transforming (i.e., translating and rotating) and uniformly scaling the
31  swept edges so that their end points connect to the points of the other two
32  edges. This does a better job than the standard interpolation algorithm of
33  conforming to cylinders, cones, toroids and similar.
34 
35  The algorithm is asymmetric, and depends on the order in which the vertices
36  are supplied. E.g., if vertices (0 1 2 3) are supplied, then that means
37  edge (0 1) will be swept towards edge (2 3) in the direction defined by
38  edges (0 3) and (1 2).
39 
40  Additionally, the swept edges can be rotated around their axis to match any
41  bend in the sweep path. This behaviour is controlled by a single
42  user-defined scalar parameter, the rotation fraction, which must take a
43  value between 0 and 1. A value of 0 means no rotation is performed, whilst
44  a value of 1 means that the edges are fully rotated to maintain a
45  consistent angle with the sweep path.
46 
47  Sweeping is done in both directions, and the results are blended with a
48  weight proportional to the proximity to the starting edge. This prevents
49  discontinuities in the case that the start and end edge are not
50  geometrically similar.
51 
52 SourceFiles
53  sweepFace.C
54 
55 \*---------------------------------------------------------------------------*/
56 
57 #ifndef sweepFace_blockFace_H
58 #define sweepFace_blockFace_H
59 
60 #include "blockFace.H"
61 
62 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
63 
64 namespace Foam
65 {
66 namespace blockFaces
67 {
68 
69 /*---------------------------------------------------------------------------*\
70  Class sweepFace Declaration
71 \*---------------------------------------------------------------------------*/
72 
73 class sweepFace
74 :
75  public blockFace
76 {
77  // Private Data
78 
79  //- Rotation fraction
80  const scalar rotationFraction_;
81 
82 
83 public:
84 
85  //- Runtime type information
86  TypeName("sweep");
87 
88 
89  // Constructors
90 
91  //- Construct from Istream setting pointsList
92  sweepFace
93  (
94  const dictionary& dict,
95  const label index,
96  const searchableSurfaceList& geometry,
97  Istream&
98  );
99 
100  //- Disallow default bitwise copy construction
101  sweepFace(const sweepFace&) = delete;
102 
103 
104  //- Destructor
105  virtual ~sweepFace()
106  {}
107 
108 
109  // Member Functions
110 
111  //- Project the given points onto the surface
112  virtual void project
113  (
114  const blockDescriptor&,
115  const label blockFacei,
117  ) const;
118 
119 
120  // Member Operators
121 
122  //- Disallow default bitwise assignment
123  void operator=(const sweepFace&) = delete;
124 };
125 
126 
127 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 
129 } // End namespace blockFaces
130 } // End namespace Foam
131 
132 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
133 
134 #endif
135 
136 // ************************************************************************* //
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:60
Takes the description of the block and the list of curved edges and creates a list of points on edges...
Define a curved face.
Definition: blockFace.H:56
This curved face sweeps the points of an opposing pair of the face's four edges over the surface of t...
Definition: sweepFace.H:75
TypeName("sweep")
Runtime type information.
void operator=(const sweepFace &)=delete
Disallow default bitwise assignment.
virtual ~sweepFace()
Destructor.
Definition: sweepFace.H:104
virtual void project(const blockDescriptor &, const label blockFacei, pointField &points) const
Project the given points onto the surface.
Definition: sweepFace.C:69
sweepFace(const dictionary &dict, const label index, const searchableSurfaceList &geometry, Istream &)
Construct from Istream setting pointsList.
Definition: sweepFace.C:46
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Container for searchableSurfaces.
const pointField & points
Namespace for OpenFOAM.
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
dictionary dict