MeshInfo#

class ansys.dpf.core.mesh_info.MeshInfo(generic_data_container=None, mesh_info=None, server=None)#

Hold the information relative to a mesh region.

This class describes the available mesh information.

Parameters:
  • server (ansys.dpf.core.server, optional) – Server with the channel connected to the remote or local instance. The default is None, in which case an attempt is made to use the global server.

  • generic_data_container (ansys.dpf.core.generic_data_container, optional) – Generic data container that is wrapped into the mesh info.

  • mesh_info (optional) – Hold the information of the mesh region into a generic data container.

Examples

Explore the mesh info from the model

>>> from ansys.dpf import core as dpf
>>> from ansys.dpf.core import examples
>>> fluent = examples.fluid_axial_model()
>>> model = dpf.Model(fluent)
>>> mesh_info = model.metadata.mesh_info

Notes

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

Overview#

deep_copy

Create a deep copy of the mesh_info’s data on a given server.

get_property

Get property with given name.

set_property

Register given property with the given name.

generic_data_container

GenericDataContainer wrapped into the MeshInfo that contains all the relative information of the derived class.

number_nodes

Returns number of nodes in the mesh.

number_faces

Returns number of faces in the mesh.

number_elements

Returns number of elements in the mesh.

splittable_by

Return name of properties according to which the mesh can be split by.

available_elem_types

Returns available mesh element types.

part_names

Return part names of the mesh.

parts

Dictionary of available part IDs to part names.

part_scoping

Return part scoping of the mesh.

body_names

Return body names of the mesh.

body_scoping

Return body scoping of the mesh.

bodies

Dictionary of available body IDs to body names.

zone_names

Return zone names of the mesh.

zones

Dictionary of available zone IDs to zone names.

face_zones

Dictionary of available face zone IDs to face zone names.

cell_zones

Dictionary of available cell zone IDs to cell zone names.

zone_scoping

Return zone scoping of the mesh.

__str__

Return a string representation of the MeshInfo instance.

Import detail#

from ansys.dpf.core.mesh_info import MeshInfo

Property detail#

property MeshInfo.generic_data_container: ansys.dpf.core.generic_data_container.GenericDataContainer#

GenericDataContainer wrapped into the MeshInfo that contains all the relative information of the derived class.

Return type:

ansys.dpf.core.generic_data_container.GenericDataContainer

property MeshInfo.number_nodes#

Returns number of nodes in the mesh.

Returns:

number_nodes – Number of nodes of the mesh.

Return type:

int

property MeshInfo.number_faces#

Returns number of faces in the mesh.

Returns:

number_faces – Number of faces of the mesh.

Return type:

int

property MeshInfo.number_elements#

Returns number of elements in the mesh.

Returns:

number_elements – Number of elements of the mesh.

Return type:

int

property MeshInfo.splittable_by#

Return name of properties according to which the mesh can be split by.

Returns:

splittable by which entity – Name of the properties according to which the mesh can be split by.

Return type:

StringField

property MeshInfo.available_elem_types#

Returns available mesh element types.

Returns:

available element types – element type available for the mesh.

Return type:

Scoping

property MeshInfo.part_names#

Return part names of the mesh.

Returns:

part_names – part names of the mesh (if it can be split by parts)

Return type:

StringField

property MeshInfo.parts: dict#

Dictionary of available part IDs to part names.

Returns:

  • parts – Map of part IDs to part names.

  • .. warning – Currently unavailable for LegacyGrpc servers.

property MeshInfo.part_scoping#

Return part scoping of the mesh.

Returns:

  • part_scoping (Scoping) – part Scoping of the mesh (if it can be split by parts)

  • .. warning – Currently unavailable for LegacyGrpc servers.

property MeshInfo.body_names#

Return body names of the mesh.

Returns:

body_names – body names of the mesh (if it can be split by bodies)

Return type:

StringField

property MeshInfo.body_scoping#

Return body scoping of the mesh.

Returns:

body_scoping – body Scoping of the mesh (if it can be split by bodies)

Return type:

Scoping

property MeshInfo.bodies: dict#

Dictionary of available body IDs to body names.

Returns:

  • bodies – Map of body IDs to body names.

  • .. warning – Currently unavailable for LegacyGrpc servers.

property MeshInfo.zone_names#

Return zone names of the mesh.

Returns:

  • zone_names (StringField) – zone_names of the mesh (if it can be split by zones)

  • .. warning – Currently unavailable for LegacyGrpc servers.

property MeshInfo.zones: dict#

Dictionary of available zone IDs to zone names.

Returns:

  • zones – Map of zone IDs to zone names.

  • .. warning – Currently unavailable for LegacyGrpc servers.

property MeshInfo.face_zones: dict#

Dictionary of available face zone IDs to face zone names.

Returns:

  • face_zones – Map of face zone IDs to face zone names.

  • .. warning – Currently unavailable for LegacyGrpc servers.

property MeshInfo.cell_zones: dict#

Dictionary of available cell zone IDs to cell zone names.

Returns:

  • cell_zones – Map of cell zone IDs to cell zone names.

  • .. warning – Currently unavailable for LegacyGrpc servers.

property MeshInfo.zone_scoping#

Return zone scoping of the mesh.

Returns:

  • zone_scoping (Scoping) – zone Scoping of the mesh (if it can be split by zone)

  • .. warning – Currently unavailable for LegacyGrpc servers.

Method detail#

MeshInfo.__str__()#

Return a string representation of the MeshInfo instance.

Returns:

A string representation of the information about a mesh space.

Return type:

str

MeshInfo.deep_copy(server=None)#

Create a deep copy of the mesh_info’s data on a given server.

This method is useful for passing data from one server instance to another.

Parameters:

server (ansys.dpf.core.server, optional) – Server with the channel connected to the remote or local instance. The default is None, in which case an attempt is made to use the global server.

Returns:

mesh_info_copy

Return type:

MeshInfo

MeshInfo.get_property(property_name)#

Get property with given name.

Parameters:

property_name (str) – Property name.

Return type:

Property object instance.

MeshInfo.set_property(property_name, prop)#

Register given property with the given name.

Parameters: