Commit 87a47bbb authored by Markus Holzer's avatar Markus Holzer
Browse files

Minor changes and adaption of the readme file

parent f317ef5b
Pipeline #33653 failed with stages
in 11 minutes and 38 seconds
......@@ -56,17 +56,26 @@ Documentation
Read the docs [here](http://pycodegen.pages.i10git.cs.fau.de/lbmpy) and
check out the Jupyter notebooks in `doc/notebooks`.
Authors
Contributing
-------
To see how to open issues, submit bug reports, create feature requests or submit your additions to lbmpy please refer to
[contribution documentation](https://i10git.cs.fau.de/pycodegen/pystencils/-/blob/master/CONTRIBUTING.md) of pystencils since lbmpy is heavily build on pystencils.
Many thanks go to the [contributors](https://i10git.cs.fau.de/pycodegen/lbmpy/-/blob/master/AUTHORS.txt) of lbmpy.
Many thanks go to the [contributors](AUTHORS.txt) of lbmpy.
### Please cite us
If you use lbmpy in a publication, please cite the following articles:
Overview:
- M. Bauer et al, lbmpy: Automatic code generation for efficient parallel lattice Boltzmann methods. Journal of Computational Science, 2021. https://doi.org/10.1016/j.jocs.2020.101269
- M. Bauer et al, lbmpy: Automatic code generation for efficient parallel lattice Boltzmann methods. Journal of Computational Science, 2021. https://doi.org/10.1016/j.jocs.2020.101269 ([Preprint](https://arxiv.org/abs/2001.11806))
Multiphase:
- M. Holzer et al, Highly efficient lattice Boltzmann multiphase simulations of immiscible fluids at high-density ratios on CPUs and GPUs through code generation. The International Journal of High Performance Computing Applications, 2021. https://doi.org/10.1177/10943420211016525
### Further Reading
- F. Hennig et al, Automatic Code Generation for the Cumulant Lattice Boltzmann Method. ICMMES, 2021. [Poster Link](https://www.researchgate.net/publication/353224406_Automatic_Code_Generation_for_the_Cumulant_Lattice_Boltzmann_Method)
......@@ -397,7 +397,7 @@ class PdfsToCentralMomentsByShiftMatrix(AbstractMomentTransform):
main_assignments = [Assignment(lhs, rhs) for lhs, rhs in zip(central_moment_symbols, central_moment_eqs)]
subexpressions = rm_ac.all_assignments
symbol_gen = SymbolGen(subexpression_base, dtype=float)
symbol_gen = SymbolGen(subexpression_base)
ac = AssignmentCollection(main_assignments=main_assignments, subexpressions=subexpressions,
subexpression_symbol_generator=symbol_gen)
......
......@@ -9,7 +9,6 @@ from pystencils.field import create_numpy_array_with_layout, layout_string_to_tu
from pystencils.simp import add_subexpressions_for_field_reads
from pystencils.sympyextensions import fast_subs
# -------------------------------------------- LBM Kernel Creation -----------------------------------------------------
......@@ -19,14 +18,14 @@ def create_lbm_kernel(collision_rule, src_field, dst_field=None, accessor=Stream
Args:
collision_rule: instance of LbmCollisionRule, defining the collision step
src_field: field used for reading pdf values
dst_field: field used for writing pdf values if None and accessor.is_inplace the src_field is used
dst_field: field used for writing pdf values if accessor.is_inplace this parameter is ignored
accessor: instance of PdfFieldAccessor, defining where to read and write values
to create e.g. a fused stream-collide kernel See 'fieldaccess.PdfFieldAccessor'
Returns:
LbmCollisionRule where pre- and post collision symbols have been replaced
"""
if accessor.is_inplace and dst_field is None:
if accessor.is_inplace:
dst_field = src_field
if not accessor.is_inplace and dst_field is None:
......@@ -58,22 +57,29 @@ def create_lbm_kernel(collision_rule, src_field, dst_field=None, accessor=Stream
return result
def create_stream_only_kernel(stencil, src_field, dst_field=None, accessor=StreamPullTwoFieldsAccessor()):
def create_stream_only_kernel(stencil, src_field, dst_field=None, accessor=StreamPullTwoFieldsAccessor(),
write_on_dst_field=False):
"""Creates a stream kernel, without collision.
Args:
stencil: lattice Boltzmann stencil which is used in the form of a tuple of tuples
src_field: field used for reading pdf values
dst_field: field used for writing pdf values if None and accessor.is_inplace the src_field is used
dst_field: field used for writing pdf values if accessor.is_inplace this parameter is ignored
accessor: instance of PdfFieldAccessor, defining where to read and write values
to create e.g. a fused stream-collide kernel See 'fieldaccess.PdfFieldAccessor'
write_on_dst_field: for benchmarking only the streaming pattern without the collision it is necassary to write
on a dst_field even if it is an inplace streaming pattern because otherwise the compiler
will optimise this
Returns:
AssignmentCollection of the stream only update rule
"""
if accessor.is_inplace and dst_field is None:
if accessor.is_inplace and not write_on_dst_field:
dst_field = src_field
if write_on_dst_field and dst_field is None:
raise ValueError("Destination field needs to be provides if write_on_dst_field is True")
if not accessor.is_inplace and dst_field is None:
raise ValueError("For two field accessors a destination field has to be provided")
......@@ -109,7 +115,7 @@ def create_stream_pull_with_output_kernel(lb_method, src_field, dst_field=None,
cqc = lb_method.conserved_quantity_computation
streamed = sp.symbols(f"streamed_:{len(stencil)}")
stream_assignments = [Assignment(a, b) for a, b in zip(streamed, accessor.read(src_field, stencil))]
output_eq_collection = cqc.output_equations_from_pdfs(streamed, output) if output \
output_eq_collection = cqc.output_equations_from_pdfs(streamed, output) if output\
else AssignmentCollection(main_assignments=[])
write_eqs = [Assignment(a, b) for a, b in zip(accessor.write(dst_field, stencil), streamed)]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment