Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TurTLE
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
TurTLE
TurTLE
Commits
407d3044
Commit
407d3044
authored
5 years ago
by
Cristian Lalescu
Browse files
Options
Downloads
Patches
Plain Diff
add comment on seeding the random numbers for the kraichnan field
parent
a11e94f0
No related branches found
No related tags found
No related merge requests found
Pipeline
#64580
passed
5 years ago
Stage: build
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
cpp/full_code/kraichnan_field.cpp
+8
-1
8 additions, 1 deletion
cpp/full_code/kraichnan_field.cpp
with
8 additions
and
1 deletion
cpp/full_code/kraichnan_field.cpp
+
8
−
1
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
());
...
...
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