Points type
Points type
- class tedeous.points_type.Points_type(grid)[source]
Bases:
objectDiscretizing the grid and allocating subsets for Finite Difference method.
- static shift_points(grid: Tensor, axis: int, shift: float) Tensor[source]
Shifts all values of an array ‘grid’ on a value ‘shift’ in a direction of axis ‘axis’, somewhat is equivalent to a np.roll. :param grid: array of a n-D points. :param axis: axis to which the shift is applied. :param shift: shift value.
- Returns:
shifted array of a n-D points.
- static in_hull(p: Tensor, hull: Tensor) ndarray[source]
Test if points in p are in hull p should be a NxK coordinates of N points in K dimensions hull is either a scipy.spatial.Delaunay object or the MxK array of the coordinates of M points in `K`dimensions for which Delaunay triangulation will be computed. :param p: shifted array of a n-D points. :param hull: initial array of a n-D points.
- Returns:
array of a n-D boolean type points. True - if ‘p’ in ‘hull’, False - otherwise.
- point_typization() dict[source]
Allocating subsets for FD (i.e., ‘f’, ‘b’, ‘central’). :param grid: array of a n-D points.
- Returns:
type with a points in a ‘grid’ above. Type may be ‘central’ - inner point and string of ‘f’ and ‘b’, where the length of the string is a dimension n. ‘f’ means that if we add small number to a position of corresponding coordinate we stay in the ‘hull’. ‘b’ means that if we subtract small number from o a position of corresponding coordinate we stay in the ‘hull’.
- grid_sort() dict[source]
Sorting grid points for each subset from result Points_type.point_typization. :param grid: array of a n-D points.
- Returns:
sorted grid in each subset (see Points_type.point_typization).
- bnd_sort(grid_dict: dict, b_coord: Union[Tensor, list])[source]
Sorting boundary points :param grid_dict: array of a n-D points. :param b_coord: boundary points of grid. It will be list if periodic condition is.
- Returns:
- bnd_dict is similar to grid_dict but with b_coord values. It
will be list of ‘bnd_dict’s if ‘b_coord’ is list too.