![]() |
GeMA
The GeMA main application
|
Index:
mesh:nodeSpacing()mesh:nodeCount()mesh:nodeWrap()mesh:nodeFromIndex()mesh:indexFromNode()mesh:neighbor()| mesh:nodeSpacing(dim) | |
|---|---|
| Description: | Returns the spacing, in the given direction, for a regular grid mesh. |
| Parameters: | dim - The queried dimension (from 1 to the mesh coordinate dimension). A value of 1 means x, 2 means y and 3 means z. |
| Returns: | Returns the mesh regular spacing in the given direction. |
Example:
| mesh:nodeCount(dim) | |
|---|---|
| Description: | Returns the node count, in the given direction, for a regular grid mesh. |
| Parameters: | dim - The queried dimension (from 1 to the mesh coordinate dimension). A value of 1 means x, 2 means y and 3 means z. |
| Returns: | Returns the number of nodes in the given direction. |
Example:
| mesh:nodeWrap(dim) | |
|---|---|
| Description: | Returns true if the mesh 'wraps around', in the given direction, for a regular grid mesh. Wrapping around means that the last and first nodes in that direction are conceptually neighbors. |
| Parameters: | dim - The queried dimension (from 1 to the mesh coordinate dimension). A value of 1 means x, 2 means y and 3 means z. |
| Returns: | Returns the mesh wrap mode in the given direction. |
Example:
| mesh:nodeFromIndex(i, j, k) | ||
|---|---|---|
| Description: | Given a set of node column, line and depth indices, returns the correspondent node index. The number of parameters sent to the function should be equal to the mesh coordinate dimension. | |
| Parameters: | i | The node position (index) in the x dimension (from 1 to mesh:nodeCount(1)). Corresponds to the grid column index. |
| j | The node position (index) in the y dimension (from 1 to mesh:nodeCount(2)). Corresponds to the grid line index. | |
| k | The node position (index) in the z dimension (from 1 to mesh:nodeCount(3)). Corresponds to the grid depth index. | |
| Returns: | Returns the mesh node index. | |
Example:
| mesh:indexFromNode(nodeIndex) | |
|---|---|
| Description: | Given a node index, returns its (i, j, k) coordinates, corresponding to the node's column, line and/or depth in the grid mesh. The number of returned coordinates depends on the mesh dimension. |
| Parameters: | nodeIndex - The mesh node index (from 1 to mesh:numNodes()). |
| Returns: | Returns the grid indices corresponding to the given node. The number of returned values is equal to the mesh dimension. |
Example:
| mesh:neighbor(node, di, dj, dk) | ||
|---|---|---|
| Description: | Given a node index and a set of offsets in each direction, returns the mesh index of the correspondent neighbor index. If the mesh wraps around in a given dimension, the last and first nodes in that dimension will be neighbors. The number of offset parameters sent to the function should be equal to the mesh coordinate dimension. | |
| Parameters: | node | The base node index (from 1 to mesh:numNodes()). |
| di | The desired integer offset from node in the x direction. Can be a positive, negative or zero value. | |
| dj | The desired integer offset from node in the y direction. Can be a positive, negative or zero value. | |
| dk | The desired integer offset from node in the z direction. Can be a positive, negative or zero value. | |
| Returns: | Returns the mesh index of the specified neighbor node or nil if out of bounds (there is no neighbor in the given direction). | |
Example:
1.8.15