Commit 591a4c40 authored by Martin Bauer's avatar Martin Bauer
Browse files

lbmpy notebook cleanup Part1

parent d72cd721
from pystencils.field import Field, FieldType
from pystencils.data_types import TypedSymbol
from pystencils.slicing import makeSlice
from pystencils.slicing import make_slice
from pystencils.kernelcreation import create_kernel, create_indexed_kernel
from pystencils.display_utils import show_code, to_dot
from pystencils.assignment_collection import AssignmentCollection
......@@ -9,7 +9,7 @@ from pystencils.sympyextensions import SymbolCreator
__all__ = ['Field', 'FieldType',
'TypedSymbol',
'makeSlice',
'make_slice',
'create_kernel', 'create_indexed_kernel',
'show_code', 'to_dot',
'AssignmentCollection',
......
......@@ -101,7 +101,7 @@ class BoundaryHandling:
Sets boundary using either a rectangular slice, a boolean mask or a combination of both
:param boundary_obj: instance of a boundary object that should be set
:param slice_obj: a slice object (can be created with makeSlice[]) that selects a part of the domain where
:param slice_obj: a slice object (can be created with make_slice[]) that selects a part of the domain where
the boundary should be set. If none, the complete domain is selected which makes only sense
if a maskCallback is passed. The slice can have ':' placeholders, which are interpreted
depending on the 'includeGhostLayers' parameter i.e. if it is True, the slice extends
......
......@@ -43,9 +43,9 @@ def sliced_block_iteration(blocks, slice_obj=None, inner_ghost_layers=1, outer_g
Args:
blocks: walberla block data structure
slice_obj: a slice (i.e. rectangular sub-region), can be created with makeSlice[]
slice_obj: a slice (i.e. rectangular sub-region), can be created with make_slice[]
inner_ghost_layers: how many ghost layers are included in the local slice and the optional index arrays
outer_ghost_layers: slices can have relative coordinates e.g. makeSlice[0.2, :, :]
outer_ghost_layers: slices can have relative coordinates e.g. make_slice[0.2, :, :]
when computing absolute values, the domain size is needed. This parameter
specifies how many ghost layers are taken into account for this operation.
dim: set to 2 for pseudo 2D simulation (i.e. where z coordinate of blocks has extent 1)
......
......@@ -7,7 +7,7 @@ class SliceMaker(object):
return item
makeSlice = SliceMaker()
make_slice = SliceMaker()
class SlicedGetter(object):
......@@ -85,7 +85,7 @@ def shift_slice(slices, offset):
def slice_from_direction(direction_name, dim, normal_offset=0, tangential_offset=0):
"""
Create a slice from a direction named by compass scheme:
i.e. 'N' for north returns same as makeSlice[:, -1]
i.e. 'N' for north returns same as make_slice[:, -1]
the naming is:
- x: W, E (west, east)
- y: S, N (south, north)
......@@ -95,9 +95,9 @@ def slice_from_direction(direction_name, dim, normal_offset=0, tangential_offset
:param direction_name: name of direction as explained above
:param dim: dimension of the returned slice (should be 2 or 3)
:param normal_offset: the offset in 'normal' direction: e.g. slice_from_direction('N',2, normalOffset=2)
would return makeSlice[:, -3]
would return make_slice[:, -3]
:param tangential_offset: offset in the other directions: e.g. slice_from_direction('N',2, tangentialOffset=2)
would return makeSlice[2:-2, -1]
would return make_slice[2:-2, -1]
"""
if tangential_offset == 0:
result = [slice(None, None, None)] * dim
......
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