BSplineEdge.C
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-2016 OpenFOAM Foundation
9  Copyright (C) 2019 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 \*---------------------------------------------------------------------------*/
28 
29 #include "BSplineEdge.H"
31 
32 
33 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
34 
35 namespace Foam
36 {
37 namespace blockEdges
38 {
39  defineTypeNameAndDebug(BSplineEdge, 0);
40 
42  (
43  blockEdge,
44  BSplineEdge,
45  Istream
46  );
47 }
48 }
49 
50 
51 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
52 
53 Foam::blockEdges::BSplineEdge::BSplineEdge
54 (
55  const pointField& points,
56  const label start,
57  const label end,
58  const pointField& internalPoints
59 )
60 :
62  BSpline(appendEndPoints(points, start, end, internalPoints))
63 {}
64 
65 
66 Foam::blockEdges::BSplineEdge::BSplineEdge
67 (
68  const dictionary& dict,
69  const label index,
70  const searchableSurfaces& geometry,
71  const pointField& points,
72  Istream& is
73 )
74 :
75  blockEdge(dict, index, points, is),
76  BSpline(appendEndPoints(points, start_, end_, pointField(is)))
77 {
78  token t(is);
79  is.putBack(t);
80 
81  // discard unused start/end tangents
82  if (t == token::BEGIN_LIST)
83  {
84  vector tangent0Ignored(is);
85  vector tangent1Ignored(is);
86  }
87 }
88 
89 
90 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
91 
93 {
94  return BSpline::position(mu);
95 }
96 
97 
99 {
100  return BSpline::length();
101 }
102 
103 
104 // ************************************************************************* //
Foam::pointField
vectorField pointField
pointField is a vectorField.
Definition: pointFieldFwd.H:44
Foam::constant::physicoChemical::mu
const dimensionedScalar mu
Atomic mass unit.
Definition: createFieldRefs.H:4
Foam::token
A token holds an item read from Istream.
Definition: token.H:69
Foam::BSpline::position
point position(const scalar lambda) const
Return the point position corresponding to the curve parameter.
Definition: BSpline.C:44
Foam::blockEdge
Define a curved edge that is parameterized for 0<lambda<1 between the start and end point.
Definition: blockEdge.H:59
Foam::BSpline
An implementation of B-splines.
Definition: BSpline.H:75
Foam::blockEdges::BSplineEdge::position
virtual point position(const scalar) const
Return the point position corresponding to the curve parameter.
Definition: BSplineEdge.C:92
Foam::label
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:62
Foam::blockEdges::defineTypeNameAndDebug
defineTypeNameAndDebug(arcEdge, 0)
Foam::Field< vector >
Foam::blockEdges::addToRunTimeSelectionTable
addToRunTimeSelectionTable(blockEdge, arcEdge, Istream)
Foam::BSpline::length
scalar length() const
Return the length of the curve.
Definition: BSpline.C:134
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
stdFoam::end
constexpr auto end(C &c) -> decltype(c.end())
Return iterator to the end of the container c.
Definition: stdFoam.H:115
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::Vector< scalar >
Foam::Istream::putBack
void putBack(const token &tok)
Put back token.
Definition: Istream.C:53
Foam::searchableSurfaces
Container for searchableSurfaces. The collection is specified as a dictionary. For example,...
Definition: searchableSurfaces.H:92
Foam::start
label ListType::const_reference const label start
Definition: ListOps.H:408
points
const pointField & points
Definition: gmvOutputHeader.H:1
Foam::blockEdges::BSplineEdge::length
virtual scalar length() const
Return the length of the spline curve (not implemented)
Definition: BSplineEdge.C:98
BSplineEdge.H