Meshpresso module¶
The following section contains a documentation of the Meshpresso module implementation.
-
class
meshpresso.
Mesh
(model_name, dict_of_parts, asbly_element_sets=None, asbly_node_sets=None, asbly_surfaces=None)[source]¶ Mesh is the most general class used to import, store and export mesh data. the idea is to initialise the constructor, then import mesh from db file. finally, the mesh can be exported to an external format. for example
>>> mesh = Mesh() >>> mesh.import_from_db_file(path_to_db_file='mesh.db') >>> mesh.export_to_calculix(exported_filename='calculix.inp') >>> mesh.export_to_unv_format(exported_filename='salome.unv')
-
model_name
¶ name of imported model
- Type
string
-
assembly_mesh
¶ the dictionary contains parts, but those have renumbered node and element labels, so that the labels are not repeating
- Type
dictionary
-
export_to_calculix
(exported_filename)[source]¶ function to export mesh to calculix format
- Parameters
exported_filename (str) – name of the file to export mesh (eg ‘calculix.inp’)
-
export_to_unv_format
(exported_filename)[source]¶ function to export to unv format
- Parameters
exported_filename (str) – name of the file to export mesh (eg ‘salome.unv’)
-
get_calculix_surf_definition
()[source]¶ function converts surfaces into format appropriate for calculix.
- Returns
dictionary with surface name as keys and dictionary surface definition as value
- Return type
-
classmethod
import_from_abaqus_cae
(abq_model_name, abq_root_assembly)[source]¶ function to initiate the mesh object
-
classmethod
import_from_db_file
(path_to_db_file)[source]¶ function to initiate the mesh object
- Parameters
path_to_db_file (str) – path to the db file
- Returns
object containing model mesh definition
- Return type
mesh
-
renumber_mesh
()[source]¶ function computes mesh at assembly level from list of part objects. the returned dictionary contains parts with renumbered nodes and elements
- Returns
dictionary of parts
- Return type
defaultdict(list)
-
-
class
meshpresso.
PartMesh
(part_name, part_nodes, part_elements, element_sets=None, node_sets=None, surfaces=None)[source]¶ PartMesh is an object used to store mesh properties for a given part.
-
nodes
¶ list of the node objects
- Type
list of node objects
-
surfaces
¶ dictionary of surfaces {surf_name: {‘nodes’: n_set, ‘elements’: el_set, ‘sides’: string}, by default None
- Type
defaultdict(list), optional
-
classmethod
from_abaqus_cae
(abq_part)[source]¶ function to initiate object from abaqus part.
- Parameters
abq_part (abq_part) – abaqus part object
- Returns
object containing part mesh definition
- Return type
part_mesh
-
get_elements_by_type
()[source]¶ function used to create a dictionary of elements with element types used as keys
- Returns
dictionary of elements with elementtypes used as keys
- Return type
defaultdict(list)
-
get_elements_from_label_list
(label_list)[source]¶ function to retrieve the elements from list of elements labels.
-
get_nodes_from_label_list
(label_list)[source]¶ function to retrieve the nodes from list of node labels
-