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
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.
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.
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.
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.
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.
Split the Mesh into connected parts.
Returns a list of Meshes that each form a connected part.
Return the largest connected part of the Mesh.
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.
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.
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.
area of elements
For surface element the faces’ area is returned. For volume elements the sum of the faces’areas is returned.
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.
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.
Initialize the Mesh extensions.
Calling this function will install some of the mesh functions defined in this modules as Mesh methods.