Diffpack Documentation
Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members Search
LinEqStatBlk Class Reference
storage and reporting of performance for linear solvers.
More...
#include <LinEqStatBlk.h>
List of all members.
Detailed Description
storage and reporting of performance for linear solvers.
NAME: LinEqStatBlk - storage and reporting of performance for linear solvers
DESCRIPTION:
The class contains data describing the performance of linear equation solvers, e.g., the number of unknowns, elapsed CPU-time, method, convergence statistics etc. There are print functions (various formats, including a `\`LaTeX`\` table line) and plotting functions. All functions (except static ones) return a "LinEqStatBlk" reference such that performance data can be compactly dumped on various formats, for example by calling ("psb" is a "LinEqStatBlk" object and "table" is a predefined "Os" object)
psb.print(Os("conv",APPEND)).LaTeXline(table).plotMonitorData(f);
WARNING! Filling a "LinEqStatBlk" object involves some computations. For example, in "LinEqSystem performance" the residual of the linear system is computed. In some applications (f.ex. where the number of iterations is very low) calls to "LinEqAdm getStatistics" for computing a "LinEqStatBlk" object may significantly influence the CPU time. It is recommended to either track the CPU time spent on linear system statistics computations or to equip the application code with an indicator variable that can be used to turn the statistics on or off.
The "LinEqStatBlk" object should not be a part of a simulator class. The object will namely hold a pointer to the linear system, and in multiple loops where the linear system may be deallocated and a new system may be allocated, this pointer will be dangling (the pointer is a handle so the problem is detected and a warning message is given). Instead we recommend to use "LinEqStatBlk" through, e.g., "LinEqAdm". That will ensure that the life time of "LinEqStatBlk" is at most the life time of the linear system. The safest way to operate your own "LinEqStatBlk" object, is to declare it, compute and write statistics, and then delete it. This is easily accomplished if the "LinEqStatBlk" object is a local variable in some result report function.
Constructor & Destructor Documentation
|
LinEqStatBlk::LinEqStatBlk (
|
)
|
|
|
|
The constructor takes no arguments. The initialization of this object is performed in the "performance" functions in the "LinEqSolver" hierarchy. That is, a typical "LinEqStatBlk" object is handed as a parameter to "LinEqAdm performance" or to the "performance" function belonging to a linear solver in the "LinEqSolver" hierarchy. |
|
LinEqStatBlk::LinEqStatBlk (
|
LinEqStatBlk & )
|
|
|
|
See documentation of one of the overloaded constructor. |
|
LinEqStatBlk::~LinEqStatBlk (
|
)
|
|
Member Function Documentation
|
LinEqStatBlk::ASSIGNMENT_OPERATOR (
|
LinEqStatBlk )
|
|
|
LinEqStatBlk & LinEqStatBlk::annotate (
|
String & comment )
|
|
|
|
Receives a string "comment" that is used as comment to any generated plot. |
|
static void LinEqStatBlk::closeLaTeXtable (
|
Os os ) [static]
|
|
|
|
Close a `\`LaTeX`\` table that has been filled by "putLaTeXline". The function "closeLaTeXtable" is static and is typically called by a derivative of "SimCase closeReport". |
|
static void LinEqStatBlk::openLaTeXtable (
|
Os os ) [static]
|
|
|
|
Initialize a `\`LaTeX`\` table to be filled by "putLaTeXline". The function "openLaTeXtable" is static and is typically called by a derivative of "SimCase openReport". |
|
LinEqStatBlk & LinEqStatBlk::plotMonitorData (
|
CurvePlotFile & file,
|
|
bool logplot = true,
|
|
bool genPSfiles = false,
|
|
const char * psFileDir = NULL )
|
|
|
|
If the current "LinEqStatBlk" object is reporting on the performance of an iterative solver, there may a number of associated convergence monitors. This function plots all recorded convergence histories using a "CurvePlotFile" object. The flag "logplot" should be true if log10 scaling is preferred. Moreover, if "genPSfiles" is true, each plot is translated to a PostScript figure, placed in the directory named by the string "psFileDir". |
|
LinEqStatBlk & LinEqStatBlk::print (
|
Reporter & rep,
|
|
const VerbosityLevel level = COMPACT,
|
|
const char * sechead = NULL )
|
|
|
|
See documentation of one of the overloaded functions. |
|
LinEqStatBlk & LinEqStatBlk::print (
|
Os os,
|
|
bool formatted = false )
|
|
|
|
The simplest "print" function takes an "Os" and writes a compact summary of the recorded performance data.
A more sophisticated version writes this information to a "Reporter" object, thus permitting reports of typesetting quality. Combining calls to this function with the "resultReport" functionality of "SimCase" derivatives and the use of "MenuSystem multipleLoop", permits extremely compact, yet flexible, reporting mechanisms. The second parameter sets the "VerbosityLevel" which decides the amount of printed information. The levels are "COMPACT", "EXTENDED" and "DETAILED", of which the lowest level gives the same information as the simplest "print" function. Note that the "DETAILED" level also generates PostScript plots of the convergence histories of any involved convergence monitors. The last parameter is a plain C string containing the section title to be used. If the default value "NULL" is used, no section title is generated. |
|
LinEqStatBlk & LinEqStatBlk::putLaTeXline (
|
Os os )
|
|
|
|
Writes a `\`LaTeX`\` table line containing the information also generated by the print functions ("COMPACT" format). This function is typically called by a derivative of "SimCase resultReport". |
|
static void LinEqStatBlk::writeHeadings (
|
StringList & headings ) [static]
|
|
|
|
As "openLaTeXtable", but the cell headings are written as strings in a string array. The function can fill only a part of the array so that the programmer can add items related to error estimates, details of the discretization etc. The function is static and is typically called by a derivative of "SimCase openReport" when the programmer wants to report the results in terms of a class "MultipleReporter" summary. |
|
LinEqStatBlk & LinEqStatBlk::writeResults (
|
StringList & results )
|
|
|
|
As "putLaTeXline", but the results are reported as strings in a string array. See the description of "putHeadingStringLine" for the purpose of such string arrays. |
Friends And Related Function Documentation
class LinEqSummary [friend]
|
|
Member Data Documentation
|
real & LinEqStatBlk::cputime
|
|
|
int & LinEqStatBlk::max_iterations
|
|
|
int & LinEqStatBlk::niterations
|
|
|
int & LinEqStatBlk::nunknowns
|
|
|
real & LinEqStatBlk::resnorm
|
|
The documentation for this class was generated from the following file:
Copyright © 2003 inuTech GmbH. All rights reserved.