LifeV
VerifySolutions Class Reference

This class helps the testsuites in verifying that the solutions do not change from one execution to the other. More...

#include <VerifySolutions.hpp>

+ Collaboration diagram for VerifySolutions:

Constructors and destructor

 VerifySolutions ()
 
virtual ~VerifySolutions ()
 

Methods

Real M_NormMean
 
Epetra_SerialDenseMatrix M_CorrelationMatrix
 
std::list< VectorEpetraM_VectorList
 
void PushBack (VectorEpetra const &newVector)
 Add a vector to the list of stored vectors. More...
 
void ComputeCorrelation ()
 Compute the correlation matrix and norm of the mean. More...
 
bool Check (Epetra_SerialDenseMatrix const &refM, Real tol) const
 Checks that the current Correlation matrix is the same as the one provided by the user. More...
 
bool Check (Real referenceMean, Real tol) const
 Checks that the current norm of the mean of the vectors is the same as the one provided by the user. More...
 
void Print () const
 Print Mean and Correlation matrix as c++ lines ready to be inserted into the test. More...
 

Detailed Description

This class helps the testsuites in verifying that the solutions do not change from one execution to the other.

We want to check if the solutions are correct between versions. we want to produce a small number of scalars and check they are always the same.

Given: u_0, ustd::placeholders::_1, ...

mean: u = mean u_j

correlation matrix: (u_i-u , u_j-u) i,j=0,1,...

Store the correlation matrix and (u,u) each entry of the matrix shall be equal to the stored one up to a tolerance.

Example of use taken from testsuite/verify_solution/main.cpp

Definition at line 67 of file VerifySolutions.hpp.

Constructor & Destructor Documentation

◆ VerifySolutions()

Definition at line 44 of file VerifySolutions.cpp.

+ Here is the caller graph for this function:

◆ ~VerifySolutions()

~VerifySolutions ( )
virtual

Definition at line 51 of file VerifySolutions.cpp.

Member Function Documentation

◆ PushBack()

void PushBack ( VectorEpetra const &  newVector)

Add a vector to the list of stored vectors.

The vector is copied in a list container.

Parameters
newVectorvector to be copied and stored

Definition at line 55 of file VerifySolutions.cpp.

+ Here is the caller graph for this function:

◆ ComputeCorrelation()

void ComputeCorrelation ( )

Compute the correlation matrix and norm of the mean.

This has to be called after all vectors have been PushBack and befor the Checks

Definition at line 61 of file VerifySolutions.cpp.

+ Here is the caller graph for this function:

◆ Check() [1/2]

bool Check ( Epetra_SerialDenseMatrix const &  refM,
Real  tol 
) const

Checks that the current Correlation matrix is the same as the one provided by the user.

Usually the reference matrix is computed with a solution set which is known to be correct.

Parameters
refMprecomputed correlation matrix
tolTolerance for checking same results

Definition at line 105 of file VerifySolutions.cpp.

◆ Check() [2/2]

bool Check ( Real  referenceMean,
Real  tol 
) const

Checks that the current norm of the mean of the vectors is the same as the one provided by the user.

Usually the norm of the mean is computed with a solution set which is known to be correct.

Parameters
referenceMeanprecomputed norm of the mean of the vectors
tolTolerance for checking same results

Definition at line 129 of file VerifySolutions.cpp.

+ Here is the caller graph for this function:

◆ Print()

void Print ( ) const

Print Mean and Correlation matrix as c++ lines ready to be inserted into the test.

Definition at line 142 of file VerifySolutions.cpp.

+ Here is the caller graph for this function:

Field Documentation

◆ M_NormMean

Real M_NormMean
private

Definition at line 117 of file VerifySolutions.hpp.

◆ M_CorrelationMatrix

Epetra_SerialDenseMatrix M_CorrelationMatrix
private

Definition at line 118 of file VerifySolutions.hpp.

◆ M_VectorList

std::list<VectorEpetra> M_VectorList
private

Definition at line 120 of file VerifySolutions.hpp.


The documentation for this class was generated from the following files: