yt.utilities.lib.mesh_construction module

This file contains the ElementMesh classes, which represent the target that the rays will be cast at when rendering finite element data. This class handles the interface between the internal representation of the mesh and the pyembree representation.

Note - this file is only used for the Embree-accelerated ray-tracer.

class yt.utilities.lib.mesh_construction.LinearElementMesh

Bases: object

This creates a 1st-order mesh to be ray-traced with embree. Currently, we handle non-triangular mesh types by converting them to triangular meshes. This class performs this transformation. Currently, this is implemented for hexahedral and tetrahedral meshes.

Parameters:
  • scene (EmbreeScene) – This is the scene to which the constructed polygons will be added.
  • vertices (a np.ndarray of floats.) – This specifies the x, y, and z coordinates of the vertices in the polygon mesh. This should either have the shape (num_vertices, 3). For example, vertices[2][1] should give the y-coordinate of the 3rd vertex in the mesh.
  • indices (a np.ndarray of ints) – This should either have the shape (num_elements, 4) or (num_elements, 8) for tetrahedral and hexahedral meshes, respectively. For tetrahedral meshes, each element will be represented by four triangles in the scene. For hex meshes, each element will be represented by 12 triangles, 2 for each face. For hex meshes, we assume that the node ordering is as defined here: http://homepages.cae.wisc.edu/~tautges/papers/cnmev3.pdf
class yt.utilities.lib.mesh_construction.QuadraticElementMesh

Bases: object

This creates a mesh of quadratic patches corresponding to the faces of 2nd-order Lagrange elements for direct rendering via embree. Currently, this is implemented for 20-point hexahedral meshes only.

Parameters:
  • scene (EmbreeScene) – This is the scene to which the constructed patches will be added.
  • vertices (a np.ndarray of floats.) – This specifies the x, y, and z coordinates of the vertices in the mesh. This should either have the shape (num_vertices, 3). For example, vertices[2][1] should give the y-coordinate of the 3rd vertex in the mesh.
  • indices (a np.ndarray of ints) – This should have the shape (num_elements, 20). Each hex will be represented in the scene by 6 bi-quadratic patches. We assume that the node ordering is as defined here: http://homepages.cae.wisc.edu/~tautges/papers/cnmev3.pdf