Mesh (class)

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

class Mesh(element={}, node=-1, submesh=[], group=None, init_dict=None)[source]

Bases: pyleecan.Classes._frozen.FrozenClass

Gather the mesh storage format

VERSION = 1
set_submesh(group_number)

Define a mesh object as submesh of parent mesh object

Parameters:
  • self (Mesh) – an Mesh object
  • group_number (numpy.array) – a group number which define the elements which constitute the submesh
get_all_node_coord(group=None)

Return a matrix of nodes coordinates and the vector of nodes tags corresponding to group. If no group specified, it returns all the nodes of the mesh.

Parameters:
  • self (Mesh) – an Mesh object
  • group (numpy.array) – Vector of targeted group
Returns:

  • coordinate (numpy.array) – Nodes coordinates
  • tag (numpy.array) – Nodes tags

add_element(node_tags, elem_type, group=-1)

Add a new element defined by a vector of node tags

Parameters:
  • self (Mesh) – an Mesh object
  • node_tags (array) – an array of node tags
Returns:

new_tag – Tag of the created element. None if the element already exist

Return type:

int

get_all_connectivity(elem_type=None, group=None)

Return the connectivity and tags for a selected type of elements and a selected group.

Parameters:
  • self (Mesh) – an Mesh object
  • elem_type (str) – a key corresponding to an element type
  • group (numpy.array) – One or several group numbers to be returned
Returns:

  • connect_select (numpy.array) – Selected connectivity
  • tag_select (ndarray) – Selected element tags

get_connectivity(elem_tag)

Return the connectivity for one selected element

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

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

Return type:

numpy.array

get_new_tag()

Return an unused element tag

Parameters:self (Mesh) – an Mesh object
Returns:new_tag – a new available element tag
Return type:int
interface(other_mesh)

Define an Mesh object corresponding to the exact intersection between two Mesh (nodes must be in both meshes, the nodes tags must be identically defined).

Parameters:
  • self (Mesh) – a Mesh object
  • other_mesh (Mesh) –

    an other Mesh object

    Returns

  • -------
get_node_tags(elem_tag)

Return a vector of (unique) node tags related to a vector of element tags. For only one element, use get connectivity.

Parameters:
  • self (Mesh) – an Mesh object
  • elem_tag (numpy.array) – an element tag
Returns:

all_node_tag – Selected nodes tags

Return type:

numpy.array

get_vertice(elem_type=None, group=None)

Return a connectivity matrix where the node tags are replaced by their coordinates.

Parameters:
  • self (Mesh) – an Mesh object
  • elem_type (str) – a key corresponding to an element type
  • group (numpy.array) – One or several group numbers to be returned
Returns:

vertice – Selected vertices

Return type:

numpy.array

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__)

element

Storing connectivity

node

Storing nodes

submesh

Storing submeshes. Node and element numbers/tags or group must be the same.

group

Contain all possible group numbers