Next: Solvers Up: AWFD Previous: Neumann boundary conditions

# Runtime Consistency Checks

Especially for the linear algebra members there are some builtin mechanisms, to avoid meaningless operations. A list of such invalid operations is given below

• Addition/subtraction/scalar multiplication/... of coefficients w.r.t. to wavelets with homogeneous Neumann BC and coefficients w.r.t. to wavelets with homogeneous Dirichlet BC: The underlying bases are different.

• Addition/subtraction/scalar multiplication/... of coefficients w.r.t. to Lifting Interpolets and coefficients w.r.t. ordinary Interpolets.

• Addition/subtraction/scalar multiplication/... of nodal values and multiscale coefficients.

• Direct application of operators to nodal values.

• ...

Errors like these are relatively common. Therefore, the checks are really usefull. My point of view is that it is better to get some anoying error messages than to compute meaningless results ...

In the following we successively debug a very small program which only intents to add the multiscale coefficients of the function to the multiscale coefficients of . The source code of our initial program is Examples/Wrong.cc. Make and start this code. You will get the error message:

AdaptiveData<2>::SetFunction: coordinate directions with periodic boundary conditions must be set, see AdaptiveGrid::SetPeriodicConditions

The reason for this error is we have forgotten to set the periodic coordinate directions of the adaptive grid. This is a feature of AdaptiveGrid<D>. For e.g. the refinement of such grids or the computation of multiscale coefficients of a function the periodic coordinate direction must be known. To fix this problem we have to add a call of AdaptiveGrid<D>::SetPeriodicConditions. The modified code is Examples/Wrong1.cc. Start this code. You will get the error message:

WC=bfff2b00 dimext=0
i: lift ismult | BC[0] BC[1] | XA XE
0: 0 1 | 0 0 | 0.000000e+00 1.000000e+00
1: 0 1 | 0 0 | 0.000000e+00 1.000000e+00
WC=bfff2b00 dimext=0
i: lift ismult | BC[0] BC[1] | XA XE
0: 0 1 | -1 -1 | 0.000000e+00 1.000000e+00
1: 0 1 | -1 -1 | 0.000000e+00 1.000000e+00