sfepy.mesh.mesh_tools module

sfepy.mesh.mesh_tools.expand2d(mesh2d, dist, rep)[source]

Expand 2D planar mesh into 3D volume, convert triangular/quad mesh to tetrahedrons/hexahedrons.

mesh2d : Mesh

The 2D mesh.

dist : float

The elements size in the 3rd direction.

rep : int

The number of elements in the 3rd direction.

mesh3d : Mesh

The 3D mesh.

sfepy.mesh.mesh_tools.smooth_mesh(mesh, n_iter=4, lam=0.6307, mu=-0.6347, weights=None, bconstr=True, volume_corr=False)[source]

FE mesh smoothing.

Based on:

[1] Steven K. Boyd, Ralph Muller, Smooth surface meshing for automated finite element model generation from 3D image data, Journal of Biomechanics, Volume 39, Issue 7, 2006, Pages 1287-1295, ISSN 0021-9290, 10.1016/j.jbiomech.2005.03.006. (http://www.sciencedirect.com/science/article/pii/S0021929005001442)

mesh : mesh

FE mesh.

n_iter : integer, optional

Number of iteration steps.

lam : float, optional

Smoothing factor, see [1].

mu : float, optional

Unshrinking factor, see [1].

weights : array, optional

Edge weights, see [1].

bconstr: logical, optional

Boundary constraints, if True only surface smoothing performed.

volume_corr: logical, optional

Correct volume after smoothing process.

coors : array

Coordinates of mesh nodes.

sfepy.mesh.mesh_tools.triangulate(mesh, verbose=False)[source]

Triangulate a 2D or 3D tensor product mesh: quadrilaterals->triangles, hexahedrons->tetrahedrons.

mesh : Mesh

The input mesh.

mesh : Mesh

The triangulated mesh.