lbmpy merge requestshttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests2021-11-16T09:11:04+01:00https://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/107shorten test cases2021-11-16T09:11:04+01:00Markus Holzershorten test casesFixes #27Fixes #27Markus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/105Relaxation rates should be floats2021-11-10T20:37:52+01:00Markus HolzerRelaxation rates should be floatsdefault rrs should be floats. Otherwise, this gives problems in the vectorisation.default rrs should be floats. Otherwise, this gives problems in the vectorisation.Markus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/104D3Q7 Stencil2021-11-02T21:58:04+01:00Markus HolzerD3Q7 StencilThis MR adds a D3Q7 stencil to lbmpy which can be used for advection-diffusion equations.This MR adds a D3Q7 stencil to lbmpy which can be used for advection-diffusion equations.Markus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/103Oldroyd-B2022-02-14T09:45:15+01:00Michael Kuronmkuron@icp.uni-stuttgart.deOldroyd-BHere is the Oldroyd-B viscoelastic method I published in https://doi.org/10.1140/epje/s10189-020-00005-6. A Poiseuille flow test case is included.
Resolves https://i10git.cs.fau.de/walberla/walberla/-/issues/158Here is the Oldroyd-B viscoelastic method I published in https://doi.org/10.1140/epje/s10189-020-00005-6. A Poiseuille flow test case is included.
Resolves https://i10git.cs.fau.de/walberla/walberla/-/issues/158Markus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/102Remove Mathjax path2021-10-29T14:36:31+02:00Markus HolzerRemove Mathjax pathAt the moment the LaTeX rendering in the HMTL output of the docu is broken.
Apparently, the mathjax hack introduced with !92 breaks the LaTeX rendering in the doc.At the moment the LaTeX rendering in the HMTL output of the docu is broken.
Apparently, the mathjax hack introduced with !92 breaks the LaTeX rendering in the doc.Markus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/101Fix longrun2021-10-28T10:27:17+02:00Markus HolzerFix longrun- Fixes `test_modes_central_moment_longrun`.
- Removes benchmark case, because it is outdated. The issue to reintroduce it again is #19
- Small fix to make entropic LBM work again, when relaxation rate for conserved quantities is not de...- Fixes `test_modes_central_moment_longrun`.
- Removes benchmark case, because it is outdated. The issue to reintroduce it again is #19
- Small fix to make entropic LBM work again, when relaxation rate for conserved quantities is not defined.Markus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/100Adaption to new API2021-10-27T15:32:20+02:00Markus HolzerAdaption to new APIWith this MR, all test cases etc should be adapted to the new API. Since all test cases are touched anyway some adaptions are made additionally. The vast majority is just formatting and removing for loops over parameter sets completely t...With this MR, all test cases etc should be adapted to the new API. Since all test cases are touched anyway some adaptions are made additionally. The vast majority is just formatting and removing for loops over parameter sets completely to replace it with the pytest functionality. A larger change is the removal of the serial scenarios since these used the LBM module of waLBerlas python coupling. However, this module is removed for almost a year now.
Furthermore, the broken elementwise multiplication from SymPy is removed (https://github.com/sympy/sympy/issues/22353).
Further changes:
- It is not simple to build entropic collision operators when forces are involved. A long and clear error message has been added if such a case occurs
- Default moment sets have been moved to their own file as they only pollute the creation functions
- Addition of better documentation for the LBMConfig and LBMOptimisation Classes
- Addition of the `_get_relaxation_info_dict` function which defines how relaxation rates are set for all methods.
- Dokumentation for the Enum classes
- Filter warnings for third party warnings
- Fixing of the maximum supported SymPy version to 1.9Markus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/99Shan-Chen tutorial fixes2022-02-12T16:53:13+01:00Alexander ReinauerShan-Chen tutorial fixesI included the changes i made to the tutorial during the espresso summer school to make it momentum conserving.
The comparison with the reference data is now done after 1000 timesteps for the two-component version and also only done up t...I included the changes i made to the tutorial during the espresso summer school to make it momentum conserving.
The comparison with the reference data is now done after 1000 timesteps for the two-component version and also only done up to an error of 1e-4. The reason is that there is a difference in the velocity-calculation using the Guo-force correction, the reference implementation always uses the current force whereas this notebook uses the old force value. I might be wrong here but the version from this notebook seems more physical to me.Michael Kuronmkuron@icp.uni-stuttgart.deMichael Kuronmkuron@icp.uni-stuttgart.dehttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/96Fix setup dependency2021-09-30T13:44:21+02:00Markus HolzerFix setup dependencyFixes #22Fixes #22Markus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/95Pre-Collision PDFs in Macroscopic Quantity Kernels2021-11-09T07:58:55+01:00Frederik HennigPre-Collision PDFs in Macroscopic Quantity KernelsAdded flags to `macroscopic_values_getter` and `macroscopic_values_setter` to explicitly use pre-collision PDFs. Required for consistent initialization in the presence of forces.Added flags to `macroscopic_values_getter` and `macroscopic_values_setter` to explicitly use pre-collision PDFs. Required for consistent initialization in the presence of forces.https://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/94Fix smagorinsky2021-09-26T15:20:30+02:00Markus HolzerFix smagorinskyThe Smagorinsky model was adapted in !93. This change should ensure that a smagorinsky model can also be added when omega is not a symbol but a number.
However, due to a small issue, only collision rules with omega being a number can be...The Smagorinsky model was adapted in !93. This change should ensure that a smagorinsky model can also be added when omega is not a symbol but a number.
However, due to a small issue, only collision rules with omega being a number can be generated at the moment. With this MR, this issue is fixed again.
Furthermore, some wrong type hints in the LBMConfig class have been correctedMarkus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/93Dataclasses for method creation2021-09-26T14:55:52+02:00Markus HolzerDataclasses for method creationIn lbmpy large dicts are created to manage all parameters for the lb method and the pystencils kernel parameters. This MR introduces dataclasses to manage all these parameters. Furthermore, a better integration with pystencils is achieve...In lbmpy large dicts are created to manage all parameters for the lb method and the pystencils kernel parameters. This MR introduces dataclasses to manage all these parameters. Furthermore, a better integration with pystencils is achieved since pystencils introduced dataclasses lately.
Fixes #1Markus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/92Rework force models and central moments transform2021-10-28T13:19:18+02:00Markus HolzerRework force models and central moments transformThis MR provides a complete rework of the force model, so they are functioning in the moment space and the central moment space.
Furthermore, a new implementation for the shift matrix is provided and a rework of the central moment based...This MR provides a complete rework of the force model, so they are functioning in the moment space and the central moment space.
Furthermore, a new implementation for the shift matrix is provided and a rework of the central moment based method.
The central moment transform classes are adapted to be able to work with the changes.
TODOs:
- [x] Test Fixed Density BC when method has a force model
- [x] Forward/Backward Transform for D3Q15
- [x] make cumulants aware of polynomials
- [x] rework cumulants with forceMarkus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/91Improved Moment-Based Method2021-08-05T20:33:29+02:00Frederik HennigImproved Moment-Based MethodRemade collision rule derivation for the moment-based method. Instead of bunching moment matrix multiplication, moment-wise relaxation and backward transformation into one equation, these steps are now split:
- Pre-collision moments are...Remade collision rule derivation for the moment-based method. Instead of bunching moment matrix multiplication, moment-wise relaxation and backward transformation into one equation, these steps are now split:
- Pre-collision moments are computed from populations by a chimera transform (or, optionally, matrix-vector-multiplication) and stored as subexpressions. This step also simplifies the conserved quantity equations by expressing them in terms of raw moments.
- Relaxation and forces are applied in moment space. Post-collision moments are stored as subexpressions. To this end, a `moment_space_forcing` interface was added to common force models.
- Post-collision populations are computed from post-collision moments by matrix-vector-multiplication with splitting of symmetric and asymmetric parts.
- If moment-space forcing is not available, force terms are added in populations space.
The new derivation process yields MRT collision rules with much fewer FLOPs than previously obtained within lbmpy. For D3Q27 compressible orthogonal weighted MRT, only 441 operations are counted, where previously 750-780 FLOPs were counted. The old derivation method is still available and used by default for SRT and TRT, still yielding the most efficient equations in population space.
Requires functionality introduced in pycodegen/pystencils!258.
To Do:
- [x] Documentation and Tutorial Notebookshttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/90Cumulant LBM Minor Fixes2021-07-01T13:10:54+02:00Frederik HennigCumulant LBM Minor Fixes- Fixed incorrect section about forcing in Cumulant Tutorial Notebook
- Made Shift-Matrix based transform the default, since it is more efficient in most situations- Fixed incorrect section about forcing in Cumulant Tutorial Notebook
- Made Shift-Matrix based transform the default, since it is more efficient in most situationshttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/89FreeSlip2021-07-09T10:14:40+02:00Markus HolzerFreeSlipThis MR adds FreeSlip boundary conditions to lbmpy. Fixes #3This MR adds FreeSlip boundary conditions to lbmpy. Fixes #3Markus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/88Add Authors to lbmpy2021-07-05T12:35:50+02:00Markus HolzerAdd Authors to lbmpyAdds authors.txt to lbmpy and citations to the ReadMe. Furthermore, the CI Skript was adapted slightly to have a pre test stage.Adds authors.txt to lbmpy and citations to the ReadMe. Furthermore, the CI Skript was adapted slightly to have a pre test stage.Markus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/87Remove gmpy workaround2021-06-26T15:43:58+02:00Markus HolzerRemove gmpy workaroundRemove pystencils gmpy import because it does not exist anymoreRemove pystencils gmpy import because it does not exist anymoreMarkus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/85Clean-up2021-06-10T14:05:31+02:00Markus HolzerClean-upA little clean-up for lbmpy.A little clean-up for lbmpy.Markus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/84Use int64 for indexing2021-06-07T15:30:42+02:00Markus HolzerUse int64 for indexingFixes #18
The code is changed in the following way. As an example, a generated UBB boundary is shown. Before the adaption:
```cpp
const int32_t f_in_inv_dir_idx [] = { 0,2,1,4,3,6,5,10,9,8,7,16,15,18,17,12,11,14,13,26,25,24,23,22,2...Fixes #18
The code is changed in the following way. As an example, a generated UBB boundary is shown. Before the adaption:
```cpp
const int32_t f_in_inv_dir_idx [] = { 0,2,1,4,3,6,5,10,9,8,7,16,15,18,17,12,11,14,13,26,25,24,23,22,21,20,19 };
const int32_t f_in_inv_offsets_x [] = { 0,0,0,-1,1,0,0,-1,1,-1,1,0,0,-1,1,0,0,-1,1,1,-1,1,-1,1,-1,1,-1 };
const int32_t f_in_inv_offsets_y [] = { 0,1,-1,0,0,0,0,1,1,-1,-1,1,-1,0,0,1,-1,0,0,1,1,-1,-1,1,1,-1,-1 };
const int32_t f_in_inv_offsets_z [] = { 0,0,0,0,0,1,-1,0,0,0,0,1,1,1,1,-1,-1,-1,-1,1,1,1,1,-1,-1,-1,-1 };
const double weights [] = { 0.296296296296296,0.0740740740740741,0.0740740740740741,0.0740740740740741,0.0740740740740741,0.0740740740740741,0.0740740740740741,0.0185185185185185,0.0185185185185185,0.0185185185185185,0.0185185185185185,0.0185185185185185,0.0185185185185185,0.0185185185185185,0.0185185185185185,0.0185185185185185,0.0185185185185185,0.0185185185185185,0.0185185185185185,0.00462962962962963,0.00462962962962963,0.00462962962962963,0.00462962962962963,0.00462962962962963,0.00462962962962963,0.00462962962962963,0.00462962962962963 };
const int32_t neighbour_offset_x [] = { 0,0,0,-1,1,0,0,-1,1,-1,1,0,0,-1,1,0,0,-1,1,1,-1,1,-1,1,-1,1,-1 };
const int32_t neighbour_offset_y [] = { 0,1,-1,0,0,0,0,1,1,-1,-1,1,-1,0,0,1,-1,0,0,1,1,-1,-1,1,1,-1,-1 };
const int32_t neighbour_offset_z [] = { 0,0,0,0,0,1,-1,0,0,0,0,1,1,1,1,-1,-1,-1,-1,1,1,1,1,-1,-1,-1,-1 };
for (int64_t ctr_0 = 0; ctr_0 < _size_indexField_0; ctr_0 += 1)
{
const int32_t x = *((int32_t *)(& _data_indexField[16*_stride_indexField_0*ctr_0]));
const int32_t y = *((int32_t *)(& _data_indexField[16*_stride_indexField_0*ctr_0 + 4]));
const int32_t z = *((int32_t *)(& _data_indexField[16*_stride_indexField_0*ctr_0 + 8]));
const int32_t dir = *((int32_t *)(& _data_indexField[16*_stride_indexField_0*ctr_0 + 12]));
_data_ldc_pdfSrc[x + 452*y + 204304*z + 92345408*f_in_inv_dir_idx[dir] + f_in_inv_offsets_x[dir] + 452*f_in_inv_offsets_y[dir] + 204304*f_in_inv_offsets_z[dir]] = -0.029999999999999999*neighbour_offset_x[dir]*weights[dir] + _data_ldc_pdfSrc[92345408*dir + x + 452*y + 204304*z];
```
After the adaption:
```cpp
const int64_t f_in_inv_dir_idx [] = { 0,2,1,4,3,6,5,10,9,8,7,16,15,18,17,12,11,14,13,26,25,24,23,22,21,20,19 };
const int64_t f_in_inv_offsets_x [] = { 0,0,0,-1,1,0,0,-1,1,-1,1,0,0,-1,1,0,0,-1,1,1,-1,1,-1,1,-1,1,-1 };
const int64_t f_in_inv_offsets_y [] = { 0,1,-1,0,0,0,0,1,1,-1,-1,1,-1,0,0,1,-1,0,0,1,1,-1,-1,1,1,-1,-1 };
const int64_t f_in_inv_offsets_z [] = { 0,0,0,0,0,1,-1,0,0,0,0,1,1,1,1,-1,-1,-1,-1,1,1,1,1,-1,-1,-1,-1 };
const double weights [] = { 0.296296296296296,0.0740740740740741,0.0740740740740741,0.0740740740740741,0.0740740740740741,0.0740740740740741,0.0740740740740741,0.0185185185185185,0.0185185185185185,0.0185185185185185,0.0185185185185185,0.0185185185185185,0.0185185185185185,0.0185185185185185,0.0185185185185185,0.0185185185185185,0.0185185185185185,0.0185185185185185,0.0185185185185185,0.00462962962962963,0.00462962962962963,0.00462962962962963,0.00462962962962963,0.00462962962962963,0.00462962962962963,0.00462962962962963,0.00462962962962963 };
const int64_t neighbour_offset_x [] = { 0,0,0,-1,1,0,0,-1,1,-1,1,0,0,-1,1,0,0,-1,1,1,-1,1,-1,1,-1,1,-1 };
const int64_t neighbour_offset_y [] = { 0,1,-1,0,0,0,0,1,1,-1,-1,1,-1,0,0,1,-1,0,0,1,1,-1,-1,1,1,-1,-1 };
const int64_t neighbour_offset_z [] = { 0,0,0,0,0,1,-1,0,0,0,0,1,1,1,1,-1,-1,-1,-1,1,1,1,1,-1,-1,-1,-1 };
for (int64_t ctr_0 = 0; ctr_0 < _size_indexField_0; ctr_0 += 1)
{
const int64_t x = *((int32_t *)(& _data_indexField[16*_stride_indexField_0*ctr_0]));
const int64_t y = *((int32_t *)(& _data_indexField[16*_stride_indexField_0*ctr_0 + 4]));
const int64_t z = *((int32_t *)(& _data_indexField[16*_stride_indexField_0*ctr_0 + 8]));
const int64_t dir = *((int32_t *)(& _data_indexField[16*_stride_indexField_0*ctr_0 + 12]));
_data_ldc_pdfSrc[x + 452*y + 204304*z + 92345408*f_in_inv_dir_idx[dir] + f_in_inv_offsets_x[dir] + 452*f_in_inv_offsets_y[dir] + 204304*f_in_inv_offsets_z[dir]] = -0.029999999999999999*neighbour_offset_x[dir]*weights[dir] + _data_ldc_pdfSrc[92345408*dir + x + 452*y + 204304*z];
```Markus HolzerMarkus Holzer