Differences between revisions 13 and 14
Revision 13 as of 2012-10-19 16:21:27
Size: 0
Editor: 46
Comment:
Revision 14 as of 2013-01-16 23:23:21
Size: 1671
Comment:
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/wave-min.py` for this exercise.

=== Guidelines ===
Things to do in `hedge/examples/wave/wave-min.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

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/wave-min.py for this exercise.

Guidelines

Things to do in hedge/examples/wave/wave-min.py:

  1. Define a function that returns the desired value for every point in the domain. (e.g. 1 if x>0, 0 else)

  2. 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.

  3. 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:

  1. 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.

  2. In the method rhs the boundary condition has to be attached to the right hand side.

  3. 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.

Hedge/Exercises/WaveEquation (last edited 2013-01-16 23:23:21 by AndreasKloeckner)