], 'space_step': .5, 'schemes': [{'velocities': list(range(19))}] }, { 'box': { 'x': [0, 3], 'y': [0, 3], 'z': [0, 3], 'label': list(range(1, 7)) }, 'elements': [ pylbm.Ellipsoid( (1.5, 1.5, 1.5), [.5, 0, 0], [0, .5, 0], [0, 0, 1], label=0 ) ], 'space_step': 0.5, 'schemes': [{'velocities': list(range(19))}] }, { 'box': { 'x': [0, 2], 'y': [0, 2], 'z': [0, 2], 'label': list(range(1, 7)) }, 'elements': [pylbm.Sphere((1, 1, 1), 0.5, label=0)],
# Authors: # Loic Gouarin <*****@*****.**> # Benjamin Graille <*****@*****.**> # # License: BSD 3 clause """ Example of a 3D geometry: the cube [0,1] x [0,1] x [0,1] with a ellipsoidal hole """ import pylbm v1 = [.3, .3, 0] v2 = [.25, -.25, 0] v3 = [0, 0, .125] dico = { 'box': { 'x': [0, 1], 'y': [0, 1], 'z': [0, 1], 'label': 0 }, 'elements': [pylbm.Ellipsoid((.5, .5, .5), v1, v2, v3, label=1)], } geom = pylbm.Geometry(dico) print(geom) geom.visualize(viewlabel=True)
pylbm: tests for the geometry """ import pytest import pylbm ELEMENTS = [ [2, pylbm.Circle([0, 0], 1)], [2, pylbm.Ellipse([0, 0], [1, 0], [0, 1])], [2, pylbm.Triangle([-1, -1], [0, 2], [2, 0])], [2, pylbm.Parallelogram([-1, -1], [0, 2], [2, 0])], [3, pylbm.CylinderCircle([0, 0, 0], [1, 0, 0], [0, 1, 0], [0, 0, 1])], [3, pylbm.CylinderEllipse([0, 0, 0], [1, 0, 0], [0, 1, 0], [0, 0, 1])], [3, pylbm.CylinderTriangle([0, 0, 0], [1, 0, 0], [0, 1, 0], [0, 0, 1])], [3, pylbm.Parallelepiped([-1, -1, -1], [2, 0, 0], [0, 2, 0], [0, 0, 2])], [3, pylbm.Ellipsoid([0, 0, 0], [1, 0, 0], [0, 1, 0], [0, 0, 1])], [3, pylbm.Sphere([0, 0, 0], 1)], ] @pytest.fixture(params=ELEMENTS, ids=[elem[1].__class__.__name__ for elem in ELEMENTS]) def get_element(request): """get one element of the geometry""" return request.param BOX = [ (1, { 'x': [-2, 2], 'label': 3
""" from six.moves import range import pylbm # pylint: disable=invalid-name ddom = { 'box': { 'x': [0, 3], 'y': [0, 3], 'z': [0, 3], 'label': list(range(1, 7)) }, 'elements': [ pylbm.Ellipsoid([1.5, 1.5, 1.5], [0.5, 0.0, 0.0], [0.0, 0.5, 0.0], [0.0, 0.0, 1.0], label=0) ], 'space_step': 0.25, 'schemes': [{ 'velocities': list(range(19)) }] } dom = pylbm.Domain(ddom) print(dom) dom.visualize(view_distance=False, label=0, view_in=False, view_out=False, view_bound=True)