Skip to content
GitLab
Menu
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
7df88c0b
Commit
7df88c0b
authored
Feb 28, 2017
by
Bert Vandenbroucke
Browse files
Added an option to disable particle movement in GIZMO_SPH.
parent
c33df916
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/const.h
View file @
7df88c0b
...
...
@@ -55,6 +55,10 @@
#define SLOPE_LIMITER_PER_FACE
#define SLOPE_LIMITER_CELL_WIDE
/* Options to control the movement of particles for GIZMO_SPH. */
/* This option disables particle movement */
#define GIZMO_FIX_PARTICLES
/* Source terms */
#define SOURCETERMS_NONE
//#define SOURCETERMS_SN_FEEDBACK
...
...
src/hydro/Gizmo/hydro.h
View file @
7df88c0b
...
...
@@ -79,13 +79,19 @@ __attribute__((always_inline)) INLINE static void hydro_timestep_extra(
__attribute__
((
always_inline
))
INLINE
static
void
hydro_first_init_part
(
struct
part
*
p
,
struct
xpart
*
xp
)
{
xp
->
v_full
[
0
]
=
p
->
v
[
0
];
xp
->
v_full
[
1
]
=
p
->
v
[
1
];
xp
->
v_full
[
2
]
=
p
->
v
[
2
];
p
->
primitives
.
v
[
0
]
=
p
->
v
[
0
];
p
->
primitives
.
v
[
1
]
=
p
->
v
[
1
];
p
->
primitives
.
v
[
2
]
=
p
->
v
[
2
];
#if defined(GIZMO_FIX_PARTICLES)
p
->
v
[
0
]
=
0
.;
p
->
v
[
1
]
=
0
.;
p
->
v
[
2
]
=
0
.;
#else
xp
->
v_full
[
0
]
=
p
->
v
[
0
];
xp
->
v_full
[
1
]
=
p
->
v
[
1
];
xp
->
v_full
[
2
]
=
p
->
v
[
2
];
#endif
}
/**
...
...
@@ -357,6 +363,13 @@ __attribute__((always_inline)) INLINE static void hydro_end_force(
/* Add normalization to h_dt. */
p
->
force
.
h_dt
*=
p
->
h
*
hydro_dimension_inv
;
#if defined(GIZMO_FIX_PARTICLES)
p
->
a_hydro
[
0
]
=
0
.
0
f
;
p
->
a_hydro
[
1
]
=
0
.
0
f
;
p
->
a_hydro
[
2
]
=
0
.
0
f
;
p
->
du_dt
=
0
.
0
f
;
#else
/* Set the hydro acceleration, based on the new momentum and mass */
/* NOTE: the momentum and mass are only correct for active particles, since
only active particles have received flux contributions from all their
...
...
@@ -383,6 +396,7 @@ __attribute__((always_inline)) INLINE static void hydro_end_force(
p
->
du_dt
=
0
.
0
f
;
}
#endif
}
/**
...
...
src/hydro/Gizmo/hydro_io.h
View file @
7df88c0b
...
...
@@ -23,6 +23,13 @@
#include
"io_properties.h"
#include
"riemann.h"
/* Set the description of the particle movement. */
#if defined(GIZMO_FIX_PARTICLES)
#define GIZMO_PARTICLE_MOVEMENT "Fixed particles."
#else
#define GIZMO_PARTICLE_MOVEMENT "Particles move with flow velocity."
#endif
/**
* @brief Specifies which particle fields to read from a dataset
*
...
...
@@ -155,6 +162,9 @@ void writeSPHflavour(hid_t h_grpsph) {
/* Riemann solver information */
io_write_attribute_s
(
h_grpsph
,
"Riemann solver type"
,
RIEMANN_SOLVER_IMPLEMENTATION
);
/* Particle movement information */
io_write_attribute_s
(
h_grpsph
,
"Particle movement"
,
GIZMO_PARTICLE_MOVEMENT
);
}
/**
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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