1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation, either version 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
28 Establish POD ortho-normal base and interpolation coefficients give a list
29 of fields. Size of ortho-normal base is calculated from the desired
30 accuracy, e.g. 0.99-0.99999 (in energy terms)
33 Hrvoje Jasak, Wikki Ltd. All rights reserved.
38 \*---------------------------------------------------------------------------*/
40 #ifndef PODOrthoNormalBase_H
41 #define PODOrthoNormalBase_H
43 #include "volFields.H"
44 #include "RectangularMatrix.H"
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 /*---------------------------------------------------------------------------*\
52 Class PODOrthoNormalBase Declaration
53 \*---------------------------------------------------------------------------*/
56 class PODOrthoNormalBase
62 typedef GeometricField<Type, fvPatchField, volMesh> GeoTypeField;
64 typedef Field<Type> TypeField;
71 //- List of ortho-normal fields
72 PtrList<GeoTypeField> orthoFields_;
74 //- Interpolation coefficients
75 RectangularMatrix<Type>* interpolationCoeffsPtr_;
78 // Private Member Functions
80 //- Disallow default bitwise copy construct
81 PODOrthoNormalBase(const PODOrthoNormalBase&);
83 //- Disallow default bitwise assignment
84 void operator=(const PODOrthoNormalBase&);
86 //- Calculate ortho-normal base
89 const PtrList<GeoTypeField>& snapshots,
98 //- Construct given list of snapshots and accuracy
101 const PtrList<GeoTypeField>& snapshots,
102 const scalar accuracy
108 ~PODOrthoNormalBase();
114 label baseSize() const
116 return orthoFields_.size();
119 //- Return n-th ortho-normal base field
120 const GeoTypeField& orthoField(const label n) const
122 return orthoFields_[n];
125 //- Return interpolation coefficients (snapshots x orthoVectors)
126 const RectangularMatrix<Type>& interpolationCoeffs() const
128 return *interpolationCoeffsPtr_;
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 } // End namespace Foam
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140 # include "PODOrthoNormalBase.C"
144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148 // ************************************************************************* //