multiDimPolyFitter.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) 2019-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::multiDimPolyFitter
28
29Description
30 Fit a polynominal function with the help of multiDimPolyFunction
31
32 Original code supplied by Henning Scheufler, DLR (2019)
33
34SourceFiles
35 multiDimPolyFitter.C
36
37\*---------------------------------------------------------------------------*/
38
39#ifndef multiDimPolyFitter_H
40#define multiDimPolyFitter_H
41
42#include "simpleMatrix.H"
44
45// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46
47namespace Foam
48{
49
50/*---------------------------------------------------------------------------*\
51 Class multiDimPolyFitter Declaration
52\*---------------------------------------------------------------------------*/
53
54template<class T>
56{
57 // Private Data
58
60
62
63
64public:
65
66 // Constructors
67
68 //- Construct from components
70 (
71 const word& polyFunctionName,
72 const labelVector& geomDirs
73 );
74
75
76 // Member Functions
77
78 void resetMatrix();
80 label nCoeffs() const
81 {
82 return A_.n();
83 }
84
85 void fillMatrix
86 (
87 const scalarField& polyTerms,
88 const T& value
89 );
90
91 void fillMatrix
92 (
93 const scalarField& polyTerms,
94 const T& value,
95 const scalar weight
96 );
97
98 void fillMatrix
99 (
100 const scalarField& polyTerms,
102 );
103
104 //- Fit data
106 (
107 const List<scalarField>& listPolyTerms,
108 const List<T>& listValue
109 );
110
111 //- Fit data
113 (
114 const List<scalarField>& listPolyTerms,
115 const List<T>& listValue,
116 const List<scalar>& listWeight
117 );
118
119 //- Compute inverse
121 (
122 const List<scalarField>& listPolyTerms
123 );
124
125 //- Compute source
127 (
128 const List<scalarField>& listPolyTerms,
129 const List<T>& listValue
130 );
131
132 //- Fit data
134 (
135 const List<vector>& positions,
136 const List<T>& listValue
137 );
138
139 //- Fit data
141 (
142 const List<vector>& positions,
143 const List<T>& listValue,
144 const List<scalar>& listWeight
145 );
146
147 //- Compute inverse
149 (
150 const List<vector>& positions
151 );
152
153 //- Compute source
155 (
156 const List<vector>& positions,
157 const List<T>& listValue
158 );
159};
160
161
162// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163
164} // End namespace Foam
165
166// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167
168#endif
169
170// ************************************************************************* //
static const Foam::dimensionedScalar A("", Foam::dimPressure, 611.21)
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: List.H:77
label n() const noexcept
The number of columns.
Definition: MatrixI.H:103
A templated (N x N) square matrix of objects of <Type>, containing N*N elements, derived from Matrix.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
Fit a polynominal function with the help of multiDimPolyFunction.
Field< T > computeMatrixSource(const List< scalarField > &listPolyTerms, const List< T > &listValue)
Compute source.
void fillMatrix(const scalarField &polyTerms, const T &value)
scalarSymmetricSquareMatrix computeInverse(const List< scalarField > &listPolyTerms)
Compute inverse.
Field< T > fitData(const List< scalarField > &listPolyTerms, const List< T > &listValue)
Fit data.
A simple square matrix solver with scalar coefficients.
Definition: simpleMatrix.H:67
A class for handling words, derived from Foam::string.
Definition: word.H:68
const volScalarField & T
Namespace for OpenFOAM.