00001
00002
00012 #ifndef __GLOBALS_H__
00013 #define __GLOBALS_H__
00014
00015 #include <string>
00016
00017 #include "hydefines.h"
00018
00019 #ifdef __cplusplus
00020 extern "C" {
00021 #endif
00022
00023 #ifndef MIN
00024 #define MIN(a, b) (((a) < (b)) ? (a) : (b))
00025 #endif
00026
00027 #ifndef MAX
00028 #define MAX(a, b) (((a) < (b)) ? (b) : (a))
00029 #endif
00030
00031
00032 #ifndef M_PI
00033 #define M_PI 3.1415926535897932385
00034 #endif
00035
00036
00037 #define IO_TYPE_UNKNOWN 0
00038 #define IO_TYPE_INT 1
00039 #define IO_TYPE_FLOAT 2
00040 #define IO_TYPE_DOUBLE 3
00041 #define IO_TYPE_STRING 4
00042
00043 #define MAX_KEY_LENGTH 100
00044
00050 extern struct all_data
00051 {
00052 double sumfile[NFMAX+1][NCOLMAX][NBACK];
00065 double mgas0;
00066 double mstar0;
00067 double mdark0;
00069 double rcom[3];
00070 double vcom[3];
00072 int npart;
00074 int ngas0;
00075 int ndark0;
00077 int irun;
00078 int ifile;
00080 int ist;
00081 int iend;
00083 int ndumpspresent;
00084 int firstdump;
00085 int lastdump;
00087 int startfile;
00091 int iprog[3];
00093 double cum[NCUM][NCUM2];
00095 } all_;
00096
00097 extern struct program_data
00098 {
00099 int iflnr,iraw,ifollowpart,iinter,iprintnumbers;
00100
00101 int ncol[NBACK];
00102 int inumpersnap;
00103 } run_;
00104
00105 extern struct number_info
00106 {
00107 int ngas0, ndm0;
00108 } np_;
00109
00110 extern struct common_units
00111 {
00112 double mum,msun,yr,kpc,lunit,vunit,tunit,mfac,munit,nunit;
00113 double rhounit,enerunit,eunit,kb,Kunit;
00114 double G;
00115 double G_astro;
00116 double gamma,mproton,Xh;
00117 double tunit_in_yr;
00118 double kpcgyrtokms;
00119 } units_;
00120
00121
00122 extern struct datatypes
00123 {
00124 int itlow,ithigh,itnone,itsdone,itstar,itdark,itgas;
00125 int itgdone,itdisk,itbulge,itbndry;
00126 int itall;
00127 } types_;
00128
00129 extern struct io_header
00130 {
00131 int npart[6];
00132 double mass[6];
00133 double time;
00134 double redshift;
00135 int flag_sfr;
00136 int flag_feedback;
00137 int npartTotal[6];
00138 int flag_cooling;
00139 int num_files;
00140 double BoxSize;
00141 double Omega0;
00142 double OmegaLambda;
00143 double HubbleParam;
00144 double hubble_a;
00145 char fill[256- 6*4- 6*8- 2*8- 2*4- 6*4 - 2*4 - 4*8 - 1*8];
00146 } header_;
00147
00148 extern struct particle_data
00149 {
00150 float Pos[3];
00151 float Vel[3];
00152 float Mass;
00153 int Type;
00154 } *P;
00155
00156 extern struct sph_particle_data
00157 {
00158 float U;
00159 float h;
00160 float Z;
00161 float FeMass;
00162 float MgMass;
00163 float Rho;
00164 float temperature;
00165
00166 float AcEntropy;
00167 } *SphP;
00168
00169 extern struct star_particle_data
00170 {
00171 float InitMass;
00172 float Z;
00173 float FeMass;
00174 float MgMass;
00175 float Formation_time;
00176 int MyP;
00177 } *StarP;
00178
00179
00180 extern struct all_particle_data
00181 {
00182 float r[NMAXAR][3],v[NMAXAR][3],tmass[NMAXAR],ener[NMAXAR];
00183 float har[NMAXAR],rho[NMAXAR],zmet[NMAXAR],arr[NMAXAR],fe[NMAXAR];
00184 float mg[NMAXAR], temperature[NMAXAR];
00185 float AcEntropy[NMAXAR];
00186 #ifndef LOW_MEMORY_MODE
00187 float lumin[8][NMAXAR];
00190 #endif
00191
00192 int itype[NMAXAR];
00193 int id[NMAXAR];
00194 } part_;
00195
00200 extern struct parameterfile_data{
00201 char starmap_x[24], starmap_y[24];
00202 char starmap_binval[24];
00203
00204 double fit_radmin;
00205 double fit_radmax;
00206 double SB_radmax;
00208 double cmd_min_age, cmd_max_age;
00209 double cmd_min_Z, cmd_max_Z;
00210
00211 double lf_min_age, lf_max_age;
00212 double lf_min_Z, lf_max_Z;
00213
00214 double cmd_xmin, cmd_xmax, cmd_ymin, cmd_ymax;
00215
00216 double starmap_xmin, starmap_xmax, starmap_ymin, starmap_ymax;
00217 double starmap_convol_sigma_x,starmap_convol_sigma_y;
00218
00219 double usergalage;
00223 double hubbleparameter;
00224 double lf_xmin;
00225 double lf_xmax;
00226
00227
00228 char cmd_mag[8], cmd_mag_x[8], cmd_mag_y[8];
00229
00230 char pgp_terminal[8];
00231
00232 int fit_nbins;
00233
00234 int snapformat, filespersnap;
00235 int read_sumfiles, cmd_contours, cmd_cont_lab, cmd_logscale;
00236
00237 int starmap_nx, starmap_ny, starmap_type;
00238
00239 int startf_number;
00241 int lf_nstep;
00242 } param_;
00243
00244 extern int read_first_datafile;
00245 extern int *Id;
00246
00247 extern int NumPart, Ngas, Nstar;
00248
00249 extern double Time, Redshift;
00250
00251
00252
00253
00254
00255 extern struct nbody_general_data
00256 {
00257 float as;
00258 } *NBG;
00259
00260 extern struct nbody_particle_data
00261 {
00262 float bodys, rhos, xns;
00263 float xs[3];
00264 float vs[3];
00265 float phi;
00266 int name;
00267 } *NBD;
00268
00269 extern struct sunmag_data
00270 {
00271 double sun[8];
00272 } sunmag_;
00273
00275 extern struct lumfunc_data
00276 {
00277 double xmin;
00278 double xmax;
00279 int nsteps;
00281 float * seps;
00282 float * lf;
00283 } lumfunc;
00284
00285 extern struct starmap_data
00286 {
00287 double xlow;
00288 double xhigh;
00289 } smd;
00290
00291
00292 class Cimf;
00293 extern Cimf * imf;
00294
00295 class CMainWindow;
00296 extern CMainWindow *mainWin;
00297
00298
00299
00300
00301 class QSettings;
00302 extern QSettings *settings;
00303
00304 #ifdef __cplusplus
00305 }
00306 #endif
00307
00308
00309 #endif