Tests the linear forms. More...

#include <linearFormTest.hh>

Inheritance diagram for test::LinearFormTest:
test::TestCase

Public Member Functions

void _succeed ()
 Explicitly succeds a test. More...
 
long getNumFailed () const
 Returns number of failed tests. More...
 
long getNumPassed () const
 Returns number of passed tests. More...
 
const ostream * getStream () const
 Returns output stream. More...
 
long report () const
 Prints a report on the number of passed and failed tests to the output stream. More...
 
virtual void reset ()
 Resets the counters for the failed and passed tests. More...
 
virtual void run ()
 Runs the tests. Must be overwritten by the specialization. More...
 
virtual void run ()
 Runs the tests. Must be overwritten by the specialization. More...
 
void setStream (ostream *osptr)
 Sets the output stream. More...
 
virtual ~LinearFormTest ()
 
virtual ~LinearFormTest ()
 

Protected Member Functions

void do_fail (const string &lbl, const char *fname, long lineno)
 Internal function to report a failed test (besides increasing the failed counter) More...
 
bool do_numtest (double num, double orig, const string &lbl, const string &lbl2, const char *fname, long lineno, const double tol=1e-10)
 Internal function to do a numerical test. More...
 
bool do_numtest (std::complex< double > num, std::complex< double > orig, const string &lbl, const string &lbl2, const char *fname, long lineno, const double tol=1e-10)
 
bool do_test (bool cond, const string &lbl, const char *fname, long lineno)
 Internal function to do a test. More...
 

Private Attributes

long m_nFail
 
long m_nPass
 
ostream * m_osptr
 

Test routines

std::unique_ptr< hp2D::Spacespc_
 Space. More...
 
std::unique_ptr< concepts::Import2dMeshm_
 Mesh. More...
 
void testRieszIntValue ()
 Tests the integral values of the Riesz linear form for lowest order shape functions. More...
 
void testGradIntValue ()
 Tests the integral values of the Gradient linear form for lowest order shape functions. More...
 
void testPlCurlIntValue ()
 Tests the integral values of the Scurl linear form for lowest order shape functions. More...
 
void testPlCurlSystem ()
 Tests the Scurl linear form with solving a system. More...
 
template<class F , class G >
void testLinearForm_ (concepts::LinearForm< F, Real > &lform, G &desiredVector)
 Creates load vector and compare it with desired vector. More...
 
void setSpace_ (uint l=0, uint p=1, concepts::BoundaryConditions *bc=0)
 Loads the mesh and builds the space. More...
 

Test routines. Values got from app-kersten/hp2Dedge-doc/Riesz.m

std::unique_ptr< hp2Dedge::Spacespc_
 Space. More...
 
void testRieszp0 ()
 Tests the integral values of the Riesz linearform for lowest order shape functions. More...
 
template<class F , class G >
void testLinearForm_ (concepts::LinearForm< F, Real > *lform, const G &desiredVector, const std::string str="")
 Creates vector and compare it with desired vector. More...
 
void setSpace_ (concepts::Mesh2 &msh, uint l=0, uint p=1)
 Builds the space. More...
 

Detailed Description

Tests the linear forms.

Author
Kersten Schmidt, 2005

x

Author
Kersten Schmidt, 2007

Definition at line 28 of file linearFormTest.hh.

Constructor & Destructor Documentation

◆ ~LinearFormTest() [1/2]

virtual test::LinearFormTest::~LinearFormTest ( )
inlinevirtual

Definition at line 30 of file linearFormTest.hh.

◆ ~LinearFormTest() [2/2]

virtual test::LinearFormTest::~LinearFormTest ( )
inlinevirtual

Definition at line 34 of file linearFormTest.hh.

Member Function Documentation

◆ _succeed()

void test::TestCase::_succeed ( )
inlineinherited

Explicitly succeds a test.

Definition at line 112 of file testcase.hh.

◆ do_fail()

void test::TestCase::do_fail ( const string &  lbl,
const char *  fname,
long  lineno 
)
protectedinherited

Internal function to report a failed test (besides increasing the failed counter)

◆ do_numtest() [1/2]

bool test::TestCase::do_numtest ( double  num,
double  orig,
const string &  lbl,
const string &  lbl2,
const char *  fname,
long  lineno,
const double  tol = 1e-10 
)
protectedinherited

Internal function to do a numerical test.

◆ do_numtest() [2/2]

bool test::TestCase::do_numtest ( std::complex< double >  num,
std::complex< double >  orig,
const string &  lbl,
const string &  lbl2,
const char *  fname,
long  lineno,
const double  tol = 1e-10 
)
protectedinherited

◆ do_test()

bool test::TestCase::do_test ( bool  cond,
const string &  lbl,
const char *  fname,
long  lineno 
)
protectedinherited

Internal function to do a test.

◆ getNumFailed()

long test::TestCase::getNumFailed ( ) const
inlineinherited

Returns number of failed tests.

Definition at line 105 of file testcase.hh.

◆ getNumPassed()

long test::TestCase::getNumPassed ( ) const
inlineinherited

Returns number of passed tests.

Definition at line 103 of file testcase.hh.

◆ getStream()

const ostream* test::TestCase::getStream ( ) const
inlineinherited

Returns output stream.

Definition at line 107 of file testcase.hh.

◆ report()

long test::TestCase::report ( ) const
inherited

Prints a report on the number of passed and failed tests to the output stream.

Returns
Number of failed tests.

◆ reset()

virtual void test::TestCase::reset ( )
inlinevirtualinherited

Resets the counters for the failed and passed tests.

Definition at line 119 of file testcase.hh.

◆ run() [1/2]

virtual void test::LinearFormTest::run ( )
virtual

Runs the tests. Must be overwritten by the specialization.

Implements test::TestCase.

◆ run() [2/2]

virtual void test::LinearFormTest::run ( )
virtual

Runs the tests. Must be overwritten by the specialization.

Implements test::TestCase.

◆ setSpace_() [1/2]

void test::LinearFormTest::setSpace_ ( concepts::Mesh2 msh,
uint  l = 0,
uint  p = 1 
)
private

Builds the space.

◆ setSpace_() [2/2]

void test::LinearFormTest::setSpace_ ( uint  l = 0,
uint  p = 1,
concepts::BoundaryConditions bc = 0 
)
private

Loads the mesh and builds the space.

◆ setStream()

void test::TestCase::setStream ( ostream *  osptr)
inlineinherited

Sets the output stream.

Definition at line 109 of file testcase.hh.

◆ testGradIntValue()

void test::LinearFormTest::testGradIntValue ( )

Tests the integral values of the Gradient linear form for lowest order shape functions.

◆ testLinearForm_() [1/2]

template<class F , class G >
void test::LinearFormTest::testLinearForm_ ( concepts::LinearForm< F, Real > &  lform,
G &  desiredVector 
)
private

Creates load vector and compare it with desired vector.

◆ testLinearForm_() [2/2]

template<class F , class G >
void test::LinearFormTest::testLinearForm_ ( concepts::LinearForm< F, Real > *  lform,
const G &  desiredVector,
const std::string  str = "" 
)
private

Creates vector and compare it with desired vector.

◆ testPlCurlIntValue()

void test::LinearFormTest::testPlCurlIntValue ( )

Tests the integral values of the Scurl linear form for lowest order shape functions.

◆ testPlCurlSystem()

void test::LinearFormTest::testPlCurlSystem ( )

Tests the Scurl linear form with solving a system.

◆ testRieszIntValue()

void test::LinearFormTest::testRieszIntValue ( )

Tests the integral values of the Riesz linear form for lowest order shape functions.

◆ testRieszp0()

void test::LinearFormTest::testRieszp0 ( )

Tests the integral values of the Riesz linearform for lowest order shape functions.

Member Data Documentation

◆ m_

std::unique_ptr<concepts::Import2dMesh> test::LinearFormTest::m_
private

Mesh.

Definition at line 63 of file linearFormTest.hh.

◆ m_nFail

long test::TestCase::m_nFail
privateinherited

Definition at line 139 of file testcase.hh.

◆ m_nPass

long test::TestCase::m_nPass
privateinherited

Definition at line 138 of file testcase.hh.

◆ m_osptr

ostream* test::TestCase::m_osptr
privateinherited

Definition at line 137 of file testcase.hh.

◆ spc_ [1/2]

std::unique_ptr<hp2D::Space> test::LinearFormTest::spc_
private

Space.

Definition at line 61 of file linearFormTest.hh.

◆ spc_ [2/2]

std::unique_ptr<hp2Dedge::Space> test::LinearFormTest::spc_
private

Space.

Definition at line 53 of file linearFormTest.hh.


The documentation for this class was generated from the following file:
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich