pylbm.elements.Parallelepiped

class pylbm.elements.Parallelepiped(point, v0, v1, v2, label=0, isfluid=False)

Class Parallelepiped

Parameters:
pointlist

the three coordinates of the first point

v0list

the three coordinates of the first vector that defines the edge

v1list

the three coordinates of the second vector that defines the edge

v2list

the three coordinates of the third vector that defines the edge

labellist

three integers (default [0,0,0] for the bottom, the top and the side)

isfluidboolean
  • True if the cylinder is added

  • False if the cylinder is deleted

Examples

the vertical canonical cube centered in (0, 0, 0)

>>> center = [0., 0., 0.5]
>>> v0, v1, v2 = [1., 0., 0.], [0., 1., 0.], [0., 0., 1.]
>>> Parallelepiped(center, v0, v1, v2)
+----------------+
| Parallelepiped |
+----------------+
    - dimension: 3
    - center: [0. 0. 1.]
    - v1: [1. 0. 0.]
    - v2: [0. 1. 0.]
    - w: [0.  0.  0.5]
    - label: [0, 0, 0, 0, 0, 0]
    - type: solid
Attributes:
number_of_boundsint

6

dim: int

3

pointndarray

the coordinates of the first point of the parallelepiped

v0list

the three coordinates of the first vector

v1list

the three coordinates of the second vector

v2list

the three coordinates of the third vector

labellist

the list of the label of the edge

isfluidboolean

True if the parallelepiped is added and False if the parallelepiped is deleted

Methods

change_of_variables()

matrix for the change of variables used to write the coordinates in the basis of the cylinder

distance(grid, v[, dmax, normal])

Compute the distance in the v direction between the cylinder and the points defined by (x, y, z).

get_bounds()

Get the bounds of the cylinder.

point_inside(grid)

return a boolean array which defines if a point is inside or outside of the cylinder.

test_label()

test if the number of labels is equal to the number of bounds.

visualize(viewer, color[, viewlabel, scale, ...])

visualize the element

Attributes

dim

number_of_bounds