pylbm.elements.Parallelogram

class pylbm.elements.Parallelogram(point, vecta, vectb, label=0, isfluid=False)

Class Parallelogram

Parameters
  • point (the coordinates of the first point of the parallelogram) –

  • vecta (the coordinates of the first vector) –

  • vectb (the coordinates of the second vector) –

  • label (list of four integers (default [0, 0, 0, 0])) –

  • isfluid (boolean) –

    • True if the parallelogram is added

    • False if the parallelogram is deleted

Examples

the square [0,1]x[0,1]

>>> point = [0., 0.]
>>> vecta = [1., 0.]
>>> vectb = [0., 1.]
>>> Parallelogram(point, vecta, vectb)
    Parallelogram([0 0],[0 1],[1 0]) (solid)
number_of_bounds

4

Type

int

point

the coordinates of the first point of the parallelogram

Type

numpy array

vecta

the coordinates of the first vector

Type

numpy array

vectb

the coordinates of the second vector

Type

numpy array

label

the list of the label of the edge

Type

list of integers

isfluid

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

Type

boolean

number_of_bounds

number of edges (4)

Type

int

__init__(point, vecta, vectb, label=0, isfluid=False)

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

Methods

__init__(point, vecta, vectb[, label, isfluid])

Initialize self.

distance(grid, v[, dmax])

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

get_bounds()

return the bounds of the parallelogram.

point_inside(grid)

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

test_label()

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