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
Commits
4cd1c355
Commit
4cd1c355
authored
5 years ago
by
Michael Kuron
Browse files
Options
Downloads
Patches
Plain Diff
Fluctuating LB needs zero mean and unit variance random numbers
parent
1c4dfcf8
No related branches found
No related tags found
1 merge request
!4
Fluctuating LB needs zero mean and unit variance random numbers
Pipeline
#17207
passed
5 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lbmpy/fluctuatinglb.py
+2
-1
2 additions, 1 deletion
lbmpy/fluctuatinglb.py
with
2 additions
and
1 deletion
lbmpy/fluctuatinglb.py
+
2
−
1
View file @
4cd1c355
...
...
@@ -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
...
...
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