1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM 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 2 of the License, or (at your
14 option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29 Class which assembles scalar eigen-base given a set of scalar fields.
30 This is performed by establishing a matrix of snapshots, calculating and
31 sorting them and providing corresponding eigen-vectors. Eigen-values are
32 sorted in increasing order. Snapshots are added one at a time and
33 when the base is completed, the calculation is triggered
36 Hrvoje Jasak, Wikki Ltd. All rights reserved.
41 \*---------------------------------------------------------------------------*/
43 #ifndef PODEigenBase_H
44 #define PODEigenBase_H
46 #include "primitiveFields.H"
47 #include "FieldFields.H"
48 #include "scalarMatrices.H"
49 #include "SortableList.H"
50 #include "EigenSolver.H"
51 #include "volFieldsFwd.H"
53 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
58 /*---------------------------------------------------------------------------*\
59 Class PODEigenBase Declaration
60 \*---------------------------------------------------------------------------*/
67 scalarField eigenValues_;
69 //- Cumulative relative eigen-values. Renormalised to sum to 1
70 scalarField cumEigenValues_;
73 FieldField<Field, scalar> eigenVectors_;
76 // Private Member Functions
78 //- Disallow default bitwise copy construct
79 PODEigenBase(const PODEigenBase&);
81 //- Disallow default bitwise assignment
82 void operator=(const PODEigenBase&);
85 //- Calculate eigen base
86 void calcEigenBase(const scalarSquareMatrix& orthMatrix);
93 //- Construct given a list of fields
94 PODEigenBase(const PtrList<volScalarField>& snapshots);
97 // Destructor - default
102 //- Return eigen-values sorted in decreasing order
103 const scalarField& eigenValues() const
108 //- Return cumulative eigen-values
109 const scalarField& cumulativeEigenValues() const
111 return cumEigenValues_;
114 //- Return eigen-vectors
115 const FieldField<Field, scalar>& eigenVectors() const
117 return eigenVectors_;
122 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124 } // End namespace Foam
126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 // ************************************************************************* //