-
Josh Borrow authored
Removed some tags that were causing compilation issues Moved old RTD around. Added rtd-specific gitignore Added 'new' RTD system Added tempaltes of how to add new items to the documentation Added HydroSchemes information Added information from the onboarding guide into the online documentation, as well as adding the makefile Add Equation of State documentation Added the onboarding guide stuff Added initial conditions section Add eos documentation Removed git marks added minor change to the particle type table to make it fully consistent with SWIFT Implemented Matthieu's changes Updated information about minimalsph removed statement about balsara switch Add Cooling doc Add cooling and update structure Minor tidy up Renamed section
Josh Borrow authoredRemoved some tags that were causing compilation issues Moved old RTD around. Added rtd-specific gitignore Added 'new' RTD system Added tempaltes of how to add new items to the documentation Added HydroSchemes information Added information from the onboarding guide into the online documentation, as well as adding the makefile Add Equation of State documentation Added the onboarding guide stuff Added initial conditions section Add eos documentation Removed git marks added minor change to the particle type table to make it fully consistent with SWIFT Implemented Matthieu's changes Updated information about minimalsph removed statement about balsara switch Add Cooling doc Add cooling and update structure Minor tidy up Renamed section
addingtasks.rst 4.04 KiB
How to add a new task to SWIFT?
This tutorial will step through how to add a new task to swift. First we will go through the idealology of adding a new task to SWIFT. This will be followed by an example of how to add a task for an imposed external gravitational field to SWIFT and a task to include "cooling" to the gas particles.
In the simplest case adding a new tasks requires changes to five files, namely:
- task.h
- cell.h
- timers.h
- task.c
- engine.c
Further, implementation details of what the task will then do should be added to another file (for example runner_myviptask.c) which will contain the actual task implementation.
So now lets look at what needs to change in each of the files above, starting with task.h
task.h
Within task.h there exists a structure of the form:
/* The different task types. */
enum task_types {
task_type_none = 0,
task_type_sort,
task_type_self,
task_type_pair,
.
.
.
task_type_my_new_task,
task_type_psort,
task_type_split_cell,
task_type_count
};