Public Member Functions
SimplePoisson1DTest Class Reference

This class sets up a test that checks convergence rate for solution of the Poisson equation in 1D with Lagrange(2) basis functions. More...

Inheritance diagram for SimplePoisson1DTest:
Sundance::LP1DTestBase Sundance::LPTestBase Sundance::ForwardProblemTestBase

List of all members.

Public Member Functions

 SimplePoisson1DTest (const Array< int > &nx)
 Construct the test object.
std::string name () const
 Return a descriptive name for the test.
Array< int > pExpected () const
 Return the expected order of accuracy for the solutions.
Expr exactSoln () const
 Return an expression for the exact solution to the test problem.
LinearProblem prob (const Mesh &mesh) const
 Return a LP for the specified mesh.
Array< LPTestSpecspecs () const
 Specify which linear solvers are to be used.

Detailed Description

This class sets up a test that checks convergence rate for solution of the Poisson equation in 1D with Lagrange(2) basis functions.

The test problem is

\[ u'' = -\frac{1}{4}\pi^2 \sin(\pi x/2) \]

with boundary conditions

\[ u(0)=1, \;\;\; u'(1)=0. \]

The solution is $u(x)=\sin(\pi x/2)$.

Definition at line 47 of file LPTests1D.cpp.


Constructor & Destructor Documentation

SimplePoisson1DTest::SimplePoisson1DTest ( const Array< int > &  nx) [inline]

Construct the test object.

The constructor calls the base class constructor with a list of mesh sizes to be used.

Definition at line 54 of file LPTests1D.cpp.


Member Function Documentation

Expr SimplePoisson1DTest::exactSoln ( ) const [inline, virtual]

Return an expression for the exact solution to the test problem.

Implements Sundance::ForwardProblemTestBase.

Definition at line 68 of file LPTests1D.cpp.

References Sundance::ForwardProblemTestBase::coord().

std::string SimplePoisson1DTest::name ( ) const [inline, virtual]

Return a descriptive name for the test.

Implements Sundance::ForwardProblemTestBase.

Definition at line 58 of file LPTests1D.cpp.

Array<int> SimplePoisson1DTest::pExpected ( ) const [inline, virtual]

Return the expected order of accuracy for the solutions.

Because a problem might have multiple field variables, the expected orders of accuracy for the different variables are returned as an array.

Implements Sundance::ForwardProblemTestBase.

Definition at line 63 of file LPTests1D.cpp.

LinearProblem SimplePoisson1DTest::prob ( const Mesh mesh) const [inline, virtual]

Return a LP for the specified mesh.

This function implements the prob() pure virtual function of class LPTestBase.

Implements Sundance::LPTestBase.

Definition at line 80 of file LPTests1D.cpp.

References Sundance::ForwardProblemTestBase::coord(), Sundance::LP1DTestBase::domain(), Sundance::gradient(), Sundance::LP1DTestBase::interior(), Sundance::LineDomain::left(), and Sundance::ForwardProblemTestBase::vecType().

Array<LPTestSpec> SimplePoisson1DTest::specs ( ) const [inline, virtual]

Specify which linear solvers are to be used.

Reimplemented from Sundance::LPTestBase.

Definition at line 103 of file LPTests1D.cpp.

Site Contact