path.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) 2025 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::extrudeModels::path
26 
27 Description
28  Extrudes by transforming points along an curve defined as an edgeMesh
29 
30  Uses rotation minimising frames (RMF) algorithm, which is based on
31  the Frenet-Serret equations, and described in:
32  \verbatim
33  Wang, W., Jüttler, B., Zheng, D., & Liu, Y. (2008).
34  Computation of rotation minimizing frames.
35  ACM Transactions on Graphics (TOG), 27(1), 1-18.
36  \endverbatim
37 
38 \*---------------------------------------------------------------------------*/
39 
40 #ifndef path_extrudeModel_H
41 #define path_extrudeModel_H
42 
43 #include "extrudeModel.H"
44 #include "pointField.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 class edgeMesh;
52 
53 namespace extrudeModels
54 {
55 
56 /*---------------------------------------------------------------------------*\
57  Class path Declaration
58 \*---------------------------------------------------------------------------*/
59 
60 class path
61 :
62  public extrudeModel
63 {
64  // Private Data
65 
66  //- Coordinates defining the extrusion curve
67  autoPtr<edgeMesh> eMeshPtr_;
68 
69  //- Cumulative point distances along the extrusion curve
70  scalarField distances_;
71 
72  //- Extrude direction for each frame along the extrusion curve
73  vectorField directions_;
74 
75  //- Normals to each direction frame
76  vectorField normals_;
77 
78  //- Transposed orthonormal rotation tensor at the first layer
79  tensor R0T_;
80 
81 
82  // Private Member Functions
83 
84  //- Find cumulative point span which contains the given distance
85  label findFrameIndex(const scalar distance) const;
86 
87 
88  // Private Static Member Functions
89 
90  //- Cartesian axis perpendicular to the supplied direction
91  static vector orthogonal(const vector& dirn);
92 
93  //- Frenet-Serret rotational tensor
94  static tensor orthonormalBasis(const vector& T, const vector& N);
95 
96 
97 public:
98 
99  //- Runtime type information
100  TypeName("path");
101 
102 
103  // Constructors
104 
105  //- Construct from dictionary
106  path(const dictionary& dict);
107 
108 
109  //- Destructor
110  virtual ~path();
111 
112 
113  // Member Operators
114 
115  point operator()
116  (
117  const point& surfacePoint,
118  const vector& surfaceNormal,
119  const label layer
120  ) const;
121 };
122 
123 
124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125 
126 } // End namespace extrudeModels
127 } // End namespace Foam
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 #endif
132 
133 // ************************************************************************* //
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Top level extrusion model class.
Definition: extrudeModel.H:52
Extrudes by transforming points along an curve defined as an edgeMesh.
Definition: path.H:62
TypeName("path")
Runtime type information.
virtual ~path()
Destructor.
Definition: path.C:119
path(const dictionary &dict)
Construct from dictionary.
Definition: path.C:89
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
void T(LagrangianPatchField< Type > &f, const LagrangianPatchField< Type > &f1)
dictionary dict