Forum Message

 

 

We have moved the forum to https://forum.ngsolve.org . This is an archived version of the topics until 05/05/23. All the topics were moved to the new forum and conversations can be continued there. This forum is just kept as legacy to not invalidate old links. If you want to continue a conversation just look for the topic in the new forum.

Notice

The forum is in read only mode.

start velocity on boundary

More
4 years 1 month ago #2526 by nsc
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?
More
4 years 4 weeks ago #2530 by mneunteufel
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
Code:
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.

Best,
Michael
The following user(s) said Thank You: nsc
More
4 years 2 weeks ago #2569 by nsc
Replied by nsc on topic start velocity on boundary
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
Time to create page: 0.150 seconds