Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
f6f29a30
Commit
f6f29a30
authored
6 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Moved some of the velociraptor interface API into the source file.
parent
3f2d785d
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/common_io.h
+0
-6
0 additions, 6 deletions
src/common_io.h
src/engine.h
+2
-1
2 additions, 1 deletion
src/engine.h
src/velociraptor_interface.c
+73
-0
73 additions, 0 deletions
src/velociraptor_interface.c
src/velociraptor_interface.h
+8
-73
8 additions, 73 deletions
src/velociraptor_interface.h
with
83 additions
and
80 deletions
src/common_io.h
+
0
−
6
View file @
f6f29a30
...
...
@@ -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
);
...
...
This diff is collapsed.
Click to expand it.
src/engine.h
+
2
−
1
View file @
f6f29a30
...
...
@@ -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
;
...
...
This diff is collapsed.
Click to expand it.
src/velociraptor_interface.c
+
73
−
0
View file @
f6f29a30
...
...
@@ -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
,
...
...
This diff is collapsed.
Click to expand it.
src/velociraptor_interface.h
+
8
−
73
View file @
f6f29a30
...
...
@@ -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
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment