multiDimPolyFunctions.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) 2020 DLR
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::multiDimPolyFunctions
28 
29 Description
30  base class for polynomial functions
31 
32  Original code supplied by Henning Scheufler, DLR (2019)
33 
34 SourceFiles
35  multiDimPolyFunctions.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef multiDimPolyFunctions_H
40 #define multiDimPolyFunctions_H
41 
42 #include "vector.H"
43 #include "vector2D.H"
44 #include "labelVector.H"
45 #include "scalarField.H"
46 #include "runTimeSelectionTables.H"
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 
53 /*---------------------------------------------------------------------------*\
54  Class multiDimPolyFunctions Declaration
55 \*---------------------------------------------------------------------------*/
56 
58 {
59 protected:
60 
61  // Protected Data
62 
63  //- Number of polynomial term
64  label nTerms_;
65 
66  const labelVector geomDir_;
67 
69 
71 
73 
74 
75 public:
76 
77  //- Runtime type information
78  TypeName("multiDimPolyFunctions");
79 
80  // Declare run-time constructor selection table
81 
82  // For the dictionary constructor
84  (
85  autoPtr,
87  word,
88  (
89  const Vector<label> dirs
90  ),
91  (dirs)
92  );
93 
94 
95  // Constructors
96 
97  //- Construct with directions
98  explicit multiDimPolyFunctions(const labelVector& dirs);
99 
100 
101  // Selectors
102 
103  //- Select a multiDimPolyFunctions
105  (
106  const word& multiDimPolyFunctionsType,
107  const labelVector& dirs
108  );
109 
110 
111  //- Destructor
112  virtual ~multiDimPolyFunctions() = default;
113 
114 
115  // Member Functions
116 
117  virtual scalar value(const vector& vec) = 0;
118 
119  virtual const scalarField& termValues(const vector& vec) = 0;
120 
121  label& nTerms()
122  {
123  return nTerms_;
124  }
125 
127  {
128  return coeffs_;
129  }
130 };
131 
132 
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 
135 } // End namespace Foam
136 
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138 
139 #endif
140 
141 // ************************************************************************* //
Foam::multiDimPolyFunctions::New
static autoPtr< multiDimPolyFunctions > New(const word &multiDimPolyFunctionsType, const labelVector &dirs)
Select a multiDimPolyFunctions.
Definition: multiDimPolyFunctions.C:44
Foam::multiDimPolyFunctions
base class for polynomial functions
Definition: multiDimPolyFunctions.H:56
Foam::multiDimPolyFunctions::nTerms
label & nTerms()
Definition: multiDimPolyFunctions.H:120
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::multiDimPolyFunctions::coeffs
scalarField & coeffs()
Definition: multiDimPolyFunctions.H:125
scalarField.H
Foam::multiDimPolyFunctions::termValues
virtual const scalarField & termValues(const vector &vec)=0
labelVector.H
Foam::Field< scalar >
Foam::multiDimPolyFunctions::value
virtual scalar value(const vector &vec)=0
Foam::multiDimPolyFunctions::~multiDimPolyFunctions
virtual ~multiDimPolyFunctions()=default
Destructor.
vector2D.H
Foam::multiDimPolyFunctions::multiDimPolyFunctions
multiDimPolyFunctions(const labelVector &dirs)
Construct with directions.
Definition: multiDimPolyFunctions.C:67
Foam::multiDimPolyFunctions::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, multiDimPolyFunctions, word,(const Vector< label > dirs),(dirs))
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::multiDimPolyFunctions::geomCorrection_
vector geomCorrection_
Definition: multiDimPolyFunctions.H:67
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::multiDimPolyFunctions::nTerms_
label nTerms_
Number of polynomial term.
Definition: multiDimPolyFunctions.H:63
Foam::multiDimPolyFunctions::TypeName
TypeName("multiDimPolyFunctions")
Runtime type information.
runTimeSelectionTables.H
Macros to ease declaration of run-time selection tables.
Foam::Vector< label >
Foam::multiDimPolyFunctions::geomDir_
const labelVector geomDir_
Definition: multiDimPolyFunctions.H:65
vector.H
Foam::multiDimPolyFunctions::coeffs_
scalarField coeffs_
Definition: multiDimPolyFunctions.H:69
Foam::multiDimPolyFunctions::termValues_
scalarField termValues_
Definition: multiDimPolyFunctions.H:71