31. mesh_ext — Extended functionality of the Mesh class. — pyFormex v0.8.6 documentation

### Navigation

- index
- modules |
- next |
- previous |
- pyFormex v0.8.6 documentation >
- pyFormex reference manual >

# 31. `mesh_ext` — Extended functionality of the Mesh class.

This module defines extended Mesh functionality which is considered to be experimental, maybe incomplete or even buggy.

The functions in this module can be called as functions operating on a Mesh object, but are also available as Mesh methods.

`Classes defined in module mesh_ext`

`Functions defined in module mesh_ext`

`mesh_ext.` `report`(self)

  Create a report on the Mesh shape and size.

  The report contains the number of nodes, number of elements, plexitude, element type, bbox and size.

`mesh_ext.` `alt_report`(self)

  Create a report on the Mesh shape and size.

  The report contains the number of nodes, number of elements, plexitude, element type, bbox and size.

`mesh_ext.` `nodeFront`(self, startat=0, front_increment=1)

  Generator function returning the frontal elements.

  startat is an element number or list of numbers of the starting front. On first call, this function returns the starting front. Each next() call returns the next front.

`mesh_ext.` `partitionByNodeFront`(self, firstprop=0, startat=0)

  Detects different parts of the Mesh using a frontal method.

  okedges flags the edges where the two adjacent elems are to be in the same part of the Mesh. startat is a list of elements that are in the first part. The partitioning is returned as a property type array having a value corresponding to the part number. The lowest property number will be firstprop.

`mesh_ext.` `partitionByConnection`(self)

  Detect the connected parts of a Mesh.

  The Mesh is partitioned in parts in which all elements are connected. Two elements are connected if it is possible to draw a continuous (poly)line from a point in one element to a point in the other element without leaving the Mesh. The partitioning is returned as a property type array having a value corresponding to the part number. The lowest property number will be firstprop.

`mesh_ext.` `splitByConnection`(self)

  Split the Mesh into connected parts.

  Returns a list of Meshes that each form a connected part.

`mesh_ext.` `largestByConnection`(self)

  Return the largest connected part of the Mesh.

`mesh_ext.` `rings`(self, sources, nrings)

  It finds the rings of elems connected to sources by node.

  Sources is a list of elem indices. A list of rings is returned, from zero (equal to sources) to step. If step is -1, all rings are returned.

`mesh_ext.` `correctNegativeVolumes`(self)

  Modify the connectivity of negative-volume elements to make positive-volume elements.

  Negative-volume elements (hex or tet with inconsistent face orientation) may appear by error during geometrical trnasformations (e.g. reflect, sweep, extrude, revolve). This function fixes those elements. Currently it only works with linear tet and hex.

`mesh_ext.` `scaledJacobian`(self, scaled=True)

  Returns a quality measure for volume meshes.

  If scaled if False, it returns the Jacobian at the corners of each element. If scaled is True, it returns a quality metrics, being the minumum value of the scaled Jacobian in each element (at one corner, the Jacobian divided by the volume of a perfect brick). Each tet or hex element gives a value between -1 and 1. Acceptable elements have a positive scaled Jacobian. However, good quality requires a minimum of 0.2. Quadratic meshes are first converted to linear. If the mesh contain mainly negative Jacobians, it probably has negative volumes and can be fixed with the correctNegativeVolumes.

`mesh_ext.` `areas`(self)

  area of elements

  For surface element the faces’ area is returned. For volume elements the sum of the faces’areas is returned.

`mesh_ext.` `area`(self)

  Return the total area of the Mesh.

  For a Mesh with dimensionality 2, the total area of the Mesh is returned. For a Mesh with dimensionality 3, the total area of all the element faces is returned. Use Mesh.getBorderMesh().area() if you only want the total area of the border faces. For a Mesh with dimensionality < 2, 0 is returned.

`mesh_ext.` `partitionByAngle`(self, **arg)

  Partition a surface Mesh by the angle between adjacent elements.

  The Mesh is partitioned in parts bounded by the sharp edges in the surface. The arguments and return value are the same as in `TriSurface.partitionByAngle()`.

  Currently this only works for ‘tri3’ and ‘quad4’ type Meshes. Also, the ‘quad4’ partitioning method currently only works corectly if the quads are nearly planar.

`mesh_ext.` `initialize`()

  Initialize the Mesh extensions.

  Calling this function will install some of the mesh functions defined in this modules as Mesh methods.

### Navigation

- index
- modules |
- next |
- previous |
- pyFormex v0.8.6 documentation >
- pyFormex reference manual >