0
Comment:

← Revision 14 as of 20130116 23:23:21 ⇥
1671

Deletions are marked like this.  Additions are marked like this. 
Line 1:  Line 1: 
## page was renamed from SciComp/Hedge/Exercises/WaveEquation ## page was renamed from SciComp/HedgeExercises/WaveEquation = Wave Equation = <<TableOfContents>> == Imposing Boundary Conditions == The task of this exercise is to impose a ''time dependent Dirichlet boundary condition'' for the wave equation. You can edit the file `hedge/examples/wave/wavemin.py` for this exercise. === Guidelines === Things to do in `hedge/examples/wave/wavemin.py`: a. Define a function that returns the desired value for every point in the domain. (e.g. 1 if x>0, 0 else) a. Define a time dependent function that returns a vector which only contains the values returned by `a.` on the boundary. Use `discr.interpolate_boundary_function()` for this purpose. a. Be sure to modify the call of the `StrongWaveOperator` in order to use the new boundary conditions. Things to do in the operator `hedge/hedge/pde.py`: a. You have modified the call of the `StrongWaveOperator` so you have to adapt the initialization of the class `StrongWaveOperator` to these modifications in order to pass the dirichlet boundary condition to the operator. a. In the method `rhs` the boundary condition has to be attached to the right hand side. a. In the method `op_template` you will find the following line: `dir_bc = join_fields(u, v)`. You have to change it according to the changes you made in `rhs`. == Imposing an additional Convection (Simulating Wind) == The task of this exercise is to superpose a drift to the wave equation. Have a look at the wave equation and modify it in order to realize this drift. You will have to change the flux as well as the operator. 
Wave Equation
Contents
Imposing Boundary Conditions
The task of this exercise is to impose a time dependent Dirichlet boundary condition for the wave equation. You can edit the file hedge/examples/wave/wavemin.py for this exercise.
Guidelines
Things to do in hedge/examples/wave/wavemin.py:
Define a function that returns the desired value for every point in the domain. (e.g. 1 if x>0, 0 else)
Define a time dependent function that returns a vector which only contains the values returned by a. on the boundary. Use discr.interpolate_boundary_function() for this purpose.
Be sure to modify the call of the StrongWaveOperator in order to use the new boundary conditions.
Things to do in the operator hedge/hedge/pde.py:
You have modified the call of the StrongWaveOperator so you have to adapt the initialization of the class StrongWaveOperator to these modifications in order to pass the dirichlet boundary condition to the operator.
In the method rhs the boundary condition has to be attached to the right hand side.
In the method op_template you will find the following line: dir_bc = join_fields(u, v). You have to change it according to the changes you made in rhs.
Imposing an additional Convection (Simulating Wind)
The task of this exercise is to superpose a drift to the wave equation. Have a look at the wave equation and modify it in order to realize this drift. You will have to change the flux as well as the operator.