phon.mesh_objects package

Submodules

phon.mesh_objects.element module

class phon.mesh_objects.element.Element(elem_type, vertices)[source]

Represents a finite element.

Parameters:
  • elem_type (str) – The type of the element in Abaqus format.
  • vertices (list of ints) – The vertices of the element given as node identifiers.

phon.mesh_objects.element_set module

class phon.mesh_objects.element_set.ElementSet(name, dimension, ids=None)[source]

Represents a set of elements

Parameters:
  • name (str) – Name of the element set.
  • dimension (int) – The dimension of the elements in the set
  • ids (list of ints) – Identifiers of the elements in the set.
get_all_node_ids(mesh)[source]

Gets all the nodes identifiers for the elements in the element set.

Parameters:mesh – The mesh :type mesh: phon.mesh_objects.mesh.Mesh()
Returns:The node identifiers
Return type:list of ints
get_dimension()[source]

Get the dimension of the element set.

Returns:The dimension.
Return type:int

phon.mesh_objects.element_side_set module

class phon.mesh_objects.element_side_set.ElementSide(elemnum, sidenum)[source]
class phon.mesh_objects.element_side_set.ElementSideSet(name)[source]

Represents a set of element sides

Parameters:name (str) – Name of the set.

phon.mesh_objects.mesh module

class phon.mesh_objects.mesh.Mesh(name, nodes=None, elements=None, element_sets=None, element_side_sets=None, node_sets=None)[source]

Represents a mesh which includes nodes, elements, element sets and node sets.

Parameters:
  • name (string) – Name of the mesh.
  • nodes (dict of format {node_id (int) : Node}) – Nodes in the mesh.
  • elements (dict of format {element_id (int) : Element}) – All elements in the mesh.
  • element_sets (dict of format {element_set (string) : [element_ids (int)]}) – Different element sets
  • element_side_sets (dict of format {element_set (string) : [element_ids (int)]}) – Different element side sets
  • node_sets (dict of format {node_set (string) : [node_ids (int)]}) –
get_number_of_2d_elements()[source]

Calculates the number of two dimensional elements in the mesh.

Returns:Number of two dimensional elements.
Return type:int
get_number_of_3d_elements()[source]

Calculates the number of three dimensional elements in the mesh.

Returns:Number of three dimensional elements
Return type:int
renumber_nodes()[source]

Renumbers nodes so that they are “dense” on the number line. For example, if the mesh consist of four nodes with identifiers 1, 2, 5, 7 this would change them to 1, 2, 3, 4. This method also updates the elements to use the renumbered node identifiers.

Currently only updates nodes for 3d elements so don’t do anything with 2d elements after calling this.

phon.mesh_objects.node module

class phon.mesh_objects.node.Node(c)[source]

Represents a node.

Parameters:c (ndarray) – The coordinates of the node

phon.mesh_objects.node_set module

class phon.mesh_objects.node_set.NodeSet(name, ids=None)[source]

Represents a set of nodes

Parameters:
  • name (str) – The name of the node set.
  • ids (list of ints) – The identifiers of the nodes

Module contents