simnibs.Elements

class simnibs.Elements(triangles=None, tetrahedra=None, points=None, lines=None)

Mesh elements.

Can only handle triangles and tetrahedra!

Parameters:
  • (optional) (triangles) – List of nodes composing each triangle

  • tetrahedra(optional) ((Nx3) ndarray) – List of nodes composing each tetrahedra

elm_number

element ID (u from 1 till nr)

Type:

(Nx1) ndarray

elm_type

elm-type (2=triangle, 4=tetrahedron, etc)

Type:

(Nx1) ndarray

tag1

first tag for each element

Type:

(Nx1) ndarray

tag2

second tag for each elenent

Type:

(Nx1) ndarray

node_number_list

4xnumber_of_element matrix of the nodes that constitute the element. For the triangles, the fourth element = -1

Type:

(Nx4) ndarray

nr

Number or elemets

Type:

int

Notes

Node and element count starts at 1!

__init__(triangles=None, tetrahedra=None, points=None, lines=None)

Methods

__init__([triangles, tetrahedra, points, lines])

add_triangles(triangles, tag)

Add triangles to mesh in-place

connected_components([element_indexes])

Finds connected components

find_adjacent_tetrahedra()

Find the tetrahedra adjacent (sharing a face) to each element

find_all_elements_with_node(node_nr)

Finds all elements that have a given node

find_neighbouring_nodes(node_nr)

Finds the nodes that share an element with the specified node

find_th_with_node(node_nr)

Finds tetrahedra that have a given node

get_faces([tetrahedra_indexes])

Creates a list of nodes in each face and a list of faces in each tetrahedra

get_outside_faces([tetrahedra_indexes])

Creates a list of nodes in each face that are in the outer volume

get_surface_outline([triangle_indices])

returns the outline of a non-closed surface

node_elm_adjacency()

Generates a sparse matrix with element indexes adjacent to each node

nodes_with_tag(tags)

Gets all nodes indexes that are part of at least one element with the given tags

Attributes

elm_number

Element numbers (1, ..., nr)

nr

Number of elements

tetrahedra

Tetrahedra element numbers

triangles

Triangle element numbers