pylbm.elements.Parallelepiped

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

Class Parallelepiped

Parameters
  • point (a list that contains the three coordinates of the first point) –

  • v0 (a list of the three coordinates of the first vector that defines the edge) –

  • v1 (a list of the three coordinates of the second vector that defines the edge) –

  • v2 (a list of the three coordinates of the third vector that defines the edge) –

  • label (list of three integers (default [0,0,0] for the bottom, the top and the side)) –

  • isfluid (boolean) –

    • True if the cylinder is added

    • False if the cylinder is deleted

number_of_bounds

6

Type

int

point

the coordinates of the first point of the parallelepiped

Type

numpy array

v0

the three coordinates of the first vector

Type

list of doubles

v1

the three coordinates of the second vector

Type

list of doubles

v2

the three coordinates of the third vector

Type

list of doubles

label

the list of the label of the edge

Type

list of integers

isfluid

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

Type

boolean

number_of_bounds

number of edges (6)

Type

int

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([0 0 0], [1 0 0], [0 1 0], [0 0 1]) (solid)
__init__(point, v0, v1, v2, label=0, isfluid=False)

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(point, v0, v1, v2[, label, isfluid])

Initialize self.

change_of_variables()

distance(grid, v[, dmax])

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.