:class:`Element` ================ .. py:class:: ansys.dpf.core.elements.Element(mesh, elementid, index, nodes) Contains all properties of an element of a mesh. The element is created from the :class:`MeshedRegion ` class. Properties include the element ID, index, type, shape, and connectivity. :param mesh: Mesh containing the element. :type mesh: :class:`ansys.dpf.core.meshed_region.MeshedRegion` :param elementid: Number (ID) of the element. :type elementid: int :param index: Fortran-based (1-based) index of the element in the result. :type index: int :param nodes: List of DPF nodes belonging to the element. :type nodes: list .. rubric:: Examples Extract a single element from a meshed region. >>> import ansys.dpf.core as dpf >>> from ansys.dpf.core import examples >>> model = dpf.Model(examples.find_static_rst()) >>> elements = model.metadata.meshed_region.elements >>> element = elements[0] List the coordinates belonging to the first node of the element. >>> element.nodes[0].coordinates [0.015, 0.045, 0.015] .. py:currentmodule:: Element Overview -------- .. tab-set:: .. tab-item:: Properties .. list-table:: :header-rows: 0 :widths: auto * - :py:attr:`~node_ids` - IDs of all nodes in the element. * - :py:attr:`~id` - ID of the element. * - :py:attr:`~index` - Index of the element in the result. * - :py:attr:`~nodes` - All nodes in the element. * - :py:attr:`~n_nodes` - Number of nodes in the element. * - :py:attr:`~type` - Type of the element. * - :py:attr:`~shape` - Shape of the element. * - :py:attr:`~connectivity` - Ordered list of node indices of the element. .. tab-item:: Special methods .. list-table:: :header-rows: 0 :widths: auto * - :py:attr:`~__str__` - Provide more details in the string representation. Import detail ------------- .. code-block:: python from ansys.dpf.core.elements import Element Property detail --------------- .. py:property:: node_ids IDs of all nodes in the element. :returns: List of IDs for all nodes in the element. :rtype: list .. rubric:: Examples >>> import ansys.dpf.core as dpf >>> from ansys.dpf.core import examples >>> model = dpf.Model(examples.find_static_rst()) >>> elements = model.metadata.meshed_region.elements >>> element = elements[0] >>> element.node_ids [1, 26, 14, 12, 2, 27, 15, 13, 33, 64, 59, 30, 37, 65, 61, 34, 28, 81, 63, 58] .. py:property:: id :type: int ID of the element. :returns: ID of the element. :rtype: int .. py:property:: index :type: int Index of the element in the result. :returns: Index of the element in the result. This uses zero-based indexing starting at ``0``. :rtype: int .. py:property:: nodes All nodes in the element. :returns: List of all nodes in the element. :rtype: list .. rubric:: Examples >>> import ansys.dpf.core as dpf >>> from ansys.dpf.core import examples >>> model = dpf.Model(examples.find_static_rst()) >>> elements = model.metadata.meshed_region.elements >>> element = elements[0] >>> first_node = element.nodes[0] .. py:property:: n_nodes :type: int Number of nodes in the element. :returns: Number of nodes. :rtype: int .. py:property:: type :type: element_types Type of the element. :returns: Type of the element. For more information, see :class:`ansys.dpf.core.elements.element_types`. :rtype: element_types .. rubric:: Examples >>> import ansys.dpf.core as dpf >>> from ansys.dpf.core import examples >>> model = dpf.Model(examples.find_static_rst()) >>> elements = model.metadata.meshed_region.elements >>> element = elements[0] >>> element.type .. py:property:: shape :type: str Shape of the element. :returns: Shape of the element, which can be ``"shell"``, ``"solid"``, ``"beam"``, or ``"unknown_shape"``. :rtype: str .. rubric:: Examples >>> import ansys.dpf.core as dpf >>> from ansys.dpf.core import examples >>> model = dpf.Model(examples.find_static_rst()) >>> elements = model.metadata.meshed_region.elements >>> element = elements[0] >>> element.shape 'solid' .. py:property:: connectivity Ordered list of node indices of the element. :returns: Ordered list of node indices. :rtype: list Method detail ------------- .. py:method:: __str__() Provide more details in the string representation.