Skip to content
Snippets Groups Projects

Advanced Streaming Extensions

Merged Frederik Hennig requested to merge da15siwa/lbmpy:advanced_streaming_extensions into master

This patch extends lbmpy's support for advanced streaming patterns. In particular, the Push-Collide-Stream, AA-Pattern and Esoteric Twist are considered.

  • Boundary Handling: The LBM boundary implementations are overhauled completely. A new framework for defining and generating boundary kernels is introduced, which makes the symbolic definition independent of the streaming pattern. Boundaries can now be defined symbolically using the proxy fields f_out for accessing populations streaming out of a cell, and f_in for populations streaming in to a cell. Those are replaced during the code generation process according to the streaming pattern. The class BetweenTimestepsIndexing used herein can also be used to generate other kernels that run on the PDF-field in-between collision steps.

  • Periodicity Handling: The build-in periodicity synchronization of pystencil's DataHandling does not work for advanced LBM streaming. The new class LBMPeriodicityHandling extends the SerialDataHandling to handle periodicity correctly.

  • Utility: The patch introduces a few utility functions for the work with advanced streaming patterns.

Edited by Markus Holzer

Merge request reports

Pipeline #27850 passed

Pipeline passed for 59ec6a0a on da15siwa:advanced_streaming_extensions

Merged by Markus HolzerMarkus Holzer 4 years ago (Nov 9, 2020 2:45pm UTC)

Loading

Pipeline #27851 passed

Pipeline passed for ba9b9d1a on master

Test coverage 90.12% from 0 jobs

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
72 inward_accesses = (
73 even_accessor if odd_to_even else odd_accessor).read(pdf_field, stencil)
74
75 self.outward_accesses = outward_accesses
76 self.inward_accesses = inward_accesses
77
78 self.pdf_field = pdf_field
79 self.stencil = stencil
80 self.directions = ['x', 'y', 'z'][:len(stencil[0])]
81
82 # Collection of translation arrays required in generated code
83 self.required_arrays = set()
84
85 def _index_array_symbol(self, f_dir, inverse, dir_symbol):
86 assert f_dir in ['in', 'out']
87 name = "f_{d}{inv}_dir_idx".format(d=f_dir, inv='_inv' if inverse else '')
  • added 1 commit

    Compare with previous version

  • Frederik Hennig added 2 commits

    added 2 commits

    • 318f7c90 - Format Fixes
    • 8244c40e - macroscopic value kernels with extended test cases

    Compare with previous version

  • added 1 commit

    • 21122ee0 - Complete and partially tested code for boundary indexing

    Compare with previous version

  • added 1 commit

    • 759a3921 - fixed macroscopic values test and flake8

    Compare with previous version

  • Frederik Hennig added 2 commits

    added 2 commits

    • dd236fb0 - refactored private members of AdvancedStreamingBoundaryIndexing
    • bad8c3d1 - Added basic boundary classes

    Compare with previous version

  • added 1 commit

    • ab28a143 - Added boundary kernel creation. Fixed a few other things.

    Compare with previous version

  • added 1 commit

    • 40bd6745 - FlexibleNoSlip with test case

    Compare with previous version

  • added 1 commit

    • 1a13269e - Implemented FlexibleLBMBoundaryHandling

    Compare with previous version

  • 20 quantities_to_set={'density': density_input_field,
    21 'velocity': velocity_input_field}, )
    22 setter(pdf_arr)
    16 accessors = [StreamPullTwoFieldsAccessor,
    17 StreamPushTwoFieldsAccessor,
    18 AAEvenTimeStepAccessor,
    19 AAOddTimeStepAccessor,
    20 EsoTwistEvenTimeStepAccessor,
    21 EsoTwistOddTimeStepAccessor]
    22
    23 stencils = ['D2Q9', 'D3Q19']
    24 force_models = ['guo', 'luo', 'none']
    25 compressibilities = [True, False]
    26
    27
    28 @pytest.mark.parametrize('stencil,force_model,compressible,accessor', product(stencils, force_models, compressibilities, accessors))
    • this works but you can also decorate the function multiple times to get the product. You can leave it as it is. Just FYI.

      @pytest.mark.parametrize('force_models', ['guo', 'luo', None])
      @pytest.mark.parametrize('stencil', ['D2Q9', 'D3Q19'])
      @pytest.mark.parametrize('compressibilities', ['compressible', False]) # using a string for true yields a nicer test description of the test in CI output

      Does force_models='none' work? Or should it be None

      Edited by Stephan Seitz
    • The more you know.

      Both variants work, in fact create_lb_method contains this line:

          no_force_model = 'force_model' not in params or params['force_model'] == 'none' or params['force_model'] is None
      
    • Please register or sign in to reply
  • added 1 commit

    • a6c4c41d - Introduced utility file and refactored tests

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • added 1 commit

    • 28a9823b - refactored kernel_type to streaming_pattern, + code style fixes

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • added 1 commit

    • 06aeddba - Completed advanced periodicity handling and added fully periodic test scenario

    Compare with previous version

  • added 1 commit

    • 06124196 - to satisfy the flake8 linter

    Compare with previous version

  • added 1 commit

    • 1a97248c - Still buggy periodic pipe test case

    Compare with previous version

  • added 1 commit

    • 231adc92 - Fixed the order of steps in the periodic pipe test case

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading