Part

class compas_fea2.model.Part[source]

Bases: _Part

Deformable part.Base class for Parts.

Parameters:
None
Attributes:
namestr

Unique identifier. If not provided it is automatically generated. Set a name if you want a more human-readable input file.

modelcompas_fea2.model.Model

The model to which the part belongs.

nodesSet[compas_fea2.model.Node]

The nodes of the part.

nodes_countint

The number of nodes in the part.

gkey_nodeDict[str, compas_fea2.model.Node]

A dictionary that associates each node and its geometric key.

materialsSet[compas_fea2.model._Material]

All the materials associated with the part.

sectionsSet[compas_fea2.model._Section]

All the materials associated with the part.

elementsSet[compas_fea2.model._Element]

The elements of the part.

element_typesDict[compas_fea2.model._Element, List[compas_fea2.model._Element]]

The types of elements in the part grouped by their type.

element_countint

Number of elements in the part.

boundary_meshcompas.datastructures.Mesh

The outer boundary mesh of the part.

Notes

Parts are registered to a compas_fea2.model.Model.

Methods

add_beam_release

Add a compas_fea2.model._BeamEndRelease to an element in the part.

frame_from_compas_mesh

Creates a Part object from a compas Mesh by converting each edge into a BeamElement with a third orientation node.

from_boundary_mesh

Create a Part object from a 3-dimensional compas.datastructures.Mesh object representing the boundary envelope of the Part.

from_compas_gmsh

Create a Part object from a gmshModel object.

Inherited Methods

ToString

Converts the instance to a string.

add_element

Add an element to the part.

add_elements

Add multiple elements to the part.

add_group

Add a node or element group to the part.

add_groups

Add multiple groups to the part.

add_node

Add a node to the part.

add_nodes

Add multiple nodes to the part.

compute_nodal_masses

Compute the nodal mass of the part from the mass of each element.

contains_element

Verify that the part contains a specific element.

contains_material

Verify that the part contains a specific material.

contains_node

Verify that the part contains a given node.

contains_section

Verify that the part contains a specific section.

copy

Make an independent copy of the data object.

elements_by_dimension

find_adjacent_elements

Finds all elements that share at least one node with a given element.

find_boundary_faces

Finds all element faces located on the exterior boundary of the part.

find_boundary_nodes

Finds all nodes located on the exterior boundary of the part.

find_closest_nodes_to_node

Find the n closest nodes around a given node (excluding the node itself).

find_closest_nodes_to_point

Find the closest number_of_nodes nodes to a given point.

find_element_by_key

Retrieve an element in the model using its key.

find_element_by_name

Find all elements with a given name.

find_element_neighbors_by_layer

Finds element neighbors in expanding layers (rings) around a starting element.

find_elements_by_node

Finds all elements connected to a given node.

find_faces_in_polygon

Find the faces of the elements that are contained within a planar polygon.

find_faces_on_plane

Find the faces of the elements that belong to a given plane, if any.

find_group_by_name

Find all groups with a given name.

find_material_by_name

Find a material with a given name.

find_material_by_uid

Find a material with a given unique identifier.

find_materials_by_name

Find all materials with a given name.

find_node_by_key

Retrieve a node in the model using its key.

find_node_by_name

Find a node with a given name.

find_node_by_uid

Retrieve a node in the part using its unique identifier.

find_nodes_around_point

Find the nodes around a given point within a specified distance.

find_nodes_by_box

Finds all nodes within a given compas.geometry.Box.

find_nodes_in_polygon

Find the nodes of the part that are contained within a planar polygon.

find_nodes_on_plane

Find all nodes on a given plane.

find_section_by_name

Find a section with a given name.

find_section_by_uid

Find a section with a given unique identifier.

find_sections_by_name

Find all sections with a given name.

find_shortest_path_between_nodes

Finds the shortest path of nodes through the mesh between two nodes.

from_brep

Create a Part object from a BREP file.

from_compas_lines

Generate a part from a list of compas.geometry.Line.

from_compas_lines_discretized

Generate a discretized model from a list of compas.geometry.Line.

from_gmsh

Creates a Part from Ggmsh.

from_json

Construct an object of this type from a JSON file.

from_jsonstring

Construct an object of this type from a JSON string.

from_step_file

Create a Part object from a STEP file.

get_connected_components

Checks if the mesh is fully connected or consists of multiple 'islands'.

is_element_on_boundary

Check if the element belongs to the boundary mesh of the part.

remove_element

Remove an element from the part.

remove_elements

Remove multiple elements from the part.

remove_node

Remove a compas_fea2.model.Node from the part.

remove_nodes

Remove multiple compas_fea2.model.Node from the part.

sha256

Compute a hash of the data for comparison during version control using the sha256 algorithm.

shell_from_compas_mesh

Creates a Part object from a compas.datastructures.Mesh.

to_json

Convert an object to its native data representation and save it to a JSON file.

to_jsonstring

Convert an object to its native data representation and save it to a JSON string.

transform

Transform the part.

transformed

Return a transformed copy of the part.

validate_data

Validate the data against the object's data schema.