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
TurTLE
TurTLE
Commits
407d3044
Commit
407d3044
authored
Nov 28, 2019
by
Cristian Lalescu
Browse files
add comment on seeding the random numbers for the kraichnan field
parent
a11e94f0
Pipeline
#64580
passed with stage
in 5 minutes and 31 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
cpp/full_code/kraichnan_field.cpp
View file @
407d3044
...
...
@@ -136,12 +136,19 @@ int kraichnan_field<rnumber>::generate_random_velocity(void)
make_gaussian_random_field
(
this
->
kk
,
this
->
velocity
,
this
->
iteration
,
// not an ideal choice because resulting field sequence depends on MPI/OpenMP configuration
this
->
iteration
,
// not an ideal choice because resulting field sequence depends on MPI/OpenMP configuration
. See note below
this
->
spectrum_slope
,
this
->
spectrum_k_cutoff
,
this
->
spectrum_coefficient
*
3.
/
2.
);
// incompressibility projection factor
// this->velocity is now in Fourier space
// project divfree, requires field in Fourier space
// Note on the choice of random seed:
// If in the future the simulation will continue with a smaller number of total threads (number of processes times number of threads per process),
// then during that run some of the threads will be seeded with a seed that has already been used for a previous iteration.
// So some sequences of Fourier modes will be identical to sequences of Fourier modes that occured in the past.
// Also see implementation of "make_gaussian_random_field".
// One work-around would be to multiply "this->iteration" with 10 or so ---
// it is unlikely the simulation will be continued with less than 0.1 of the initial total number of threads.
DEBUG_MSG
(
"L2Norm before: %g
\n
"
,
this
->
velocity
->
L2norm
(
this
->
kk
));
this
->
kk
->
template
project_divfree
<
rnumber
>(
this
->
velocity
->
get_cdata
());
...
...
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