pylbm.elements.CylinderEllipse

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

Class CylinderEllipse

Parameters:
centerlist

the three coordinates of the center

v1list

the first vector that defines the circular section

v2list

the second vector that defines the circular section

wlist

the vector that defines the direction of the side

labellist

three integers (default [0,0,0] for the bottom, the top and the side)

isfluidboolean
  • True if the cylinder is added

  • False if the cylinder is deleted

Warning

The vectors v1 and v2 have to be orthogonal.

Examples

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

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

3

dim: int

3

centerndarray

the coordinates of the center of the cylinder

v1list

the three coordinates of the first vector defining the base section

v2list

the three coordinates of the second vector defining the base section

wlist

the three coordinates of the vector defining the direction of the side

labellist

the list of the label of the edge

isfluidboolean

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

Methods

change_of_variables()

matrix for the change of variables used to write the coordinates in the basis of the cylinder

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

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.

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

visualize the element

Attributes

dim

number_of_bounds