Faces
#
- class ansys.dpf.core.faces.Faces(mesh)#
Contains faces belonging to a meshed region.
- Parameters:
mesh (str) – Name of the meshed region.
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 >>> faces.n_faces 44242
Notes
Class available with server’s version starting at 7.0 (2024 R1 pre0).
Overview#
Retrieve a face by face ID. |
|
Retrieve a face using its index. |
|
Retrieve the indices to map the scoping of these faces to the scoping of a field. |
Scoping of the faces. |
|
Field of all faces types. |
|
Field containing for each face ID the node indices connected to the face. |
|
Number of faces. |
|
Mapping between the IDs and indices of the entity. |
Provide custom string representation. |
|
Retrieve face based on an index. |
|
Retrieve the number of faces. |
|
Provide for iterating in loops. |
Import detail#
from ansys.dpf.core.faces import Faces
Property detail#
- property Faces.scoping: ansys.dpf.core.scoping.Scoping#
Scoping of the faces.
- Return type:
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 >>> my_scoping = faces.scoping
- property Faces.faces_type_field#
Field of all faces types.
- Returns:
Field of all faces types.
- Return type:
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 >>> field = faces.faces_type_field >>> print(field.data) [16 16 16 ... 16 16 16]
- property Faces.faces_nodes_connectivity_field#
Field containing for each face ID the node indices connected to the face.
- Returns:
Field containing for each face ID the node indices connected to the face.
- Return type:
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 >>> field = faces.faces_nodes_connectivity_field >>> field.get_entity_data(1) DPFArray([11415, 11347, 11387, 11454])
- property Faces.n_faces: int#
Number of faces.
- property Faces.mapping_id_to_index: dict#
Mapping between the IDs and indices of the entity.
This property is useful for mapping scalar results from a field to the meshed region.
Examples
>>> import ansys.dpf.core as dpf >>> from ansys.dpf.core import examples >>> model = dpf.Model(examples.fluid_axial_model()) >>> meshed_region = model.metadata.meshed_region >>> map = meshed_region.faces.mapping_id_to_index
Method detail#
- Faces.__str__()#
Provide custom string representation.
- Faces.__getitem__(index)#
Retrieve face based on an index.
- Faces.__len__()#
Retrieve the number of faces.
- Faces.__iter__()#
Provide for iterating in loops.
- Faces.face_by_id(id) Face #
Retrieve a face by face ID.
- Parameters:
id (int) – Number (ID) of the face.
- Returns:
Face object.
- Return type:
- Faces.face_by_index(index) Face #
Retrieve a face using its index.
- Parameters:
index (int) – Zero-based index.
- Returns:
Yield face.
- Return type:
Examples
faces.face_by_index(0)
Notes
This is equivalent to
faces[0]
- Faces.map_scoping(external_scope)#
Retrieve the indices to map the scoping of these faces to the scoping of a field.
- Parameters:
external_scope (
ansys.dpf.core.scoping.Scoping
) – Scoping to map to.- Returns:
indices (numpy.ndarray) – List of indices to map from the external scope to the scoping of these faces.
mask (numpy.ndarray) – Members of the external scope that are in the face scoping.
Examples
Return the indices that map a field to a faces collection.
>>> 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 >>> m = model.results.mass_flow_rate() >>> field = m.outputs.fields_container()[0] >>> ind, mask = faces.map_scoping(field.scoping)