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
88811430
Commit
88811430
authored
Mar 11, 2018
by
Matthieu Schaller
Browse files
Better name for the parameter governing the clean-up and rescaling of smoothing lengths.
parent
9ff194f4
Changes
5
Hide whitespace changes
Inline
Side-by-side
examples/SedovBlast_3D/sedov.yml
View file @
88811430
...
...
@@ -31,6 +31,6 @@ SPH:
# Parameters related to the initial conditions
InitialConditions
:
file_name
:
./sedov.hdf5
# The file to read
h_scaling
:
3.33
file_name
:
./sedov.hdf5
smoothing_lengt
h_scaling
:
3.33
examples/main.c
View file @
88811430
...
...
@@ -484,7 +484,7 @@ int main(int argc, char *argv[]) {
#endif
/* Common variables for restart and IC sections. */
int
clean_h_values
=
0
;
int
clean_
smoothing_lengt
h_values
=
0
;
int
flag_entropy_ICs
=
0
;
/* Work out where we will read and write restart files. */
...
...
@@ -620,8 +620,8 @@ int main(int argc, char *argv[]) {
parser_get_param_string
(
params
,
"InitialConditions:file_name"
,
ICfileName
);
const
int
replicate
=
parser_get_opt_param_int
(
params
,
"InitialConditions:replicate"
,
1
);
clean_
h_values
=
parser_get_opt_param_int
(
params
,
"InitialConditions:cleanup_
h
"
,
0
);
clean_
smoothing_length_values
=
parser_get_opt_param_int
(
params
,
"InitialConditions:cleanup_
smoothing_lengths
"
,
0
);
if
(
myrank
==
0
)
message
(
"Reading ICs from file '%s'"
,
ICfileName
);
fflush
(
stdout
);
...
...
@@ -836,7 +836,7 @@ int main(int argc, char *argv[]) {
#endif
/* Initialise the particles */
engine_init_particles
(
&
e
,
flag_entropy_ICs
,
clean_h_values
);
engine_init_particles
(
&
e
,
flag_entropy_ICs
,
clean_
smoothing_lengt
h_values
);
/* Write the state of the system before starting time integration. */
engine_dump_snapshot
(
&
e
);
...
...
examples/parameter_example.yml
View file @
88811430
...
...
@@ -81,12 +81,12 @@ Statistics:
# Parameters related to the initial conditions
InitialConditions
:
file_name
:
SedovBlast/sedov.hdf5
# The file to read
cleanup_
h
:
0
# (Optional) Clean the values of
h that are read in
. Set to 1 to activate.
h_scaling
:
1.
# (Optional) A scaling factor to apply to all smoothing lengths in the ICs.
cleanup_
smoothing_lengths
:
0
# (Optional) Clean the values of
the smoothing lengths that are read in to remove stupid values
. Set to 1 to activate.
smoothing_length_scaling
:
1.
# (Optional) A scaling factor to apply to all smoothing lengths in the ICs.
shift_x
:
0.
# (Optional) A shift to apply to all particles read from the ICs (in internal units).
shift_y
:
0.
shift_z
:
0.
replicate
:
2
# (Optional) Replicate all particles along each axis a given number of times. Default 1.
replicate
:
2
# (Optional) Replicate all particles along each axis a given
integer
number of times. Default 1.
# Parameters controlling restarts
Restarts
:
...
...
src/engine.c
View file @
88811430
...
...
@@ -3665,10 +3665,10 @@ int engine_estimate_nr_tasks(struct engine *e) {
* @brief Rebuild the space and tasks.
*
* @param e The #engine.
* @param clean_h_values Are we cleaning up the values of
h before building
* the tasks ?
* @param clean_
smoothing_lengt
h_values Are we cleaning up the values of
* the
smoothing lengths before building the
tasks ?
*/
void
engine_rebuild
(
struct
engine
*
e
,
int
clean_h_values
)
{
void
engine_rebuild
(
struct
engine
*
e
,
int
clean_
smoothing_lengt
h_values
)
{
const
ticks
tic
=
getticks
();
...
...
@@ -3679,7 +3679,7 @@ void engine_rebuild(struct engine *e, int clean_h_values) {
space_rebuild
(
e
->
s
,
e
->
verbose
);
/* Initial cleaning up session ? */
if
(
clean_h_values
)
space_sanitize
(
e
->
s
);
if
(
clean_
smoothing_lengt
h_values
)
space_sanitize
(
e
->
s
);
/* If in parallel, exchange the cell structure, top-level and neighbouring
* multipoles. */
...
...
src/space.c
View file @
88811430
...
...
@@ -2948,8 +2948,8 @@ void space_init(struct space *s, const struct swift_params *params,
}
/* Apply h scaling */
const
double
scaling
=
parser_get_opt_param_double
(
params
,
"InitialConditions:h_scaling"
,
1
.
0
);
const
double
scaling
=
parser_get_opt_param_double
(
params
,
"InitialConditions:
smoothing_lengt
h_scaling"
,
1
.
0
);
if
(
scaling
!=
1
.
0
&&
!
dry_run
)
{
message
(
"Re-scaling smoothing lengths by a factor %e"
,
scaling
);
for
(
size_t
k
=
0
;
k
<
Npart
;
k
++
)
parts
[
k
].
h
*=
scaling
;
...
...
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