Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SWIFT
SWIFTsim
Commits
9924305c
Commit
9924305c
authored
Oct 09, 2018
by
Matthieu Schaller
Browse files
Moved some of the velociraptor interface API into the source file.
parent
d4dc8462
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/common_io.h
View file @
9924305c
...
...
@@ -56,12 +56,6 @@ enum IO_DATA_TYPE {
CHAR
};
/**
* @brief The different formats for when to run structure finding.
*
*/
enum
io_stf_output_format
{
io_stf_steps
=
0
,
io_stf_time
};
#if defined(HAVE_HDF5)
hid_t
io_hdf5_type
(
enum
IO_DATA_TYPE
type
);
...
...
src/engine.h
View file @
9924305c
...
...
@@ -49,6 +49,7 @@
#include
"space.h"
#include
"task.h"
#include
"units.h"
#include
"velociraptor_interface.h"
/**
* @brief The different policies the #engine can follow.
...
...
@@ -230,7 +231,7 @@ struct engine {
int
snapshot_output_count
;
/* Structure finding information */
in
t
stf_output_freq_format
;
enum
io_stf_output_forma
t
stf_output_freq_format
;
int
delta_step_stf
;
double
a_first_stf_output
;
double
time_first_stf_output
;
...
...
src/velociraptor_interface.c
View file @
9924305c
...
...
@@ -35,6 +35,79 @@
#ifdef HAVE_VELOCIRAPTOR
/* Structure for passing cosmological information to VELOCIraptor. */
struct
cosmoinfo
{
/*! Current expansion factor of the Universe. (cosmology.a) */
double
atime
;
/*! Reduced Hubble constant (H0 / (100km/s/Mpc) (cosmology.h) */
double
littleh
;
/*! Matter density parameter (cosmology.Omega_m) */
double
Omega_m
;
/*! Baryon density parameter (cosmology.Omega_b) */
double
Omega_b
;
/*! Radiation constant density parameter (cosmology.Omega_lambda) */
double
Omega_Lambda
;
/*! Dark matter density parameter (cosmology.Omega_m - cosmology.Omega_b) */
double
Omega_cdm
;
/*! Dark-energy equation of state at the current time (cosmology.w)*/
double
w_de
;
};
/* Structure for passing unit information to VELOCIraptor. */
struct
unitinfo
{
/* Length conversion factor to kpc. */
double
lengthtokpc
;
/* Velocity conversion factor to km/s. */
double
velocitytokms
;
/* Mass conversion factor to solar masses. */
double
masstosolarmass
;
/* Potential conversion factor. */
double
energyperunitmass
;
/*! Newton's gravitationl constant (phys_const.const_newton_G)*/
double
gravity
;
/*! Hubble constant at the current redshift (cosmology.H) */
double
hubbleunit
;
};
/* Structure to hold the location of a top-level cell. */
struct
cell_loc
{
/* Coordinates x,y,z */
double
loc
[
3
];
};
/* Structure for passing simulation information to VELOCIraptor. */
struct
siminfo
{
double
period
,
zoomhigresolutionmass
,
interparticlespacing
,
spacedimension
[
3
];
/* Number of top-cells. */
int
numcells
;
/*! Locations of top-level cells. */
struct
cell_loc
*
cell_loc
;
/*! Top-level cell width. */
double
cellwidth
[
3
];
/*! Inverse of the top-level cell width. */
double
icellwidth
[
3
];
int
icosmologicalsim
;
};
/* VELOCIraptor interface. */
int
InitVelociraptor
(
char
*
config_name
,
char
*
output_name
,
struct
cosmoinfo
cosmo_info
,
struct
unitinfo
unit_info
,
...
...
src/velociraptor_interface.h
View file @
9924305c
...
...
@@ -22,81 +22,16 @@
/* Config parameters. */
#include
"../config.h"
/* Forward declaration */
struct
engine
;
/* Structure for passing cosmological information to VELOCIraptor. */
struct
cosmoinfo
{
/*! Current expansion factor of the Universe. (cosmology.a) */
double
atime
;
/*! Reduced Hubble constant (H0 / (100km/s/Mpc) (cosmology.h) */
double
littleh
;
/*! Matter density parameter (cosmology.Omega_m) */
double
Omega_m
;
/*! Baryon density parameter (cosmology.Omega_b) */
double
Omega_b
;
/*! Radiation constant density parameter (cosmology.Omega_lambda) */
double
Omega_Lambda
;
/*! Dark matter density parameter (cosmology.Omega_m - cosmology.Omega_b) */
double
Omega_cdm
;
/*! Dark-energy equation of state at the current time (cosmology.w)*/
double
w_de
;
/**
* @brief The different formats for when to run structure finding.
*/
enum
io_stf_output_format
{
io_stf_steps
=
0
,
/*!< Output every N steps */
io_stf_time
/*!< Output at fixed time intervals */
};
/* Structure for passing unit information to VELOCIraptor. */
struct
unitinfo
{
/* Length conversion factor to kpc. */
double
lengthtokpc
;
/* Velocity conversion factor to km/s. */
double
velocitytokms
;
/* Mass conversion factor to solar masses. */
double
masstosolarmass
;
/* Potential conversion factor. */
double
energyperunitmass
;
/*! Newton's gravitationl constant (phys_const.const_newton_G)*/
double
gravity
;
/*! Hubble constant at the current redshift (cosmology.H) */
double
hubbleunit
;
};
/* Structure to hold the location of a top-level cell. */
struct
cell_loc
{
/* Coordinates x,y,z */
double
loc
[
3
];
};
/* Structure for passing simulation information to VELOCIraptor. */
struct
siminfo
{
double
period
,
zoomhigresolutionmass
,
interparticlespacing
,
spacedimension
[
3
];
/* Number of top-cells. */
int
numcells
;
/*! Locations of top-level cells. */
struct
cell_loc
*
cell_loc
;
/*! Top-level cell width. */
double
cellwidth
[
3
];
/*! Inverse of the top-level cell width. */
double
icellwidth
[
3
];
int
icosmologicalsim
;
};
/* Forward declaration */
struct
engine
;
/* VELOCIraptor wrapper functions. */
void
velociraptor_init
(
struct
engine
*
e
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment