pyLBM.elements.Triangle

class pyLBM.elements.Triangle(point, vecta, vectb, label=0, isfluid=False)

Class Triangle

Parameters:

point : list

the coordinates of the first point of the triangle

vecta : list

the coordinates of the first vector

vectb : list

the coordinates of the second vector

label : list of three integers (default [0, 0, 0])

isfluid : boolean

  • True if the triangle is added
  • False if the triangle is deleted

Examples

the bottom half square of [0,1]x[0,1]

>>> point = [0., 0.]
>>> vecta = [1., 0.]
>>> vectb = [0., 1.]
>>> Triangle(point, vecta, vectb)
    Triangle([0 0],[0 1],[1 0]) (solid)

Attributes

point (numpy array) the coordinates of the first point of the triangle
vecta (numpy array) the coordinates of the first vector
vectb (numpy array) the coordinates of the second vector
label (list of integers) the list of the label of the edge
isfluid (boolean) True if the triangle is added and False if the triangle is deleted
number_of_bounds (int) number of edges

Methods

distance(grid, v[, dmax]) Compute the distance in the v direction between the triangle and the points defined by (x, y).
get_bounds() return the smallest box where the triangle is.
point_inside(grid) return a boolean array which defines
test_label() test if the number of labels is equal to the number of bounds.