Face#

class ansys.dpf.core.faces.Face(mesh, faceid, index, nodes)#

Contains all properties of a face of a mesh.

The face is created from the MeshedRegion class. Properties include the face ID, index, type, shape, and connectivity.

Parameters:
  • mesh (ansys.dpf.core.meshed_region.MeshedRegion) – Mesh containing the face.

  • faceid (int) – Number (ID) of the face.

  • index (int) – Fortran-based (1-based) index of the face in the result.

  • nodes (list) – List of DPF nodes belonging to the face.

Examples

Extract a single face from a meshed region.

>>> import ansys.dpf.core as dpf
>>> from ansys.dpf.core import examples
>>> model = dpf.Model(examples.fluid_axial_model())
>>> faces = model.metadata.meshed_region.faces
>>> face = faces[0]

List the coordinates belonging to the first node of the face.

>>> face.nodes[0].coordinates
[-0.030426240620025163, -0.05908951107677226, -0.034248966723680496]

Notes

Class available with server’s version starting at 7.0 (2024 R1 pre0).

Overview#

node_ids

IDs of all nodes in the face.

id

ID of the face.

index

Index of the face in the result.

nodes

All nodes in the face.

n_nodes

Number of nodes in the face.

type

Type of the face.

connectivity

Ordered list of node indices of the face.

__str__

Provide more information in string representation.

Import detail#

from ansys.dpf.core.faces import Face

Property detail#

property Face.node_ids#

IDs of all nodes in the face.

Returns:

List of IDs for all nodes in the face.

Return type:

list

Examples

>>> import ansys.dpf.core as dpf
>>> from ansys.dpf.core import examples
>>> model = dpf.Model(examples.fluid_axial_model())
>>> faces = model.metadata.meshed_region.faces
>>> face = faces[0]
>>> face.node_ids
[11291, 11416, 11455, 11325]
property Face.id: int#

ID of the face.

Returns:

ID of the face.

Return type:

int

property Face.index: int#

Index of the face in the result.

Returns:

Index of the face in the result. This uses zero-based indexing starting at 0.

Return type:

int

property Face.nodes#

All nodes in the face.

Returns:

List of all nodes in the face.

Return type:

list

Examples

>>> import ansys.dpf.core as dpf
>>> from ansys.dpf.core import examples
>>> model = dpf.Model(examples.fluid_axial_model())
>>> faces = model.metadata.meshed_region.faces
>>> face = faces[0]
>>> first_node = face.nodes[0]
property Face.n_nodes: int#

Number of nodes in the face.

Returns:

Number of nodes.

Return type:

int

property Face.type: int#

Type of the face.

Returns:

Type of the face. For more information, see ansys.dpf.core.elements.element_types.

Return type:

int

Examples

>>> import ansys.dpf.core as dpf
>>> from ansys.dpf.core import examples
>>> model = dpf.Model(examples.fluid_axial_model())
>>> faces = model.metadata.meshed_region.faces
>>> face = faces[0]
>>> face.type

property Face.connectivity#

Ordered list of node indices of the face.

Returns:

Ordered list of node indices.

Return type:

list

Method detail#

Face.__str__()#

Provide more information in string representation.