uniform_mesh, rect_mesh, struct_mesh


Synopsis

mesh mappers that create meshes from dimensions and coordinates

Input Ports

in_dims

int[]

dimensions of mesh

in_points

float[sum(dims)][nspace]

points (rect only)

in_coord

float[prod(dims)][nspace]

coordinates (struct only)

 

Output Ports

out

Mesh

obj

output renderable object

 

Description

Each of these macros creates a mesh from arrays containing the dimensions, and optionally, the locations of the nodes in space. These macros simplify the process of generating field data by reducing the amount of data you must supply to create a field. Usually the output of one of these macros is merged, using combine_mesh_data, with the output of one of the data mapper macros to create a field.

uniform_mesh generates an N-dimensional uniform mesh, where N is the size of the input dimensions array, in_in_dims. The mesh has prod(in_dims) nodes. in_dims[0] is the number of nodes along the X axis, in_dims[1] is the number of nodes along the Y axis, and so on. The coordinate extents of the resulting mesh will be (0,in_dims[0]-1) in the X direction, (0,in_dims[1]-1) in the Y direction, and so on

rect_mesh generates an N-dimensional rectilinear mesh. It is similar to uniform_mesh except that the nodes are not necessarily equally spaced along the coordinate axes. The nodes are, however, aligned parallel to the axes, so the cells are still stretched rectangles or cubes (in the case of a 2D or 3D mesh respectively). The spacing of the nodes along the axes is determined by the in_points array, as described below.

struct_mesh generates an N-dimensional structured mesh. Each node (point) in this mesh can be located anywhere in space. The coordinates of the nodes are described in the in_coord array. The second dimension of this array determines the space of the mesh (typically 2 or 3).

Input Ports

in_dims

int[]. Describes the dimensions of the mesh. For example, in_dims={3,4} creates a 2D mesh with 3 nodes in X and 4 nodes in Y. Note that this does not necessarily specify the number of spatial dimensions in which the grid lives; it only sets the number of computational dimensions, or the number of indices needed to describe the location of a point in the mesh. The number of spatial dimensions is set by nspace, which by default is connected to the second dimension of the in_coord array. It must always be equal to or greater than the number of computational dimensions, since the computational grid is embedded in the space.

in_points

float[sum(in_dims)][nspace]. Used only for rect_mesh. Describes the spacing along each axis of the nodes in a rectilinear mesh. This is a list of points in space, where the points along the X axis are listed first, then points along the Y axis, and so on.

For example, in the in_dims={3,4} case described above


in_points={
{4,1}, {8,1}, {16,1},
{1,1}, {1,2}, {1,3}, {1,4}
}

describes a log-spaced three-element X axis with nodes at 4, 8, and 16, and a linear four-element Y axis with nodes at 1, 2, 3, and 4 in a 2D space. If the desired space (nspace) is 3D but the computational grid is 2D, the Z values of the points must be constant.

in_coords

float[prod(in_dims)][nspace]. Used only for struct_mesh. Describes the location of each node of the mesh in space. nspace (that is, the second dimension of this array), must be greater than or equal to ndims. The order of coordinates in in_coords is associated with the in_dims array.

For example, in the in_dims={3,4} case described above, the coordinates must be provided in the following order:


{0,0},{1,0},{2,0},{0,1},{1,1},{2,1},{0,2},{1,2},...{2,3}

The in_dims array implies connectivity between the coordinates. The first in_dims[0] entries in the coordinates array are considered to be a row of nodes. The next in_dims[0] coordinates are considered to be the next row, connectedto the nodes in the first row, and so on

Parameters

none

Output Ports

out

Mesh. Contains the mesh described by the input arrays.

obj

Renderable object corresponding to out.

Example

Not available.

Libraries.Main.Field_Mappers.Mesh_Mappers.rect_mesh
Libraries.Main.Field_Mappers.Mesh_Mappers.struct_mesh

File

v/fld_map.v

See also

Related modules: