pylbm.elements.Sphere

class pylbm.elements.Sphere(center, radius, label=0, isfluid=False)

Class Sphere

Parameters:
centerlist

the three coordinates of the center

radiusreal

a positive real number for the radius

labellist

one integer (default [0])

isfluidboolean
  • True if the sphere is added

  • False if the sphere is deleted

Examples

the sphere centered in (0, 0, 0) with radius 1

>>> center = [0., 0., 0.]
>>> radius = 1.
>>> Sphere(center, radius)
+--------+
| Sphere |
+--------+
    - dimension: 3
    - center: [0. 0. 0.]
    - radius: 1.0
    - label: [0]
    - type: solid
Attributes:
number_of_boundsint

1

dim: int

3

centerndarray

the coordinates of the center of the sphere

radiusreal

a positive real number for the radius of the sphere

labellist

the list of the label of the edge

isfluidboolean

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

Methods

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

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

get_bounds()

Get the bounds of the sphere.

point_inside(grid)

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

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