LoopStructural.interpolators.StructuredGrid2D#
- class LoopStructural.interpolators.StructuredGrid2D(origin=array([0., 0.]), nsteps=array([10, 10]), step_vector=array([1., 1.]))#
Bases:
BaseSupport
- Parameters:
array (origin - 2d list or numpy)
ints (nsteps - 2d list or numpy array of)
int (step_vector - 2d list or numpy array of)
- __init__(origin=array([0., 0.]), nsteps=array([10, 10]), step_vector=array([1., 1.]))#
- Parameters:
array (origin - 2d list or numpy)
ints (nsteps - 2d list or numpy array of)
int (step_vector - 2d list or numpy array of)
Methods
__init__
([origin, nsteps, step_vector])bilinear
(local_coords)returns the bilinear interpolation for the local coordinates :param x - double: :param array of doubles: :param y - double: :param array of doubles: :param z - double: :param array of doubles:
cell_centres
(global_index)[summary]
cell_corner_indexes
(cell_indexes)Returns the indexes of the corners of a cell given its location xi, yi, zi
check_position
(pos)[summary]
evaluate_gradient
(evaluation_points, ...)Evaluate the gradient of the support at the evaluation points
evaluate_value
(evaluation_points, property_array)Evaluate the value of of the property at the locations.
Get the element for a location
Calculates the gradient matrix at location pos :param pos: numpy array of location Nx3 :return: Nx3x4 matrix
get_operators
(weights)Get
global_cell_indices
(indexes)global_index_to_cell_index
(global_index)Convert from global indexes to xi,yi,zi
global_index_to_node_index
(global_index)global_node_indices
(indexes)inside
(pos)Check if a position is inside the support
neighbour_global_indexes
([mask])Get neighbour indexes
node_indexes_to_position
(node_indexes)Called when the geometry changes
position_to_cell_corners
(pos)[summary]
Get the vertices of the cell a point is in
global posotion to interpolation coefficients :param pos:
Convert from global to local coordinates within a cel :param pos - array of positions inside:
print_geometry
()vtk
([node_properties, cell_properties])Return a vtk object
Attributes
Return the number of dimensions
dimension
Return the element size
Return the elements
Return the number of elements
Return the number of points
Return the nodes
- property barycentre#
Return the number of dimensions
- bilinear(local_coords: ndarray) ndarray #
returns the bilinear interpolation for the local coordinates :param x - double: :param array of doubles: :param y - double: :param array of doubles: :param z - double: :param array of doubles:
- Returns:
array of interpolation coefficients
- cell_centres(global_index: ndarray) ndarray #
[summary]
[extended_summary]
- Parameters:
global_index ([type]) – [description]
- Returns:
[type] – [description]
- cell_corner_indexes(cell_indexes: ndarray) ndarray #
Returns the indexes of the corners of a cell given its location xi, yi, zi
- Parameters:
x_cell_index
y_cell_index
z_cell_index
- check_position(pos: ndarray) ndarray #
[summary]
[extended_summary]
- Parameters:
pos ([type]) – [description]
- Returns:
[type] – [description]
- property element_size#
Return the element size
- property elements: ndarray#
Return the elements
- evaluate_gradient(evaluation_points, property_array)#
Evaluate the gradient of the support at the evaluation points
- evaluate_value(evaluation_points: ndarray, property_array: ndarray)#
Evaluate the value of of the property at the locations. Trilinear interpolation dot corner values
- Parameters:
locations (evaluation_points np array of)
name (property_name string of property)
- get_element_for_location(pos: ndarray) Tuple[ndarray, ndarray, ndarray, ndarray] #
Get the element for a location
- get_element_gradient_for_location(pos) Tuple[ndarray, ndarray, ndarray, ndarray] #
Calculates the gradient matrix at location pos :param pos: numpy array of location Nx3 :return: Nx3x4 matrix
- get_operators(weights: Dict[str, float]) Dict[str, Tuple[ndarray, float]] #
Get
- Parameters:
weights (Dict[str, float]) – _description_
- Returns:
Dict[str, Tuple[np.ndarray, float]] – _description_
- global_index_to_cell_index(global_index)#
Convert from global indexes to xi,yi,zi
- Parameters:
global_index
- inside(pos: ndarray) ndarray #
Check if a position is inside the support
- property n_elements#
Return the number of elements
- property n_nodes#
Return the number of points
- neighbour_global_indexes(mask=None, **kwargs)#
Get neighbour indexes
- Parameters:
neighbours (kwargs - indexes array specifying the cells to return)
- property nodes#
Return the nodes
- onGeometryChange()#
Called when the geometry changes
- position_to_cell_index(pos: ndarray) Tuple[ndarray, ndarray] #
[summary]
[extended_summary]
- Parameters:
pos ([type]) – [description]
- Returns:
[type] – [description]
- position_to_cell_vertices(pos)#
Get the vertices of the cell a point is in
- Parameters:
pos (np.array) – Nx3 array of xyz locations
- Returns:
np.array((N,3),dtype=float), np.array(N,dtype=int) – vertices, inside
- position_to_dof_coefs(pos: ndarray)#
global posotion to interpolation coefficients :param pos:
- position_to_local_coordinates(pos: ndarray) ndarray #
Convert from global to local coordinates within a cel :param pos - array of positions inside:
- Returns:
localx, localy, localz
- vtk(node_properties={}, cell_properties={})#
Return a vtk object