Next: Example
Up: How to use
Previous: Thorn writers
Contents
Evolution method writers
If you want to try adding a new evolution method to MoL the simplest
way is to use the generic table option to specify it completely in the
parameter file - no coding is required at all.
All the generic methods evolve the equation
 |
(part103) |
using the following algorithm for an -step method:
This method is completely specified by ( GenericIntermediateSteps) and the ( GenericAlphaCoeffs) and (GenericBetaCoeffs)
arrays. The names in parentheses give the keys in a table that MoL
will use. This table is created from the string parameter Generic_Method_Descriptor.
As an example, the standard TVD RK2 method that is implemented both in
optimized and generic form is written as
To implement this using the generic table options, use
methodoflines::MoL_Intermediate_Steps = 2
methodoflines::MoL_Num_Scratch_Levels = 1
methodoflines::Generic_Method_Descriptor = \
"GenericIntermediateSteps = 2 \
GenericAlphaCoeffs = { 1.0 0.0 0.5 0.5 } \
GenericBetaCoeffs = { 1.0 0.5 }"
The number of steps specified in the table must be the same as MoL_Intermediate_Steps, and the number of scratch levels should
be at least MoL_Intermediate_Steps - 1.
The generic methods are somewhat inefficient for use in production
runs, so it is frequently better to write an optimized version once
you are happy with the method. To do this you should
- write your code into a new file, called from the scheduler under
the alias MoL_Add,
- make certain that at each intermediate step the correct values
of cctk_time and cctk_delta_time are set in SetTime.c for mesh refinement, boundary conditions and so on,
- make certain that you check for the number of intermediate steps
in ParamCheck.c.
Next: Example
Up: How to use
Previous: Thorn writers
Contents
|