mesh.Mesh.scaled_jacobian#
- Mesh.scaled_jacobian(scaled=True, blksize=100000)#
Compute a quality measure for volume meshes.
Parameters#
- scaled: bool
If False returns the Jacobian at the corners of each element. If True, returns a quality metric, being the minimum value of the scaled Jacobian in each element (at one corner, the Jacobian divided by the volume of a perfect brick).
- blksize: int
If > 0 and the number of elements is larger than blksize, the Mesh is split in blocks with this number of elements, to reduce the memory required in handling large meshes. If <= 0, all elements are handled at once.
Returns#
- array
If scaled=True, returns an (n_elems,) float array with the scaled Jacobian for each element. If scaled=False, returns an (n_elems,plexitude) float array with the Jacobian at the corners of each element.
Notes#
If scaled is True each tet or hex element gets a value between -1 and 1. Acceptable elements have a positive scaled Jacobian. However, good quality requires a minimum of 0.2 or even 0.5. Quadratic meshes are first converted to linear. If the mesh contains negative Jacobians, it probably has negative volumes and can be fixed with the
fix_volumes()method.Examples#
>>> H = Mesh(eltype='hex20') >>> print(H.scaled_jacobian()) [1.] >>> print(H.scaled_jacobian(scaled=False)) [[1. 1. 1. 1. 1. 1. 1. 1.]] >>> H2 = H.shear(1, 0, 2.0) >>> print(H2.scaled_jacobian()) [0.4472] >>> T = Mesh(eltype='tet10') >>> print(T.scaled_jacobian()) [0.5]