Moved the fields controlling if, and under what name, the recurrence matrix is
written to disk to the parent class recModel to make the behaviour common to all
derived classes.
Fixed some formatting and added some diagnostic output in class gerhardsRecModel
The standardRecModel class reads all fields of the data base at once. This
might create a problem in cases with a large number of snapshots and/or
a large mesh, as the machine's memory (RAM) would become a bottleneck.
Thus, the class gerhardsRecModel implements an incomplete data base, with
a user-defined number of slots M. In cases with a larger number of
snapshots on disk N, with N > M, the class will manage its data base
in a fashion similar to an operating system managing memory pages.
The class gerhardsRecModel implements a least-recently used (LRU)
algorithm, which vacates the least-used of the dataBase's M slots.
An integer list is used to track the slots' usage, each access to a
slot is logged, thus the least-used slot can be easily determined.
In order to fully utilize the LRU algorithm, the computation of the
recurrence matrix in sqrDiffNorm.C had to modified such, that three
nested for-loops are used, instead of two nested loops. Thus, a certain
number of additional, essentially no-op, loop iterations are expended
in order to accomodate the LRU algorithm. Keeping the two nested loops
would have reaped only part of LRU's potential gains.
In order to accomodate data base management in the classes derived
from the class recModel, some const specifiers had to be removed.
For informational purposes, a method has been added to the class.
The class gerhardsRecModel first checks the existence of all N
to-be-read fields, and then fills the data base with the first M
fields.
Further features included in this commit:
All elements of the recurrence model are initialized with the value of -1.0
Thus, some form of error checking is introduced, as negative values should not
remain within the matrix after computation has finished.
Skipping the 0 directory of the data base. This, might be useful when
using rStatAnalysis as post-processing tool.
The class multiIntervalPath was adapted to use OpenFOAM's
methods for parallel communication.
Reference:
Modern Operating Systems
Andrew S. Tannenbaum,
Prentice Hall, 1992
Add an optional boolean switch to standardRecModel class to allow
ignoring the 0 directory when building the recurrence data base.
This is useful when using rStatAnalysis as a post-processing tool
on a case where OpenFOAM's purgeWrite feature was used.
If purgeWrite is set to 0, then all time steps will be written to disk.
If purgeWrite is set to N, then only the last N time steps will be stored.
As a new time step is written to disk, the oldest one will be discarded.
However, the 0 directory is excluded from removal.
If purgeWrite is set to 5, and we run a simulation with deltaT=1 und endTime=10,
then the time steps on disk will be: 0, 6, 7, 8, 9, 10.
Running rStatAnalysis on this case, will end in fatal error, as the time step
within the data base will be found to be non-uniform.
The quick and dirty fix, would be to remove or rename the 0 directory, so that
it does not get read. However, telling the recurrence model whether to include
0 or not seems the more elegant solution.
This changes nothing from the previous behaviour, however, this allows
to use rStatAnalysis as a post-processing tool. A demo case will follow
to demonstrate this.
By default, the data base is located in $CASE_DICT/dataBase. By specifying
the case dict as the path to the data base, rStatAnalysis can now act on
the case's actual time steps, thus post-processing data computed by another
solver.