scallop dome pyformex logo

Previous topic

45. lima — Lindenmayer Systems

Next topic

47. nurbs — Using NURBS in pyFormex.

[FSF Associate Member]

Valid XHTML 1.0 Transitional

46. 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.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 correctly if the quads are nearly planar.