DISPATCH
extras_mod Module Reference

Template version of a module intended for adding extra features, at a level between the basic task and patch layer, and the layer of solvers. More...

Data Types

type  extras_t
 

Variables

type(extras_t), public extras
 

Detailed Description

Template version of a module intended for adding extra features, at a level between the basic task and patch layer, and the layer of solvers.

To add extra features to the code, copy this file to experiments/your_dir/, and add the extra dependencies to the Makefile (only) there.

When doing to, the sketch of module dependencies below may be useful. In particular, it shows that extras underlings, via gpatch_t, may use the list_t data type (and hence they can access the copy of the task_list pointer made available there).

The sketch also illustrates that extras underlings can at most cast a task pointer to a gpatch_t pointer, but not to an extras_t pointer (which is why generic array data needs to be stored in data types below extras_t).

                          task_list_t
                           / |  |
               experiment_t  |  |
                solver_t     |  |
                  mhd_t      |  |
                    | refine_t  |
                    |  /        |
                 extras_t       |
                 /    \         |
                /      \        |
         extras_1_t extras_2_t  |
            |     \    /        |
            |     gpatch_t      |
            |       |     \     |
            |       |      list_t
            |       |     /  |
            |      patch_t   |
            |      /   \     |
            |     /     link_t
            |    /       |
           connect_t   task_t

The extra modules needed in an experiment should be chosen and coordinated in this module, and the ones that are "below" (USEd by) this module should generally refer to array memory in patch_t, and/or to local memory allocated inside these extra modules. Only key physics effects, such as forcing, cooling or heating, ionization, etc., should be added to the patch_t module,

Modules that prepare input to the solvers should generally be called from the pre_upate() procedure, while modules that rely on results from the solver should be called from the post_update() procedure.

This module should generally NOT use the h5_mod (HDF5) module itself. h5_mod should instead be USEd from the actual extra modules that wish to use it to save ad hoc results in a standardized format.