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
970b6bbd
Commit
970b6bbd
authored
8 months ago
by
Philipp Suffa
Browse files
Options
Downloads
Patches
Plain Diff
Added small test for strain rate tensor getter
parent
9b8ec60e
No related branches found
No related tags found
1 merge request
!179
Implements a getter function for the strain rate tensor
Pipeline
#69273
passed
8 months ago
Stage: pretest
Stage: test
Stage: docs
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_macroscopic_value_kernels.py
+17
-1
17 additions, 1 deletion
tests/test_macroscopic_value_kernels.py
with
17 additions
and
1 deletion
tests/test_macroscopic_value_kernels.py
+
17
−
1
View file @
970b6bbd
import
pytest
import
numpy
as
np
import
sympy
as
sp
from
lbmpy.creationfunctions
import
create_lb_method
,
LBMConfig
from
lbmpy.enums
import
Stencil
,
ForceModel
,
Method
from
lbmpy.macroscopic_value_kernels
import
(
compile_macroscopic_values_getter
,
compile_macroscopic_values_setter
)
compile_macroscopic_values_getter
,
compile_macroscopic_values_setter
,
strain_rate_tensor_getter
)
from
lbmpy.advanced_streaming.utility
import
streaming_patterns
,
Timestep
from
lbmpy.stencils
import
LBStencil
...
...
@@ -83,3 +84,18 @@ def test_set_get_constant_velocity(stencil, force_model, compressible):
computed_velocity
=
velocity_output_field
[
0
,
0
,
0
,
:]
np
.
testing
.
assert_almost_equal
(
np
.
array
(
ref_velocity
[:
method
.
dim
]),
computed_velocity
)
@pytest.mark.parametrize
(
'
stencil
'
,
[
Stencil
.
D2Q9
,
Stencil
.
D3Q19
])
@pytest.mark.parametrize
(
"
method_enum
"
,
[
Method
.
SRT
,
Method
.
TRT
,
Method
.
MRT
,
Method
.
CUMULANT
])
def
test_get_strain_rate_tensor
(
stencil
,
method_enum
):
stencil
=
LBStencil
(
stencil
)
lbm_config
=
LBMConfig
(
stencil
=
stencil
,
method
=
method_enum
,
compressible
=
True
)
method
=
create_lb_method
(
lbm_config
=
lbm_config
)
pdfs
=
sp
.
symbols
(
f
"
f_:
{
stencil
.
Q
}
"
)
strain_rate_tensor
=
sp
.
symbols
(
f
"
strain_rate_tensor_:
{
method
.
dim
*
method
.
dim
}
"
)
getter_assignments
=
strain_rate_tensor_getter
(
method
,
strain_rate_tensor
,
pdfs
)
assert
len
(
getter_assignments
)
==
method
.
dim
*
method
.
dim
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