Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
lbmpy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pycodegen
lbmpy
Merge requests
!4
Fluctuating LB needs zero mean and unit variance random numbers
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Fluctuating LB needs zero mean and unit variance random numbers
fluctuating
into
master
Overview
0
Commits
1
Pipelines
2
Changes
1
Merged
Michael Kuron
requested to merge
fluctuating
into
master
5 years ago
Overview
0
Commits
1
Pipelines
2
Changes
1
Expand
0
0
Merge request reports
Compare
master
version 1
56d36cec
5 years ago
master (base)
and
latest version
latest version
4cd1c355
1 commit,
5 years ago
version 1
56d36cec
1 commit,
5 years ago
1 file
+
2
−
1
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
lbmpy/fluctuatinglb.py
+
2
−
1
Options
@@ -63,7 +63,8 @@ def fluctuation_correction(method, rng_generator, variances=SymbolGen("variance"
conserved_moments
=
{
sp
.
sympify
(
1
),
*
MOMENT_SYMBOLS
}
# A diagonal matrix containing the random fluctuations
random_matrix
=
sp
.
Matrix
([
0
if
m
in
conserved_moments
else
next
(
rng_generator
)
for
m
in
method
.
moments
])
random_matrix
=
sp
.
Matrix
([
0
if
m
in
conserved_moments
else
(
next
(
rng_generator
)
-
0.5
)
*
sp
.
sqrt
(
12
)
for
m
in
method
.
moments
])
random_variance
=
sp
.
diag
(
*
[
v
for
v
,
_
in
zip
(
iter
(
variances
),
method
.
moments
)])
# corrections are applied in real space hence we need to convert to real space here
Loading