The FARGO_THORIN code developer's guide
|
Contains the functions interfacing FARGO with the REBOUND package. More...
#include "fargo.h"
Go to the source code of this file.
Functions | |
int | ResolveCollisions (struct reb_simulation *rsim, struct reb_collision coll) |
If the REBOUND collision search is successful, this function merges the bodies, outputs information about the merger event and reorganises the particle list. More... | |
void | DiscardParticlesDist (struct reb_simulation *rsim, real dt) |
A simple discard routine which looks for planets that were scattered/migrated away from the FARGO grid. More... | |
void | SetupIntegratorParams (struct reb_simulation *rsim) |
Fills the rebound simulation structure with parameters inherited from FARGO. More... | |
struct reb_simulation * | SetupReboundSimulation (PlanetarySystem *sys, char *plfile) |
Initialises a rebound simulation coupled with FARGO. More... | |
void | AdvanceSystemRebound (PlanetarySystem *sys, struct reb_simulation *rsim, real dt) |
Performs an integration step of the N-body problem. More... | |
void | SynchronizeFargoRebound (PlanetarySystem *sys, struct reb_simulation *rsim) |
Synchronises the planetary system between the REBOUND integration and the FARGO simulation. More... | |
void | MinStepForRebound (struct reb_simulation *rsim) |
A simple time step restriction in order not to miss a collision. More... | |
void | OutputElements (struct reb_simulation *rsim) |
Calculates and outputs the orbital elements. More... | |
void | OutputNbodySimulation (int nout, struct reb_simulation *rsim) |
Stores the entire Rebound simulation in a binary file. More... | |
struct reb_simulation * | RestartReboundSimulation (PlanetarySystem *sys, int nrestart) |
Part of the restart process. More... | |
Variables | |
real | OmegaFrame |
boolean | Corotating |
Contains the functions interfacing FARGO with the REBOUND package.
The default setup uses the IAS15 integrator to propagate the planets in time and employs the direct collision search with merging, if turned on. This can be easily reprogrammed if needed.
Note: This version has no test particles, rsim->N could be used directly as the loop limit. But rsim->N_active is used instead so that test particles could be easily implemented. If rsim->N is used, it indicates that a loop would in principle handle test particles as well.
Copyright (c) 2017 Ondřej Chrenko. See the LICENSE file of the distribution.
Definition in file ReboundInterface.c.
void AdvanceSystemRebound | ( | PlanetarySystem * | sys, |
struct reb_simulation * | rsim, | ||
real | dt | ||
) |
Performs an integration step of the N-body problem.
Definition at line 197 of file ReboundInterface.c.
References DiscardParticlesDist(), planetary_system::mass, and PhysicalTime.
void DiscardParticlesDist | ( | struct reb_simulation * | rsim, |
real | dt | ||
) |
A simple discard routine which looks for planets that were scattered/migrated away from the FARGO grid.
Must be called from the heliocentric frame.
Definition at line 75 of file ReboundInterface.c.
References CPU_Master, discard, masterprint(), NO, PhysicalTime, RMAX, and YES.
Referenced by AdvanceSystemRebound().
void MinStepForRebound | ( | struct reb_simulation * | rsim | ) |
A simple time step restriction in order not to miss a collision.
This should be in principle always be overridden by the IAS15 time step division.
Definition at line 281 of file ReboundInterface.c.
References invdtreb_sq.
void OutputElements | ( | struct reb_simulation * | rsim | ) |
Calculates and outputs the orbital elements.
Definition at line 309 of file ReboundInterface.c.
References CPU_Number, CPU_Rank, G, PhysicalTime, and plout.
void OutputNbodySimulation | ( | int | nout, |
struct reb_simulation * | rsim | ||
) |
Stores the entire Rebound simulation in a binary file.
Useful for restarts.
Definition at line 328 of file ReboundInterface.c.
References CPU_Master, and OUTPUTDIR.
int ResolveCollisions | ( | struct reb_simulation * | rsim, |
struct reb_collision | coll | ||
) |
If the REBOUND collision search is successful, this function merges the bodies, outputs information about the merger event and reorganises the particle list.
Definition at line 33 of file ReboundInterface.c.
References CPU_Master, masterprint(), and mergers.
Referenced by SetupIntegratorParams().
struct reb_simulation* RestartReboundSimulation | ( | PlanetarySystem * | sys, |
int | nrestart | ||
) |
Part of the restart process.
Definition at line 343 of file ReboundInterface.c.
References ACCRETIONRATE, Collisions, CPU_Master, discard, FeelDisk, fopenp(), mergers, OUTPUTDIR, PhysicalTime, plout, SetupIntegratorParams(), and YES.
void SetupIntegratorParams | ( | struct reb_simulation * | rsim | ) |
Fills the rebound simulation structure with parameters inherited from FARGO.
The integrator type can be easily changed from here.
Definition at line 111 of file ReboundInterface.c.
References Collisions, IAS15MINDT, IAS15PRECISSION, ResolveCollisions(), and YES.
Referenced by RestartReboundSimulation(), and SetupReboundSimulation().
struct reb_simulation* SetupReboundSimulation | ( | PlanetarySystem * | sys, |
char * | plfile | ||
) |
Initialises a rebound simulation coupled with FARGO.
Definition at line 127 of file ReboundInterface.c.
References a, ACCRETIONRATE, Collisions, discard, FeelDisk, fopenp(), G, masterprint(), mergers, OUTPUTDIR, PI, PLANETARYDENSITY, plout, prs_exit(), RHO2CGS, SetupIntegratorParams(), and YES.
void SynchronizeFargoRebound | ( | PlanetarySystem * | sys, |
struct reb_simulation * | rsim | ||
) |
Synchronises the planetary system between the REBOUND integration and the FARGO simulation.
Definition at line 250 of file ReboundInterface.c.
References NO, prs_exit(), and YES.
boolean Corotating |
Definition at line 30 of file Interpret.c.