LoopStructural.interpolators.TetMesh#

class LoopStructural.interpolators.TetMesh(origin=array([0., 0., 0.]), nsteps=array([10., 10., 10.]), step_vector=array([1., 1., 1.]))#

Bases: BaseStructuredSupport

Parameters:
  • array (origin - 3d list or numpy) –

  • ints (nsteps - 3d list or numpy array of) –

  • int (step_vector - 3d list or numpy array of) –

__init__(origin=array([0., 0., 0.]), nsteps=array([10., 10., 10.]), step_vector=array([1., 1., 1.]))#
Parameters:
  • array (origin - 3d list or numpy) –

  • ints (nsteps - 3d list or numpy array of) –

  • int (step_vector - 3d list or numpy array of) –

Methods

__init__([origin, nsteps, step_vector])

param origin - 3d list or numpy array:

associateInterpolator(interpolator)

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(pos, property_array)

Evaluate the gradient of an interpolant at the locations

evaluate_shape(locations)

Convenience function returning barycentric coords

evaluate_shape_derivatives(pos[, elements])

evaluate_value(pos, property_array)

Evaluate value of interpolant

get_element_for_location(pos)

Determine the tetrahedron from a numpy array of points

get_element_gradient_for_location(pos)

Get the gradient of the tetra for a location

get_element_gradients([elements])

Get the gradients of all tetras

get_elements()

Get a numpy array of all of the elements in the mesh

get_neighbours()

This function goes through all of the elements in the mesh and assembles a numpy array with the neighbours for each element

global_cell_indices(indexes)

Convert from cell indexes to global cell index

global_cell_indicies(indexes)

Convert from cell indexes to global cell index

global_index_to_cell_index(global_index)

Convert from global indexes to xi,yi,zi

global_index_to_node_index(global_index)

Convert from global indexes to xi,yi,zi

global_node_indices(indexes)

Convert from node indexes to global node index

global_node_indicies(indexes)

Convert from node indexes to global node index

inside(pos)

Check if a position is inside the support

node_indexes_to_position(node_indexes)

onGeometryChange()

Function to be called when the geometry of the support changes

position_to_cell_corners(pos)

position_to_cell_global_index(pos)

position_to_cell_index(pos)

Get the indexes (i,j,k) of a cell that a point is inside

position_to_cell_vertices(pos)

Get the vertices of the cell a point is in

rotate(pos)

tetra_global_index(indices, tetra_index)

Get the global index of a tetra from the cell index and the local tetra index

to_dict()

Attributes

barycentre

Return the barycentres of all tetrahedrons or of specified tetras using global index

dimension

element_scale

element_size

Calculate the volume of a tetrahedron using the 4 corners volume = abs(det(A))/6 where A is the jacobian of the corners

elements

Return the elements

maximum

n_cells

n_elements

Return the number of elements

n_nodes

Return the number of points

neighbours

nodes

Return the nodes

nsteps

nsteps_cells

ntetra

origin

rotation_xy

shared_element_norm

Get the normal to all of the shared elements

shared_element_scale

shared_element_size

Get the area of the share triangle

step_vector

vtk

property barycentre: ndarray#

Return the barycentres of all tetrahedrons or of specified tetras using global index

Returns:

barycentres (numpy array) – barycentres of all tetrahedrons

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#

Calculate the volume of a tetrahedron using the 4 corners volume = abs(det(A))/6 where A is the jacobian of the corners

Returns:

_type_ – _description_

property elements#

Return the elements

evaluate_gradient(pos: ndarray, property_array: ndarray) ndarray#

Evaluate the gradient of an interpolant at the locations

Parameters:
  • array (pos - numpy) – locations

  • string (prop -) – property to evaluate

evaluate_shape(locations)#

Convenience function returning barycentric coords

evaluate_value(pos: ndarray, property_array: ndarray) ndarray#

Evaluate value of interpolant

Parameters:
  • array (pos - numpy) – locations

  • string (prop -) – property name

get_element_for_location(pos: ndarray)#

Determine the tetrahedron from a numpy array of points

Parameters:

pos (np.array) –

get_element_gradient_for_location(pos: ndarray)#

Get the gradient of the tetra for a location

Parameters:

pos

get_element_gradients(elements=None)#

Get the gradients of all tetras

Parameters:

elements

get_elements()#

Get a numpy array of all of the elements in the mesh

Returns:

numpy array elements

get_neighbours() ndarray#

This function goes through all of the elements in the mesh and assembles a numpy array with the neighbours for each element

global_cell_indices(indexes) ndarray#

Convert from cell indexes to global cell index

Parameters:

indexes

global_cell_indicies(indexes: ndarray)#

Convert from cell indexes to global cell index

Parameters:

indexes

global_index_to_cell_index(global_index)#

Convert from global indexes to xi,yi,zi

Parameters:

global_index

global_index_to_node_index(global_index: ndarray)#

Convert from global indexes to xi,yi,zi

Parameters:

global_index

global_node_indices(indexes) ndarray#

Convert from node indexes to global node index

Parameters:

indexes

global_node_indicies(indexes: ndarray)#

Convert from node indexes to global node index

Parameters:

indexes

inside(pos: ndarray)#

Check if a position is inside the support

property n_elements: int#

Return the number of elements

property n_nodes#

Return the number of points

property nodes#

Return the nodes

onGeometryChange()#

Function to be called when the geometry of the support changes

position_to_cell_index(pos: ndarray) ndarray#

Get the indexes (i,j,k) of a cell that a point is inside

Parameters:

pos (np.array) – Nx3 array of xyz locations

Returns:

np.ndarray – N,3 i,j,k indexes of the cell that the point is in

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

property shared_element_norm#

Get the normal to all of the shared elements

property shared_element_size#

Get the area of the share triangle

tetra_global_index(indices, tetra_index)#

Get the global index of a tetra from the cell index and the local tetra index

Parameters:
  • indices

  • tetra_index