pylbm.elements.Cylinder_Ellipse

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

Class Cylinder_Ellipse

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

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

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

  • w (a list of the three coordinates of the vector that defines the direction of the side) –

  • 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

Warning

The vectors v1 and v2 have to be orthogonal.

number_of_bounds

3

Type

int

center

the coordinates of the center of the cylinder

Type

numpy array

v0

the three coordinates of the first vector that defines the base section

Type

list of doubles

v1

the three coordinates of the second vector that defines the base section

Type

list of doubles

w

the three coordinates of the vector that defines the direction of the side

Type

list of doubles

label

the list of the label of the edge

Type

list of integers

isfluid

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

Type

boolean

number_of_bounds

number of edges (3)

Type

int

number_of_bounds

number of edges (3)

Type

int

Examples

the vertical canonical cylinder centered in (0, 0, 1/2) with radius 1

>>> center = [0., 0., 0.5]
>>> v0, v1 = [1., 0., 0.], [0., 1., 0.]
>>> w = [0., 0., 1.]
>>> Cylinder_Ellipse(center, v0, v1, w)
    Cylinder_Ellipse([0 0 0.5], [1 0 0], [0 1 0], [0 0 1]) (solid)
__init__(center, v1, v2, w, label=0, isfluid=False)

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

Methods

__init__(center, v1, v2, w[, 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.