ElementMat (class)

File generated according to Generator/ClassesRef/Mesh/ElementMat.csv WARNING! All changes made in this file will be lost!

class ElementMat(connectivity=None, nb_elem=0, nb_node_per_element=0, group=None, tag=None, init_dict=None)[source]

Bases: pyleecan.Classes.Element.Element

Define the connectivity under matricial format containing one type of element (example: only triangles with 3 nodes).

VERSION = 1
get_node2element(node_tag)

Return all element tags of elements containing the node tag node_tag

Parameters:
  • self (ElementMat) – an ElementMat object
  • node_tag (int) – a node tag
Returns:

nodes_to_elements – Element tags of all elements containing the node node_tag

Return type:

dict

convert_element
add_element(node_tags, new_tag, group=-1)

Add a new element defined by a vector of node tags

Parameters:
  • self (ElementMat) – an ElementMat object
  • new_tag (int) – an new element tag
  • node_tags (numpy.array) – an array of node tags
  • group (int) – the group number
Returns:

is_created – False if the element already exist or if it is not possible to add the element

Return type:

bool

get_connectivity(elem_tag=None)

Return the connectivity for one element designed by its tag

Parameters:
  • self (ElementMat) – an ElementMat object
  • elem_tag (int) – an element tag
Returns:

connect_select – Selected element connectivity. Return None if the tag does not exist

Return type:

numpy.array

get_all_connectivity(group=None)

Return the connectivity and tags for a selected group of elements

Parameters:
  • self (ElementMat) – an ElementMat object
  • group (numpy.array) – one or several group number
Returns:

  • connect_select (ndarray) – Selected connectivity
  • tag_select (ndarray) – Selected element tags

is_exist(node_tags)

Check the existence of an element defined by a vector of node tags

Parameters:
  • self (ElementMat) – an ElementMat object
  • node_tags (numpy.ndarray) – an array of node tags
Returns:

True if the element already exist

Return type:

bool

get_new_tag
get_all_node_tags()

Return a vector of all nodes tags related to the connectivity

Parameters:self (ElementMat) – an ElementMat object
Returns:node_tags – Selected nodes coordinates
Return type:numpy.array
get_group(group_number)

Define an Element object as submesh of parent mesh object

Parameters:
  • self (ElementMat) – an ElementMat object
  • group_number (int) – a group number which define the elements which constitute the submesh
Returns:

subelem – an ElementMat which is a submesh of parent mesh self related to group_number

Return type:

ElementMat

save(save_path='')

Save the object to the save_path

Parameters:
  • self – A pyleecan object
  • save_path (str) – path to the folder to save the object
get_logger()

Get the object logger or its parent’s one

Parameters:obj – A pyleecan object
Returns:logger – Pyleecan object dedicated logger
Return type:logging.Logger
as_dict()[source]

Convert this objet in a json seriable dict (can be use in __init__)

connectivity

Matrix of connectivity for one element type

nb_elem

Total number of elements

nb_node_per_element

Define the number of node per element

group

Attribute a group number (int) to each element . This group number should correspond to a subpart of the machine.

tag

Element tags