Demo: The 2-D Steklov-Poincaré problem: P0 Boundary Element
In this demo, we consider a problem derived from the Laplace equation, namely
the Steklov-Poincaré problem. The problem is the following:
Given a function g defined on the boundary of the domain. We look for the
normal derivative of the solution of the Laplace equation whose trace
on the boundary is g. The problem is solved by
an integral representation by using P0 boundary elements. In the
OFELI library contains the class
SteklovPoincare2DBE for
such a purpose.
- The code starts like the previous ones
concerning the Laplace equation. Then, we declare two vectors: The vector g
will store the prescribed boundary value, and the vector g,
will contain the solution i.e. the normal derivative. This
is why it is declared as a BOUNDARY_SIDE_FIELD, i.e.
constant on each boundary side.
Vect g(ms), u(ms,0,BOUNDARY_SIDE_FIELD);
|
- As an example, we consider an annular domain defined by the intersection of the
circle with center (0,0) and radius 2,
with the circle with center (0,0) and radius 1.
We impose in this example, the values g=0 on
the inner boundary and g=1 on the outer boundary.
g.setNodeBC(1,"0.");
g.setNodeBC(2,"1.");
|
- We can now instantiate the class
SteklovPoincare2DBE.
We also transmit the boundary condition to the equation using the
member function setInput
SteklovPoincare2DBE eq(ms,u);
eq.setInput(BOUNDARY_CONDITION,g);
|
- We can now solve the problem and print out the solution.
We also compute the L2-norm of the solution to check convergence.
eq.run();
cout << u;
cout << "L2 solution norm: " << u.Norm(WNORM2) << endl;
|