-
John Regan authoredJohn Regan authored
externalgravity.rst 6.53 KiB
External Gravity Task Example
An example of how to implement an external gravity task in SWIFT
An external gravitational field can be imposed in SWIFT to mimic self-gravity. This is done by assigning a gravitational force that falls as $1/ r^2$ (mathjax support to be included).
In order to do this we update the files as described in :ref:`NewTask`. For the specific case of adding an external graviational field the additions are as follows:
task.h
Code (snapshot Nov 2015):
/* The different task types. */
enum task_types {
task_type_none = 0,
task_type_sort,
task_type_self,
task_type_pair,
task_type_sub,
task_type_ghost,
task_type_kick1,
task_type_kick2,
task_type_send,
task_type_recv,
task_type_link,
task_type_grav_pp,
task_type_grav_mm,
task_type_grav_up,
task_type_grav_down,
**task_type_grav_external,**
task_type_psort,
task_type_split_cell,
task_type_count
};
Task of type - task_type_grav_external - added to list of tasks.