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-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::multiDimPolyFunctions
28
29Description
30 base class for polynomial functions
31
32 Original code supplied by Henning Scheufler, DLR (2019)
33
34SourceFiles
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"
47
48// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49
50namespace Foam
51{
52
53/*---------------------------------------------------------------------------*\
54 Class multiDimPolyFunctions Declaration
55\*---------------------------------------------------------------------------*/
58{
59protected:
60
61 // Protected Data
62
63 //- Number of polynomial term
64 label nTerms_;
73
74
75public:
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
117 virtual scalar value(const vector& vec) = 0;
119 virtual const scalarField& termValues(const vector& vec) = 0;
121 label& nTerms()
122 {
123 return nTerms_;
124 }
127 {
128 return coeffs_;
129 }
130};
131
132
133// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134
135} // End namespace Foam
136
137// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138
139#endif
140
141// ************************************************************************* //
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
base class for polynomial functions
virtual const scalarField & termValues(const vector &vec)=0
static autoPtr< multiDimPolyFunctions > New(const word &multiDimPolyFunctionsType, const labelVector &dirs)
Select a multiDimPolyFunctions.
virtual scalar value(const vector &vec)=0
TypeName("multiDimPolyFunctions")
Runtime type information.
virtual ~multiDimPolyFunctions()=default
Destructor.
label nTerms_
Number of polynomial term.
declareRunTimeSelectionTable(autoPtr, multiDimPolyFunctions, word,(const Vector< label > dirs),(dirs))
A class for handling words, derived from Foam::string.
Definition: word.H:68
Namespace for OpenFOAM.
Macros to ease declaration of run-time selection tables.
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes)
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73