Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

seaduck.topology

Topology

class Topology(od, typ=None)

Topology object.

A light weight object that remembers the structure of the grid, what is connected, what is not. The core method is simply move the index to a direction. In the movie kill Bill, the bride sat in a car and said “wiggle your big toe”. After the toe moved, “the hard part is over”. You get the idea.

Parameters

Topology.check_illegal (method)

check_illegal(self, ind, cuvwg='C')

Check if the index is legal.

A vectorized check to see whether the index is legal, index can be a tuple of numpy ndarrays. no negative index is permitted for sanity reason.

Parameters

Topology.four_matrix_for_uv (method)

four_matrix_for_uv(self, fface)

Expand get_uv_mask_from_face to 2D array of faces.

Topology.get_the_other_edge (method)

get_the_other_edge(self, face, edge)

See what is adjacent to the face by this edge.

The (edge) side of the (face) is connected to the (new_edge) side of the (new_face). 0,1,2,3 stands for up, down, left, right.

Parameters

Returns

Topology.get_uv_mask_from_face (method)

get_uv_mask_from_face(self, faces)

Get the masking of UV points.

The background is as following: For a dataset with face connection, when one is finding the neighboring cells for vector interpolation, the fact that faces can be rotated against each other can create local inconsistency in vector definition near face connections. This method corrects that.

Parameters

Topology.ind_moves (method)

ind_moves(self, ind, moves, **kwarg)

Move an index in a serie of directions.

moves being a list of directions (0,1,2,3), ind being the starting index, return the index after moving in the directions in the list.

Parameters

Topology.ind_tend (method)

ind_tend(self, ind, tend, cuvwg='C', **kwarg)

Move an index in a direction.

ind is a tuple that is face,iy,ix, tendency again is up, down, left, right represented by 0,1,2,3 return the next cell.

Parameters

Topology.ind_tend_vec (method)

ind_tend_vec(self, inds, tend, **kwarg)

Move many indices in a list of directions.

Vectorized version for ind_tend method.

Parameters

Topology.mutual_direction (method)

mutual_direction(self, face, new_face, **kwarg)

Find the relative orientation of two faces.

0,1,2,3 stands for up, down, left, right given 2 faces, the returns are

  1. the 2nd face is to which direction of the 1st face

  2. the 1st face is to which direction of the 2nd face.