<< scibench_poissonA Benchmark Toolbox

Benchmark Toolbox >> Benchmark Toolbox > scibench_poissonAu

scibench_poissonAu

Returns the A*u sparse product for 2D Poisson PDE.

Calling Sequence

v = scibench_poissonAu ( u )

Parameters

u :

a m-by-1 matrix of doubles, the vector.

A :

a m-by-m matrix of doubles, the matrix-vector product v=A*u

Description

We compute the numerical solution with finite differences for the Poisson problem with homogeneous Dirichlet boundary conditions.

We consider the 2 dimensional problem Partial Differential Equation:

where the Laplace operator is

We consider the domain 0 <= x1 <= 1, 0 <= x2 <= 1. The function f is defined by f(x, y) = -2pi^2 cos(2pix) sin^2(piy) - 2pi^2 sin^2(pix) cos(2piy). The solution is u(x, y) = sin^2(pix) sin^2(piy). We use a grid of N-by-N points. We use a second order finite difference approximation of the Laplace operator.

The matrix A is not stored: only the matrix-vector product v=A*u is performed.

Examples

stacksize("max");
N = 50;
m = N^2;
u = ones(m,1)
v1 = scibench_poissonAu ( u );
// Compute explicitely the matrix-vector product:
A = scibench_poissonA(50);
v2 = A*u;
norm(v1-v2)

Bibliography

"A Comparative Evaluation Of Matlab, Octave, Freemat, And Scilab For Research And Teaching", 2010, Neeraj Sharma and Matthias K. Gobbert

<< scibench_poissonA Benchmark Toolbox