pylbm.elements.Circle

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

Class Circle

Parameters:
centerlist

the two coordinates of the center

radiusfloat

the radius

labellist

default [0]

isfluidboolean
  • True if the circle is added

  • False if the circle is deleted

Examples

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

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

1

dimension: int

2

centerndarray

the coordinates of the center of the circle

radiusdouble

positive float for the radius of the circle

labellist

the list of the label of the edge

isfluidboolean

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

Methods

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

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

get_bounds()

Get the bounds of the circle.

point_inside(grid)

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

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