create_zones_from_labels#

Mesh.create_zones_from_labels(label_expression=None, conversion_method=LabelToZoneMethod.SIMPLE)#

Create zones from labels.

When exporting to various solvers, zones play a very important role. Zones are where material properties and boundary conditions can be set in respective solvers.

Zones allow downstream setting of boundary conditions or material properties.

Zone names in PyPrimeMesh are translated into equivalent concepts in solver. Currently, only one method is available to convert zone to label. Currently, only face zones are created.

The method finds the entities by labels and then adds them to the zone with the same name as label.

If no label_expression is provided then all labels will be flattened to create zones. Label names will be combined if overlaps occur and separate zones created.

For example, if “LabelA” and “LabelB” had overlapping TopoFaces then the following three zones would be created; “LabelA”, “LabelB” and “LabelA_LabelB” for the overlap.

Parameters:
label_expressionstr

Expression for labels to be converted to zones.

conversion_methodLabelToZoneMethod

Method used to convert label to zones.

Examples

>>> from ansys.meshing.prime import lucid
>>> mesh_util = lucid.Mesh(model)
>>> mesh_util.create_zones_from_labels()