class pulse.preprocessing.mesh.Mesh
A mesh class. This class creates a acoustic and structural mesh object.
_create_acoustic_elements(indexes, connectivities, map_nodes, map_elements) This method generate the mesh acoustic elements.
Parameters
• indexes (List) – Nodes global indexes.
• connectivities (array) – Connectivity matrix that relates the elements and its nodes.
• map_nodes (dict) – Dictionary maps global indexes to external indexes.
• map_elements (dict) – Dictionary maps global element indexes.
_create_entities()
This method generate the mesh entities, nodes, structural elements, acoustic elements and their connectivity.
_create_nodes(indexes, coords, map_nodes) This method generate the mesh nodes.
Parameters
• indexes (List) – Nodes global indexes.
• coords (array) – Nodes coordinates.
• map_nodes (dict) – Dictionary maps global indexes to external indexes.
_create_structural_elements(indexes, connectivities, map_nodes, map_elements) This method generate the mesh structural elements.
Parameters
• indexes (List) – Nodes global indexes.
• connectivities (array) – Connectivity matrix that relates the elements and its nodes.
• map_nodes (dict) – Dictionary maps global indexes to external indexes.
• map_elements (dict) – Dictionary maps global element indexes.
_finalize_gmsh()
This method finalize the mesher gmsh algorithm.
_initialize_gmsh(path)
This method initializes mesher algorithm gmsh.
Parameters str – CAD file path. ‘.igs’ is the only format file supported.
_load_neighbors()
This method updates the structural elements neighbors dictionary. The dictionary’s keys and values are nodes objects.
_map_lines_to_elements(mesh_loaded=False) This method maps entities to elements.
Parameters mesh_loaded (boll, optional.) – True if the mesh was already generated (internally or externally). False otherwise.
_order_global_indexes()
This method updates the nodes global indexes numbering.
_process_beam_nodes_and_indexes() This method ?????.
3.7. Mesh 21
Returns
Return type boll _reset_global_indexes()
This method attributes None to global index of all mesh nodes.
_set_gmsh_options(element_size)
This method sets the mesher algorithm configuration.
Parameters float – Element size.
add_compressor_excitation(parameters) This method ???????
Parameters ?????? –
add_damper_to_node(nodes, values)
This method attributes structural lumped damping (damper) to a list of nodes.
Parameters
• nodes_id (list) – Nodes external indexes.
• values (complex or array) – Lumped damping. Complex valued input corresponds to a constant damping with respect to the frequency. Array valued input corresponds to a variable damping with respect to the frequency.
add_elastic_nodal_link(nodeID_1, nodeID_2, parameters, _stiffness=False, _damp-ing=False)
This method ???????
Parameters
• nodeID_1 (int) – Node 1 external index.
• nodeID_2 (int) – Node 2 external index.
• parameters – ???????.
• _stiffness (boll, optional) – True if ???????. False otherwise. Default is False.
• _damping (boll, optional) – True if ???????. False otherwise. Default is False.
add_mass_to_node(nodes, values)
This method attributes structural lumped mass to a list of nodes.
Parameters
• nodes_id (list) – Nodes external indexes.
• values (complex or array) – Lumped mass. Complex valued input cor-responds to a constant mass with respect to the frequency. Array valued input corresponds to a variable mass with respect to the frequency.
add_spring_to_node(nodes, values)
This method attributes structural lumped stiffness (spring) to a list of nodes.
Parameters
• nodes_id (list) – Nodes external indexes.
• values (complex or array) – Lumped stiffness. Complex valued input corresponds to a constant stiffness with respect to the frequency. Array valued input corresponds to a variable stiffness with respect to the frequency.
check_fluid_and_cross_section_in_all_elements()
This method checks if all acoustic elements have a fluid object and a cross section object at-tributed.
check_fluid_inputs_in_all_elements()
This method checks if each acoustic element has the necessary fluid data to evaluate the analysis according to its element type.
check_material_all_elements()
This method checks if all structural elements have a material object attributed.
check_material_and_cross_section_in_all_elements()
This method checks if all structural elements have a material object and a cross section object attributed.
check_nodes_attributes(acoustic=False, structural=False, coupled=False)
This method checks if there is the necessary nodal input data to evaluate the analysis according to its type.
Parameters
• acoustic (boll, optional) – True if a acoustic analysis will be per-formed. False otherwise. Default is False.
• structural (boll, optional) – True if a structural analysis will be per-formed. False otherwise. Default is False.
• coupled (boll, optional) – True if a coupled analysis will be performed.
False otherwise. Default is False.
check_poisson_all_elements()
This method checks if all structural elements have a Poisson ratio attributed.
enable_fluid_mass_adding_effect(reset=False)
This method enables or disables the addition of fluid mass in the structural element mass.
Parameters reset (boll, optional) – True if the fluid mass effect have to be disable. False to enable. Default is False.
generate(path, element_size)
This method evaluates the Lamé’s first parameter lambda.
Parameters
• path (str) – CAD file path. ‘.igs’ is the only format file supported.
• element_size (float) – Element size to be used to build the mesh.
get_beam_elements()
This method returns the indexes of the structural beam elements.
Returns Beam elements indexes.
Return type list
get_beam_elements_global_dofs()
This method returns the acoustic global degrees of freedom of the nodes associated to structural beam elements. This method helps to exclude those degrees of freedom from acoustic analysis.
Returns Acoustic global degrees of freedom associated to beam element.
Return type list
get_beam_nodes_and_indexes()
This method returns the global indexes of the nodes associated to structural beam elements.
Returns Nodes global indexes associated to beam element.
Return type list
get_connectivity_matrix(reordering=True)
This method updates the mesh connectivity data. Connectivity matrix row structure: ‘’[Element index, first node index, last node index]”.
Parameters reordering (boll, optional.) – True if the nodes numbering is according to the global indexing. False otherwise. Default is True.
get_gdofs_from_nodes(nodeID_1, nodeID_2)
This method returns the ordered global degrees of freedom of two nodes.
Parameters
• nodeID_1 (int) – Node 1 external index.
• nodeID_2 (int) – Node 2 external index.
3.7. Mesh 23
Returns
• reord_gdofs (list) – Global degrees of freedom ordered according to its indexes.
• first_node (Node object) – First node.
• last_node (Node object) – Last node.
get_global_acoustic_indexes()
This method returns the placement of the rows and columns of the acoustic global degrees of freedom in the global matrices.
Returns
• row (array.) – Integers that place the rows.
• column (array.) – Integers that place the columns.
get_global_structural_indexes()
This method returns the placement of the rows and columns of the structural global degrees of freedom in the global matrices.
Returns
• row (array.) – Integers that place the rows.
• column (array.) – Integers that place the columns.
get_nodal_coordinates_matrix(reordering=True)
This method updates the mesh nodes coordinates data. Coordinates matrix row structure:
‘’[Node index, x-coordinate, y-coordinate, z-coordinate]”.
Parameters reordering (boll, optional.) – True if the nodes numbering is according to the global indexing. False otherwise. Default is True.
get_pipe_elements()
This method returns the indexes of the structural pipe elements.
Returns Pipe elements indexes.
Return type list
get_pipe_elements_global_dofs()
This method returns the acoustic global degrees of freedom of the nodes associated to structural pipe elements. This method helps to keep only those degrees of freedom in acoustic analysis.
Returns Acoustic global degrees of freedom associated to pipe element.
Return type list get_radius()
This method updates and returns the ????.
Returns Radius at certain node.
Return type dictionary load_mesh(coordinates, connectivity)
This method creates mesh data from nodes coordinates and connectivity matrix.
Parameters
• coordinates (array.) – Nodes’ coordinates. Each row presents the nodes’
index, x-coordinate, y-coordinate, and z-coordinate. Coordinates matrix row structure: ‘’[Node index, x-coordinate, y-coordinate, z-coordinate]”.
• connectivity (array.) – Connectivity matrix. Each row presents the el-ements’ index, first node index, and last node index. Connectivity matrix row structure: ‘’[Element index, first node index, last node index]”.
neighboor_elements_of_node(node_ID)
This method returns the acoustic elements that a node belongs to.
Parameters int – Node external indexes.
Returns List of acoustic elements indexes.
Return type List
neighbor_elements_diameter()
This method maps the elements external diameters that each node belongs to. The maping is done according to the node external index.
Returns External diameters at a certain node. Giving a node external index, returns a list of diameters.
Return type dict
neighbor_elements_diameter_global()
This method maps the elements internal diameters that each node belongs to. The maping is done according to the node global index.
Returns Internal diameters at a certain node. Giving a node global index, returns a list of diameters.
Return type Dict
process_all_rotation_matrices() This method ???????
process_element_cross_sections_orientation_to_plot() This method ???????
reset_variables()
This method reset the class default values.
set_B2PX_rotation_decoupling(element_ID, node_ID, rota-tions_to_decouple=[False, False, False], re-move=False)
This method . Parameters
• element_ID (list) – Element indexes.
• nodes_id (list) – Nodes external indexes.
• rotations_to_decouple (list of bollean, optional) – Default is [False, False, False]
• remove (boll, optional) – True if the ???????? have to be removed from the ???????? dictionary. False otherwise. Default is False.
set_acoustic_element_type_by_element(elements, element_type, hys-teretic_damping=None, re-move=False)
This method attributes acoustic element type to a list of elements.
Parameters
• elements (list) – Acoustic elements indexes.
• element_type (str, ['dampingless', 'hysteretic', 'wide-duct', 'LRF fluid equivalent', 'LRF full']) – Acoustic element type to be attributed to the listed elements.
• hysteretic_damping (float, optional) – Acoustic hysteretic damp-ing coefficient. It must be attributed to the elements of type ‘hysteretic’. Default is None.
• remove (boll, optional) – True if the element_type have to be removed from the acoustic element type dictionary. False otherwise. Default is False.
set_acoustic_element_type_by_line(line, element_type, hys-teretic_damping=None, remove=False) This method attributes acoustic element type to all elements that belongs to a line/entity.
Parameters
• line (list) – Entities tag.
• element_type (str, ['dampingless', 'hysteretic', 'wide-duct', 'LRF fluid equivalent', 'LRF full']) – Acoustic element type to be attributed to the listed elements.
3.7. Mesh 25
• hysteretic_damping (float, optional) – Acoustic hysteretic damp-ing coefficient. It must be attributed to the elements of type ‘hysteretic’. Default is None.
• remove (boll, optional) – True if the element_type have to be removed from the acoustic element type dictionary. False otherwise. Default is False.
set_acoustic_pressure_bc_by_node(nodes, value)
This method attributes acoustic pressure boundary condition to a list of nodes.
Parameters
• nodes (list) – Nodes external indexes.
• values (complex or array) – Acoustic pressure. Complex valued input corresponds to a constant pressure boundary condition with respect to the fre-quency. Array valued input corresponds to a variable pressure boundary condition with respect to the frequency.
set_capped_end_by_elements(elements, value, selection)
This method enables or disables the capped end effect in a list of acoustic elements.
Parameters
• elements (list) – Acoustic elements indexes.
• value (boll) – True if the capped end effect have to be activated. False other-wise.
• selection –
set_capped_end_by_line(lines, value)
This method enables or disables the capped end effect to all acoustic elements that belongs to a line.
Parameters
• lines (list) – Lines/entities indexes.
• value (boll) – True if the capped end effect have to be activated. False other-wise.
set_cross_section_by_element(elements, cross_section, up-date_cross_section=False)
This method attributes cross section object to a list of acoustic and structural elements.
Parameters
• elements (list) – Acoustic and structural elements indexes.
• cross_section (Cross section object) – Tube cross section data.
• update_cross_section (boll, optional) – True if the cross section data have to be evaluated or updated. False otherwise. Default is False.
set_cross_section_by_line(line, cross_section)
This method attributes cross section object to all elements that belongs to a line/entity.
Parameters
• line (list) – Entities tag.
• cross_section (Cross section object) – Tube cross section data.
set_fluid_by_element(elements, fluid)
This method attributes fluid object to a list of acoustic elements.
Parameters
• elements (list) – Acoustic elements indexes.
• fluid (Fluid object) – Fluid data.
set_fluid_by_line(lines, fluid)
This method attributes fluid object to all acoustic elements that belongs to a line/entity.
Parameters
• line/entity (list) – Lines/entities tags.
• fluid (Fluid object) – Fluid data.
set_length_correction_by_element(elements, value, section, delete_from_dict=False)
This method enables or disables the acoustic length correction effect in a list of acoustic ele-ments.
Parameters
• elements (list) – Acoustic elements indexes.
• value ([None, 0, 1, 2]) – Acoustic length correction due to acoustic continuities. The prescription is done through the following labeling: None: dis-able 0 : expansion 1 : side_branch 2 : loop
• section –
• remove (boll, optional) – True if the ???????? have to be removed from the ???????? dictionary. False otherwise. Default is False.
set_material_by_element(elements, material)
This method attributes material object to a list of acoustic and structural elements.
Parameters
• elements (list) – Acoustic and structural elements indexes.
• material (Material object) – Material data.
set_material_by_line(lines, material)
This method attributes material object to all elements that belongs to a line/entity.
Parameters
• line (list) – Entities tag.
• material (Material object) – Material data.
set_prescribed_dofs_bc_by_node(nodes, values)
This method attributes structural displacement and rotation boundary condition to a list of nodes.
Parameters
• nodes_id (list) – Nodes external indexes.
• values (complex or array) – Displacement and rotation. Complex val-ued input corresponds to a constant boundary condition with respect to the fre-quency. Array valued input corresponds to a variable boundary condition with respect to the frequency.
set_radiation_impedance_bc_by_node(nodes, impedance_type)
This method attributes acoustic lumped radiation impedance to a list of nodes according to the anechoic, flanged, and unflanged prescription.
Parameters
• nodes (list) – Nodes external indexes.
• impedance_type ([None, 0, 1, 2]) – Acoustic length correction due to acoustic discontinuities. The prescription is done through the following labeling:
0 : anechoic termination 1 : unflanged pipe 2 : flanged pipe If None is attributed, then no radiation impedance is considered.
set_specific_impedance_bc_by_node(nodes, values)
This method attributes acoustic lumped specific impedance to a list of nodes.
Parameters
• nodes (list) – Nodes external indexes.
• values (complex or array, None) – Specific impedance. Complex val-ued input corresponds to a constant specific impedance with respect to the fre-quency. Array valued input corresponds to a variable specific impedance with respect to the frequency.
If None is attributed, then no specific impedance is considered.
set_stress_intensification_by_element(elements, value)
3.7. Mesh 27
This method enables or disables the stress intensification effect in a list of structural elements.
Parameters
• elements (list) – Elements indexes.
• value (boll) – True if the stress intensification effect have to be activated. False otherwise.
set_stress_intensification_by_line(lines, value)
This method enables or disables the stress intensification effect to all structural elements that belongs to a line.
Parameters
• lines (list) – Lines/entities indexes.
• value (boll) – True if the stress intensification effect have to be activated. False otherwise.
set_stress_stiffening_by_elements(elements, parameters, section=None, re-move=False)
This method . Parameters
• lines (list) – Elements indexes.
• parameters (list) – ????????.
• section – Default is None
• remove (boll, optional) – True if the ???????? have to be removed from the ???????? dictionary. False otherwise. Default is False.
set_stress_stiffening_by_line(lines, parameters, remove=False) This method .
Parameters
• lines (list) – Lines/entities indexes.
• parameters (list) – ????????.
• remove (boll, optional) – True if the ???????? have to be removed from the ???????? dictionary. False otherwise. Default is False.
set_structural_element_type_by_element(elements, element_type, re-move=False)
This method attributes structural element type to a list of elements.
Parameters
• elements (list) – Structural elements indexes.
• element_type (str, ['pipe_1', 'pipe_2', 'beam_1']) – Struc-tural element type to be attributed to the listed elements.
• remove (boll, optional) – True if the element_type have to be removed from the structural element type dictionary. False otherwise. Default is False.
set_structural_element_type_by_line(line, element_type, remove=False) This method attributes structural element type to all elements that belongs to a line/entity.
Parameters
• line (list) – Entities tag.
• element_type (str, ['pipe_1', 'pipe_2', 'beam_1']) – Struc-tural element type to be attributed to elements.
• remove (boll, optional) – True if the element_type have to be removed from the structural element type dictionary. False otherwise. Default is False.
set_structural_load_bc_by_node(nodes_id, values)
This method attributes structural force and moment loads to a list of nodes.
Parameters
• nodes_id (list) – Nodes external indexes.
• values (complex or array) – Force and moment loads. Complex valued input corresponds to a constant load with respect to the frequency. Array valued
input corresponds to a variable load with respect to the frequency.
set_volume_velocity_bc_by_node(nodes, values, additional_info=None) This method attributes acoustic volume velocity load to a list of nodes.
Parameters
• nodes (list) – Nodes external indexes.
• values (complex or array) – Volume velocity. Complex valued input corresponds to a constant volume velocity load with respect to the frequency. Ar-ray valued input corresponds to a variable volume velocity load with respect to the frequency.