pylbm.elements.Ellipse

class pylbm.elements.Ellipse(center, v1, v2, label=0, isfluid=False)

Class Ellipse

Parameters
  • center (a list that contains the two coordinates of the center) –

  • v1 (a vector) –

  • v2 (a second vector (v1 and v2 have to be othogonal)) –

  • label (list of one integer (default [0])) –

  • isfluid (boolean) –

    • True if the ellipse is added

    • False if the ellipse is deleted

number_of_bounds

1

Type

int

center

the coordinates of the center of the ellipse

Type

numpy array

v1

the coordinates of the first vector

Type

numpy array

v2

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 ellipse is added and False if the ellipse is deleted

Type

boolean

number_of_bounds

number of edges (1)

Type

int

Examples

the ellipse centered in (0, 0) with v1=[2,0], v2=[0,1]

>>> center = [0., 0.]
>>> v1 = [2., 0.]
>>> v2 = [0., 1.]
>>> Ellipse(center, v1, v2)
    Ellipse([0 0], [2 0], [0 1]) (solid)
__init__(center, v1, v2, label=0, isfluid=False)

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

Methods

__init__(center, v1, v2[, label, isfluid])

Initialize self.

distance(grid, v[, dmax])

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

get_bounds()

Get the bounds of the ellipse.

point_inside(grid)

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

test_label()

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