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 Class which assembles scalar eigen-base given a set of scalar fields.
29 This is performed by establishing a matrix of snapshots, calculating and
30 sorting them and providing corresponding eigen-vectors. Eigen-values are
31 sorted in increasing order. Snapshots are added one at a time and
32 when the base is completed, the calculation is triggered
35 Hrvoje Jasak, Wikki Ltd. All rights reserved.
40 \*---------------------------------------------------------------------------*/
42 #ifndef PODEigenBase_H
43 #define PODEigenBase_H
45 #include "primitiveFields.H"
46 #include "FieldFields.H"
47 #include "scalarMatrices.H"
48 #include "SortableList.H"
49 #include "EigenSolver.H"
50 #include "volFieldsFwd.H"
52 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
57 /*---------------------------------------------------------------------------*\
58 Class PODEigenBase Declaration
59 \*---------------------------------------------------------------------------*/
66 scalarField eigenValues_;
68 //- Cumulative relative eigen-values. Renormalised to sum to 1
69 scalarField cumEigenValues_;
72 FieldField<Field, scalar> eigenVectors_;
75 // Private Member Functions
77 //- Disallow default bitwise copy construct
78 PODEigenBase(const PODEigenBase&);
80 //- Disallow default bitwise assignment
81 void operator=(const PODEigenBase&);
84 //- Calculate eigen base
85 void calcEigenBase(const scalarSquareMatrix& orthMatrix);
92 //- Construct given a list of fields
93 PODEigenBase(const PtrList<volScalarField>& snapshots);
96 // Destructor - default
101 //- Return eigen-values sorted in decreasing order
102 const scalarField& eigenValues() const
107 //- Return cumulative eigen-values
108 const scalarField& cumulativeEigenValues() const
110 return cumEigenValues_;
113 //- Return eigen-vectors
114 const FieldField<Field, scalar>& eigenVectors() const
116 return eigenVectors_;
121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
123 } // End namespace Foam
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129 // ************************************************************************* //