start velocity on boundary

Hey everyone,

I have a question about implementing the following problem:
[tex]u_{xx} - u_{tt} = 0[/tex]
on the unit square
[tex]x,t \in [0,1][/tex]
subjected to the boundary condition
[tex]u(0,t) = 0 \ u(1,t) = 0 \ u(x,0) = 0 \ u_{t}(x,0) = \pi sin(\pi x)[/tex]

I do know how to specify the 0 boundary condition on its own. However, I am struggling with setting the starting velocity and the Dirichlet condition on the same edge. Is there a way to do that?

Hi nsc,

I guess you have one GridFunction for saving u and another GridFunction for saving the velocity u_t.
Then, at the beginning, you can set the starting velocity by

gfut.Set(pi*sin(pi*x), definedon=mesh.Boundaries("your boundary"))

During the update scheme you have to take care that you carry on the boundary condition.


Hi Michael,
thanks for the answer and sorry for not writing back so long.
For now, I have only used the automatic utility for solving the BVP, so coming up with my own update scheme is quite a challenge. Nevertheless, I will have a look at that.

Thanks again, nsc