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
a15bfe22
Commit
a15bfe22
authored
Sep 08, 2016
by
Matthieu Schaller
Browse files
Improved referencing of the Gadget-2 SPH-scheme
parent
aad1163b
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/hydro/Gadget2/hydro.h
View file @
a15bfe22
...
...
@@ -19,6 +19,18 @@
#ifndef SWIFT_GADGET2_HYDRO_H
#define SWIFT_GADGET2_HYDRO_H
/**
* @file Gadget2/hydro.h
* @brief SPH interaction functions following the Gadget-2 version of SPH.
*
* The interactions computed here are the ones presented in the Gadget-2 paper
* Springel, V., MNRAS, Volume 364, Issue 4, pp. 1105-1134.
* We use the same numerical coefficients as the Gadget-2 code. When used with
* the Spline-3 kernel, the results should be equivalent to the ones obtained
* with Gadget-2 up to the rounding errors and interactions missed by the
* Gadget-2 tree-code neighbours search.
*/
#include
"adiabatic_index.h"
#include
"approx_math.h"
#include
"dimension.h"
...
...
src/hydro/Gadget2/hydro_iact.h
View file @
a15bfe22
...
...
@@ -20,18 +20,20 @@
#ifndef SWIFT_GADGET2_HYDRO_IACT_H
#define SWIFT_GADGET2_HYDRO_IACT_H
#include
"minmax.h"
/**
* @file Gadget2/hydro_iact.h
* @brief SPH interaction functions following the Gadget-2 version of SPH.
*
* The interactions computed here are the ones presented in the Gadget-2 paper
* and use the same numerical coefficients as the Gadget-2 code. When used with
* Springel, V., MNRAS, Volume 364, Issue 4, pp. 1105-1134.
* We use the same numerical coefficients as the Gadget-2 code. When used with
* the Spline-3 kernel, the results should be equivalent to the ones obtained
* with Gadget-2 up to the rounding errors and interactions missed by the
* Gadget-2 tree-code neighbours search.
*/
#include
"minmax.h"
/**
* @brief Density loop
*/
...
...
src/hydro/Gadget2/hydro_part.h
View file @
a15bfe22
...
...
@@ -19,6 +19,18 @@
#ifndef SWIFT_GADGET2_HYDRO_PART_H
#define SWIFT_GADGET2_HYDRO_PART_H
/**
* @file Gadget2/hydro_part.h
* @brief SPH interaction functions following the Gadget-2 version of SPH.
*
* The interactions computed here are the ones presented in the Gadget-2 paper
* Springel, V., MNRAS, Volume 364, Issue 4, pp. 1105-1134.
* We use the same numerical coefficients as the Gadget-2 code. When used with
* the Spline-3 kernel, the results should be equivalent to the ones obtained
* with Gadget-2 up to the rounding errors and interactions missed by the
* Gadget-2 tree-code neighbours search.
*/
#include
"cooling_struct.h"
/* Extra particle data not needed during the SPH loops over neighbours. */
...
...
src/hydro/Minimal/hydro.h
View file @
a15bfe22
...
...
@@ -29,9 +29,8 @@
* term is implemented.
*
* This corresponds to equations (43), (44), (45), (101), (103) and (104) with
* \f$\beta=3\f$ and \f$\alpha_u=0\f$ of
* Price, D., Journal of Computational Physics, 2012, Volume 231, Issue 3,
* pp. 759-794.
* \f$\beta=3\f$ and \f$\alpha_u=0\f$ of Price, D., Journal of Computational
* Physics, 2012, Volume 231, Issue 3, pp. 759-794.
*/
#include
"adiabatic_index.h"
...
...
src/hydro/Minimal/hydro_iact.h
View file @
a15bfe22
...
...
@@ -28,9 +28,8 @@
* term is implemented.
*
* This corresponds to equations (43), (44), (45), (101), (103) and (104) with
* \f$\beta=3\f$ and \f$\alpha_u=0\f$ of
* Price, D., Journal of Computational Physics, 2012, Volume 231, Issue 3,
* pp. 759-794.
* \f$\beta=3\f$ and \f$\alpha_u=0\f$ of Price, D., Journal of Computational
* Physics, 2012, Volume 231, Issue 3, pp. 759-794.
*/
#include
"adiabatic_index.h"
...
...
src/hydro/Minimal/hydro_part.h
View file @
a15bfe22
...
...
@@ -28,9 +28,8 @@
* term is implemented.
*
* This corresponds to equations (43), (44), (45), (101), (103) and (104) with
* \f$\beta=3\f$ and \f$\alpha_u=0\f$ of
* Price, D., Journal of Computational Physics, 2012, Volume 231, Issue 3,
* pp. 759-794.
* \f$\beta=3\f$ and \f$\alpha_u=0\f$ of Price, D., Journal of Computational
* Physics, 2012, Volume 231, Issue 3, pp. 759-794.
*/
#include
"cooling_struct.h"
...
...
@@ -44,13 +43,14 @@
*/
struct
xpart
{
float
x_diff
[
3
];
/*!
<
Offset between current position and position at last
tree rebuild. */
/*! Offset between current position and position at last
tree rebuild. */
float
x_diff
[
3
];
float
v_full
[
3
];
/*!< Velocity at the last full step. */
/*! Velocity at the last full step. */
float
v_full
[
3
];
struct
cooling_xpart_data
cooling_
data
;
/*!< Additional data used to record cooling information */
/*! Additional data used to record cooling information */
struct
cooling_
xpart_data
cooling_data
;
}
SWIFT_STRUCT_ALIGN
;
...
...
@@ -63,27 +63,38 @@ struct xpart {
*/
struct
part
{
double
x
[
3
];
/*!< Particle position. */
/*! Particle position. */
double
x
[
3
];
float
v
[
3
];
/*!< Particle predicted velocity. */
/*! Particle predicted velocity. */
float
v
[
3
];
float
a_hydro
[
3
];
/*!< Particle acceleration. */
/*! Particle acceleration. */
float
a_hydro
[
3
];
float
mass
;
/*!< Particle mass. */
/*! Particle mass. */
float
mass
;
float
h
;
/*!< Particle smoothing length. */
/*! Particle smoothing length. */
float
h
;
int
ti_begin
;
/*!< Time at the beginning of time-step. */
/*! Time at the beginning of time-step. */
int
ti_begin
;
int
ti_end
;
/*!< Time at the end of time-step. */
/*! Time at the end of time-step. */
int
ti_end
;
float
u
;
/*!< Particle internal energy. */
/*! Particle internal energy. */
float
u
;
float
u_dt
;
/*!< Time derivative of the internal energy. */
/*! Time derivative of the internal energy. */
float
u_dt
;
float
rho
;
/*!< Particle density. */
/*! Particle density. */
float
rho
;
float
rho_dh
;
/*!< Derivative of density with respect to h */
/*! Derivative of density with respect to h */
float
rho_dh
;
/* Store density/force specific stuff. */
union
{
...
...
@@ -97,10 +108,12 @@ struct part {
*/
struct
{
float
wcount
;
/*!< Neighbour number count. */
/*! Neighbour number count. */
float
wcount
;
/*! Derivative of the neighbour number with respect to h. */
float
wcount_dh
;
float
wcount_dh
;
/*!< Derivative of the neighbour number with respect to
h. */
}
density
;
/**
...
...
@@ -112,19 +125,24 @@ struct part {
*/
struct
{
float
pressure
;
/*!< Particle pressure. */
/*! Particle pressure. */
float
pressure
;
float
v_sig
;
/*!< Particle signal velocity */
/*! Particle signal velocity */
float
v_sig
;
float
h_dt
;
/*!< Time derivative of smoothing length */
/*! Time derivative of smoothing length */
float
h_dt
;
}
force
;
};
long
long
id
;
/*!< Particle unique ID. */
/*! Particle unique ID. */
long
long
id
;
struct
gpart
*
gpart
;
/*!< Pointer to corresponding gravity part. */
/*! Pointer to corresponding gravity part. */
struct
gpart
*
gpart
;
}
__attribute__
((
aligned
(
part_align
)))
;
}
SWIFT_STRUCT_ALIGN
;
#endif
/* SWIFT_MINIMAL_HYDRO_PART_H */
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