All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
lineEdge.C
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) 2011-2018 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 \*---------------------------------------------------------------------------*/
25 
26 #include "lineEdge.H"
28 
29 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
30 
31 namespace Foam
32 {
33 namespace blockEdges
34 {
35  defineTypeNameAndDebug(lineEdge, 0);
36  addToRunTimeSelectionTable(blockEdge, lineEdge, Istream);
37 }
38 }
39 
40 
41 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
42 
44 (
45  const pointField& points,
46  const label start,
47  const label end
48 )
49 :
50  blockEdge(points, start, end)
51 {}
52 
53 
55 (
56  const dictionary& dict,
57  const label index,
58  const searchableSurfaces& geometry,
59  const pointField& points,
60  Istream& is
61 )
62 :
63  blockEdge(dict, index, points, is)
64 {}
65 
66 
67 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * * //
68 
70 {}
71 
72 
73 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
74 
76 {
77  if (lambda < -small || lambda > 1+small)
78  {
80  << "Parameter out of range, lambda = " << lambda
81  << abort(FatalError);
82  }
83 
84  return points_[start_] + lambda * (points_[end_] - points_[start_]);
85 }
86 
87 
89 {
90  return mag(points_[end_] - points_[start_]);
91 }
92 
93 
94 // ************************************************************************* //
scalar length() const
Return the length of the curve.
Definition: lineEdge.C:88
error FatalError
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:306
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
dimensionedScalar lambda(viscosity->lookup("lambda"))
Macros for easy insertion into run-time selection tables.
Container for searchableSurfaces.
errorManip< error > abort(error &err)
Definition: errorManip.H:131
point position(const scalar) const
Return the point position corresponding to the curve parameter.
Definition: lineEdge.C:75
defineTypeNameAndDebug(arcEdge, 0)
addToRunTimeSelectionTable(blockEdge, arcEdge, Istream)
Define a curved edge that is parameterised for 0<lambda<1 between the start and end point...
Definition: blockEdge.H:56
virtual ~lineEdge()
Destructor.
Definition: lineEdge.C:69
dimensioned< scalar > mag(const dimensioned< Type > &)
lineEdge(const pointField &, const label start, const label end)
Construct from components.
Definition: lineEdge.C:44
Namespace for OpenFOAM.