POD_BASIS_FLOW
PDE Model Reduction
POD_BASIS_FLOW
is a FORTRAN90 program which
applies the principal
orthogonal direction (POD) analysis to a set of solutions of a
PDE that models two dimensional time dependent fluid flow.
This procedure, originally devised by Karl Pearson, has arisen
repeatedly in a variety of fields, and hence is known under
various names, including:

the Hotelling transform;

the discrete KarhunenLoeve transform (KLT)

Principal Component Analysis (PCA)

Principal Orthogonal Direction (POD)

Proper Orthogonal Decomposition (POD)

Singular Value Decomposition (SVD)
You almost certainly should rather use the simpler program
called
SVD_BASIS,
which does not assume that the data comes from a particular
fluid flow problem!
The purpose of the algorithm is to extract the dominant modes
of behavior of the system; these modes could then be used, for
instance, in a reduced order model of the physical system.
For the computations considered here, a partial differential
equation (PDE) has been defined, specifying the timedependent
flow of a fluid through a region. The PDE specification includes
a parameter alpha whose value strongly affects the behavior of
the flow. The steady state solution X0 is computed for a particular
value of alpha. Then the timedependent problem is solved over a
fixed time interval, with alpha varying from time to time.
A set of several hundred solutions X(T(I),alpha(I)) are saved.
The need is to try to extract from this solution data the
typical modes of behavior of the solution, that is, a small set
of orthogonal vectors V such that "most" of the solution
vectors X can be well represented by a linear combination
of elements of V. Such a set of modes may then be used as
a finite element basis that is highly tuned to the physics of the
problem, so that a very small set of basis functions can be used
to closely approximate the behavior of the solution over a range
of values of alpha.
The method of extracting information from the solution data
begins by constructing an M by N matrix A, each
of whose columns is one of the solution vectors X. Thus,
A = [ X1  X2  ...  XN ]
Then the singular value decomposition of A:
A = U * S * V'
is determined using the DGESVD routine from the linear algebra package
LAPACK.
A subset of the columns of the orthogonal M by M
matrix U, associated with the largest singular values S,
is chosen to form the POD basis.
Because the data comes from a finite element computation, and
the results may be used as a new reduced basis, it may be
desirable to carry out mass matrix preconditioning of the data,
so that output POD vectors are orthogonal
in the L2 inner product (integration of the product of the finite
element functions over the domain).
The current version of the program assumes that a steady state
solution SS of the PDE is known, and that a multiple
of SS is to be subtracted from each solution vector before processing.
FILES: the program assumes the existence of the following files:
(the actual names of the files are specified by the user at run time.
The names used here are just suggestions.)

xy.txt, contains the (x,y) coordinates of each node, with
one pair of coordinates per line of the file;

ss.txt, contains the (u,v) values at each node for the
steady state solution, with one pair of values per line of the file;

uv01.txt, uv02.txt, ..., contains the (u,v) values
at each node for solution 1, 2, and so on;

element.txt, contains the indices of the six nodes that
make up each element, with one set of six indices per line of
the file (only needed if mass matrix
preconditioning is used);
INPUT: at run time, the user specifies:

run_type describes how we subtract off the steady state,
whether we drop some data, and other options. The current
values range from 1 to 8. The most common value is 6, used
with the TCELL data:

no steady state file, no preprocessing;

no steady state file, no preprocessing;

subtract 1/3 SS from solution 1, 5/3 SS from solutions
2 to 201, and 1/3 SS from solutions 202 through 401.

subtract 1/3 SS from solution 1, 5/3 SS from solutions
2 to 201, and 1/3 SS from solutions 202 through 401,
and drop the evennumbered data.

subtract 1/3 SS from solution 1, 5/3 SS from solutions
2 to 201, and 1/3 SS from solutions 202 through 401,
and skip half the data and normalize it.

subtract 5/3 SS from solutions
1 to 250, and 1/3 SS from solutions 251 through 500, do not
normalize.

subtract 5/3 SS from solutions
1 to 250, and 1/3 SS from solutions 251 through 500,
normalize the data.

subtract 5/3 SS from solutions
1 to 250, and 1/3 SS from solutions 251 through 500, then
drop the oddnumbered data, do not
normalize.

basis_num, the requested basis size.

xy_file, the name of the xy file.

steady_file, the name of the steady state solution file
(only if run_type is 1 or 2).

uv0_file, the name of the first solution file (the program
will assume all the files are numbered consecutively).

element_file, the name of the element file, if mass matrix
preconditioning is desired, or else "none".
OUTPUT: the program computes basis_num basis vectors.
The first vector is written to the file pod_001.txt; again,
the output vectors are written with two values per line, since
this represents the two components of velocity at a particular
node.
Licensing:
The computer code and data files described and made available on this web page
are distributed under
the GNU LGPL license.
Languages:
POD_BASIS_FLOW is available in
a FORTRAN90 version.
Related Data and Programs:
BRAIN_SENSOR_POD,
a MATLAB program which
applies the method of Proper Orthogonal Decomposition
to seek underlying patterns in sets of 40 sensor readings of
brain activity.
CVT_BASIS_FLOW,
a FORTRAN90 program which
is similar to POD_BASIS_FLOW but uses CVT techniques to
do the analysis of the data.
LAPACK_EXAMPLES,
a FORTRAN90 program which
demonstrates the use of the LAPACK linear algebra library.
SVD_BASIS,
a FORTRAN90 program which
is a simpler version of this program; it does not assume that
the underlying data represents solutions of a fluid flow problem.
Reference:

Edward Anderson, Zhaojun Bai, Christian Bischof, Susan Blackford,
James Demmel, Jack Dongarra, Jeremy Du Croz, Anne Greenbaum,
Sven Hammarling, Alan McKenney, Danny Sorensen,
LAPACK User's Guide,
Third Edition,
SIAM, 1999,
LC: QA76.73.F25L36

John Burkardt, Max Gunzburger, HyungChun Lee,
Centroidal Voronoi TessellationBased ReducedOrder
Modelling of Complex Systems,
SIAM Journal on Scientific Computing,
Volume 28, Number 2, 2006, pages 459484.

Gal Berkooz, Philip Holmes, John Lumley,
The proper orthogonal decomposition in the analysis
of turbulent flows,
Annual Review of Fluid Mechanics,
Volume 25, 1993, pages 539575.

Lawrence Sirovitch,
Turbulence and the dynamics of coherent structures, Parts IIII,
Quarterly of Applied Mathematics,
Volume XLV, Number 3, 1987, pages 561590.
Source Code:
Examples and Tests:
PDE solution datasets you may copy include:
Once the reduced basis set is computed, it is possible to
set up new finite element problems in which the reduced basis
set is used as the finite element basis. To see an example
of such a calculation, refer to

TCELL, the program which generated the TCELL data;

TCELL_MASS, used to calculate the mass matrix;

TCELL_ROM, the TCELL reduced order modeling program;
This program has been run with a number of different datasets,
and with various requirements as to normalization and so on.
The purpose of most of the runs is to find a generator set of
given size. The input and output of each run is stored in
a separate subdirectory.
Each run of the code is stored in a separate subdirectory.
Available runs include:

run_01,
getting 16 POD vectors from the CAVITY_FLOW data.

run_02,
getting 16 POD vectors from the INOUT_FLOW data.

run_03,
getting 16 POD vectors from the TCELL_FLOW data.

run_04,
getting 16 POD vectors from the CAVITY_FLOW data,
with mass matrix preconditioning.

run_05,
getting 16 POD vectors from the INOUT_FLOW data,
with mass matrix preconditioning.

run_06,
getting 16 POD vectors from the TCELL_FLOW data,
with mass matrix preconditioning.

run_07,
getting 16 POD vectors from the CAVITY_FLOW data,
with mass matrix preconditioning. We drop the odd
numbered data vectors.

run_08,
getting 16 POD vectors from the INOUT_FLOW data,
with mass matrix preconditioning. We drop the odd
numbered data vectors.

run_09,
getting 16 POD vectors from the TCELL_FLOW data,
with mass matrix preconditioning. We drop the odd
numbered data vectors.

run_10,
getting 16 POD vectors from the INOUT_FLOW2 data.

run_11,
getting 16 POD vectors from the INOUT_FLOW2 data,
with mass matrix preconditioning.
List of Routines:

MAIN is the main program for POD_BASIS_FLOW.

BANDWIDTH_DETERMINE computes the lower bandwidth of a finite element matrix.

BASIS_WRITE writes a basis vector to a file.

CH_CAP capitalizes a single character.

CH_EQI is a case insensitive comparison of two characters for equality.

CH_IS_DIGIT is TRUE if a character is a decimal digit.

CH_TO_DIGIT returns the integer value of a base 10 digit.

DATA_IVEC_READ reads an dataset of integer vectors stored in a file.

DATA_D2_READ reads pairs of double precision numbers stored in a file.

DATA_SIZE counts the size of a data set stored in a file.

DBLT_CHECK checks the dimensions of a banded lower triangular matrix.

DBLT_PRINT prints a band lower triangular matrix.

DBLT_PRINT_SOME prints some of a band lower triangular matrix.

DIGIT_INC increments a decimal digit.

DIGIT_TO_CH returns the character representation of a decimal digit.

DPBL_CHECK checks the dimensions of a positive definite symmetric band matrix.

DPBL_PRINT prints a symmetric banded matrix.

DPBL_PRINT_SOME prints some of a symmetric banded matrix.

FILE_EXIST reports whether a file exists.

FILE_NAME_INC generates the next filename in a series.

GET_UNIT returns a free FORTRAN unit number.

I4_INPUT prints a prompt string and reads an integer from the user.

I4_RANGE_INPUT reads a pair of integers from the user, representing a range.

MASS_MATRIX computes the mass matrix.

NODE_T6 returns the basis nodes for a 6 node triangle.

R8VEC_PRINT prints a double precision vector.

REFQBF evaluates a reference element quadratic basis function.

S_EQI is a case insensitive comparison of two strings for equality.

S_INPUT prints a prompt string and reads a string from the user.

S_OF_I4 converts an integer to a leftjustified string.

S_REP_CH replaces all occurrences of one character by another.

S_TO_I4 reads an I4 from a string.

S_TO_R8 reads an R8 from a string.

S_WORD_COUNT counts the number of "words" in a string.

SINGULAR_VECTORS computes the desired singular values.

TIMESTAMP prints the current YMDHMS date as a time stamp.

TIMESTRING writes the current YMDHMS date into a string.

TRIANGLE_UNIT_SET sets weights and abscissas for quadrature in a unit triangle.
You can go up one level to
the FORTRAN90 source codes.
Last revised on 17 July 2004.