Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
waLBerla
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
Martin Bauer
waLBerla
Commits
d93bbd2b
Commit
d93bbd2b
authored
5 years ago
by
Martin Bauer
Browse files
Options
Downloads
Patches
Plain Diff
Optional compiled-in boundaries
parent
aeff901c
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
apps/benchmarks/UniformGridGenerated/UniformGridGenerated.cpp
+2
-2
2 additions, 2 deletions
.../benchmarks/UniformGridGenerated/UniformGridGenerated.cpp
apps/benchmarks/UniformGridGenerated/UniformGridGenerated.py
+33
-11
33 additions, 11 deletions
apps/benchmarks/UniformGridGenerated/UniformGridGenerated.py
with
35 additions
and
13 deletions
apps/benchmarks/UniformGridGenerated/UniformGridGenerated.cpp
+
2
−
2
View file @
d93bbd2b
...
...
@@ -107,7 +107,7 @@ int main( int argc, char **argv )
{
timeLoop
.
add
()
<<
BeforeFunction
(
directComm
?
F
(
twoFieldCommDirect
)
:
F
(
twoFieldComm
),
"communication"
)
<<
Sweep
(
pystencils
::
GenLbKernel
(
pdfFieldId
,
omega
),
"LB stream & collide1"
);
timeLoop
.
add
()
<<
BeforeFunction
(
directComm
?
F
(
twoFieldCommDirect
)
:
F
(
twoFieldComm
),
"communication"
)
timeLoop
.
add
()
<<
BeforeFunction
(
directComm
?
F
(
twoFieldCommDirect
)
:
F
(
twoFieldComm
),
"communication"
)
<<
Sweep
(
pystencils
::
GenLbKernel
(
pdfFieldId
,
omega
),
"LB stream & collide2"
);
}
else
if
(
timeStepMode
==
"twoFieldKernelOnly"
)
{
...
...
@@ -122,7 +122,7 @@ int main( int argc, char **argv )
timeLoop
.
add
()
<<
Sweep
(
pystencils
::
GenLbKernelAAEven
(
pdfFieldId
,
omega
),
"AA Even"
);
timeLoop
.
add
()
<<
Sweep
(
pystencils
::
GenLbKernelAAOdd
(
pdfFieldId
,
omega
),
"AA Odd"
);
}
else
{
WALBERLA_ABORT
(
"Invalid value for timeStepMode
"
);
WALBERLA_ABORT
(
"Invalid value for timeStepMode"
);
}
...
...
This diff is collapsed.
Click to expand it.
apps/benchmarks/UniformGridGenerated/UniformGridGenerated.py
+
33
−
11
View file @
d93bbd2b
import
sympy
as
sp
import
pystencils
as
ps
from
lbmpy.creationfunctions
import
create_lb_update_rule
from
lbmpy.creationfunctions
import
create_lb_update_rule
,
create_lb_collision_rule
from
pystencils_walberla
import
CodeGeneration
,
generate_pack_info_from_kernel
,
generate_sweep
,
generate_mpidtype_info_from_kernel
from
lbmpy.macroscopic_value_kernels
import
macroscopic_values_getter
,
macroscopic_values_setter
from
lbmpy.fieldaccess
import
AAEvenTimeStepAccessor
,
AAOddTimeStepAccessor
...
...
@@ -117,16 +117,38 @@ with CodeGeneration() as ctx:
'
split
'
:
opts
[
'
two_field_split
'
],
'
cse_global
'
:
opts
[
'
two_field_cse_global
'
],
'
cse_pdfs
'
:
opts
[
'
two_field_cse_pdfs
'
]},
**
options
)
update_rule_aa_even
=
create_lb_update_rule
(
kernel_type
=
AAEvenTimeStepAccessor
(),
optimization
=
{
'
symbolic_field
'
:
pdfs
,
'
split
'
:
opts
[
'
aa_even_split
'
],
'
cse_global
'
:
opts
[
'
aa_even_cse_global
'
],
'
cse_pdfs
'
:
opts
[
'
aa_even_cse_pdfs
'
]},
**
options
)
update_rule_aa_odd
=
create_lb_update_rule
(
kernel_type
=
AAOddTimeStepAccessor
(),
optimization
=
{
'
symbolic_field
'
:
pdfs
,
'
split
'
:
opts
[
'
aa_odd_split
'
],
'
cse_global
'
:
opts
[
'
aa_odd_cse_global
'
],
'
cse_pdfs
'
:
opts
[
'
aa_odd_cse_pdfs
'
]},
**
options
)
include_boundaries
=
True
if
include_boundaries
:
from
lbmpy.boundaries
import
NoSlip
,
UBB
from
lbmpy.boundaries.boundaries_in_kernel
import
update_rule_with_push_boundaries
from
collections
import
OrderedDict
boundaries
=
OrderedDict
((
((
1
,
0
,
0
),
NoSlip
()),
((
-
1
,
0
,
0
),
NoSlip
()),
((
0
,
1
,
0
),
NoSlip
()),
((
0
,
-
1
,
0
),
NoSlip
()),
((
0
,
0
,
1
),
UBB
([
0.05
,
0
,
0
])),
((
0
,
0
,
-
1
),
NoSlip
()),
))
cr_even
=
create_lb_collision_rule
(
stencil
=
"
D3Q19
"
,
compressible
=
False
,
optimization
=
{
'
cse_global
'
:
opts
[
'
aa_even_cse_global
'
],
'
cse_pdfs
'
:
opts
[
'
aa_even_cse_pdfs
'
]})
cr_odd
=
create_lb_collision_rule
(
stencil
=
"
D3Q19
"
,
compressible
=
False
,
optimization
=
{
'
cse_global
'
:
opts
[
'
aa_odd_cse_global
'
],
'
cse_pdfs
'
:
opts
[
'
aa_odd_cse_pdfs
'
]})
update_rule_aa_even
=
update_rule_with_push_boundaries
(
cr_even
,
pdfs
,
boundaries
,
AAEvenTimeStepAccessor
,
AAOddTimeStepAccessor
.
read
)
update_rule_aa_odd
=
update_rule_with_push_boundaries
(
cr_odd
,
pdfs
,
boundaries
,
AAOddTimeStepAccessor
,
AAEvenTimeStepAccessor
.
read
)
else
:
update_rule_aa_even
=
create_lb_update_rule
(
kernel_type
=
AAEvenTimeStepAccessor
(),
optimization
=
{
'
symbolic_field
'
:
pdfs
,
'
split
'
:
opts
[
'
aa_even_split
'
],
'
cse_global
'
:
opts
[
'
aa_even_cse_global
'
],
'
cse_pdfs
'
:
opts
[
'
aa_even_cse_pdfs
'
]},
**
options
)
update_rule_aa_odd
=
create_lb_update_rule
(
kernel_type
=
AAOddTimeStepAccessor
(),
optimization
=
{
'
symbolic_field
'
:
pdfs
,
'
split
'
:
opts
[
'
aa_odd_split
'
],
'
cse_global
'
:
opts
[
'
aa_odd_cse_global
'
],
'
cse_pdfs
'
:
opts
[
'
aa_odd_cse_pdfs
'
]},
**
options
)
vec
=
{
'
assume_aligned
'
:
True
,
'
assume_inner_stride_one
'
:
True
}
...
...
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