pylbm.elements.Ellipsoid

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

Class Ellipsoid

Parameters:
centerlist

the three coordinates of the center

v1list

a vector

v2list

a vector

v3list

a vector (v1, v2, and v3 have to be orthogonal)

labellist

one integer (default [0])

isfluidboolean
  • True if the ellipsoid is added

  • False if the ellipsoid is deleted

Examples

the ellipsoid centered in (0, 0, 0) with v1=[3,0,0], v2=[0,2,0], and v3=[0,0,1]

>>> center = [0., 0., 0.]
>>> v1, v2, v3 = [3,0,0], [0,2,0], [0,0,1]
>>> Ellipsoid(center, v1, v2, v3)
+-----------+
| Ellipsoid |
+-----------+
    - dimension: 3
    - center: [0. 0. 0.]
    - v1: [3 0 0]
    - v2: [0 2 0]
    - v3: [0 0 1]
    - label: [0]
    - type: solid
Attributes:
number_of_boundsint

1

dim: int

3

centerndarray

the coordinates of the center of the sphere

v1ndarray

the coordinates of the first vector

v2ndarray

the coordinates of the second vector

v3ndarray

the coordinates of the third vector

labellist

the list of the label of the edge

isfluidboolean

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

Methods

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

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

get_bounds()

Get the bounds of the ellipsoid.

point_inside(grid)

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

test_label()

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

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

visualize the element

Attributes

number_of_bounds