The FARGO_THORIN code developer's guide
 All Data Structures Files Functions Variables Typedefs Macros
types.h
Go to the documentation of this file.
1 /** \file types.h
2 
3 Definition of the structures used in the FARGO code.
4 
5 @author THORIN modifications by
6 Ondřej Chrenko <chrenko@sirrah.troja.mff.cuni.cz>, Copyright (C) 2017;
7 original code by Frédéric Masset
8 
9 */
10 
11 #include <sys/times.h>
12 
13 /** The boolean type will be used mainly for the variables
14  corresponding to the command line switches */
15 typedef int boolean;
16 /** Definition of the type 'real' used throughout the code. You can
17  force FARGO to work in single precision by redefining real to
18  float here. This is an untested feature of FARGO, however, and in
19  practice it should be of little use. */
20 typedef double real;
21 
22 /** Set of two reals. It is used whenever a set of two reals is needed,
23 and it usually represents a vector in the (x,y) plane (e.g., a %force), but not
24 only: it is for instance used to store the mass inside and outside the orbit
25 in MassInOut(). */
26 struct pair {
29 };
30 
31 typedef struct pair Pair;
32 
33 /** A structure used to store any scalar fied on the computational
34 domain. In addition to the size (Nrad*Nsec) and field pointer, it also
35 has a name, which is used by WritePolarGrid () to name appropriately
36 the output file, automatically. */
37 struct polargrid {
38  int Nrad; /**< Radial size of the grid, in number of zones */
39  int Nsec; /**< Azimuthal size of the grid, in number of zones */
40  real *Field; /** Pointer to the array of Nrad*Nsec reals (e.g., density, etc.) */
41  char *Name; /**< Name of the PolarGrid (can be "dens", "vrad", "vtheta" or "label"). */
42 };
43 
44 typedef struct polargrid PolarGrid;
45 
46 #define YES 1
47 #define NO 0
48 #define REAL 1
49 #define INT 0
50 #define STRING 2
51 #define SINE 0
52 #define COSINE 1
53 #define ABSCISSA 0
54 #define ORDINATE 1
55 #define HEIGHT 2
56 #define INF 0
57 #define SUP 1
58 #define GET 0
59 #define MARK 1
60 #define FREQUENCY 2
61 #define COM_DENSITY 0
62 #define COM_VRAD 1
63 #define COM_VTHETA 2
64 
65 #define MAX1D 16384
66 
67 #define MAXPLANETS 10
68 
69 /** The Param structure handles the parameters of the parameter
70 file. It allows to associate the values found in the file to the
71 strings defining the parameters, and ultimately to the global
72 variables associated to these strings. It is used by the function
73 var(). */
74 struct param {
75  char name[80]; /**< Name of the parameter. This is the (case insensitive) string found in the parameter file */
76  int type; /**< Type of the parameter (e.g. INT, REAL, or STRING), see var.c */
77  char *variable; /**< A pointer to the corresponding variable */
78  int read; /**< This variable is set to YES if and only if the parameter has been found in the parameter file */
79  int necessary; /**< Tell whether defining the parameter is optional or mandatory. */
80 };
81 
82 typedef struct param Param;
83 
84 /** This structure is used for monitoring CPU time usage. It is used
85  only if -t is specified on the command line. */
86 struct timeprocess {
87  char name[80];
88  clock_t clicks;
89 };
90 
91 typedef struct timeprocess TimeProcess;
92 
93 /** Contains all the information about a planetary system at a given
94  instant in time.
95  #THORIN: 3rd dimension added, acceleration from the disk added. */
97  int nb; /**< Number of planets */
98  real *mass; /**< Masses of the planets */
99  real *x; /**< x-coordinate of the planets */
100  real *y; /**< y-coordinate of the planets */
101  real *z; /**< z-coordinate of the planets */
102  real *vx; /**< x-coordinate of the planets'velocities */
103  real *vy; /**< y-coordinate of the planets'velocities */
104  real *vz; /**< z-coordinate of the planets'velocities */
105  real *ax; /**< ax-coordinate of the planets' acceleration from the disk */
106  real *ay; /**< ay-coordinate of the planets' acceleration from the disk */
107  real *az; /**< az-coordinate of the planets' acceleration from the disk */
108  real *acc; /**< The planets' accretion times^-1 */
109  char **name; /**< The planets' names */
110  boolean *FeelDisk; /**< For each planet tells if it feels the disk (ie migrates) */
111  boolean *FeelOthers; /**< For each planet tells if it feels
112  the other planet's gravity */
113 };
114 
double real
Definition of the type 'real' used throughout the code.
Definition: types.h:20
boolean * FeelOthers
For each planet tells if it feels the other planet's gravity.
Definition: types.h:111
char * Name
Pointer to the array of Nrad*Nsec reals (e.g., density, etc.)
Definition: types.h:41
boolean * FeelDisk
For each planet tells if it feels the disk (ie migrates)
Definition: types.h:110
char name[80]
Definition: types.h:87
real * z
z-coordinate of the planets
Definition: types.h:101
This structure is used for monitoring CPU time usage.
Definition: types.h:86
int boolean
The boolean type will be used mainly for the variables corresponding to the command line switches...
Definition: types.h:15
real * vz
z-coordinate of the planets'velocities
Definition: types.h:104
real * x
x-coordinate of the planets
Definition: types.h:99
real * y
y-coordinate of the planets
Definition: types.h:100
A structure used to store any scalar fied on the computational domain.
Definition: types.h:37
real * vx
x-coordinate of the planets'velocities
Definition: types.h:102
real * Field
Definition: types.h:40
real * mass
Masses of the planets.
Definition: types.h:98
int Nrad
Radial size of the grid, in number of zones.
Definition: types.h:38
Contains all the information about a planetary system at a given instant in time. ...
Definition: types.h:96
int nb
Number of planets.
Definition: types.h:97
int necessary
Tell whether defining the parameter is optional or mandatory.
Definition: types.h:79
real x
Definition: types.h:27
char * variable
A pointer to the corresponding variable.
Definition: types.h:77
real * acc
The planets' accretion times^-1.
Definition: types.h:108
char name[80]
Name of the parameter.
Definition: types.h:75
The Param structure handles the parameters of the parameter file.
Definition: types.h:74
real * ay
ay-coordinate of the planets' acceleration from the disk
Definition: types.h:106
real * vy
y-coordinate of the planets'velocities
Definition: types.h:103
real y
Definition: types.h:28
int read
This variable is set to YES if and only if the parameter has been found in the parameter file...
Definition: types.h:78
int Nsec
Azimuthal size of the grid, in number of zones.
Definition: types.h:39
Set of two reals.
Definition: types.h:26
real * ax
ax-coordinate of the planets' acceleration from the disk
Definition: types.h:105
int type
Type of the parameter (e.g.
Definition: types.h:76
real * az
az-coordinate of the planets' acceleration from the disk
Definition: types.h:107
clock_t clicks
Definition: types.h:88
char ** name
The planets' names.
Definition: types.h:109