TOC PREV NEXT INDEX

The Data Visualization Kit


4

DV base modules


This chapter provides an introduction and comprehensive reference material for the Data Visualization Kit base modules.

Note: Some of the modules described in this chapter are available only in the Developer Edition. Where this is the case, a line identifying this fact appears directly below the module name at the top of the page.

4.1 Introduction
4.1.1 DV prefix base modules

Base visualization objects can be viewed as special V group objects, from which an application can be built. Defined as groups, the base modules define their input and output data templates and the name of the method to call when the object is notified. For example, a V description of an isosurface group object template includes "input_field," "output_field," and "level." The description also includes the method "iso," the name of the data processing function associated with the object. Note that this group object can be used to process any field that has mesh and node data.

group DViso {
Mesh+Node_Data+Iparam &in {
xform+nonotify;
nnodes+req;
};
float+Iparam level;
Mesh+Oparam out {
&xform<weight=-1> => in.xform;
};
NParam_Data+Oparam nparam;
method+notify_val+notify_inst iso_update = "iso";
};

V provides the ability to associate the name of a data processing method ("iso" in the example above) with a callable function that gets executed when the object is notified. The set of all visualization data functions provides a powerful and extensible interface between the Object Manager and the Data Visualization Kit.

Base modules are also sometimes referred to as primitives.

4.1.2 DVM macros

When you look at the icons under Libraries.Visualization.Macros, you will also see a large number of icons with the "DVM" prefix, or no prefix at all. These are V macros that define a series of objects that are in between the low-level DV base modules, and the high-level AVS/Express macros. They define a collection of user interface macros, plus a set of parameter ports that together make it convenient to create the AVS/Express macros described in the "Macros" chapter.

The AVS/Express macros use these intermediate level DVM hierarchical macro objects to define themselves. You can use them to construct macros with your own user interface design.

These intermediate level macro objects are not documented on their own reference pages.

4.1.3 V source

All base modules are defined in v/dv.v .

The mid-level DVM macros are defined in v/dv_macro.v.

4.1.4 Source to methods

Where base modules use methods, those methods are implemented as library calls in modules/*.

4.2 DVadvect
Available in Developer Edition Only
Synopsis

determine the position of a massless particle along a velocity streamline

group DVadvect {
Mesh+Node_Data+Iparam &in { /* input field */
nnodes+req;
xform+nonotify;
};
float+Iparam time; /* time step */
int+Iparam direction ; /* direction of integration */
Mesh+Node_Data+Oparam out { /* output field */
&xform<weight=-1> => in.xform;
};
method+notify_val+notify_inst upd_advect = "advect";
} ;
Description

DVadvect takes the output of DVstream, which is a polyline Mesh with velocity Node_Data that represents the path of the velocities through a field, plus a float value that is a time along that streamline. From this, for each streamline, it calculates the position of a particle at that a given time along the streamline.

For example

:

Input
&in

Reference to the field output of DVstream. This is a polyline unstructured Mesh that is the path of a streamline through a velocity (three object X, Y, Z vector component) field. Its Node_Data is a velocity value.

time

A float. Sets the time along the streamline for which the particle's position should be calculated.

direction

An integer. If the value is not 0, the direction of integration is forward. If it is zero, the direction is backward.

Output
&out

The output is a new object. Its mesh is an unstructured Mesh of cell type Point. The locations of the points represent each particle's current position. Its Node_Data is the velocities at those points. The field also includes a reference to the input field's xform.

Algorithm

advector uses precomputed streamlines (from DVstream) as particle paths. It integrates velocity along the streamlines to calculate the new position of the particles at each time step.

The streamlines are originally calculated using the Runge-Kutte method of specified order with adaptive time steps.

Files

v/dv.v
modules/advect.c

Utility DVM macros

DVMadvect_param, Advect

Example

Libraries.Main.Mappers.advector

See also
Section 4.82, DVstream  [page 4-174]

4.3 DVaverage_coord
Available in Developer Edition Only
Synopsis

average the coordinates between two meshes

group DVaverage_coord {
Mesh+Node_Data+IPort2 &in1;
Mesh+Node_Data+IPort2 &in2;
float+IPort2 t=0.5;
Grid+Xform out_grid {
nnodes => in1.nnodes;
nspace => in1.nspace;
&xform => in1.xform;
int npoints => nnodes;
float points[nnodes][nspace];
coordinates {
values+nres => (1-t)*in1.coordinates.values + t*in2.coordinates.values ;
};
};
Mesh+Node_Data+OPort2 &out => merge(out_grid, in1);
};
Description

DVaverage_coord takes the meshes of two input fields and produces an output field whose Grid equals:

(1-t) * in1.coordinates.values + t * in2.coordinates.values

where t is a user-settable value. Its Node_Data is that of the first input field.

Input
&in1
&in2

References to two input fields containing any type of mesh and Node_Data. The nnodes and nspace of the two meshes should be equal.

t

An integer constant by which the two coordinate grids will be modified. The default is .5.

Output
&out

The output is a reference to a merged object that contains the new Grid, plus a reference to all the non-Grid portions of &in1.

Files

v/dv.v

Example

Not available.

4.4 DVaxis
Available in Developer Edition Only
Synopsis

generate an axis line

module DVaxis {
Mesh+Iparam &in {
nnodes+req;
};
float+req+Iparam limits[2];
float+req+Iparam reference;
float+req+Iparam tick_step;
float+req+Iparam tick_y_below;
float+req+Iparam tick_y_above;
float+req+Iparam tick_z_below;
float+req+Iparam tick_z_above;
int+req+Iparam minor_ticks;
float+req+Iparam minor_scale;
int+req+Iparam ndig;
float+req+Iparam y_anno;
float+req+Iparam z_anno;
int+write ntick;
string+write labels[ntick];
float+write xyz[ntick*3];

Mesh+Oparam out;
Mesh+Oparam out_minor {
&xform => <-.out.xform;
};
TextField out_anno {
nspace=3;
nnodes => <-.ntick;
text_values => <-.labels;
coordinates {
&values+nres => <-.<-.xyz;
};
&xform => <-.out.xform;
};
method+notify_val+notify_inst upd_axis<status=1> = "DVaxis";
};
Description

DVaxis generates an axis line with optional tick marks. It can be transformed to any position.

Input Ports
Mesh+Iparam &in_field

A field whose extents define the size of the axis

float+req+Iparam limits[2]

The lower and upper limits of the axis line

float+req+Iparam reference

The value along the axis at which the perpendicular axes will be drawn

float+req+Iparam tick_step

The spacing between major tick lines

float+req+Iparam tick_y_below

How far below the Y axis the Y-axis ticks extend

float+req+Iparam tick_y_above

How far above the Y axis the Y-axis ticks extend

float+req+Iparam tick_z_below

How far below the Z axis the Z-axis ticks extend

float+req+Iparam tick_z_above

How far above the Z axis the Z-axis ticks extend

int+req+Iparam minor_ticks

If 1, minor tick lines are drawn. If 0, no minor tick lines are drawn.

float+req+Iparam minor_scale

The spacing between minor tick lines

float+req+Iparam ndig

Number of digits to display on the axis labels

float+req+Iparam y_anno

Offset for annotation text from the xyz positions

float+req+Iparam z_anno

Offset for annotation text from the xyz positions

int+write ntick

Number of major ticks

string+write labels[ntick]

Label strings to be drawn at the tick positions

float+write xyz[ntick*3]

Where to draw the ticks.

Output Ports
Mesh+OParam out

Output mesh describing the lines to be drawn for the major ticks

Mesh+Oparam out_minor

Output mesh describing the lines to be drawn for the minor ticks

TextField out_anno

Output field describing the numeric labels to be drawn along the axis

Example

Libraries.Main.Geometries.Axis2D
Libraries.Main.Geometries.Axis3D

File

v/dv.v

See also

Not applicable.

4.5 DVbounds
Available in Developer Edition Only
Synopsis

generate a bounding box of a 3D structured field

group DVbounds {
Mesh_Struct+Iparam &in {
ndim+req;
xform+nonotify;
};
int+Iparam hull;
int+Iparam edges;
int+Iparam faces;
int+Iparam imin;
int+Iparam imax;
int+Iparam jmin;
int+Iparam jmax;
int+Iparam kmin;
int+Iparam kmax;
int+Iparam data;
int+notify+IPort2 component;
Mesh+Node_Data+Oparam out {
&xform<weight=-1> => in.xform;
}; /* output field */
method+notify_val+notify_inst upd_bounds = "bounds";
} ;
Description

DVbounds generates lines and/or surfaces that show the bounding box of a 3D structured field.

Input
&in

The input is a reference to a field with a structured mesh. Mesh_Struct, Mesh_Rect, and Mesh_Unif are all accepted. If you toggle the data input, then the field must also have a Node_Data, but this is not normally required.

hull

An integer. When this is not 0, DVbounds draws a wireframe around the perimeter extents of the input mesh.

edges

An integer. When this is not 0, the imin/imax, jmin/jmax, kmin/kmax buttons will produce a wireframe representation of the mesh grid at that plane.

faces

An integer. When this is not 0, the imin/imax, jmin/jmax, kmin/kmax buttons will produce a solid face representing the location of that plane extent.

imin
imax
jmin
jmax
kmin
kmax

Integers. When they are not 0, each of these switches displays the grid (edges turned on) or plane (faces turned on) on one of the six faces of the hull. imin produces edges/faces at the i=0 plane. imax produces edges/faces at i=dims[0] - 1. jmin produces edges/faces at the j=0 plane. jmax produces edges/faces at the j=dims[1] - 1 plane. kmin/kmax control the third dimension.

data

An integer. When this is not 0, DVbounds will copy the selected component's Node_Data values at node points along the output mesh to the output field. Because the data is present, the bounds lines can be colored by the interpolated data values of the selected Node_Data component. Otherwise, the lines will display as white.

component

An integer. Sets which component's data values to copy to the output field. A Node_Data must be present in the input field.

Output
out

The output is a new object. Its mesh is an unstructured Mesh with cell type Polyline (edges, first cell set) and/or Quad (faces, second cell set) representing the boundings. Its Node_Data, if present and data was selected, contains the selected component's values at nodes on the output mesh.

Files

v/dv.v
modules/bounds.c

Utility DVM macros

DVMbounds_param

Example

Libraries.Main.Mappers.bounds

See also
Section 4.33, DVext_edge  [page 4-74]
Section 4.34, DVext_face  [page 4-76]

4.6 DVcell_data_labels
Available in Developer Edition Only
Synopsis

extract cell data labels for display in a UIradioBoxLabel

group DVcell_data_labels {
group+Iparam &in{
group+opt cell_set {
group+opt cell_data {
string+opt labels;
};
};
};
string+Oparam labels[];
int+Oparam ncomp => array_size(labels);
method+notify_val+notify_inst upd_cell_data_labels = "cell_data_labels";
};
Description

DVcell_data_labels extracts the cell data labels from all the Data_Arrays within a Cell_Data and stores them in a string array. If there are multiple cell_sets, labels are output for all. This string array (along with the ncomp value) can be used as inputs to a UIradioBoxLabel widget so that the user can pick which component, by label, he/she wants a downstream object to work on.

Input
&in

A reference to a field containing Cell_Data.

Output
labels[]

An string array object. The array is as long as: (ncell_sets * ncell_data) - duplicate_labels in the input field. It contains the labels strings from each component's Data_Array. If no label was present, the string value is empty (""). If duplicate labels are found, only one is output.

ncomp

An integer representing the size of the labels[] array.

Files

v/dv.v
modules/labels.c

Example

Libraries.Main.Filters.extract_component
Libraries.Main.Filters.threshold
Libraries.Main.Filters.clamp
Libraries.Main.Mappers.surf_plot
and many others

See also
Section 4.8, DVcell_labels  [page 4-20]
Section 4.9, DVcell_to_node  [page 4-22]
Section 4.35, DVextr_cell_comp  [page 4-78]

4.7 DVcell_data_math
Available in Developer Edition Only
Synopsis

perform arbitrary math operations on cell-based data

module DVcell_data_math {
string+IPort2 operation = "#1";
Mesh+Cell_Data+IPort2+nonotify &in1;
Mesh+Cell_Data+IPort2+nonotify &in2;
Mesh+Cell_Data+IPort2+nonotify &in3;
Mesh+Cell_Data+IPort2+nonotify &in4;
int+IPort2 data_type = 4;

int dim => in1.ncell_sets;
group+nonotify out_data[dim] {
int ncells => in1.cell_set[index_of(out_data)].ncells;
int ncell_data=1;
Data_Array cell_data[ncell_data] {
&id => in1.cell_set[index_of(out_data)].cell_data[0].id;
&veclen => in1.cell_set[index_of(out_data)].cell_data[0].veclen;
prim values[nvals][veclen];
labels = "cell_data_math";
};
};
group+nonotify out_sets[dim] {
group &out_set => merge(out_data[index_of(out_sets)],
in1.cell_set[index_of(out_sets)]);
};
Cells+Cell_Data+write+nonotify out_cd {
*cell_set[];
ncell_sets => array_size(cell_set);
};
Mesh+OPort2+nonotify &out =>merge(out_cd, in1);
method+notify_val+notify_inst upd_data_math<status=1>
="DVcell_data_math";
};
Description

DVcell_data_math performs arbitrary math operations on up to four cell-based data sets. You can use any operation or expression that can be specified in the V language to operate on the data. The expression you enter may use #1, #2, #3, and
#4 to stand for the four input fields.

Input Ports
string+IPort2 operation

The elementwise math expression to perform on the input fields' cell data set(s). Use #1 through #4 to refer to the input fields.

Mesh+Cell_Data+IPort2+nonotify &in1

One of the input fields.

Mesh+Cell_Data+IPort2+nonotify &in2

One of the input fields.

Mesh+Cell_Data+IPort2+nonotify &in3

One of the input fields.

Mesh+Cell_Data+IPort2+nonotify &in4

One of the input fields.

int+IPort2 data_type

The desired type of the output data set, as follows:

0
char
1
byte
2
short
3
int
4
float
5
double

Output Ports
Mesh+Cell_Data+OPort2+nonotify &out

The output field containing the resulting cell data set.

Example

cell_data_math macro, v/modules.v

File

v/dv.v

See also
Section 4.24, DVdata_math  [page 4-53]
4.8 DVcell_labels
Available in Developer Edition Only
Synopsis

extract all cell_names and names from the Cells in a Grid

group DVcell_data_labels {
group+Iparam &in{
group+opt cell_set {
string+opt cell_name;
string+opt labels;
};
};
string+Oparam labels[];
int+Oparam nsets => array_size(labels);
method+notify_val+notify_inst upd_cell_labels = "cell_labels";
};
Description

DVcell_labels extracts all of the cell_names ("Tri," "Hex2," etc.) and names (user-defined strings) in all Cell_Sets in the Cells portion of a Grid. It stores them in a single string array. This string array (along with the nsets value) can be used as inputs to a UIoptionBoxLabel widget and DVselect_cells so that the user can pick which Cell_Sets, by cell_name (type) and name (user-defined label), he/she wants a downstream object to work on.

Input
&in

A reference to a field containing a Grid with Cells.

Output
labels[]

An string array object. The array is as long as the ncell_sets. The strings are stored: "cell_name name". If no cell_name is found, it is set to "Set". If no name is found, it is left empty.

nsets

An integer representing the length of the labels array (ncell_sets).

Files

v/dv.v
modules/labels.c

Example

Libraries.Main.Filters.extract_component
Libraries.Main.Filters.threshold
Libraries.Main.Filters.clamp
Libraries.Main.Mappers.surf_plot
and many others

See also
Section 4.73, DVselect_cells  [page 4-157]
Section 4.6, DVcell_data_labels  [page 4-15]

4.9 DVcell_to_node
Available in Developer Edition Only
Synopsis

convert Cell_Data to Node_Data

group DVcell_to_node {
Mesh+Cell_Data+Iparam &in;
int+Iparam comps[];
int+Iparam order;
Node_Data+Oparam out_nd {
nnodes<weight=-1> => in.nnodes;
};
Mesh+Node_Data+OPort2+nonotify &out => merge(out_nd,in);
method+notify_val+notify_inst upd_cell_to_node = "cell_to_node";
};
Description

DVcell_to_node converts Cell_Data to Node_Data. It is necessary to visualize cell-based data when the visualization macro or base module selected does not process cell-based data.

Note: All nodes referenced by a cell with a NULL value will have their Node_Data set to NULL.

Inputs
&in

A reference to a field containing any type of Mesh and also Cell_Data.

comps[]

An integer array of variable length that specifies which components (0-n) of the input Cell_Data to convert to Node_Data. As many components will be converted as the length of this array. If the Cell_Data contains multiple cell_sets, then the conversion is performed on the specified components in each cell_set.

This array is generally provided by a combination of UIoptionBoxLabel and DVcell_data_labels.

order

An integer that sets the order of interpolation. Allowed values are:

0
averaging. A node's value is computed by averaging values at all adjoining cells.
1-n
A node's value is computed by interpolating values using distances from the node to the adjoining cell centroids.
Output
&out

The output is a reference to a merged object that contains the new Node_Data, plus the existing Mesh and Cell_Data.

Files

v/dv.v
modules/cellnode.c

Utility DVM macros

DVMcell_to_node_param

Example

Libraries.Main.Filters.cell_to_node

See also
Section 4.6, DVcell_data_labels  [page 4-15]
Section 4.35, DVextr_cell_comp  [page 4-78]
Section 4.8, DVcell_labels  [page 4-20]
Section 4.73, DVselect_cells  [page 4-157]
4.10 DVclamp
Available in Developer Edition Only
Synopsis

clamp Node_Data to min/max values

group DVclamp {
Node_Data+Iparam &in { /* input field */
nnodes+req;
};
int+Iparam component; /* which component to clamp */
int+Iparam below; /* toggle to turn on lower clamping */
int+Iparam above; /* toggle to turn on upper clamping */
int+Iparam reset_minmax
float+Iparam min_value; /* lower clamping value */
float+Iparam max_value; /* upper clamping value */
Node_Data+Oparam out; /* output field */
method+notify_val+notify_inst upd_clamp = "clamp" ;
} ;
Description

DVclamp transforms the values in one component of a Node_Data object as follows:

If both above and below are on, then the output field's selected component values are all in this range:

min_value <= value <= max_value

Null data values are not affected.

Input
&in

A reference to an input field that contains a Node_Data object. The field's data components can be scalar or vector.

component

An integer. Selects which of the input field's components to clamp.

above

An integer. If value is not 0, clamps data above the max_value.

below

An integer. If value is not 0, clamps data below the min_value.

reset_minmax

An integer. If the value is not 0, the field's minimum and maximum data values are reset to post-clamping values.

min_value
max_value

Floats. Establish the min and max values above and below which data is clamped to.

Output
out

A new Node_Data that contains the clamped output component. It has the same data type as the input Node_Data.

Files

v/dv.v
modules/clamp.c

Utility DVM macros

DVMclamp_param, Clamp

Example

Libraries.Main.Filters.clamp

See also
Section 4.88, DVthreshold  [page 4-187]

4.11 DVcomb_comp
Available in Developer Edition Only
Synopsis

combine Node_Data components from two fields into one new Node_Data

group DVcomb_comp {
Node_Data+Iparam &nd1 {
nnodes+req;
};
Node_Data+Iparam &nd2 {
nnodes+req;
};
int+Iparam comp1[];
int+Iparam comp2[];
Node_Data+Oparam out {
nnodes<weight=-1> => nd1.nnodes;
// we are only modifying the pointer value of node_data
// the '*' here prevents us from getting dependencies on
// the upstream guys.
*node_data[];
nnode_data => array_size(node_data);
};
method+notify_val upd_comb_comp = "comb_comp";
};
Description

DVcomb_comp combines any combination of components of two Node_Data objects into one new Node_Data object with n components. The user should ensure that the nnodes of the two input Node_Datas are equal.

Input
&nd1

Reference to a Node_Data object.

&nd2

Reference to a Node_Data object.

comp1[]

An integer array of variable length. Sets which components to take from &nd1. For example, if comp1 = {0, 3}, then the first and fourth components will be extracted.

comp2[]

An integer array of variable length. Sets which components to take from &nd2. For example, if comp2 = {1}, then the second component will be extracted.

Output
out

This is a new Node_Data with the same number of nodes as the first input field, and n components (nnode_data), where n is the sum of the dimensions of comp1 and comp2. Its own Node_Data is a reference (*node_data) to an n object array, where the array values are references to the components in nd1 and nd2.

Files

v/dv.v
modules/combcomp.c

Utility DVM macros

DVMcomb_comp_param

Example

Libraries.Main.Mappers.cut

See also
Section 4.36, DVextract_comp  [page 4-80]
Section 4.37, DVextr_scalar  [page 4-82]
Section 4.38, DVextr_vector  [page 4-84]

4.12 DVcomb_mesh_and_data
Available in Developer Edition Only
Synopsis

combine a Mesh object and a Node_Data object into a field

group DVcomb_mesh_and_data {
Mesh+IPort2 &in_mesh ;
Node_Data+nres+IPort2 &in_nd;
Mesh+Node_Data+OPort2 &out => merge(in_nd, in_mesh);
};
Description

DVcomb_mesh_and_data takes two inputs, any Mesh and Node_Data, and combines them together to form a new field.

Many base module visualization objects input only the mesh of a field object (for example, DVmirror), and do not care if Node_Data is present or not. Other base module objects input only an object's Node_Data (for example, DVclamp), and do not care if a mesh is present. Yet one may presume that the user usually wants both the Mesh and Node_Data objects of his/her original field rejoined prior to further processing. The DVcomb_mesh_and _data base module object performs this rejoining.The actual effect of DVcomb_mesh_and_data is slightly more subtle. What actually happens is that references to the input Mesh and input Node_Data are merged. A reference object named out is defined that points to this merging. Graphically, the operation looks like the following figure (again using DVclamp as the example):


Any object referencing the out port will receive a reference to the merged in_mesh and in_node. This will in turn reference the appropriate subobject of either Mesh or New Node_Data.

The following table lists which base modules work only on the mesh or only on the Node_Data, and hence may require DVcomb_mesh_and_data:

Mesh Only
Node_Data Only
DVscat_to_tet
DVextr_vector
DVplane_dist
DVextr_scalar
DVext_face
DVthreshold
DVext_edge
DVclamp
DVintegr_vol
DVnode_data_labels
DVprobe
DVcomb_comp
DVmirror
DVnmap
DVscale
DVfld_match
DVplane_crop
DVbounds
DVset_xform

Input
&in_mesh

A reference to the input Mesh.

&in_nd

A reference to the input Node_Data.

Output
&out

A reference to the object that is the merge of in_mesh and in_nd.

Files

v/dv.v

Example

Libraries.Main.Filters.threshold
Libraries.Main.Filters.clamp
Libraries.Main.Mappers.scat_to_fld

See also

Not applicable.

4.13 DVcombine_rgb
Available in Developer Edition Only
Synopsis

combine three scalars into an RGB image

module DVcombine_rgb {
Mesh_Unif+Dim2+Byte+Space2+Node_Data+Iparam &in1;
Mesh_Unif+Dim2+Byte+Space2+Node_Data+Iparam &in2;
Mesh_Unif+Dim2+Byte+Space2+Node_Data+Iparam &in3;

Node_Data+Byte out_nd {
nnodes => in1.nnodes;
nnode_data = 1;
node_data {
veclen = 3;
id = 669;
values+nres => combine_array(in1.node_data[0].values,
in2.node_data[0].values,
in3.node_data[0].values);
};
};

Mesh_Unif+Dim2+Byte+Space2+Node_Data+OPort2 &out =>
merge(out_nd, in1, in2, in3);
};
Description

DVcombine_rgb combines three scalar 2D, 2-space byte input fields into an RGB image. It sets the resulting vector node data set's ID to tell the renderer that it is an RGB image.

Input Ports
in1

Mesh_Unif+Dim2+Byte+Space2+Node_Data. This field represents the red channel of the image.

in2

Mesh_Unif+Dim2+Byte+Space2+Node_Data. This field represents the green channel of the image.

in3

Mesh_Unif+Dim2+Byte+Space2+Node_Data. This field represents the blue channel of the image.

Output Ports
out

Mesh_Unif+Dim2+Byte+Space2+Node_Data+OPort2. The output vector (image) field containing the combined three scalar fields.

Example

Not available.

File

v/dv.v

See also

Not applicable.

4.14 DVconcat_xform
Available in Developer Edition Only
Synopsis

concatenate two transformations

group DVconcat_xform {
GDxform_templ+Iparam &xform_in1;
GDxform_templ+Iparam &xform_in2;
GDxform_templ+Oparam xform_out;
method+notify_val+notify_inst upd_concat_xform = "concat_xform";
};
Description

DVconcat_xform concatenates the xform transformation matrix of two inputs, thus "adding" one transformation on an object to another. For example, one field may be rotated, another scaled, and the output will be rotated and scaled.

Input
&xform_in1
&xform_in2

Two xform transformation matrices. These can usually be obtained from the Grid of a field.

Output
xform_out

The new, concatenated transformation matrix.

Files

v/dv.v
modules/cnct_xfm.c

Example

Not available.

See also
Section 4.76, DVset_xform  [page 4-162]

4.15 DVcontour
Available in Developer Edition Only
Synopsis

create an isovolume bounded by two isosurface (3D) or isolines (2D)

group DVcontour {
Mesh+Node_Data+Iparam &in {
xform+nonotify;
nnodes+req;
};
int+Iparam contour_comp;
int+Iparam map_comp[];
float+Iparam level_min;
float+Iparam level_max;
Mesh+Node_Data+Oparam out { /* output field */
&xform<weight=-1> => in.xform;
};
method+notify_val+notify_inst upd_contour = "contour";
};
Description

DVcontour creates a field that is the volume bounded by two isosurfaces (if the field is 3D) or two isolines (if the field is 2D).

For example, you could set the level_min and level_max isosurfaces to be densities found just outside a bone. When combined, the isovolume produced would be the bone itself.

The isosurfaces or isolines are colored by the first map_comp selected. All of the selected map_comps are in the Node_Data of the output field.

Input
&in

The input is a reference to any mesh with Node_Data. A 2D mesh will produce isolines. A 3D mesh produces isosurfaces. At least one of the components must be scalar.

contour_omp

An integer that sets which component to isosurface/isoline. The selected component must be scalar or the message "iso: first component is not scalar" is written to stderr.

map_comp

Integer array to pick which components will be written to the output field In addition, the first component in the array will be mapped onto the isosurface/isoline (for example, map pressure value onto a density isosurface). The selection does not have to be scalar. Where the isosurface/isoline does not exactly intersect a node, the data value is linearly interpolated based on the surface's distance from the adjacent nodes.

level_min
level_max

Floats. Set the minimum and maximum isosurface/isoline values, between which data will be extracted. The float data type is converted to the data type of the node data before use.

Output
out

The output is a new field object that is an unstructured Mesh of cell type Tri (3D) or Line (2D) that represents the contour volume. Its Node_Data is the values within the volume. The surface values are interpolated along the isosurface/lines. The field's tranformation is a reference to the original input's transformation.

Algorithm

DVcontour uses the Marching Cubes algorithm to construct the isosurfaces/isolines. See W. Lorensen and H. Cline, "Marching Cubes: A High Resolution Surface Reconstruction Algorithm." Computer Graphics 21(4) (SIGGRAPH Proceedings, 1987), July, 1987, pp. 163-169.

This algorithm has a known limitation. There are cases where there are two possible paths that the isosurface could take through a cell, and only one is the correct path. If isosurface picks the wrong path, it will appear as a discontinuity in the surface such as a hole.

Files

v/dv.v
modules/contour.c

Utility DVM macros

DVMcontour_param

Example

Libraries.Main.Mappers.contour

See also
Section 4.49, DVisoline  [page 4-109]
Section 4.48, DViso  [page 4-104]
Section 4.50, DVisotrace  [page 4-111]
Section 4.51, DVisoline_trace  [page 4-112]
4.16 DVcopy_mesh
Synopsis

copy an input mesh to an output mesh

module DVcopy_mesh {
Grid+Cells+IPort2 &inMesh;
int+IPort2 trigger;
Grid+Cells+Data+Oparam outMesh;
method+notify_val update<status=1> = "DVcopy_mesh";
};
Description

DVcopy_mesh copies an input mesh to an output mesh. Any node or cell data that is present is also copied to the output.

Input Ports
inMesh

The input mesh to be copied to the output mesh.

Parameters
trigger

A trigger that can be used to cause the module to execute.

Output Ports
outMesh

The output mesh that is created from the input mesh.

Example

Libraries.Main.Mappers.copy_ROI

File

v/dv.v

See also

Related modules

Section 5.18, copy_ROI  [page 5-46]
4.17 DVcreate_line
Available in Developer Edition Only
Synopsis

interactively draw a polylines

group DVcreate_line {
float+Iparam &picked_xyz[3];
GDxform_templ+Iparam &picked_xform;
int+Iparam pick=1;
int+IOparam new=0;
int+nonotify new_cell=0;
Mesh+Node_Data+Oparam out {
nnodes = 0;
nspace = 3;
ncell_sets = 1;
Polyline cell_set;
};
method+notify_val upd_create_line = "create_line";
};
Description

DVcreate_line lets the user interactively draw a polylines over an object in a viewer window.

Input
&picked_xyz[3]

The coordinates of the picked point. This red input port should be connected to a viewer's pick-xform output port.

&picked_xform

The xform of the picked point. This red input port should be connected to a viewer's pick-coordinate output port.

pick

An integer. When not 0, the user is using the left mouse button to select a series of points on the object. Lines are drawn between each point. The default is 1 (on).

new

An integer. When not 0, the user wants to select a new "first" point and begin drawing a new series of lines. When 0, the user is in the middle of drawing a series of lines and any left mouse button click is a line endpoint. The default is 0. This value is also passed as output.

Output
out

The output is a new unstructured mesh of cell type Polyline. Each cell is one line segment in the drawing.

Files

v/dv.v
modules/drw_line.c

Example

Libraries.Main.Mappers.draw_line

See also

Not applicable.

4.18 DVcrop
Available in Developer Edition Only
Synopsis

discover the type of mesh, then call the corresponding cropping base module

group DVcrop {
Mesh_Struct+Node_Data+Iparam &in {
nnodes+req;
};
int+Iparam min[in.ndim];
int+Iparam max[in.ndim];

DVcrop_struct DVcrop_struct {
&min => <-.min;
&max => <-.max;
};
DVcrop_unif DVcrop_unif {
&min => <-.min;
&max => <-.max;
};
DVcrop_rect DVcrop_rect {
&min => <-.min;
&max => <-.max;
};

DVfld_match DVfld_match {
Mesh_Struct+IPort2 &in=> <-.in;
links {
link0 => DVcrop_unif.in;
link1 => DVcrop_rect.in;
link2 => DVcrop_struct.in;
};
};

DVswitch DVswitch {
in => {DVcrop_unif.out, DVcrop_rect.out, DVcrop_struct.out};
index => DVfld_match.index;
};
olink out => DVswitch.out;
};
Description

DVcrop is a utility base module. It discovers what type of mesh (Mesh_Struct, Mesh_Rect, or Mesh_Unif) its input field has, then passes control through DVswitch to the corresponding base module (DVcrop_struct, DVcrop_rect, or DVcrop_unif).

Input
&in

A reference to a field containing any type of structured mesh, plus Node_Data.

min[in.ndim]
max[in.ndim]

The cropping parameters. These are passed through to the selected base module.

Output
out

The output is the same as the DVswitch selection.

Files

v/dv.v

Utility DVM macros

DVMcrop_param

Example

Libraries.Main.Filters.crop

See also
Section 4.19, DVcrop_rect  [page 4-42]
Section 4.20, DVcrop_struct  [page 4-44]
Section 4.21, DVcrop_unif  [page 4-46]

4.19 DVcrop_rect
Available in Developer Edition Only
Synopsis

extract a subset of a rectilinear field

group DVcrop_rect {
Mesh_Rect+Node_Data+Iparam &in {
xform_nonotify;
nnodes+req;
};
int+Iparam min[in.ndim];
int+Iparam max[in.ndim];
Mesh_Rect+Node_Data+Oparam out{
&xform<weight=-1> => in.xform;
};
method+notify_val+notify_inst upd_crop = "crop_rect";
} ;
Description

DVcrop_rect reduces the size of a Mesh_Rect field by extracting the data within a specified range of its dimensions. The process is analogous to "cropping" a photographic image. Typical uses are to eliminate uninteresting portions of the data and to increase processing speed by reducing the amount of data.

Input
&in

A reference to an input that contains a Mesh_Rect and Node_Data.

min[in.ndim]
max[in.ndim]

Integers. These are references to 1D arrays that will hold the minimum and maximum X (Y, and Z) coordinates for the cropping operation. The arrays take their length from the ndim of the input Grid_Struct, i.e., a 1D mesh needs only 1 array element to specify X min and max coordinates, a 2D mesh needs 2 array elements for X and Y, etc.

Output
out

The output field contains a new Mesh_Rect. Its points array (extents) are modified to retain the mesh's position in space.

For example, the following 1D field has a points array (extents) from 0 to 49.

1 2 3 4
01234567890123456789012345678901234567890123456789

You crop the field using an I min of 30 and an I max of 49. The output field has coordinate indices from 0 to 19 and a points array from 30 to 49.

3 4
..............................01234567890123456789

The output field also contains a new Node_Data that has the data within the cropped region.

Files

v/dv.v
modules/crop.c

Example

Libraries.Main.Filters.crop

See also
Section 4.21, DVcrop_unif  [page 4-46]
Section 4.20, DVcrop_struct  [page 4-44]
Section 4.18, DVcrop  [page 4-40]
Section 4.23, DVcut  [page 4-50]
Section 4.27, DVdownsize_rect  [page 4-59]

4.20 DVcrop_struct
Available in Developer Edition Only
Synopsis

extract a subset of a structured field

group DVcrop {
Mesh_Struct+Node_Data+Iparam &in {
xform+nonotify;
nnodes+req;
};
int+Iparam min[in.ndim];
int+Iparam max[in.ndim];
Mesh_Struct+Node_Data+Oparam out{
&xform<weight=-1> => in.xform;
};
method+notify_val+notify_inst upd_crop = "crop";
} ;
Description

DVcrop_struct reduces the size of a structured field (mesh type Mesh_Struct) by extracting the data within a specified range of its dimensions. The process is analogous to "cropping" a photographic image. Typical uses are to eliminate uninteresting portions of the data and to increase processing speed by reducing the amount of data.

Input
&in

A reference to an input that contains a Mesh_Struct and Node_Data. Mesh_Unif and Mesh_Rect will be accepted, but may not produce correct results. (Use DVcrop_rect and DVcrop_unif instead.)

min[in.ndim]
max[in.ndim]

Integers. These are references to 1D arrays that will hold the minimum and maximum X (Y, and Z) coordinates for the cropping operation. The arrays take their length from the ndim of the input Grid_Struct, i.e., a 1D mesh needs only 1 array element to specify X min and max coordinates, a 2D mesh needs 2 array elements for X and Y, etc.

Output
out

The output field contains a new Mesh_Struct. The output field also contains a new Node_Data associated with the cropped region, and a reference to the input field's xform.

Files

v/dv.v
modules/crop.c

Example

Libraries.Main.Filters.crop

See also
Section 4.21, DVcrop_unif  [page 4-46]
Section 4.19, DVcrop_rect  [page 4-42]
Section 4.18, DVcrop  [page 4-40]
Section 4.23, DVcut  [page 4-50]
Section 4.28, DVdownsize_struct  [page 4-62]

4.21 DVcrop_unif
Synopsis

extract a subset of a uniform field

group DVcrop_unif {
Mesh_Unif+Node_Data+Iparam &in {
xform+nonotify;
nnodes+req;
};
int+Iparam min[in.ndim];
int+Iparam max[in.ndim];
Mesh_Unif+Node_Data+Oparam out{
&xform<weight=-1> => in.xform;
};
method+notify_val+notify_inst upd_crop = "crop_unif";
} ;
Description

DVcrop_unif reduces the size of a Mesh_Unif field by extracting the data within a specified range of its dimensions. The process is analogous to "cropping" a photographic image. Typical uses are to eliminate uninteresting portions of the data and to increase processing speed by reducing the amount of data.

Input
&in

A reference to an input that contains a Mesh_Unif and Node_Data.

min[in.ndim]
max[in.ndim]

Integers. These are references to 1D arrays that will hold the minimum and maximum X (Y, and Z) coordinates for the cropping operation. The arrays take their length from the ndim of the input Grid_Struct, i.e., a 1D mesh needs only 1 array element to specify X min and max coordinates, a 2D mesh needs 2 array elements for X and Y, etc.

Output
out

The output field contains a new Mesh_Unif. Its points array (extents) is modified to retain the mesh's position in space.

For example, the following 1D field has a points array (extents) from 0 to 49.

1 2 3 4
01234567890123456789012345678901234567890123456789

You crop the field using an I min of 30 and an I max of 49. The output field has a points array from 30 to 49.

3 4
..............................01234567890123456789

The output field also contains a new Node_Data that has the data within the cropped region.

Files

v/dv.v
modules/crop.c

Example

Libraries.Main.Filters.crop

See also
Section 4.19, DVcrop_rect  [page 4-42]
Section 4.20, DVcrop_struct  [page 4-44]
Section 4.18, DVcrop  [page 4-40]
Section 4.23, DVcut  [page 4-50]
Section 4.29, DVdownsize_unif  [page 4-65]

4.22 DVcurl
Available in Developer Edition Only
Synopsis

compute the curl of a vector field

group DVcurl {
Mesh+Node_Data+Iparam &in {
nnodes+req;
xform+nonotify;
coordinates.values+req;
};
int+Iparam comp;
Node_Data+write+nonotify out_nd;
Mesh+Node_Data+nonotify+OPort2 &out => merge(out_nd, in);
method+notify_val+notify_inst upd_curl = "curl";
};
Description

DVcurl computes the curl of a vector field with any mesh type.

Input
&in

The input is a reference to a field with any mesh type. The Node_Data must have one or more 3-vector components.

comp

An integer. Sets which component's curl to compute. The selected component must be a 3-vector.

Output
out_nd

This output is a new Node_Data object. It contains one 3-vector float component at each node that represents the curl.

&out

This output is a new object that is the merge of the new out_nd Node_Data plus a reference to the original input field.

Algorithm

The algorithm used to compute the curl in structured meshes is a finite difference approximation based on a central difference scheme. For unstructured meshes, the function is based on the cell shape functions and their derivatives.

In both cases, where the input is the vector function

:

The equation used to compute the curl is:


Files

v/dv.v
modules/curl.c

Example

Libraries.Main.Filters.curl

See also
Section 4.25, DVdivrg  [page 4-55]
Section 4.44, DVgrad  [page 4-96]
Section 4.53, DVmagnitude  [page 4-115]

4.23 DVcut
Available in Developer Edition Only
Synopsis

create a volume of all cells whose node data is above or below a level value

group DVcut {
Mesh+Node_Data+Iparam &in { /* input field (to be sliced) */
xform+nonotify;
nnodes+req;
};
int+Iparam cut_comp;
int+Iparam map_comp[];
float+Iparam level;
int+Iparam above; /* toggle for specifying which side
of the plane will be removed-- */
Mesh+Node_Data+Oparam out { /* output field */
&xform<weight=-1> => in.xform;
};
method+notify_val+notify_inst upd_cut = "cut";
};
Description

DVcut creates a volume of cells whose node data is above or below a specified level value. It is similar to DVthreshold, except that DVthreshold can only compare the data exactly at nodes, while DVcut creates an isovolume whose surface may be located between nodes. The surface may be between nodes because it is interpolated. For example, if the user specified a level value of 1.5, and one node has a value of 1.0, the adjacent node's value is 2.0, the isovolume's surface will bisect the space between the nodes.

Moreover, DVthreshold edits nodes out by setting them to NULL, while DVcut physically removes the cells from the output Node_Data and Mesh.

For example, you have a 3D uniform field that is a series of MRI scans of a cranium. You give it a level value that equals bone density. DVcut creates an unstructured mesh of all the node datas equal to bone density; effectively a mesh of the skull. If you make above = 0 (turn it off), DV cut outputs an unstructured mesh of all tissue whose node data is less than that of bone.

DVcut uses one scalar component to construct the isovolume, but outputs any combination of components from the input field. So, you may use, say, pressure to create the isovolume, but output pressure, temperature, and density.

Input
&in

The input is a reference to a field with any type of Mesh and Node_Data. Multiple cell sets are allowed.

cut_comp

An integer. Sets which component of the input field to use when constructing the isovolume. This component must be scalar.

map_comp[]

An integer array. Each array value is the number (from 0 up) of a component to extract. For example, for an input field with two components:

(a, b, c, [e, f, g]) --> set map_comp = { 0 , 3 } --> (a, [e, f, g]) in the output field.

Note that this array is not explicitly dimensioned. It is a variable-length array that will have as many values as you assign to it with the = { n, n, n,...n} notation. The supplied AVS/Express modules that use DVcut implicitly set the dimension to 1 by specifying map_comp = {0}, i.e., the user can specify any one component to send to the output field, and the default is the first (0th) component.

level

A float. Set the value to use in constructing the isovolume. level is converted to the data type of the Node_Data before use.

above

An integer. When not equal to 0, values above level are in the output field. When equal to 0, values below or equal to level are in the output field.

Output
out

The output is a new field. Its Mesh is unstructured, containing just the nodes above or below level. It may have mixed cell types and hence multiple cell sets. Its Node_Data contains the components specified by map_comp[nmap_comp] that were above or below level. It also contains a reference to the input field's xform.

Algorithm

The algorithm used to perform the interpolation and construct the isovolume is similar to the Marching Cubes algorithm. However, it uses pre-generated lookup tables to determine the intersection of the isosurface with the cells.

Files

v/dv.v
modules/cut.c

Utility DVM macros

DVMcut_param, Cut

Example

Libraries.Main.Mappers.cut
Libraries.Main.Mappers.isovolume

See also
Section 4.88, DVthreshold  [page 4-187]

4.24 DVdata_math
Available in Developer Edition Only
Synopsis

perform mathematical operations on fields using V expressions

group DVdata_math {
string+IPort2 operation = "#1";
Mesh+Node_Data+IPort2+nonotify &in1;
Mesh+Node_Data+IPort2+nonotify &in2;
Mesh+Node_Data+IPort2+nonotify &in3;
Mesh+Node_Data+IPort2+nonotify &in4;
int+IPort2 data_type = 4;
Node_Data+write+nonotify out_nd {
nnodes+nres => in1.nnodes;
nnode_data = 1;
!node_data[0] {
&id+nres => in1.node_data[0].id;
&veclen+nres => in1.node_data[0].veclen;
prim values[nvals][veclen];
labels+nres = "data_math";
};
};
Mesh+Node_Data+nonotify+OPort2 &out => merge(out_nd,in1);
method+notify_val+notify_inst upd_data_math = "data_math";
};
Description

DVdata_math performs mathematical operations on one to four input fields. You supply any valid V expression and use the data_type input to set what data type you want the computation to be performed in.

Input
operation

A string containing any valid V mathematical expression, as described in the Developer's Reference manual. Do not enclose in quotes or terminate with ";".

For example:

sqrt( pow(#1,2) + pow(#2,2) + pow(#3,2) )

would calculate the magnitude of the 0th component of input fields 1, 2, and 3.

The default string is #1.

&inn

The input field(s) are references to fields with any type of mesh and Node_Data. You can use from 1 to 4 inputs. When typing the expression, you refer to them as #1, #2, #3, and #4.

DVdata_math uses the first (0th) component of each field. Operations between two fields require that their components be the same length (nnodes must be equal) and both components have the same veclen.

data_type

An integer to set the data type in which the computation will be performed. Each input's 0th component Node_Data is first converted to that type, the computation is performed in that type, and the output Node_Data is in that type. The choices are 0 (char), 1 (byte), 2 (short), 3 (int), 4 (float), and 5 (double). The default is 4 (float).

Output
&out

The output is a reference to a merged object that contains the new Node_Data that has the result of the computation. Its mesh is a reference to the input mesh of in1.

Files

v/dv.v
modules/dmath.c

Example

Libraries.Main.Filters.data_math

See also

The Developer's Reference manual for discussion of V mathematical expressions.

4.25 DVdivrg
Available in Developer Edition Only
Synopsis

compute the divergence of a vector field

group DVdivrg {
Mesh+Node_Data+Iparam &in { /* input field */
xform_nonotify;
nnodes+req;
coordinates.values+req;
};
int+Iparam comp;
Node_Data+write+nonotify out_nd;
Mesh+Node_Data+nonotify+OPort2 &out => merge(out_nd, in);
method+notify_val+notify_inst upd_divrg = "divrg";
};
Description

DVdivrg computes the divergence of a vector field with any mesh type.

Input
&in

The input is a reference to a field with any mesh type. The Node_Data must have one or more 3-vector components.

comp

An integer. Sets which component's divergence to compute. The selected component must be a 3-vector.

Output
out_nd

This output is a new Node_Data object. It contains one scalar float component at each node that represents the divergence.

&out

This output is a new object that is the merge of the new out_nd Node_Data plus a reference to the original input field.

Algorithm

The algorithm used to compute the divergence in structured meshes is a finite difference approximation based on a central difference scheme. For unstructured meshes, the function is based on the cell shape functions and their derivatives.

In both cases, where the vector node data component is:


The equation used to compute the divergence is:


Files

v/dv.v
modules/div.c

Example

Libraries.Main.Filters.divergence

See also
Section 4.22, DVcurl  [page 4-48]
Section 4.44, DVgrad  [page 4-96]
Section 4.53, DVmagnitude  [page 4-115]

4.26 DVdownsize
Available in Developer Edition Only
Synopsis

discover the type of mesh, then call the corresponding downsizing base module

group DVdownsize {
Mesh_Struct+Node_Data+Iparam &in {
nnodes+req;
};

float+Iparam factor[in.ndim];

DVdownsize_struct DVdownsize_struct {
&factor => <-.factor;
};
DVdownsize_unif DVdownsize_unif {
&factor => <-.factor;
};
DVdownsize_rect DVdownsize_rect {
&factor => <-.factor;
};

DVfld_match DVfld_match {
Mesh_Struct+IPort2 &in=> <-.in;
links {
link0 => DVdownsize_unif.in;
link1 => DVdownsize_rect.in;
link2 => DVdownsize_struct.in;
};
};

DVswitch DVswitch {
in => {DVdownsize_unif.out, DVdownsize_rect.out,
DVdownsize_struct.out};
index => DVfld_match.index;
};
olink out => DVswitch.out;
};
Description

DVdownsize is a utility base module. It discovers what type of mesh (Mesh_Struct, Mesh_Rect, or Mesh_Unif) its input field has, then passes control through DVswitch to the corresponding base module (DVdownsize_struct, DVdownsize_rect, or DVdownsize_unif).

Input
&in

A reference to a field containing any type of structured mesh, plus Node_Data.

factor[in.ndim]

The scaling factor. This is passed through to the selected base module.

Output
out

The output is the same as the DVswitch selection.

Files

v/dv.v

Utility DVM macros

DVMdownsize_param

Example

Libraries.Main.Filters.downsize

See also
Section 4.27, DVdownsize_rect  [page 4-59]
Section 4.28, DVdownsize_struct  [page 4-62]
Section 4.29, DVdownsize_unif  [page 4-65]
4.27 DVdownsize_rect
Available in Developer Edition Only
Synopsis

resample a rectilinear field to reduce (or increase) its size

group DVdownsize_rect {
Mesh_Rect+Node_Data+Iparam &in {
xform+nonotify;
nnodes+req;
};
float+Iparam factor[in.ndim];
Mesh_Rect+Node_Data+Oparam out{
&xform<weight=-1> => in.xform;
};
method+notify_val+notify_inst upd_downsize = "downsize";
} ;
Description

DVdownsize_rect resamples a rectilinear field (mesh type Mesh_Rect) using a scaling factor. Where the factor is > 1, DVdownsize reduces the size of the field, saving processing time and memory by "thinning out" the data. Where factor < 1, DVdownsize_rect increases the size of the field by duplicating data.

DVdownsize_rect works like this (see the 1D example on the following page):

For each dimension i (X, Y, and Z) calculate:

Note that, throughout the process, the actual node data values and coordinate values are irrelevant. All that is being manipulated are the indexes into these arrays.

Input
&in

A reference to an input field containing a Mesh_Rect and Node_Data.

factor[in.ndim]

A float array used as a scaling coefficient. The output field's values (and coordinates for irregular data) are:

dims_out[i] = dims_in[i] / factor [i]

where i cycles through the dims of the field, either 1D, 2D, or 3D.

The length of the factor array (1D: just X; 2D: X and Y; 3D: X, Y and Z) is taken from the ndim of the Grid_Struct. You control the factor for each dimension separately.

Note: factors < 1 will make the output field larger. For example, a factor of 0.5 will double the size of the output field.

Output
out

The output is a new object that contains a new Mesh_Rect. The new Mesh_Rect's points array (extents) will occupy the same "space" as the input field's Mesh_Rect.

The output field also contains a new Node_Data object containing the data associated with the downsized region.

Files

v/dv.v
modules/down.c

Example

Libraries.Main.Filters.downsize

See also
Section 4.26, DVdownsize  [page 4-57]
Section 4.28, DVdownsize_struct  [page 4-62]
Section 4.29, DVdownsize_unif  [page 4-65]
Section 4.19, DVcrop_rect  [page 4-42]
Section 4.23, DVcut  [page 4-50]
4.28 DVdownsize_struct
Available in Developer Edition Only
Synopsis

resample a structured field to reduce (or increase) its size

group DVdownsize {
Mesh_Struct+Node_Data+Iparam &in {
xform+nonotify;
nnodes+req;
};
float+Iparam factor[in.ndim];
Mesh_Struct+Node_Data+Oparam out{
&xform<weight=-1> => in.xform;
};
method+notify_val+notify_inst upd_downsize = "downsize";
} ;
Description

DVdownsize_struct resamples a structured field (mesh type Mesh_Struct) using a scaling factor. Where the factor is > 1, DVdownsize_struct reduces the size of the field, saving processing time and memory by "thinning out" the data. Where factor < 1, DVdownsize_struct increases the size of the field by duplicating data.

DVdownsize_struct works like this (see the 1D example on the following page):

For each dimension i (X, Y, and Z) calculate:

Note: Throughout the process, the actual node data values and coordinate values are irrelevant. All that is being manipulated are the indexes into these arrays.

Input
&in

A reference to an input field containing a Mesh_Struct and Node_Data.

factor[in.ndim]

A float array used as a scaling coefficient. The output field's values (and coordinates for irregular data) are:

dims_out[i] = dims_in[i] / factor [i]

where i cycles through the dims of the field, either 1D, 2D, or 3D.

The length of the factor array (1D: just X; 2D: X and Y; 3D: X, Y and Z) is taken from the ndim of the Grid_Struct. You control the factor for each dimension separately.

Note: factors < 1 will make the output field larger. For example, a factor of .5 will double the size of the output field.

Output
out

The output is a new object that contains a new Mesh_Struct. The new Mesh_Struct's points array (extents) will occupy the same "space" as the input field's Mesh_Struct.

The output field also contains a new Node_Data object containing the data associated with the downsized region.

Files

v/dv.v
modules/down.c

Example

Libraries.Main.Filters.downsize

See also
Section 4.26, DVdownsize  [page 4-57]
Section 4.27, DVdownsize_rect  [page 4-59]
Section 4.29, DVdownsize_unif  [page 4-65]
Section 4.20, DVcrop_struct  [page 4-44]
Section 4.23, DVcut  [page 4-50]
4.29 DVdownsize_unif
Available in Developer Edition Only
Synopsis

resample a uniform field to reduce (or increase) its size

group DVdownsize_unif {
Mesh_Unif+Node_Data+Iparam &in {
xform+nonotify;
nnodes+req;
};
float+Iparam factor[in.ndim];
Mesh_Unif+Node_Data+Oparam out{
&xform<weight=-1> => in.xform;
};
method+notify_val+notify_inst upd_downsize = "downsize";
} ;
Description

DVdownsize_unif resamples a uniform field (mesh type Mesh_Unif) using a scaling factor. Where the factor is > 1, DVdownsize_unif reduces the size of the field, saving processing time and memory by "thinning out" the data. Where factor < 1, DVdownsize_unif increases the size of the field by duplicating data.

DVdownsize_unif works like this (see the 1D example on the following page):

For each dimension i (X, Y, and Z) calculate:

Note: Throughout the process, the actual node data values and coordinate values are irrelevant. All that is being manipulated are the indexes into these arrays.

Input
&in

A reference to an input field containing a Mesh_Unif and Node_Data.

factor[in.ndim]

A float array used as a scaling coefficient. The output field's values (and coordinates for irregular data) are:

dims_out[i] = dims_in[i] / factor [i]

where i cycles through the dims of the field, either 1D, 2D, or 3D.

The length of the factor array (1D: just X; 2D: X and Y; 3D: X, Y and Z) is taken from the ndim of the Grid_Struct. You control the factor for each dimension separately.

Note: factors < 1 will make the output field larger. For example, a factor of 0.5 will double the size of the output field.

Output
out

The output is a new object that contains a new Mesh_Unif. The new Mesh_Unif's points array (extents) will occupy the same "space" as the input field's Mesh_Unif.

The output field also contains a new Node_Data object containing the data associated with the downsized region.

Files

v/dv.v
modules/down.c

Example

Libraries.Main.Filters.downsize

See also
Section 4.26, DVdownsize  [page 4-57]
Section 4.28, DVdownsize_struct  [page 4-62]
Section 4.27, DVdownsize_rect  [page 4-59]
Section 4.21, DVcrop_unif  [page 4-46]
Section 4.23, DVcut  [page 4-50]
4.30 DVexcavate_brick3d
Available in Developer Edition Only
Synopsis

perform 3D texture mapping on a 3D uniform field

group DVexcavate_brick3d {
Mesh_Unif+Dim3+Node_Data+Iparam &in { /* uniform input field */
xform+nonotify;
ndim+req;
};
int+Iparam x;
int+Iparam y;
int+Iparam z;
int+Iparam flip_x;
int+Iparam flip_y;
int+Iparam flip_z;
int+Iparam draw_sides;
Mesh+Node_Data+Oparam out { /* output field */
&xform<weight=-1> => in.xform;
};
method+notify_val+notify_inst upd_excavate_brick3d = "excavate_brick3d";
};
Description

DVexcavate_brick3d is a technique for visualizing 3D uniform volume data. The volume is displayed with three slice planes: one each in X, Y, and Z. The slice planes remove a rectangular chunk of the field, revealing the structures inside.

Texture mapping is much faster than the sampling techniques used by, for example, DVslice, particularly for large datasets. The point sampling done by the texture mapping technique is always done at the resolution of the data; thus differences in data values within a small area are not obscured as they can be with DVslice.

Input
&in

The input is a reference to a Mesh_Unif, Dim3 field with Node_Data.

x
y
z

Integers. These set the X, Y, Z position of their respective slice planes.

flip_x
flip_y
flip_z

Integers. These select whether the excavating cube should be positioned on the positive or negative axis for each of the X, Y, and Z dimensions. When the value is not 0, the cube is positioned on the negative axis.

draw_sides

An integer. When 0, only the excavating cube is drawn. When not 0, a texture map of the bounding faces of the volume is also drawn.

Output
out

The output is a new Mesh and Node_Data. u, v, w textures are added. There is a reference to the input mesh's xform.

Algorithm

DVexcavate_brick3D creates its picture of the volume data using 3D texture mapping. In this method, the boundary of the volume has three values, u, v, w, associated with each of its vertices. Where the slice planes intersect this volume, u, v, w values are computed for the vertices of the resulting solid. These values are attached to the vertices of the output object. Viewers use the u, v, w information to create the texture-mapped rendering.

Files

v/dv.v
modules/exc_brk3.c

Utility DVM macros

DVMexc_brick_param

Example

Libraries.Main.Mappers.excavate_brick3d

See also

Not applicable.

4.31 DVexplode_materials
Available in Developer Edition Only
Synopsis

create an array of fields from a single field based on material properties of cell
sets

module DVexplode_materials {
Mesh+Iparam &in {
nnodes+req;
xform+nonotify;
};
int+Iparam property;
int+Oparam nfld;
Cells+write+nonotify out_sets[nfld] {
*cell_set[];
ncell_sets => array_size(cell_set);
};
group out_mrgs[nfld] {
int+nres arr_ind => index_of(out_mrgs);
Mesh+Node_Data+Cell_Data+nres &out_flds =>
merge(out_sets[arr_ind],in);
};
mlink+nonotify+OPort2 out => out_mrgs.out_flds;

method+notify_val+notify_inst upd_explode_mat<status=1> =
"DVexplode_mat";
};
Description

Each cell set in a field has an associated properties array. You may use this array to
store anything related to the cell set, but it is commonly used to store material
properties of the cells in the cell set.

DVexplode_materials splits up the field into an array of fields based on the values of a particular element of the properties array. The same array index is used to look up the value in the properties array of each cell set. Each cell set with a distinct value of that property goes into a separate output field. The actual values are not significant, only whether they are equal or not. Note that this module compares floating-point numbers for equality; you are responsible for ensuring that the values in the material property array are bit-for-bit equal or not, as desired.

Input Ports
in

Mesh. This mesh is split apart into multiple meshes on the output, according to the selected property value of each cell set.

property

int. Which element of the property value array to use.

Output Ports
nfld

Number of meshes in the output array.

out

Mesh[]. An array of meshes, with other data merged from the input field.

Example

explode_materials

File

v/dv.v

See also

Not applicable.

4.32 DVexplode_xform
Available in Developer Edition Only
Synopsis

transform an array of meshes away from their common center

module DVexplode_xform {
Mesh+Iparam &in[] {
nnodes+req;
};
float+Iparam x_factor;
float+Iparam y_factor;
float+Iparam z_factor;
group+write+nonotify out[array_size(in)] {
DefaultXform xform;
};
group+nonotify out_field_mrg[array_size(in)] {
int+nres arr_ind => index_of(out_field_mrg);
Mesh+nres &out_fld => merge(out[arr_ind],in[arr_ind]);
};
mlink+nonotify+OPort2 out_flds => out_field_mrg.out_fld;

method+notify_val+notify_inst upd_xform_mat<status=1> =
"DVexplode_xform";
};
Description

DVexplode_xform transforms each mesh in an array of meshes away from their common center (measured as the average of the min and max in each dimension). The transformation matrices and transformed fields are both available as outputs.

Input Ports
in

Mesh[]. The array of input fields.

x_factor

float. Scales the amount that the the fields are translated away from the center.

y_factor

float. Scales the amount that the the fields are translated away from the center.

z_factor

float. Scales the amount that the the fields are translated away from the center.

Output Ports
out

group[]. Contains the new transforms to be applied to each field.

out_flds

Mesh[]. Contains the output fields.

Example

explode_xform.

File

v/dv.v

See also

Not applicable.

4.33 DVext_edge
Available in Developer Edition Only
Synopsis

extract external edges of a field to reveal inside objects

group DVext_edge {
Mesh+Iparam &in { /* input field */
xform+nonotify;
nnodes+req;
};
float+Iparam angle; /* maximum face angle */
Mesh+Node_Data+Oparam out {
&xform<weight=-1> => in.xform;
};
method+notify_val+notify_inst upd_ext_edge = "ext_edge";
} ;
Description

DVext_edge produces a wireframe representation of the outside of an unstructured mesh. You use it when you want to see objects produced by other modules that are inside an unstructured mesh (isosurfaces, streamlines, probes, etc.) while still being able to see the enclosing skeletal shape of the mesh.

Input
&in

A reference to an unstructured Mesh. Structured meshes (Mesh_Struct, Mesh_Rect, etc.) will be accepted but are converted to unstructured during execution.

angle

A float. This value controls the accuracy of the boundary representation on the base of the angle between two adjoining faces. All edges that have an angle < this value will be represented in the output field. Like all DV parameters, angle has no default. However, the angle used should be between 0.0 and 180.0.

Output
out

The output is a new unstructured Mesh of the input mesh's exterior. It contains a reference to the input mesh's xform.

Files

v/dv.v
modules/ext_edge.c

Example

Libraries.Main.Mappers.external_edges

See also
Section 4.34, DVext_face  [page 4-76]
Section 4.5, DVbounds  [page 4-12]

4.34 DVext_face
Available in Developer Edition Only
Synopsis

extract external faces of a field for faster rendering

group DVext_face {
Mesh+Iparam &in { /* input field */
xform+nonotify;
nnodes+req;
};
Cells+Oparam out_cells {
*cell_set[];
ncell_sets => array_size(cell_set);
};
Cells+Cell_Data+write+nonotify out_sets;

Mesh+OPort2+nonotify &out => merge(out_cells, in);
method+notify_val+notify_inst upd_face = "face";
};
Description

DVext_face produces a mesh that represents just the exterior, visible faces of an unstructured mesh. It saves memory and greatly speeds rendering because all of the unstructured mesh's many interior, hidden nodes and cells are not represented.

Input
&in

A reference to an input unstructured mesh (mesh type Mesh). All other objects are ignored. Structured meshes (Mesh_Struct, Mesh_Rect, etc.) will be accepted but are converted to unstructured during execution.

Output
out_cells

An array of cell_sets whose contents are the unstructured Mesh that represents the field's external faces. This output is not normally used. Use the output below instead.

out

The output is a reference to a merged object that is a combination of the new unstructured Mesh of the input mesh's exterior faces, divided into cell sets, and the input field's Mesh.

Files

v/dv.v
modules/ext_face.c

Example

Libraries.Main.Mappers.external_faces

See also
Section 4.33, DVext_edge  [page 4-74]
Section 4.5, DVbounds  [page 4-12]

4.35 DVextr_cell_comp
Available in Developer Edition Only
Synopsis

extract one cell_data component from each Cell_Data cell_set

group DVextr_cell_comp {
Mesh+Cell_Data+Iparam &in;
int+Iparam comp;
int+nres+nonotify dim => in.ncell_sets;
group+nonotify out_data[dim] {
int+nres ncells => in.cell_set[index_of(out_data)].ncells;
int ncell_data=1;
group+nres &cell_data =>
{in.cell_set[index_of(out_data)].cell_data[comp]};
};
group+nonotify out_sets[dim] {
group+nres &out_set => merge(out_data[index_of(out_sets)],
in.cell_set[index_of(out_sets)]);
};
Cells+Cell_Data+Oparam out_cd {
*cell_set[];
ncell_sets => array_size(cell_set);
};
Mesh+Oparam &out =>merge(out_cd, in);
method+notify_val+notify_inst upd_extr_cell_comp = "extr_cell_comp";
};
Description

DVextr_cell_comp extracts one cell_data component from each Cell_Data cell_set. If there are multiple Cell_Data cell_sets, the same component is extracted from each cell_set. DVextr_cell_comp is the cell data equivalent of DVextract_comp for node data.

Since the renderer draws just the first component it finds in each cell_set, you use DVextr_cell_comp to obtain the right component from a multi-component Cell_Data field.

Input
&in

A reference to a field that contains a Mesh and Cell_Data.

comp

An integer that specifies which component (0-n) to extract. This is often obtained from a combination of a UIradioBoxLabels and the DVcell_data_labels base module.

Output
&out

The output is a reference to a merged object that contains the new Cell_Data, plus references to all other unchanged objects in the input Mesh.

Files

v/dproc.c
modules/extr_cll.c

Example

Libraries.Main.Filters.extract_cell_component
v/modules.v

See also
Section 4.6, DVcell_data_labels  [page 4-15]

4.36 DVextract_comp
Available in Developer Edition Only
Synopsis

extract a single data component from a field

group DVextract_comp {
int+IPort2 component = 0;
Mesh+Node_Data+IPort2 &in;
Node_Data out_nd {
nnodes => in.nnodes;
nnode_data = 1;
&node_data+nres => {in.node_data[component]};
};
Mesh+Node_Data+OPort2 &out => merge(out_nd,in);
};
Description

DVextract_comp creates a new field object that is a reference to one component of an existing Node_Data. The component can be scalar or vector. Most modules that work on Node_Data work on just one component of Node_Data. DVextract_comp is the base module that they use to acquire this single component.

Input
component

An integer. Sets which component of the input Node_Data to extract. The default is the first (0th) component.

&in

A reference to a field containing a Mesh and Node_Data.

Output
&out

A reference to a merged object. That object's first member is a reference to the extracted Node_Data component. The object's second member is a reference to the remainder of the input field.

Files

v/dv.v

Utility DVM macros

DVMextr_comp_param

Example

Libraries.Main.Filters.clamp
Libraries.Main.Mappers.cut
Libraries.Main.Filters.extract_scalar
and many others

See also
Section 4.11, DVcomb_comp  [page 4-26]
Section 4.37, DVextr_scalar  [page 4-82]
Section 4.38, DVextr_vector  [page 4-84]

4.37 DVextr_scalar
Available in Developer Edition Only
Synopsis

extract a scalar data element from a field's vector component

func DVextr_scalar {
Node_Data+Iparam &in { /* input field */
nnodes+req;
};
int+Iparam component; /* which component to extract */
Node_Data+Oparam out; /* output field */
method+notify_val+notify_inst upd_extr_scalar = "extr_scalar";
} ;
Description

DVextr_ scalar extracts a single scalar data element from a vector component of a field with Node_Data.

([a, b, c]) --> select second vector element --> (b)

Input
&in

A reference to a field with Node_Data. The Node_Data can contain only one component. (See DVextract_comp to obtain a single component.) This component can be scalar or vector.

component

An integer. Establishes which sub-component of the component to extract.

Output
out

A new Node_Data object that contains only the extracted scalar data.

Files

v/dv.v
modules/extr_scl.c

Utility DVM macros

DVMextract_scalar_param, ExtractScalar

Example

Libraries.Main.Filters.extract_scalar

See also
Section 4.36, DVextract_comp  [page 4-80]
Section 4.11, DVcomb_comp  [page 4-26]
Section 4.38, DVextr_vector  [page 4-84]

4.38 DVextr_vector
Available in Developer Edition Only
Synopsis

extract arbitrary vector elements from Node_Data as one component

group DVextr_vector {
Node_Data+Iparam &in { /* input field */
nnodes+req;
};
int+Iparam veclen; /* length of vector to be extracted */
int+Iparam components[veclen];
int+Iparam sub_components[veclen];
Node_Data+Oparam out; /* output field */
method+notify_val+notify_inst upd_extr_vector = "extr_vector";
} ;
Description

DVextr_vector extracts n scalar elements from the components of Node_Data and turns them into a a single component with n vector elements. For example:

(a, b, c, [d, e, f]) --> select 0 and 3 index components, select 0 and 1 index sub_components --> ([a, e])

You could use it, for example, to assemble three scalar components into one three element vector component prior to using DVadvect or DVstream.

Input
&in

A reference to the input field from which elements will be extracted.

veclen

An integer. Establishes how many individual scalar elements to extract overall. This will be the veclen of the output Node_Data's single component Data_Array.

components[veclen]

An integer pointer to an array whose values specify which of &in's components will be examined for subcomponent extraction. For example:

(a, b, c, [d, e, f])

If the user gave veclen=2, then components is an array with two indices, 0 and 1. Each array value could be 0 (a) , 1 (b) , 2 (c) , or 3 ([d, e, f]).

sub_components[veclen]

An integer pointer to an array of veclen whose values specify which of the component's subcomponents will be extracted in the output. For example:

(a, b, c, [d, e, f])

If the user has given veclen=2 and components (0, 3), then sub_components is an array with two indices, 0 and 1. The first array value can only be 0 (since that component is scalar (a). The second array value could be 0 (d), 1 (e), or 2 (f).

Output
out

The output is a new Node_Data object containing the extracted values. It has one component. That component's elements are the extracted values.

Files

v/dv.v
modules/extr_vec.c

Utility DVM macros

DVMcombine_vect_param, CombineVect

Example

Libraries.Main.Filters.combine_vect

See also
Section 4.36, DVextract_comp  [page 4-80]
Section 4.37, DVextr_scalar  [page 4-82]
Section 4.11, DVcomb_comp  [page 4-26]

4.39 DVextract_mesh
Available in Developer Edition Only
Synopsis

create a mesh without any data

module DVextract_mesh {
Mesh+IPort2 &in;
Node_Data out_nd {
nnodes => <-.in.nnodes;
nnode_data = 0;
};
Mesh+Node_Data+OPort2 &out=>merge(out_nd, in);
};
Description

DVextract_mesh outputs the same mesh as the input, but with no node data (nnode_data=0).

Input Ports
in

Mesh+Node_Data. The output mesh is copied from this input.

Output Ports
out

Mesh+Node_Data. Contains only the mesh part of the input field.

Example

Not available.

File

v/dv.v

See also

Not applicable.

4.40 DVfld_match
Available in Developer Edition Only
Synopsis

detect the mesh type of a field

group DVfld_match {
Mesh+IPort2 &in;
int+OPort2 index=0;
group+write links {
link+OPort2 link0;
link+OPort2 link1;
link+OPort2 link2;
link+OPort2 link3;
};
method+notify_val upd_match = "fld_match";
};
Description

DVfld_match detects the mesh type of a field. It compares the mesh type of the input field &in against a list of links to specific mesh types. It then outputs the index of the matching mesh. This index is usually used as input to DVswitch, which uses it as an index into its array of base modules to find the correct base module to use.

Input
&in

A reference to a field containing any type of Mesh.

Output
link0
link1
link2
link3

Links to DVfld_match's matching choices. For example, DVcrop uses DVfld_match to discover the mesh type of its input in order to call the correct DVcrop_type base module. It defines these links as:

links {
link0 => DVcrop_unif.in;
link1 => DVcrop_rect.in;
link2 => DVcrop_struct.in;
};

index

An integer whose value is the index of the "match" in the links object. For example, if the input field to DVcrop is Mesh_Rect, index's value is 1.

Files

v/dv.v
modules/match.c

Example

Libraries.Main.Filters.downsize
Libraries.Main.Filters.crop
Libraries.Main.Mappers.slice

See also
Section 4.86, DVswitch  [page 4-184]

4.41 DVgen_fld
Available in Developer Edition Only
Synopsis

create an AVS/Express Field object of any type

group DVgen_fld {
int+Iparam fld_type;
int+Iparam ndim;
int+Iparam dims[ndim];
int+Iparam nspace;
float+Iparam extents[2][nspace];
string cell_type;
int+Iparam ndata_veclen;
int+Iparam ndata_type;
float+Iparam ndata_coeff[10];
int null_flag;
float null_value;
Field+Oparam &out; /* output field */
method+notify_val+notify_inst upd_gen_fld = "gen_fld";
};
Description

DVgen_fld generates a Field of any type as specified by its input parameters. Its primary purpose is to create different kinds of Fields against which to test modules or macros that you are developing. The fields include dummy data that is the sum of a polynomial.

Input
fld_type

An integer that specifies the field type:

0 Field
1 Field_Struct
2 Field_Unif
3 Field_Rect

ndim

An integer that specifies the ndim of a structured, uniform, or rectilinear coordinate Grid_Struct.

dims[ndim]

An integer pointer to the beginning of the dims array for a structured, uniform, or rectilinear Grid_Struct. The user does not have to specify this value.

nspace

An integer that specifies the nspace of a Grid.

extents

A set of float parameters to set the field's points array (uniform and rectilinear fields).

cell_type

A string that specifies the cell type of unstructured meshes. Allowed values are: "Point", "Line", "Polyline", "Tri", "Quad", "Tet", "Hex", or "Prism".

ndata_veclen

An integer that specifies the nnode_data value in the Node_Data object of the field (the number of Node_Data components).

ndata_type

An integer that specifies the primitive data type of the Node_Data's Data_Array values array. The allowed values are (from avs/dtype.h):

DTYPE_CHAR 0
DTYPE_BYTE 1
DTYPE_SHORT 2
DTYPE_INT 3
DTYPE_FLOAT 4
DTYPE_DOUBLE 5

ndata_coeff

A floating-point "seed" value for the polynomial function that will generate the fictitious data in the Node_Data's Data_Array values array.

null_flag

An integer. If not zero, then set the null_flag in the output field's Data_Array to "has null data."

null_value

A float. If null_flag is not zero, then set the null_value in the output field's Data_Array to this value.

Output
&out

Reference to the output field.

Example

Not available.

Files

v/dv.v
modules/gen_fld.c

See also

Not applicable.

4.42 DVgeo_glyph
Available in Developer Edition Only
Synopsis

take an array of glyphs as input and output glyphs at nodes using node data as an index into the glyph array

module DVgeo_glyph { /* produces scaled, colored glyphs at nodal locations */
Mesh+Iparam &in { /* input field */
nnodes+req;
coordinates+req;
coordinates.values+req;
int+opt nnode_data;
Data_Array+opt node_data[nnode_data];
};
Mesh+Iparam &glyph[] { /* glyph geometry */
nnodes+req;
coordinates+req;
coordinates.values+req;
};
float+Iparam scale; /* scale factor applied to glyph */
float+Iparam color[3]; /* color applied to glyph */
int+Iparam normalize; /* normalize glyph index */
Mesh+Node_Data+Oparam out { /* output field */
xform+nowrite;
};
method+notify_val+notify_inst geo_glyph_update<status=1> =
"DVgeo_glyph";
};
Description

DVgeo_glyph takes an input field and an array of glyphs, and draws one glyph at each node location of the in_field. The glyph drawn is selected by using the data at that node as an index into the glyph array.

If normalize is off, floating point values are converted to integers by truncation. If normalize is on, the data range is mapped to the number of glyphs so that each glyph represents the same fraction of the data range.

If the data is out of the bounds of the glyph array, the minimum or maximum glyph is drawn, as appropriate.

The glyphs' colors are determined by the color parameters unless the glyphs themselves provide node data for coloring, and their size is scaled by the scale parameter. Their orientation is unchanged.

Input Ports
in

Mesh. Glyphs will be placed at the nodes of this mesh.

glyph

Mesh[]. Array of geometries for the glyphs.

scale

float. The glyphs are scaled by this amount.

color

float[3]. The color to be applied to each glyph.

normalize

int. If zero, the glyphs are scaled to the data value at the node. If nonzero, the glyphs are only scaled by the scale input.

Output Ports
out

Mesh+Node_Data. Contains all the glyphs as geometry data.

Example

Not available.

File

v/dv.v

See also

Not applicable.

4.43 DVglyph
Available in Developer Edition Only
Synopsis

produce scaled, colored glyphs at single component node locations

group DVglyph {
Mesh+Node_Data+Iparam &in { /* input field */
nnodes+req;
coordinates.values+req;
};
Mesh+Iparam &glyph; /* glyph geometry */
int+Iparam vector; /* toggle to transform glyph by vector data */
int+Iparam glyph_comp; /* glyph data component */
int+Iparam map_comp; /* color glyph by data */
float+Iparam scale; /* scale factor applied to glyph */
int+Iparam normalize; /* toggle to normalize glyphs */
Mesh+Node_Data+Oparam out; /* output field */
method+notify_val+notify_inst upd_glyph_mod = "glyph_mod";
};
Description

DVglyph places a geometrical object at each node of an input field so that node locations can be easily identified. The glyph can be sized and colored according to the selected data component at each node.

When combined with other base modules such as DVinterp_data, and vector base modules such as DVstreams, DVglyph acts like a "hedgehog" function.

Input
&in

A reference to a field with any type of mesh plus Node_Data

&glyph

A reference to a mesh describing the geometry of the glyph. Any mesh can be used (for example, that of a teapot) but for convenience you can use one of the geometries in Geometries, such as Arrow1, Arrow2, or Cross3D.

vector

An integer. If the value is not zero, the glyph (for example, an arrow) will be rotated to point at the direction of the data vector at that node. Scalar vectors rotate along the X axis, 2 element vectors along the XY axes, and 3 element vector components along all three axis.

glyph_comp

An integer. Selects which component to use to draw and orient the glyph. The component can be scalar or vector.

map_comp

An integer. Selects which component to use to color the glyph.

scale

A float. This value adjusts the sizes of the glyphs.

normalize

An integer. If the value is zero, the sizes of the glyphs will be proportional to the data component values at each node. If the value is not zero, all glyphs are the same size.

Output
out

The output is a new object that contains an unstructured mesh (mesh type Mesh) that is the meshes of all the glyphs. It also contains a new Node_Data consisting of the magnitude of the single component's data values.

Files

v/dv.v
modules/glyph.c

Utility DVM macros

DVMglyph_param

Example

Libraries.Main.Mappers.glyph
Libraries.Main.Mappers.probe
Libraries.Main.Mappers.advector

See also

Not applicable.

4.44 DVgrad
Available in Developer Edition Only
Synopsis

compute the vector gradient of a field

group DVgrad {
Mesh+Node_Data+Iparam &in { /* input field */
nnodes+req;
xform+nonotify;
coordinates.values+req;
};
int+Iparam comp;
Node_Data+write+nonotify out_nd;
Mesh+Node_Data+nonotify+OPort2 &out => merge(out_nd, in);
method+notify_val+notify_inst upd_grad = "grad";
};
Description

DVgrad computes the vector gradient of a field with any mesh.

Input
&in

The input is a reference to a field with any mesh type. The Node_Data must have one or more scalar components.

comp

An integer. Sets which component's gradient to compute. The selected component must be scalar.

Output
out_nd

This output is a new Node_Data object. It contains one 3-vector float component at each node that represents the gradient.

&out

This output is a new object that is the merge of the new out_nd Node_Data plus a reference to the original input field.

Algorithm

The algorithm used to compute the gradient in structured meshes is a finite difference approximation based on a central difference scheme. For unstructured meshes, the function is based on the cell shape functions and their derivatives.

In both cases, the equation used to compute the gradient is:


Files

v/dv.v
modules/grad.
c

Example

Libraries.Main.Filters.gradient

See also
Section 4.22, DVcurl  [page 4-48]
Section 4.25, DVdivrg  [page 4-55]
Section 4.53, DVmagnitude  [page 4-115]

4.45 DVintegr_vol
Available in Developer Edition Only
Synopsis

determine the length, area, or volume and mass of an unstructured field

group DVintegr_vol {
Mesh+Iparam &in { /* input field */
xform+nonotify;
nnodes+req;
};
int+Iparam component=0;
int+Iparam dim;
float+Oparam volume; /* volume of field */
float+Oparam mass; ' /* mass of field */
method+notify_val+notify_inst upd_integr_vol = "integr_vol";
} ;
Description

DVintegr_vol calculates the length (1D cells), area (2D cells), or volume (3D cells) and mass of an unstructured field and outputs them as two float values.

Input
&in

A reference to an unstructured Mesh. Structured meshes (Mesh_Struct, Mesh_Unif, etc.) will be accepted but DVintegr_vol will create a temporary working version of the mesh by converting it to an unstructured Mesh of cell type Hex.

If only a Mesh is present, then only the length, area, or volume is calculated. To calculate mass, a Node_Data must be present.

component

An integer that selects which component of the Node_Data to use in the mass calculation. The selected component must be a scalar representing density. The default is the first (0th) component.

dim

An integer. This value only comes into play if the unstructured mesh contains mixed (1D and 2D, or 2D and 3D) cell types. Then, you must specify whether you want to calculate the length of the 1D cells, the area of the 2D cells, or the volume of the 3D cells.

Output
volume

A float value that is the volume of the field.

mass

A float value that is the mass of the field.

Algorithm

The algorithm used to calculate the volume and mass is: Gauss-Legendre quadrature (aka "Gauss sampling points").

Files

v/dv.v
modules/integr.c

Utility DVM macros

DVMintegr_param

Example

Libraries.Main.Mappers.volume_integrate

See also

Not applicable.

4.46 DVinterp_cell_data
Available in Developer Edition Only
Synopsis

sample cell data of one field at the node locations of another "probe" field

module DVinterp_cell_data {
/* uses data from the first field to interpolate data at
locations of the second field */
Mesh+Cell_Data+Iparam &in { /* input field */
nnodes+req;
coordinates+req;
coordinates.values+req;
};
Mesh+Iparam &probe { /* field grid */
nnodes+req;
coordinates+req;
coordinates.values+req;
};
int+Iparam component;
Node_Data+write+nonotify out_nd; /* output field */
Mesh+Node_Data+nonotify+OPort2 &out => merge(out_nd, probe);
method+notify_val+notify_inst interp_data_update<status=1> =
"DVinterp_cell_data";
};
Description

DVinterp_cell_data uses the node coordinates specified in the input mesh (in_probe) as a set of sample points for the in_field. For each sample point, it locates the cell containing that point in the in_field, and uses the (possibly vector) value of the given component in that cell as the node data in the output field.

If there is no cell in in_field containing a given sample point, a null data value is used.

Input Ports
in

Mesh+Cell_Data. This field is sampled at the locations determined by the nodes of the probe mesh.

probe

Mesh. The node coordinates of this field define the sample points for interpolating the input field.

component

int. Which data component to interpolate.

Output Ports
out

The interpolated output field.

Example

Not available.

File

v/dv.v

See also

Related modules

Section 4.47, DVinterp_data  [page 4-102]
4.47 DVinterp_data
Available in Developer Edition Only
Synopsis

use coordinates from a probe mesh as sample points to interpolate data in a field

group DVinterp_data {
Mesh+Node_Data+Iparam &in { /* input field */
xform+nonotify;
nnodes+req;
coordinates.values+req;
};
Mesh+Iparam &probe { /* field grid */
nnodes+req;
coordinates.values+req;
};
int+Iparam comps[];
Node_Data+write+nonotify out_nd; /*output field*/
Mesh+Node_Data+nonotify+OPort2 &out => merge(out_nd, probe);
method+notify_val+notify_inst upd_interp_data = "interp_data";
} ;
Description

DVinterp_data uses the coordinates specified in an input mesh (in_probe) as a set of sample points for a field. It takes each set of coordinates in the mesh (the sample points), locates these same coordinates in the input field, then calculates what the interpolated data value of the selected scalar component would be at that exact location based on the values of the same component in the adjacent nodes.

Input
&in

A reference to a field with any mesh type and Node_Data. The Node_Data's first component will be used. It must be scalar.

&probe

A reference to any mesh whose coordinates represent the sample points.

To create this sampling mesh you could, for example, use the plane object in Geometries.plane or the DVslice module.

comps[]

An integer array. Each array value is the number (from 0 up) of a component to interpolate. The specified component must be scalar. For example:

(a, b, c, [e, f, g]) --> set map_comp = {0, 2} --> (a, c)

causes a and c to be interpolated and sent to the output field.

Note that this array is not explicitly dimensioned. It is a variable-length array
that will have as many values as you assign to it with the = { n, n, n,...n} notation. The supplied AVS/Express modules that use DVinterp_data implicitly set the dimension to 1 by specifying map_comp = {0}, i.e., the user can specify any one component to send to the output field, and the default is the first (0th) component.

Output
out_nd

This output is a new Node_Data object that contains the interpolated data values at the mesh nodes.

&out

The output is a reference to a new object that is the merge of a new Node_Data out_nd, and a reference to the probe's unstructured mesh. That is, it is a reference to the interpolated data values at the mesh nodes, plus that mesh.

Algorithm

Structured fields use trilinear interpolation. Unstructured fields use shape function interpolation.

Files

v/dv.v
modules/int_data.c

Utility DVM macros

DVMinterp_param, InterpTxt3D

Example

Libraries.Main.Mappers.interp_data
Libraries.Main.Mappers.probe

See also

Related modules

Section 4.46, DVinterp_cell_data  [page 4-100]
4.48 DViso
Available in Developer Edition Only
Synopsis

produce a mesh representing an isosurface

group DViso {
Mesh+Node_Data+Iparam &in {
xform_nonotify;
nnodes+req;
};
float+Iparam level;
Mesh+Oparam out {
&xform<weight=-1> => in.xform;
};
NParam_Data+Oparam nparam;
method+notify_val+notify_inst iso_update = "iso";
} ;
Description

DViso is used to create isosurfaces-a 3D contour surface that passes through all cells containing a specified level value. The surface may actually occur between node locations. For example, if one node has a component value of 1.0, and the adjacent node's component value is 2.0, then if the user sets a level value of 1.5, the surface Mesh is interpolated and will occur midway between the two real nodes.

Input
&in

The input is a reference to a field with Mesh and Node_Data. Both structured and unstructured meshes are fully supported. It uses the first component of the Node_Data, which must be a scalar component.

level

A float. Sets the value for which an isosurface will be constructed. Its data type will be converted to the Node_Data's data type before use.

Output
out

The output is a new object. It is an unstructured Mesh made up of one cell set. The cell type is Tri. The Mesh is the location of the isosurface. It includes a reference to the input field's xform.

nparam

This output is of type NParam_Data, which is defined as follows in v/fld.v:

dgroup NParam_Data {
int nnodes;
int min_node[nnodes];
int max_node[nnodes];
float tpar[nnodes];
};

One often wishes to map the values of one component (for example, temperature), as a color onto the isosurface of another component (say, pressure). The picture would show an isosurface of component pressure = .25, and that surface would be colored by the interpolated temperature component values all along that isosurface.

To perform this mapping most efficiently, using a minimum of memory and node data processing, DViso outputs only a "table" that lists which pairs of nodes the isosurface crossed, and a parametric value from between 0.0 and 1.0 that tells where the isosurface crossed between the nodes. A different base module, DVnmap, can take this nparam data and quickly calculate interpolated values for any other component.

For example, consider the simpler 2D Mesh case. There are six nodes in two cells. The user-specified pressure component isosurface level is .25

The iso looks like this:


The original Node_Data Data_Array is:

Array Index values[nvals][veclen]
Numeric Value
values[0]
0.0
values[1]
0.0
values[2]
0.0
values[3]
1.0
values[4]
0.5
values[5]
.25

The nparam structure output by DViso would look like this:

nnodes = 3

min_node
max_node
tpar
0
3
.25
1
4
0.5
2
5
1.0

That is, between the node that is the nval = 1 index into the component's Data_Array and node that is the nval = 4 index, the pressure component isosurface mesh crosses at .5. Thus, when DVnmap is trying to figure out what numeric value to produce for a temperature at that location, it knows that all it has to do is use the temperature component's nval = 1 and nval = 4 index node values and calculate ((nval[4] - nval[1]) * tpar).

Algorithm

isosurface uses the Marching Cubes algorithm to construct the isosurface. See W. Lorensen and H. Cline, "Marching Cubes: A High Resolution Surface Reconstruction Algorithm." Computer Graphics 21(4) (SIGGRAPH Proceedings, 1987), July, 1987, pp. 163-169.

This algorithm has a known limitation. There are cases where there are two possible paths that the isosurface could take through a cell, and only one is the correct path. If isosurface picks the wrong path, it will appear as a discontinuity in the surface such as a hole.

Files

v/dv.v
modules/iso.c

Utility DVM macros

DVMiso_param, Iso

Example

Libraries.Main.Mappers.isosurface
Libraries.Main.Mappers.slice

See also
Section 4.56, DVnmap  [page 4-121]
Section 4.49, DVisoline  [page 4-109]
Section 4.50, DVisotrace  [page 4-111]
Section 4.51, DVisoline_trace  [page 4-112]
Section 4.23, DVcut  [page 4-50]
4.49 DVisoline
Available in Developer Edition Only
Synopsis

create contour lines of constant value

group DVisoline {
Mesh+Node_Data+Iparam &in { /* input field */
xform_nonotify;
nnodes+req;
};
int+Iparam component;
float+Iparam level; /* isoline level */
int+Iparam color; /* toggle for colored lines */
Mesh+Node_Data+Oparam out { /* output field */
&xform<weight=-1> => in.xform;
};
method+notify_val+notify_inst isoline_update = "isoline";
};
Description

DVisoline creates contour lines of a given level value in a 2D field. The contour lines can be colored by the level value. The selected component must be scalar.

Input
&in

The input is a reference to a field with a 2D mesh and Node_Data. The mesh can be of any defined type (Mesh, Mesh_Struct, Mesh_Unif, Mesh_Rect). However, the mesh must be 2D (nspace = 2 in structured fields, cell_ndim = 2 in unstructured fields). No checking is done to ensure that the mesh is 2D. 3D meshes will not generate output. The Node_Data must have a single scalar component.

level

A float. Sets the isoline level. The data type is converted to the data type of the input field prior to use.

color

An integer. If the value is not 0, then the isolines will be colored by the level value.

Output
out

The output is a new object that contains an unstructured Mesh of cell type Line that represents the contour lines. The value of the Node_Data is the level value.

Algorithm

For each "cell" of the 2D field, a straight line is created connecting locations on the cell's edges with an interpolated value equal to the level. The interpolation is linear.

Files

v/dv.v
modules/isoline.c

Example

Libraries.Main.Mappers.isoline

See also
Section 4.48, DViso  [page 4-104]
Section 4.50, DVisotrace  [page 4-111]
Section 4.51, DVisoline_trace  [page 4-112]
Section 4.23, DVcut  [page 4-50]

4.50 DVisotrace
Available in Developer Edition Only
Synopsis

create a local surface of constant value at a picked probe location

group DVisotrace {
Mesh_Struct+Dim3+Node_Data+Iparam &in {
xform+nonotify;
nnodes+req;
};
Grid+Xform+Iparam &probe;
float+Oparam level;
Mesh+Oparam out {
&xform<weight=-1> => in.xform;
};
NParam_Data+Oparam nparam;
method+notify_val+notify_inst isotrace_update = "isotrace";
};
Description

DVisotrace takes a field and a probe location, and iteratively finds a surface of constant value starting at the seed point defined by the probe location. It outputs the value at the seed location and an NParam_Data data structure corresponding to the isosurface. An NParam_Data is an optimization structure containing the isosurface coordinates in a way designed to minimize recomputation due to incremental changes. See Section 4.56, DVnmap  [page 4-121] for how NParam_Data can be used.

Example

Libraries.Main.Mappers.isosurface_trace

File

v/dv.v

Utility DVM macros

IsoSurfTrace, DVMiso_param

See also
Section 4.48, DViso  [page 4-104]
Section 4.49, DVisoline  [page 4-109]
Section 4.51, DVisoline_trace  [page 4-112]
Section 4.23, DVcut  [page 4-50]
Section 4.56, DVnmap  [page 4-121]
4.51 DVisoline_trace
Available in Developer Edition Only
Synopsis

create a local contour line of constant value at a picked probe location

group DVisoline_trace {
Mesh_Struct+Dim2+Node_Data+Iparam &in {
xform+nonotify;
nnodes+req;
};
Grid+Xform+Iparam &probe;
int+Iparam component;
int+Iparam color;
float+Oparam level;
Mesh+Node_Data+Oparam out {
&xform<weight=-1> => in.xform;
};
method+notify_val+notify_inst isoline_trace_update = "isoline_trace";
};
Description

DVisoline_trace builds a local isoline of the specified component in the specified field from the given pick location by examining neighboring cells. If color is nonzero, the lines are colored by the data values. Otherwise the lines use the default line color in the viewer. It also outputs in "level" the value at the picked point (the value of the isoline).

See also
Section 4.48, DViso  [page 4-104]
Section 4.49, DVisoline  [page 4-109]
Section 4.50, DVisotrace  [page 4-111]
Section 4.23, DVcut  [page 4-50]
4.52 DVloop
Available in Developer Edition Only
Synopsis

execute an object n times using for loop-like controls

group DVloop {
link+notify+IPort2 trigger;
float+Iparam start;
float+Iparam end;
float+Iparam incr;
float+Oparam count;
int+Oparam done;
method+notify_val+notify_inst upd_loop = "loop";
};
Description

DVloop is a for/Do loop mechanism. It provides a way to iteratively execute an object. The basic structure is:

for ( count = start; count < end; count = count + incr )

Note: DVloop cannot be interrupted. You will likely want to use the almost identical, but interruptible Templates.GMOD.loop instead.

Input
trigger

A link. When the object that this is connected to changes, DVloop begins to execute its for loop. For example, this could be connected to UItoggle.

start

A float. Sets the initial value of the for loop control variable. It is the
"for (count = start" clause.

end

A float. Sets the terminal value of the for loop's control variable. It is the "end" in "for ( count = start; count <end".

incr

A float. Sets the increment to the for loop's control variable. It is the "incr" in
"for (count = start; count < end; count=count+incr". It must be non-zero.

count

A float. This contains the current value of the for loop's control variable. It is the "count" in the "for ( count = start" clause. DVadvect, for example, uses count to set its time step input.

done

An integer. When this is set to 1, the loop has finished executing.

Files

v/dv.v
modules/loop.c

Example

Not available.

See also
Section 4.86, DVswitch  [page 4-184]
4.53 DVmagnitude
Available in Developer Edition Only
Synopsis

calculate the magnitude of a vector field

group DVmagnitude {
int+IPort2 component = 0;
Mesh+Node_Data+IPort2 &in;
Node_Data out_nd {
nnodes => in.nnodes;
nnode_data = 1;
node_data {
veclen+nres = 1;
values+nres => cache(magnitude(in.node_data[component].values));
null_flag+nres => in.node_data[component].null_flag;
null_value+nres => in.node_data[component].null_value;
&min => in.node_data[component].min;
&max => in.node_data[component].max;
&min_vec => in.node_data[component].min_vec;
&max_vec => in.node_data[component].max_vec;
labels+nres = "magnitude";
};
};
Mesh+Node_Data+OPort2 &out => merge(out_nd,in);
};
Description

DVmagnitude calculates the magnitude of a vector field.

Input
component

An integer. Selects which component of the input field to use in the magnitude calculation. The component should contain 1, 2, or 3 vector subcomponents. The default is the first (0th) component.

&in

The input is a reference to a field with any mesh and Node_Data.

Output
&out

The output is a reference to the merge of the new magnitude Node_Data, plus a reference to the original input mesh. The new Node_Data has the same extents and null data is the input, but contains just one scalar component that is the magnitude, plus the label "magnitude".

Algorithm

The equation used to compute the magnitude is:


where a1, a2, etc. are the individual vector subcomponents within the selected component.

Files

v/dv.v

Example

Libraries.Main.Filters.magnitude

See also
Section 4.22, DVcurl  [page 4-48]
Section 4.25, DVdivrg  [page 4-55]
Section 4.44, DVgrad  [page 4-96]

4.54 DVmesh_uv
Available in Developer Edition Only
Synopsis

generate texture (u,v) coordinates from the (x,y) coordinates of a mesh's nodes

module DVmesh_uv {
Mesh+IPort2 &in;
int+IPort2 uv_switch = 0;
int+IPort2 u_flip = 0;
int+IPort2 v_flip = 0;
float+IPort2 u_shift = 0;
float+IPort2 v_shift = 0;
float+IPort2 u_scale = 1;
float+IPort2 v_scale = 1;
.
. (internal subobjects omitted for brevity)
.
Node_Data uv_data {
nnodes => <-.in.nnodes;
nnode_data = 1;
node_data {
veclen = 2;
id = 670;
values => combine_array(switch_uv.out.values,switch_vu.out.values);
};
};

Mesh+Node_Data+OPort2 &out => merge(uv_data, in);
};
Description

DVmesh_uv takes an input field and generates texture coordinates based on the physical (X,Y) coordinates of the mesh. The input Z coordinate is ignored. The resulting texture data is merged into the field and output. The output field can then accept a texture map.

Controls are provided to position the texture on the mesh by shifting and scaling the mapping from physical to texture space.

Input Ports
in

Field. The mesh to be textured.

uv_switch

int. Switch U and V (or X and Y) when generating the texture coordinates.

u_flip

int. Flip U so that the texture is applied backwards in X.

v_flip

int. Flip V so that the texture is applied backwards in Y.

u_scale

float. Scale U by this amount. The larger this value, the less space in X the texture takes up. In other words, decreasing this value stretches the texture, increasing it compresses the texture.

v_scale

float. Scale V by this amount. The larger this value, the less space in Y the texture takes up. In other words, decreasing this value stretches the texture, increasing it compresses the texture.

u_shift

float. Shift U by this amount. Positive shift shifts the texture to the left, negative shifts to the right.

v_shift

float. Shift V by this amount. Positive shift shifts the texture down, negative shifts up.

Output Ports
out

Mesh+Node_Data. Contains the input mesh and data, as well as the generated texture coordinates.

Path

Libraries.Visualization.Primitives

File

v/dv.v

See also
Section 5.102, texture_mesh  [page 5-256]
4.55 DVmirror
Available in Developer Edition Only
Synopsis

create the mirror image of a mesh

group DVmirror {
Mesh+IPort2 &in ;
float+Iparam mir_x = -1.0;
float+Iparam mir_y = -1.0;
float+Iparam mir_z = -1.0;
DefaultXform+nonotify mirr_xform {
mat => {{mir_x, 0.0, 0.0, 0.0},
{0.0, mir_y, 0.0, 0.0},
{0.0, 0.0, mir_z, 0.0},
{0.0, 0.0, 0.0, 1.0}};
};
group out_xfm {
DefaultXform xform;
};
DVconcat_xform concat_xform {
xform_in1 => in.xform;
xform_in2 => mirr_xform;
&xform_out => out_xfm.xform;
};
Mesh+0Port2 &out => merge( out_xfm, in);
};
Description

DVmirror generates a mesh that is the mirror image of the input mesh. "Mirror image" means that the mesh is mirrored about the X, Y, and/or Z plane. You can control each independently. It accomplishes this by modifying the xform transformation matrix object associated with a field. Mirroring is useful for visualization of axis symmetric problems.

Input
&in

The input is a reference to any mesh.

mir_x
mir_y
mir_z

Floating parameters that define the transformation to apply to the X, Y, and Z axes of the mesh. The default for all is -1.0. If you change it to 0.0, that axis will not be mirrored.

Output
&out

The output is a reference a new object that is the merge of the new transformation matrix plus a reference to the original input field.

Files

v/dv.v

Utility DVM macros

DVMmirror_param

Example

Libraries.Main.Filters.mirror

See also
Section 4.70, DVscale  [page 4-150]
Section 4.14, DVconcat_xform  [page 4-34]
Section 4.76, DVset_xform  [page 4-162]

4.56 DVnmap
Available in Developer Edition Only
Synopsis

calculate data values at a given location based upon a node map

group DVnmap {
Node_Data+Iparam &in {
nnodes+req;
};
NParam_Data+Iparam &nparam {
nnodes+req;
};
int+Iparam map_comp[];
Node_Data+Oparam out;
method+notify_val+notify_inst upd_nmap = "nmap";
};
Description

DVnmap is an optimization utility. It uses a data structure called NParam_Data (aka "node map") to quickly calculate the data value at a point that is between two real nodes in a Node_Data using linear interpolation. The DViso and DVisotrace base modules output this NParam_Data node map.

Input
&in

This input is a reference to any object with Node_Data.

&nparam

This input is a reference to an NParam_Data object, which is defined as follows in v/fld.v:

dgroup NParam_Data {
int nnodes;
int min_node[nnodes];
int max_node[nnodes];
float tpar[nnodes];
};

The DViso base module outputs this NParam_Data object.

This "node map" is a table that lists which pairs of nodes a sampling surface (such as an isosurface) crossed, and a parametric value from between 0.0 and 1.0 that tells where the where the surface crossed between the nodes. DVnmap, can take this nparam data and quickly calculate interpolated values for any component in the Node_Data.

The nparam structure output by DViso would look like this:

nnodes = 3

min_node
max_node
tpar
0
3
.25
1
4
0.5
2
5
1.0

That is, between the node that is the nval = 1 index into the component's Data_Array and node that is the nval = 4 index, the pressure component isosurface mesh crosses at .5. Thus, when DVnmap is trying to figure out what numeric value to produce for a temperature at that location, it knows that all it has to do is use the temperature component's nval = 1 and nval = 4 index node values and calculate ((nval[4] - nval[1]) * tpar).

map_comp[]

An integer array. Specifies which component will be mapped onto the isosurface (for example, map pressure value onto a density isosurface). Each array value is the number (from 0 up) of a component to map. For example:

(a, b, c, [e, f, g]) --> set map_comp = {0, 2} --> (a, b) in the output field

Note that this array is not explicitly dimensioned. It is a variable-length array that will have as many values as you assign to it with the = { n, n, n,...n} notation. The supplied AVS/Express modules that use DVnmap implicitly set the dimension to 1 by specifying map_comp = {0}, i.e., the user can specify any one component to map to the isosurface, and the default is the first (0th) component.

Output
out

The output is a new Node_Data containing the computed values.

Files

v/dv.v
modules/nmap.c

Example

Libraries.Main.Mappers.isosurface
Libraries.Main.Mappers.slice

See also
Section 4.48, DViso  [page 4-104]
Section 4.50, DVisotrace  [page 4-111]

4.57 DVnode_data_labels
Available in Developer Edition Only
Synopsis

extract node data labels for display in a UIradioBoxLabel

group DVnode_data_labels {
group+Iparam &in{
group+opt node_data {
string+opt labels;
};
};
string+Oparam labels[];
int+Oparam ncomp => array_size(labels);
method+notify_val+notify_inst upd_node_data_labels = "node_data_labels";
};
Description

DVnode_data_labels extracts the node data labels from the Data_Arrays within a Node_Data and stores them in a string array. This string array (along with the Node_Data's nnode_data value) can be used as inputs to a UIradioBoxLabel widget so that the user can pick which component, by label, he/she wants a downstream object to work on.

Input
&in

A reference to a Node_Data.

Output
labels[]

A string array object. The array is as long as the nnode_data of the input Node_Data. It contains the label strings from each component's Data_Array. If no label was present, the string value is "NO NAME".

ncomp

An integer whose value is the size of the labels array (the number of components, nnode_data, in the input field).

Files

v/dv.v
modules/labels.c

Example

Libraries.Main.Filters.extract_component
Libraries.Main.Filters.threshold
Libraries.Main.Filters.clamp
Libraries.Main.Mappers.surf_plot
and many others

See also
Section 4.36, DVextract_comp  [page 4-80]
4.58 DVoffset
Available in Developer Edition Only
Synopsis

deform a mesh by data vector component at each node

group DVoffset {
Mesh+Node_Data+IPort2 &in ;
int+IPort2 component;
float+IPort2 scale;
Grid+Xform out_grid {
nnodes => in.nnodes;
nspace => in.nspace;
&xform => in.xform;
int npoints => nnodes;
float points[nnodes][nspace];
coordinates {
values+nres => in.coordinates.values +
scale*in.node_data[component].values;
};
};
Mesh+Node_Data+OPort2 &out => merge(out_grid, in);
};
Description

DVoffset "physically" deforms a mesh by the values of a 1, 2 or 3 vector component located at each node. The first element of the vector translates the node's X coordinate, the second (if present) translates the Y coordinate, and the third (again, if present) translates the Z coordinate. The magnitude of each translation is proportional to the values at the nodes multiplied by a scaling factor.

Input
&in

A reference to a field with Mesh and Node_Data. Its components can be a 1, 2, or 3 element vector.

component

An integer. Selects which of the Node_Data's components to use for the offset calculation.

scale

A float. A scaling factor to adjust the degree of distortion caused by the vector component.

Output
&out

A reference to an object that is the merge of the new Grid, plus a reference to the remaining fields of the input mesh, plus a reference to the original Node_Data. Mesh --> Mesh. Mesh_Struct or Mesh_Unif or Mesh_Rect --> Mesh_Struct.

Files

v/dproc.c

Utility DVM macros

DVMoffset_param

Example

Libraries.Main.Mappers.offset

See also

Not applicable.

4.59 DVorthoslice
Available in Developer Edition Only
Synopsis

discover the type of mesh, then call the corresponding orthoslicing base module

group DVorthoslice {
Mesh_Struct+Node_Data+Iparam &in {
nnodes+req;
};
int+Iparam axis;
int+Iparam plane;

DVorthoslice_struct DVorthoslice_struct {
&axis => <-.axis;
&plane => <-.plane;
};
DVorthoslice_unif DVorthoslice_unif {
&axis => <-.axis;
&plane => <-.plane;
};
DVorthoslice_rect DVorthoslice_rect {
&axis => <-.axis;
&plane => <-.plane;
};
DVfld_match DVfld_match {
Mesh_Struct+IPort2 &in=> <-.in;
links {
link0 => DVorthoslice_unif.in;
link1 => DVorthoslice_rect.in;
link2 => DVorthoslice_struct.in;
};
};
DVswitch DVswitch {
in => {DVorthoslice_unif.out, DVorthoslice_rect.out,
DVorthoslice_struct.out};
index => DVfld_match.index;
};
olink out => DVswitch.out;
};
Description

DVorthoslice is a utility base module. It discovers what type of mesh (Mesh_Struct, Mesh_Rect, or Mesh_Unif) its input field has, then passes control through DVswitch to the corresponding base module (DVorthoslice_struct, DVorthoslice_rect, or DVorthoslice_unif).

Input
&in

A reference to a field containing any type of structured mesh, plus Node_Data.

axis
plane

The orthoslicing parameters. These are passed through to the selected base module.

Output
out

The output is the same as the DVswitch selection.

Files

v/dv.v

Utility DVM macros

DVMortho_slice_param

Example

Libraries.Main.Filters.orthoslice

See also
Section 4.60, DVorthoslice_rect  [page 4-130]
Section 4.61, DVorthoslice_struct  [page 4-132]
Section 4.62, DVorthoslice_unif  [page 4-134]

4.60 DVorthoslice_rect
Available in Developer Edition Only
Synopsis

produce a slice of a rectilinear field perpendicular to a coordinate axis

group DVorthoslice_rect {
Mesh_Rect+Iparam &in {
nnodes+req;
};
int+Iparam axis;
int+Iparam plane;
Mesh_Rect+Node_Data+Oparam out;
method+notify_val+notify_inst upd_orthoslice = "orthoslice";
} ;
Description

DVorthoslice_rect subsets a rectilinear structured field (mesh type Mesh_Rect) by removing one slice plane. The slice plane can only be orthogonal to the X, Y, or Z axis.

Input
&in

The input is a reference to a field containing a Mesh_Rect and Node_Data. The input can be 1D, 2D, or 3D.

axis

An integer. Selects which axis (X = 0, Y = 1, Z = 2) the orthoslice will be perpendicular to.

plane

An integer. Selects which plane to extract from the input. The "units" are the array indices of the coordinates. So, for example, if you have a field that has 64 [0-63] nodes extending from -0.5 to 3.12 in X, you are picking a number from 0 to 63, not an absolute location from -0.5 to 3.12.

Output
out

The output is a new field object with a new rectilinear mesh (mesh type Mesh_Rect) for the slice with a new Node_Data that contains all components of the slice.

Files

v/dv.v
modules/orthoslc.c

Example

Libraries.Main.Mappers.orthoslice

See also
Section 4.59, DVorthoslice  [page 4-128]
Section 4.61, DVorthoslice_struct  [page 4-132]
Section 4.62, DVorthoslice_unif  [page 4-134]

4.61 DVorthoslice_struct
Available in Developer Edition Only
Synopsis

produce a slice of a structured field perpendicular to a coordinate axis

group DVorthoslice_struct {
Mesh_Struct+Node_Data+Iparam &in {
nnodes+req;
};
int+Iparam axis;
int+Iparam plane;
Mesh_Struct+Node_Data+Oparam out;
method+notify_val+notify_inst upd_orthoslice = "orthoslice";
};
Description

DVorthoslice_struct subsets a structured field (mesh type Mesh_Struct) by removing one slice plane. The slice plane can only be orthogonal to the X, Y, or Z axis.

Input
&in

The input is a reference to a field containing a Mesh_Struct and Node_Data. Mesh_Unif and Mesh_Rect will be accepted, but may produce incorrect results. The input can be 1D, 2D, or 3D.

axis

An integer. Selects which axis (X = 0, Y = 1, Z = 2) the orthoslice will be perpendicular to.

plane

An integer. Selects which plane to extract from the input. The "units" are the array indices of the coordinates. So, for example, if you have a field that has 64 [0-63] nodes extending from -0.5 to 3.12 in X, you are picking a number from 0 to 63, not an absolute location from -0.5 to 3.12.

Output
out

The output is a new field object with a new structured mesh (mesh type Mesh_Struct) for the slice that contains a new Node_Data that is all components of the slice.

Files

v/dv.v
modules/orthoslc.c

Example

Libraries.Main.Mappers.orthoslice

See also
Section 4.59, DVorthoslice  [page 4-128]
Section 4.60, DVorthoslice_rect  [page 4-130]
Section 4.62, DVorthoslice_unif  [page 4-134]
4.62 DVorthoslice_unif
Synopsis

produce a slice of a uniform field perpendicular to a coordinate axis

group DVorthoslice_unif {
Mesh_Unif+Node_Data+Iparam &in {
nnodes+req;
};
int+Iparam axis;
int+Iparam plane;
Mesh_Unif+Node_Data+Oparam out;
method+notify_val+notify_inst upd_orthoslice = "orthoslice";
} ;
Description

DVorthoslice_unif subsets a uniform structured field (mesh type Mesh_Unif) by removing one slice plane. The slice plane can only be orthogonal to the X, Y, or Z axis.

Input
&in

The input is a reference to a field containing a Mesh_Unif and Node_Data. The input can be 1D, 2D, or 3D.

axis

An integer. Selects which axis (X = 0, Y = 1, Z = 2) the orthoslice will be perpendicular to.

plane

An integer. Selects which plane to extract from the input. The "units" are the array indices of the coordinates. So, for example, if you have a field that has 64 [0-63] nodes you are picking a number from 0 to 63.

Output
out

The output is a new field object with a new uniform mesh (mesh type Mesh_Unif) for the slice and a new Node_Data that contains all components of the slice.

Files

v/dv.v
modules/orthoslc.
c

Example

Libraries.Main.Mappers.orthoslice

See also
Section 4.59, DVorthoslice  [page 4-128]
Section 4.60, DVorthoslice_rect  [page 4-130]
Section 4.61, DVorthoslice_struct  [page 4-132]
4.63 DVplane_crop
Available in Developer Edition Only
Synopsis

subset a volume using any number of 2D uniform grids as slicing planes

group DVplane_crop {
Mesh+Iparam &in { /* input field */
xform+nonotify;
nnodes+req;
};
Plane_Grid+Xform+Iparam &plane[]; /* slice planes */
int+Iparam in_out;
int+Iparam and_or = 1;
Mesh+Node_Data+Oparam out { /* output field */
&xform<weight=-1> => in.xform;
};
method+notify_val+notify_inst upd_plane_crop = "plane_crop";
};
Description

DVplane_crop subsets a field by outputting all whole cells that are inside or outside a volume created by an unlimited number of slice planes.

Input
&in

The input is a field with any Mesh. Node_Data is optional.

&plane[]

An array of references to any number of Plane_Grids that will slice the volume. A Plane_Grid is defined as Grid_Unif+Space2+Dim2. It is therefore any 2D uniform grid.

in_out

An integer. When this value is not 0, then the entire cell intersected by a plane is output. If it is 0, then the entire cell is not output.

and_or

An integer. When this value is not 0, the cells inside the slicing planes are output. If it is 0, then the cells outside the slicing planes are output.

Output
out

The output is a new Mesh and Node_Data that is the plane-cropped input Mesh, plus any Node_Data for the output nodes. The mesh contains a reference to the input field's xform.

Files

v/dv.v
modules/pln_crop.c

Utility DVM macros

DVMplane_crop_param

Example

Not available.

See also
Section 4.20, DVcrop_struct  [page 4-44]
Section 4.23, DVcut  [page 4-50]
Section 4.87, DVthresh_null  [page 4-185]
4.64 DVplane_dist
Available in Developer Edition Only
Synopsis

compute distance from all nodes to a plane

group DVplane_dist {
Mesh+Iparam &in {
nnodes+req;
};
Plane_Grid+Xform+Iparam &plane;
Node_Data+Scalar+Float+Oparam out;
float+Oparam dist;
method+notify_val+notify_inst upd_plane_dist = "plane_dist";
} ;
Description

DVplane_dist is an underlying utility base module that, combined with DViso, is widely used in slicing and cutting operations.

DVplane_dist requires an input plane and an input field. This plane, considered to be infinite, is positioned somewhere in space, likely slicing through the volume of the input field. DVplane_dist then calculates the distance from the plane to every node in the input field. "Distance" is measured along the normal (90 degrees) to the plane. These distances are output as a Node_Data.

When passed to the isosurfacing base module DViso, the field can be cut or sliced in two by finding everywhere that the isosurface level = 0 (meaning that the distance from the node to the plane is 0, or, in other words, the node is on the slicing plane).

Input
&in

The input is a reference to a field containing a mesh of any type.

&plane

This input is a reference to a Plane_Grid, such as that generated by Geometries.FPlane.

Output
out

This output is a new Node_Data of scalar floats whose values are the distance from the plane to each node in the original data.

dist

A float. The distance from the plane to the origin (0, 0, 0 index) of the data.

Files

v/dv.v
modules/pln_dist.c

Example

Libraries.Main.Mappers.slice
Libraries.Main.Mappers.cut

See also
Section 4.48, DViso  [page 4-104]
Section 6.16, FPlane  [page 6-29]
4.65 DVprint
Available in Developer Edition Only
Synopsis

print a field's V and data to stderr

group DVprint {
Field+Iparam &in;
method+notify_val+notify_inst upd_print = "print";
} ;
Description

DVprint lists all of a field's V and data values to stderr.

Input
&in

A reference to an input field. The field can be an entire field or any subobject of a field.

Files

v/dv.v
modules/print.c

Example

Not available.

See also

Not applicable.

4.66 DVread_image
Synopsis

read an image file and output an AVS/Express field

module DVread_image {
string+Iparam filename; /* name of file to read */
int+Iparam flip; /* invert image in y */
int+Iparam filetype; /* file type */
Mesh_Unif+Dim2+Space2+Node_Data+Vector4+Oparam out; /* out field */
method+notify_val+notify_inst read_image_update = "DVread_image_update";
} ;
Description

DVread_image reads an image file of a specified type and converts it into an AVS/Express Field.

Input
filename

A string. Names the input file to be read. The string can be either the complete absolute pathname, or a relative pathname. If it is relative, it will be interpreted relative to the user's working directory when AVS/Express was started.

flip

Boolean indicating whether to invert the image about the x axis, i.e. in the vertical direction. The renderers assume that the image origin is at the lower left: toggle the flip param if the image is rendered upside-down.

filetype

An integer value indicating the image file type. A value of 0 causes the type to be determined from the file itself by looking at the id information in the header, or by using the filename extension. The following image formats are currently supported:

Note: Developer Edition users wishing to create runtimes that include support for reading GIF and TIFF image formats, which use the patented LZW compression algorithm, must first obtain a license from Unisys Corporation:
WARNING: Use of this software for providing LZW capability for any purpose is not authorized unless user first enters into a license agreement with Unisys under U.S. Patent No. 4,558,302 and foreign counterparts. For information concering licensing, please contact:

Unisys Corporation
Welch Licensing Department - C1SW19
Township Line & Union Meeting Roads
P.O. Box 500
Blue Bell, PA 19422
Once you have entered into such a license agreement with Unisys Corp, runtime generation support for GIF and TIFF can be enabled in AVS/Express at no additional cost. Contact Advanced Visual Systems customer support for details.

Support for additional image formats can be provided by creating new readers using availabel API calls (see Appendix A, Adding your own image readers and writers). To obtain a current list of the supported image types, you can open v/modules.v and search for "Read_Image" - the list can be found in the defined radioBox labels.

Output
out

The output is a new Mesh_Unif object.

The new Mesh_Unif contains:

Node_Data
nnodes equal to the number of pixels
nnode_data (number of components) equals 1
Data_Array
veclen equals 4 (alpha, red, green, blue)
id equals GD_RGB_DATA_ID
values array contains the ARGBs of all pixels
primitive data type DTYPE_BYTE
Grid_Unif (portions derived from Grid_Struct)
ndims equal to 2 (from Dim2)
dims array equal to dims[0] = x; dims[1] = y
points array equal to: points[0] = 0.0
points[1] = 0.0
points[2] = (float) x - 1
points[3] = (float) y - 1
Grid

nspace equals Space2.

Note: The order of the image's scan lines is reversed. For example, if an input image had four rows of pixels (0, 1, 2, 3) with 0 the "top" of the image, the output image has four rows of pixels (3, 2, 1, 0) with 0 at the"bottom" of the image. The reason for this is that renderer is set up to recognize 0,0 as the lower left of an object, not the upper left. Reversing the image's scan lines means that the image appears upright in the renderer window.
Because the scan lines are reversed, a few image processing functions may not produce the same result as they would if the image was rightside up. To ensure correct results toggle the flip param in this module. You might also compare the output of the image processing operations (using IPcompare) both with and without inve rting the image to determine if this is necessary.
Files

v/dv.v
modules/rd_image.c
modules/image.h

Example

Libraries.Main.Readers.Read_Image

See also

Related modules:

Section 4.67, DVread_net_cdf  [page 4-145]
Section 4.69, DVread_vol  [page 4-148]
Section 4.90, DVwrite_image  [page 4-193]

Adding a new readable image format:

Appendix A, Adding your own image readers and writers
4.67 DVread_net_cdf
Available in Developer Edition Only
Synopsis

reads a data set from a netCDF file

module DVread_net_cdf<locked=0> {
string+Iparam filename;
olink out;
method+notify_val+notify_inst read_update<status=1> = "DVread_net_cdf";
};
Description

Read_netCDF reads a data set from a netCDF file into an AVS/Express field.

Input Ports
filename

string. Name of netCDF file to read

Output Ports
out

any. Object containing the elements of the specified netCDF file.

Example

Not available.

File

v/dv.v

See also

Related modules

Section 5.78, Read_netCDF  [page 5-199]
4.68 DVread_PLOT3D_mb
Available in Developer Edition Only
Synopsis

reads a multiblock Plot3D format data file

module DVread_PLOT3D_mb {
string+Iparam filename_xyz; /* name of file to read */
string+Iparam filename_q; /* name of file to read */
int+Iparam iblanks = 1;
Multi_Block+Oparam out; /* output field */
mlink+nonotify+OPort2 out_flds => out.fields;
method+notify_val+notify_inst upd_read_plot3d<status=1> =
"DVread_PLOT3D_mb";
};
Description

DVread_PLOT3D_mb reads a pair of files which describe a Plot3D data set. It reads that data into an array of fields; each field describes one block of the data set. The result can be operated on by any of the *_ARR array-of-fields macros.

The Multi_Block object contains the array of fields plus some additional information, including the number of blocks and the bounds of the data set.

Input Ports
filename_xyz

string. Name of Plot3d xyz file.

filename_q

string. Name of Plot3d q file.

iblanks

int. Accept blanks in input when nonzero.

Output Ports
out

Multi_Block. A Multi_Block object describing the read-in fields.

out_flds

field[]. An array of fields, each field describing one block of the data set.

Example

Not available.

File

v/dv.v

See also

Related modules

Section 5.66, Plot3d_Multi_Block  [page 5-154]
4.69 DVread_vol
Synopsis

read an AVS volume (.dat file) and output an AVS/Express field

group DVread_vol {
string+Iparam filename;
Field_Unif+Dim3+Space3+Scalar+Byte+Oparam out;
method+notify_val+notify_inst upd_read_vol = "read_vol";
} ;
Description

DVread_vol reads an Application Visualization System volume format file (.dat suffix) and converts it into an AVS/Express Field_Unif.

Input
filename

A string. Names the input file to be read as a .dat format file. The string can be either the complete absolute pathname, or a relative pathname. If it is relative, it will be interpreted relative to the user's working directory when AVS/Express was started.

Output
out

The output is a new Field_Unif object containing:

Node_Data
nnodes equal to the product of the dims array (X x Y x Z)
nnode_data equals 1 (one Data_Array component)
Data_Array
nvals equals nnodes
veclen equals 1
values array contains the scalar node values
primitive data type OM_TYPE_BYTE
Grid_Unif (portions derived from Grid_Struct)
ndims equal to 3 (from Dim3)
dims array equal to dims[0] = x dim; dims[1] = y dim; dims[2] = z dim
points array equal to: points[0] = 0.0
points[1] = 0.0
points[2] = 0.0
points[3] = (float) x - 1.0
points[4] = (float) y - 1.0
points[5] = (float) z - 1.0
Grid
nspace equal Space3
Files

v/dv.v
modules/rd_vol.c

Example

Not available.

See also
Section 4.66, DVread_image  [page 4-141]

4.70 DVscale
Synopsis

scale a 3D mesh in X, Y, and/or Z

group DVscale {
Mesh+IPort2 &in ;
float+Iparam scale_x = 1.0;
float+Iparam scale_y = 1.0;
float+Iparam scale_z = 1.0;
DefaultXform+nonotify scale_xform {
mat => {{scale_x, 0.0, 0.0, 0.0},
{0.0, scale_y, 0.0, 0.0},
{0.0, 0.0, scale_z, 0.0},
{0.0, 0.0, 0.0, 1.0}};
};
group out_xfm {
DefaultXform xform;
};
DVconcat_xform concat_xform {
xform_in1 => in.xform;
xform_in2 => scale_xform;
&xform_out => out_xfm.xform;
};
Mesh+OPort2 &out => merge( out_xfm, in);
};
Description

DVscale scales a mesh in X, Y, and/or Z, making it appear larger or smaller in the renderer window. It accomplishes this by modifying the field's associated transformation matrix, xform.

Input
&in

The input is a reference to a field containing any 3D mesh.

scale_x
scale_y
scale_z

Floats. These inputs independently control the degree of scaling in X, Y, and Z. The default 1.0 means "render at 'actual' size."

Output
&out

The output is a reference to a new object that is the merge of the new xform, plus a reference to the original field.

Files

v/dv.v

Utility DVM macros

DVMscale_param

Example

Libraries.Main.Filters.scale

See also
Section 4.55, DVmirror  [page 4-119]
Section 4.14, DVconcat_xform  [page 4-34]

4.71 DVscat_to_tet
Available in Developer Edition Only
Synopsis

convert a scattered grid into triangular or tetrahedral unstructured mesh

group DVscat_to_tet {
Mesh+Node_Data+Iparam &in { /* input field */
nnodes+req;
xform+nonotify;
};
int+Iparam triangle=0;
Cells+write+nonotify out_mesh;
};
Mesh+Node_Data+nonotify+OPort2 &out => merge(out_mesh, in);
method+notify_val+notify_inst upd_scat_to_tet = "scat_to_tet";
};
Description

DVscat_to_tet converts a field with a scattered grid into a triangular or tetrahedral mesh. A "scattered grid" means that there is a structured mesh made up of disconnected nodes in space. An example would be seismic data where the coordinates are the latitude, longitude, (and perhaps elevation) of a sensing station, and the Node_Data is a set of observations. The grid is "scattered" because the data samples are located at arbitrary positions in space, not on any grid.

Fields whose meshes have nspace=2 are always converted to triangular unstructured meshes. nspace=3 meshes are usually converted to tetrahedral unstructured meshes. But, if triangle does not equal 0, they are converted to triangular meshes (2D surface existing in 3-space).

Input
&in

A reference to any mesh with Node_Data.

triangle

An integer. If this flag is 0 and nspace=3, the field is converted to a tetrahedral mesh. If this flag is not 0 and nspace=2 or nspace=3, the field is converted to a triangle mesh.

Output
out_mesh

This output is a new unstructured Mesh object that has been organized into Cells: cell type Tri (for nspace=2 or nspace=3 with triangles on input) or Tet (nspace =3 input).

out

The output is a reference to a merge of the new unstructured Mesh object and the original Node_Data.

Algorithm

DVscat_to_tet uses a proprietary version of the Delauney tesselation algorithm.

Files

v/dv.v
modules/scat_tet.c

Example

Libraries.Main.Mappers.scat_to_tri

See also
Section 4.72, DVscat_to_unif  [page 4-154]

4.72 DVscat_to_unif
Available in Developer Edition Only
Synopsis

interpolate scattered data into a uniform mesh

group DVscat_to_unif {
Mesh+Node_Data+Iparam &in { /* input field */
nnodes+req;
xform+nonotify;
};
int+Iparam rndim;
int+Iparam rdims[rndim];
float+Iparam min_xyz[rndim] => in.coordinates.min_vec[0:rndim-1];
float+Iparam max_xyz[rndim] => in.coordinates.max_vec[0:rndim-1];
float+Iparam search_cube[rndim] => 3*(max_xyz-min_xyz)/rdims;
int+Iparam interp_order = 2;
float+notify+IPort2 null_value => in.node_data[0].max+1;
Mesh_Unif+Node_Data+Oparam out { /* output field */
ndim => rndim;
dims => rdims;
nspace => rndim;
};
method+notify_val+notify_inst upd_scat_to_unif = "scat_to_unif";
} ;
Description

DVscat_to_unif converts a field with a scattered grid into a field with a uniform mesh. A "scattered grid" means that there is a mesh made up of disconnected nodes in space. An example would be seismic data where the coordinates are the latitude, longitude, (and perhaps elevation) of a sensing station, and the Node_Data was a set of observations. The grid is "scattered" because the data points are located at arbitrary points in space, not on any grid.

DVscat_to_unif lets you define a uniform mesh of any dimensionality and coordinate extents. It superimposes the input grid over this new grid that you have defined. Then, for each new node, it searches the input grid's neighboring original nodes (where search_cube controls the depth of the search) and creates data values for all the nodes in the new grid from interpolations on those neighboring actual data values. You can control the order of interpolation and what number to use as the NULL data value should the search around a node fail to find any data in the original input.

Input
&in

The input is a reference to a field with any mesh and Node_Data.

rndim

An integer. Sets the dimensionality of the uniform grid to 1, 2, or 3D.

rdims[rndim]

An integer array, rndim long. Sets the dimensions of the uniform grid. As this is a uniform grid, numbering always starts at 0. rdim specifies the upper dimension. For example rdim[0] = 100 means the X dimension is 100. rdim[1] = 50 means the Y dimension is 50, etc.

min_xyz[rndim]
max_xyz[rndim]

A float array, rndim long that sets the coordinate extents of the uniform grid (where the grid is located in space) for each dimension. They are initially set to the extents of the input Mesh.

search_cube[rndim]

A float array, rndim long that controls the depth of the search for nodes in the input mesh. The result of the default formula is 3 cells.

interp_order

An integer that controls the order of interpolation done on the adjacent nodes.

null_value

A float that specifies a null value to put in the output Node_Data for each node in the uniform grid that failed to find any input data within search_cube cells of the node. By default, it is set to one above the input's maximum.

Output
out

The output is a new Mesh_Unif with the dimensions specified by rndim and rdims, and a new Node_Data that has the interpolated values of each node, including null data values.

Algorithm

DVscat_to_unif uses a proprietary version of the Delauney tesselation algorithm.

Files

v/dv.v
modules/scat2unif.c

Utility DVM macros

DVMscat_2_unif_param, Scat2Unif

Example

Libraries.Main.Mappers.scat_to_unif

See also
Section 4.71, DVscat_to_tet  [page 4-152]
4.73 DVselect_cells
Available in Developer Edition Only
Synopsis

extract one or more Cell_Sets from a Cells Grid

group DVselect_cells {
Mesh+Iparam &in;
int+Iparam sets[];
Cells+Oparam out_cells {
*cell_set[];
ncell_sets => array_size(cell_set);
};
Mesh+nonotify+OPort2 &out =>merge(out_cells, in);
method+notify_val+notify_inst upd_select_cells = "select_cells";
};
Description

DVselect_cells extracts one or more Cell_Sets from a Cells Grid. You use it, for example, if the Grid contains both Tri and Hex cells, and all you want the downstream module to work on is the Tri cell_set.

Input
&in

A reference to an input Mesh that contains one or more Cell_Sets.

sets[]

An integer array of variable length. Each array element is the index of a Cell_Set to extract. The array is as long as the number of Cell_Sets to be extracted. This array is typically generated by referencing the output of a UIoptionBoxLabel widget and the DVcell_labels base module.

Output
&out

The output is a reference to a merged object that contains a new Cells object with the selected cell_sets, plus the remainder of the input Mesh.

Files

v/dv.v
modules/sel_cell.c

Example

Libraries.Main.Filters.select_cell

See also
Section 4.8, DVcell_labels  [page 4-20]
4.74 DVset_null
Available in Developer Edition Only
Synopsis

flag a specified data value as NULL in one component of a field

group DVset_null {
Node_Data+IOparam &in { /* input field */
nnodes+req;
};
int+Iparam component; /* which component to set */
int+IOparam unset;
float+Iparam null_value; /* what is the NULL value */
Node_Data+Oparam &out => in; /* output field */
method+notify_val+notify_inst upd_set_null = "set_null";
} ;
Description

DVset_null alters a field by defining a specified value as a NULL value and setting the flag that indicates the presence of NULL data to 1 ("has null data"). This is done on a per-component basis-one component may have NULL data while others do not. DVset_null can also turn off the NULL data flag.

Input
&in

A reference to a field with Node_Data.

component

An integer. Sets which component will be flagged as having NULL data. The components can be scalar or vector.

unset

An integer. When not equal to 0, DVset_null will turn off the selected component's NULL data flag.

null_value

A float. Specifies the data value that will be treated as a NULL value. This is converted to the data type of the field before it is used.

Output
&out

The output is a reference to the input field. The input field has been modified so that its Node_Data Data_Array null_flag =1 and null_value is set for the component's Data_Array. DVset_null is one of the few modules that actually changes its input data field.

Files

v/dv.v
modules/set_null.c

Utility DVM macros

DVMset_null_param

Example

Not available.

See also
Section 4.88, DVthreshold  [page 4-187]
Section 4.87, DVthresh_null  [page 4-185]

4.75 DVset_slice_data
Synopsis

copy a slice of node data from an input field to an output field

module DVset_slice_data {
Mesh_Unif+Node_Data+Port2+nonotify &inField;
Mesh_Unif+Node_Data+Iparam &sliceField;
int+Iparam slice;
method+notify_val update<status=1> = "DVset_slice_data"
};
Description

DVset_slice_data copies the node data from the slice field to a specified slice in the input field. Conceptually, this is the opposite of a module like orthoslice which extracts a slice from an input field. This module is useful in building up an output field from a series of individual slices.

Input Ports
inField

Input field into which the slice field's data will be copied into.

sliceField

The slice field that contains the node data that will be copied into the output field.

Parameters
slice

Index into the input field where the slice field's data will be written.

Output Ports
inField

The output field as well as the input field.

Example

Libraries.Main.Mappers.vect2rast_vol

File

v/dv.v

See also

Related modules

Section 5.112, vect2rast_vol  [page 5-280]
4.76 DVset_xform
Synopsis

set the transformation of a field

group DVset_xform {
Mesh+IPort2 &in;
group+IPort2 &in_xfm {
GDxform_templ &xform;
};
group set_xform {
GDxform_templ &xform=>in_xfm.xform;
};
Mesh+OPort2 &out => merge( set_xform, in);
};
Description

DVset_xform sets the transformation of a field's mesh to be equal to an input transformation. It is used when you want to "synch up" the transformation of one field with another.

Input
&in

The input is a reference to a field with any mesh. This is the field to be transformed.

&in_xfm

A transformation of type GDxform_templ. &in's transformation will be set to this transformation.

Output
&out

The output is a reference to a merged object that contains the original input, plus the new xform.

Files

v/dv.v

Example

Libraries.Main.Filters.set_xform
Libraries.Main.Filters.reset_xform

See also
Section 4.14, DVconcat_xform  [page 4-34]
4.77 DVslice
Available in Developer Edition Only
Synopsis

discover the type of mesh, then call the corresponding slicing base module

group DVslice {
Mesh+Node_Data+Iparam &in { /* input field */
nnodes+req;
};
Plane_Grid+Xform+Iparam &plane; /* slice plane */
float+notify+IPort2 dist; /* plane distance */
int+Iparam map_comp[];
DVslice_gen DVslice_gen {
plane => <-.plane;
&dist => <-.dist;
&map_comp => <-.map_comp;
};
DVslice_unif DVslice_unif {
plane => <-.plane;
&dist => <-.dist;
&map_comp => <-.map_comp;
};
DVslice_rect DVslice_rect {
plane => <-.plane;
&dist => <-.dist;
&map_comp => <-.map_comp;
};
DVfld_match DVfld_match {
in => <-.in;
links {
link0 => DVslice_unif.in;
link1 => DVslice_rect.in;
link2 => DVslice_gen.in;
};
};
DVswitch DVswitch {
in => {DVslice_unif.out, DVslice_rect.out, DVslice_gen.out};
index => DVfld_match.index;
};
olink out => DVswitch.out;
};
Description

DVslice is a utility base module. It discovers what type of mesh (general (structured or unstructured), Mesh_Rect, or Mesh_Unif) its input field has, then passes control through DVswitch to the corresponding base module (DVslice_gen, DVslice_rect, or DVslice_unif).

Input
&in

A reference to a field containing any type of mesh, plus Node_Data.

&plane
dist
map_comp[]

The slicing parameters. These are passed through to the selected base module.

Output
out

The output is the same as the DVswitch selection.

Files

v/dv.v

Utility DVM macros

DVMslice_param, Slice, SliceTxt3D, SliceTxt2D

Example

Libraries.Main.Mappers.slice

See also
Section 4.78, DVslice_gen  [page 4-165]
Section 4.79, DVslice_rect  [page 4-168]
Section 4.80, DVslice_unif  [page 4-170]
4.78 DVslice_gen
Available in Developer Edition Only
Synopsis

extract a 2D slice from a structured or unstructured field using an arbitrarily oriented slice plane

group DVslice_gen {
Mesh+Node_Data+Iparam &in { /* input field */
nnodes+req;
};
Plane_Grid+Xform+Iparam &plane; /* slice plane */
float+notify+IPort2 dist; /* plane distance */
int+Iparam map_comp[];


DVplane_dist DVplane_dist {
in => <-.in;
plane => <-.plane;
};
DVcomb_mesh_and_data DVcomb_mesh_and_data {
in_mesh => <-.in;
in_nd => DVplane_dist.out;
};
DViso DViso<vpy=341,vpx=297> {
in => DVcomb_mesh_and_data.out;
level => DVplane_dist.dist+(<-.dist);
};
DVnmap DVnmap {
in => <-.in;
nparam => DViso.nparam;
map_comp => <-.map_comp;
};
DVcomb_mesh_and_data DVcomb_mesh_and_data_1 {
in_mesh => DViso.out;
in_nd => DVnmap.out;
};
Mesh+Node_Data+Oparam &out=>DVcomb_mesh_and_data_1.out;
};
Description

DVslice_gen extracts an arbitrarily-oriented 2D slice of data from an unstructured or structured 3D mesh field. Any number of components can be extracted. Output is generated every time the slice plane moves.

Input
&in

The input is a reference to a field that must be a 3D field (Dims3) with an unstructured or structured mesh and any type of Node_Data.

&plane

A reference to a Plane_Grid object that will be the slicing plane. This could be generated by the plane object found in Geometries.Plane, or it could be any 2D Mesh_Unif. The plane object generated by Geometries.Plane's advantage is that its plane object has its own Plane Transformation panel that controls plane rotation, translation, and scale, as well as controls to specify its size when it is connected to the Module Stack object.

Section 6.16, FPlane  [page 6-29]
dist

A float. This value will move the plane through the field perpendicular to the plane. Though the Plane Transformation panel has X, Y, and Z transformation controls, it is usually easier to use plane's controls to orient and size the plane, but use this plane distance control to move the plane. DVslice_gen generates output whenever the slice plane moves.

map_comp[]

An integer array. Each array value is the number (from 0 up) of a component to extract. For example:

(a, b, c, [e, f, g]) --> set map_comp = {0, 3} --> (a, [e, f, g]) in the output field

Note that this array is not explicitly dimensioned. It is a variable-length array that will have as many values as you assign to it with the = { n, n, n,...n} notation. The supplied AVS/Express modules that use DVslice_gen implicitly set the dimension to 1 by specifying map_comp = {0}, i.e., the user can specify any one component to send to the output field, and the default is the first (0th) component.

Output
&out

The output is a reference to the output of the DVcomb_mesh_and_data object. It contains a new, subsetted 2D Mesh and a new Node_Data of the selected components' slices. Where the slice plane does not land exactly on a node, the data value is interpolated from the values of the adjacent nodes.

Algorithm

DVslice_gen uses trilinear interpolation to interpolate data values between mesh nodes.

Files

v/dv.v

Example

Libraries.Main.Mappers.slice

See also
Section 4.77, DVslice  [page 4-163]
Section 4.79, DVslice_rect  [page 4-168]
Section 4.80, DVslice_unif  [page 4-170]

4.79 DVslice_rect
Available in Developer Edition Only
Synopsis

extract a 2D slice from a rectilinear field using an arbitrarily oriented slice plane

group DVslice_rect {
Mesh_Rect+Dim3+Node_Data+Iparam &in { /* rectilinear input field */
nnodes+req;
};
Plane_Grid+Xform+Iparam &plane; /* slice plane */
float+notify+IPort2 dist; /* plane distance */
int+Iparam map_comp[];
Mesh_Rect+Dim2+Node_Data+Oparam out; /* output field */
method+notify_val+notify_inst upd_slice = "slice";
};
Description

DVslice_rect extracts an arbitrarily-oriented 2D slice of data from a 3D rectilinear mesh field. Any number of components can be extracted. Output is generated every time the slice plane moves.

Input
&in

The input is a reference to a field that must be a 3D field (Dims3) with a rectilinear mesh (mesh type Mesh_Rect) and any type of Node_Data.

&plane

A reference to a Plane_Grid object that will be the slicing plane. This could be generated by the plane object found in Geometries.Plane, or it could be any 2D Mesh_Unif. The plane object generated by Geometries.Plane's advantage is that its plane object has its own Plane Transformation panel that controls plane rotation, translation, and scale, as well as controls to specify its size when it is connected to the Module Stack object.

Section 6.16, FPlane  [page 6-29]
dist

A float. This value will move the plane through the field perpendicular to the plane. Though the Plane Transformation panel has X, Y, and Z transformation controls, it is usually easier to use plane's controls to orient and size the plane, but use this plane distance control to move the plane. DVslice_rect generates output whenever the slice plane moves.

map_comp[]

An integer array. Each array value is the number (from 0 up) of a component to extract. For example:

(a, b, c, [e, f, g]) --> set map_comp = {0, 3} --> (a, [e, f, g]) in the output field

Note that this array is not explicitly dimensioned. It is a variable-length array that will have as many values as you assign to it with the = { n, n, n,...n} notation. The supplied AVS/Express modules that use DVslice_rect implicitly set the dimension to 1 by specifying map_comp = {0}, i.e., the user can specify any one component to send to the output field, and the default is the first (0th) component.

Output
out

The output is a new object. It contains a new, subsetted 2D Mesh_Rect and a new Node_Data of the selected components' slices. Where the slice plane does not land exactly on a node, the data value is interpolated from the values of the adjacent nodes.

Algorithm

DVslice_rect uses trilinear interpolation to interpolate values between mesh nodes.

Files

v/dv.v
modules/slice.c

Example

Libraries.Main.Mappers.slice

See also
Section 4.77, DVslice  [page 4-163]
Section 4.78, DVslice_gen  [page 4-165]
Section 4.80, DVslice_unif  [page 4-170]

4.80 DVslice_unif
Available in Developer Edition Only
Synopsis

extract a 2D slice from a uniform field using an arbitrarily oriented slice plane

group DVslice_unif {
Mesh_Unif+Dim3+Node_Data+Iparam &in { /* uniform input field */
nnodes + req;
};
Plane_Grid+Xform+Iparam &plane; /* slice plane */
float+notify+IPort2 dist; /* plane distance */
int+Iparam map_comp[];
Mesh_Unif+Dim2+Node_Data+Oparam out; /* output field */
method+notify_val+notify_inst upd_slice = "slice";
};
Description

DVslice_unif extracts an arbitrarily-oriented 2D slice of data from a 3D uniform mesh field. Any number of components can be extracted. Output is generated every time the slice plane moves.

Input
&in

The input is a reference to a field that must be a 3D field (Dims3) with a uniform mesh (mesh type Mesh_Unif) and any type of Node_Data.

&plane

A reference to a Plane_Grid object that will be the slicing plane. This could be generated by the Plane object found in Geometries.Plane, or it could be any 2D Mesh_Unif. The plane object generated by Geometries.Plane's advantage is that its plane object has its own Plane Transformation panel that controls plane rotation, translation, and scale, as well as controls to specify its size when it is connected to the Module Stack object.

Section 6.16, FPlane  [page 6-29]
dist

A float. This value will move the plane through the field perpendicular to the plane. Though the Plane Transformation panel has X, Y, and Z transformation controls, it is usually easier to use plane's controls to orient and size the plane, but use this plane distance control to move the plane. DVslice_unif generates output whenever the slice plane moves.

map_comp[]

An integer array. Each array value is the number (from 0 up) of a component to extract. For example:

(a, b, c, [e, f, g]) --> set map_comp = {0, 3} --> (a, [e, f, g]) in the output field

Note that this array is not explicitly dimensioned. It is a variable-length array that will have as many values as you assign to it with the = { n, n, n,...n} notation. The supplied AVS/Express modules that use DVslice_unif implicitly set the dimension to 1 by specifying map_comp = {0}, i.e., the user can specify any one component to send to the output field, and the default is the first (0th) component.

Output
out

The output is a new object. It contains a new, subsetted 2D Mesh_Unif and the new Node_Data of the selected components' slices. Where the slice plane does not land exactly on a node, the data value is interpolated from the values of the adjacent nodes.

Algorithm

DVslice_unif uses trilinear interpolation to interpolate data values between mesh nodes.

Files

v/dv.v
modules/slice.c

Example

Libraries.Main.Mappers.slice

See also
Section 4.77, DVslice  [page 4-163]
Section 4.78, DVslice_gen  [page 4-165]
Section 4.79, DVslice_rect  [page 4-168]

4.81 DVsolid_contour
Available in Developer Edition Only
Synopsis

create multiple 2D or 3D filled contours

module DVsolid_contour {
Mesh+Node_Data+Iparam &in {
xform+nonotify;
nnodes+req;
};
int+Iparam contour_comp;
float+Iparam level[];
Mesh+Cell_Data+Oparam out {
&xform+nowrite => in.xform;
};
method+notify_val+notify_inst solid_contour_update<status=1> =
"DVsolid_contour";
};
Description

DVsolid_contour produces solid (filled) contour regions of a given component of an input field. If the input mesh is 2D, the output is similar to contour lines, except the regions between the lines are filled in with a color representing the value of that contour. The output cells are subdivisions of the input cells, cut by the contour lines.

If the input mesh is 3D, the output is a set of 3D cells filling the regions between adjacent isosurfaces. The output cells are, in general, subdivisions of the input cells, cut by the contour surfaces.

The contour levels are defined by the elements of the levels[] array; the number of contours is the size of the array, and each element of the array defines one contour level.

The data value in the output cells is the average of the values of the two contour lines or surfaces bounding that region.

Input Ports
in

Mesh+Node_Data. 2D or 3D input field to be contoured.

contour_comp

int. Select which component of in_field to contour.

level

float[]. Array of levels; a contour will be made at each level.

Output Ports
out

Mesh+Cell_Data. Represents the solid contours. This mesh has the same
dimensionality as the input.

Example

Not available.

File

v/dv.v

See also

Related modules

Section 5.94, solid_contour  [page 5-230]
4.82 DVstream
Available in Developer Edition Only
Synopsis

integrate a velocity field producing streamlines or streamribbons

group DVstream {
Mesh+Node_Data+Iparam &in { /* input field */
xform+nonotify;
nnodes+req;
};
Grid+Xform+ Iparam &probe; /* where the streamlines originate */
int+Iparam order; /* order of integration */
int+Iparam forw_back; /* toggle for lines forward/backward */
int+Iparam nseg;
float+Iparam min_vel;
int+Iparam max_seg;
int+Iparam stream_comp;
int+Iparam ribbons;
int+notify rib_width;
int+notify rib_angle;
Mesh+Node_Data+Oparam out { /*output field */
&xform<weight=-1> => in.xform;
};
method+notify_val+notify_inst upd_stream = "stream";
} ;
Description

DVstream generates streamlines or streamribbons based on a field of any mesh type that has at least one component that is a 1, 2, or 3 element vector.

You place a sample of points (the &probe) at a starting location in the field. Then, for every time step, DVstream advances each sample point through space based on the interpolated value of the vector field at its present position. The result is a set of streamlines or streamribbons showing the progress of massless particles through a vector field.

Input
&in

The input is a reference to a field with any type of mesh. Its Node_Data must contain at least one component that is a 1, 2, or 3 element velocity vector.

&probe

A reference to any mesh whose coordinates represent the sample points. To create this sampling mesh you could, for example, use the Plane, Line or Box objects in Geometries.[plane|slice|box] or the slice macro.

order

An integer. Sets the order of integration. Higher orders are more accurate, but execute more slowly.

forw_back

An integer. If the value is not 0, streamlines are generated forward from the starting sample points. If the value is 0, they are generated backward from the starting sample points.

nseg

An integer. Sets how many integration steps will be used within one grid "cell" to compute the streamline path.

min_velocity

A float. When a streamline falls below this velocity, the integration process for that streamline stops. You use this to prevent wasted computation for streamlines barely moving, or even stationary (min_velocity =0).

max_seg

An integer. Sets the total number of integration steps to take. When an individual streamline exceeds this value, integration for it stops.

stream_comp

An integer. Sets which component to base the streamlines upon. The selection must be a three element vector.

ribbons

An integer. When this is not 0, DVstream will produce streamribbons rather than streamlines.

rib_width

An integer. Scales the width of the ribbon. Ribbon width varies along its length according to the divergence of the flow. This value controls ribbon width at the beginning of the ribbon.

rib_angle

An integer. Controls the initial angle at which the ribbon is drawn. Reasonable values are from 0.0 to 360.0.

Output
out

The output field is a new object. It contains an unstructured Mesh of cell type Polyline that represents streamlines. Its new Node_Data contains the selected element's velocity component. The output also contains a reference to the input field's xform.

Algorithm

The streamlines are calculated using the Runge-Kutte method of specified order with adaptive time steps.

Files

v/dv.v
modules/stream.c

Utility DVM macros

DVMstream_param

Example

Libraries.Main.Mappers.streamlines
Libraries.Main.Mappers.advector

See also
Section 4.2, DVadvect  [page 4-4]
Section 4.43, DVglyph  [page 4-94]

4.83 DVstream_multi_block
Available in Developer Edition Only
Synopsis

create streamlines and stream ribbons for a Multi_Block object

module DVstream_multi_block {
/* integrates velocity field (produces streamlines) */
Multi_Block+Iparam &in { /* input field */
nblocks+req;
};
Grid+Xform+Iparam &probe { /* where the streamlines originate */
nnodes+req;
coordinates+req;
coordinates.values+req;
};
int+Iparam order; /* order of integration */
int+Iparam forw_back; /* toggle to generate lines forward */
int+Iparam nseg;
float+Iparam min_vel;
int+Iparam max_seg;
int+Iparam stream_comp;
int+Iparam ribbons;
float+notify rib_width;
float+notify rib_angle;
Mesh+Node_Data+Oparam out;
method+notify_val+notify_inst stream_multi_block<status=1> =
"DVstream_multi_block";
};
Description

DVstream_multi_block creates streamlines and stream ribbons for a Multi_Block object.

Input Ports
in

Multi_Block. The input multiblock data set.

probe

Grid+Xform. Streamlines start at each node of this mesh.

order

int. Integration order for the streamline advection. Higher orders are more accurate but execute more slowly. The default is 2, for second-order integration. The range is from 1 to 4.

forw_back

int. When on (nonzero), streamlines are advected forward, in the downstream direction of the flow. When off (zero), they are advected backward, upstream in the flow. The default is forward.

nseg

int. How many integration steps are used per grid cell to compute the streamline path. The default is 2.

min_vel

float. If the absolute value of the velocity is less than this limit, the streamline advection is terminated. This is usually used to avoid wasting computation on streamlines which are barely moving. Velocity is measured in the coordinate system of the data set. The default is 0.000001.

max_seg

int. Maximum number of integration steps to take for an individual streamline. A streamline is terminated either when it leaves the data set, when the absolute value of its velocity is less than min_velocity (see below), or when it exceeds this number of integration steps.

stream_comp

int. Which component of the data set to use.

ribbons

int. When on (nonzero), produces stream ribbons rather than streamlines. The width of the ribbons varies along the length with the divergence of the field, and the angle varies with the curl.

rib_width

float. This value scales the width of the ribbons when ribbons are turned on.

rib_angle

float. This value sets the initial angle at which the ribbons are drawn. The ribbons twist along their length according to the curl of the field.

Output Ports
out

Mesh+Node_Data. Field containing the streamlines.

Example

Not available.

File

v/dv.v

See also

Related modules

Section 5.96, stream_multi_block  [page 5-235]
4.84 DVsurf_plot
Available in Developer Edition Only
Synopsis

produce a 3D or 2D surface by extruding a 2D or 1D mesh according to data values

group DVsurf_plot {
Mesh+Node_Data+Port2 &in ;
int+IPort2 component;
float+IPort2 scale;
float+IPort2 offset;
Grid+Xform out_grid {
nnodes => in.nnodes;
nspace+nres => in.nspace+in.node_data[component].veclen;
&xform => in.xform;
int npoints => nnodes;
float points[nnodes][nspace];
coordinates {
values+nres => combine_array(in.coordinates.values,
offset+scale*in.node_data[component].values);
};
};
Mesh+Node_Data+OPort2 &out => merge(out_grid, in);
};
Description

DVsurf_plot creates a 3D or 2D mesh whose height at each point is proportional to the scalar data value at that node location in the original field. 2D input produces a 3D mesh. 1D input produces a 2D output.

Input
&in

The input is a reference to a field of any mesh type and any Node_Data. The field's mesh should have nspace=1 or 2. However, no checking is done to enforce this restriction. The Node_Data must contain at least one scalar component.

component

An integer. Sets which of the input's data components to use to set the mesh height.

scale

A float. Used to scale the height (scale*component values).

offset

A float. Raises or lowers the resulting mesh with respect to the input mesh so that both are visible at the same time.

Output
&out

The output is a reference to a merged group made up of the new object out_grid, which is a mesh of the same type as the input mesh, with nspace+1, whose coordinate values represent the projected, scaled, and offset surface, plus a reference to the original &in field.

Files

v/dv.v

Utility DVM macros

DVMsurf_plot_param

Example

Libraries.Main.Mappers.surf_plot

See also

Section 5.98, surf_plot  [page 5-240]

4.85 DVsurf_ribbons
Available in Developer Edition Only
Synopsis

create "height surfaces" of a 2D field that are continuous along one axis but discontinuous along the other

module DVsurf_ribbons {
Mesh_Unif+Dim2+Node_Data+Iparam &in {
xform+nonotify;
nnodes+req;
dims+req;
};
int+IPort2 ribbon_dir;
int+IPort2 height_comp;
int+IPort2 map_comp;
float+IPort2 scale;
float+IPort2 offset;
Mesh+Node_Data+Oparam out {
&xform+nowrite => in.xform;
};
method+notify_val+notify_inst surf_ribbons_update<status=1> =
"DVsurf_ribbons";
};
Description

DVribbons_plot creates height surfaces of a 2D field by treating the values of a
component of that field as height above the surface of the field, and the values of
another component as color to be applied. The surfaces so created are continuous
along one axis (selectable as X or Y) and discontinuous along the other axis, so
they look like a set of colored ribbons draping over a surface.

Input Ports
in_field

Mesh_Unif+Node_Data. The ribbon plot is built on this mesh, using the node data values as heights.

ribbon_dir

int. Selects which direction (X or Y) the ribbons should run in.

height_comp

int. Which node data component to map to ribbon height.

map_comp

int. Which node data component to map to ribbon color.

scale

float. This scale factor is applied to the data values to convert them into heights above the mesh.

offset

float. This offset is added to the heights to offset the ribbons from the surface of the field.

Output Ports
out

Mesh+Node_Data. Contains the generated ribbons.

Example

Libraries.Main.Mappers.surf_plot

File

v/dv.v

See also

Related modules

Section 5.98, surf_plot  [page 5-240]
4.86 DVswitch
Synopsis

select one output from a series of inputs

group DVswitch {
group+IPort2 &in[];
int+IPort2 index;
olink+nres out => in[index];
};
Description

DVswitch creates a new output that is selected by the user from any number or type of inputs.

Input
&in[]

An array of references to other objects.

index

An integer that selects which of the input objects to output.

Output
out

The output is a new object that contains a reference to one of the input objects.

Files

v/dv.v

Example

Not available.

See also
Section 4.52, DVloop  [page 4-113]

4.87 DVthresh_null
Available in Developer Edition Only
Synopsis

remove cells with nodes that contain null data from input field

group DVthresh_null {
Mesh+Node_Data+Iparam &in { /* input field */
xform+nonotify;
nnodes+req;
};
int+Iparam thresh_component; /* component to be thresholded */
Mesh+Node_Data+Oparam out { /* output field */
&xform<weight=-1> => in.xform;
};
method+notify_val+notify_inst upd_thresh_null = "thresh_null";
} ;
Description

DVthresh_null removes cells where the selected component's node data is equal to the null data value; if the null_data flag is not set on the input field no processing is done. You would use DVthresh_null, for example, to improve the performance of the renderer when rendering fields with NULL data. While the renderer will automatically delete NULL data cells, it must do so every time the object is transformed. With DVthresh_null as a data "preprocessor," this overhead is removed.

Input
&in

The input is a reference to a field containing any mesh and Node_Data.

thresh_component

An integer. Sets which Node_Data component to use during the search for NULL data. The component can be scalar or vector.

Output
out

The output is a new object. It contains the new unstructured Mesh and its new Node_Data contains all data that is not from a deleted cell.

Files

v/dv.v
modules/thresh0.c

Example

Libraries.Main.Mappers.thresh_null

See also
Section 4.74, DVset_null  [page 4-159]
4.88 DVthreshold
Available in Developer Edition Only
Synopsis

remove data below and/or above min/max threshold level by setting to NULL

group DVthreshold {
Node_Data+Iparam &in { /* input field */
nnodes+req;
};
int+Iparam check_vector;
int+Iparam check_comp;
int+Iparam thresh_vector;
int+Iparam below; /* toggle to turn on lower thresholding */
int+Iparam above; /* toggle to turn on upper thresholding */
float+Iparam min_value; /* lower threshold value */
float+Iparam max_value; /* upper threshold value */
float+Iparam null_value; /* value to set when data is out of range */
Node_Data+Oparam out; /* output field */
method+notify_val+notify_inst upd_threshold = "threshold";
} ;
Description

DVthreshold "removes" all values in a field above a max_value, and/or below a min_value by setting them to NULL.

DVthreshold can be used in two ways.

1. It can look at the values in just one component and set them to null_value if they exceed max_value or min_value (thresh_vector = check vector). This is its most common use. Or,
2. It can look at the values in one scalar subcomponent to see if they exceed max_value or min_value. If they do exceed the threshold bounds, it then sets the corresponding array index value in a second, different component to null_value (thresh_vector not equal check_vector).

This second behavior is useful, for example, if you use one component to flag the visibility of a node (for example, 0 = invisible, 1 = visible) in another component.

DVthreshold's procedure is:

If thresh_vector and check_vector point to the same component, the effect is simpler. Any value above max_value in that component is set to null_value.

If thresh_vector and check_vector point to the same component, the effect is simpler. Any value below min_value in that component is set to null_value.

Input
&in

The input is a reference to a field with Node_Data of any type.

check_vector

An integer. Sets which component will be compared against min_value and max_value.

check_comp

An integer. Sets which subcomponent of check_vector will be compared against min_value and max_value.

thresh_vector

An integer. Sets which component of the input field to threshold. The selected component can be scalar or vector.

above

An integer. When not 0, thresholds data above the max_value.

below

An integer. When not 0, thresholds data below the min_value.

min_value
max_value

Floats. Set the min and max values. The float value is converted to the data type of the input field before use.

null_value

A float. Establishes what the null_value is. The value specified is converted to the data type of the field before use.

Output
out

The output is a new object that contains only the thresh_vector, thresholded Node_Data component.

Files

v/dv.v
modules/thresh.c

Utility DVM macros

DVMthresh_param, Threshold

Example

Libraries.Main.Filters.threshold

See also
Section 4.10, DVclamp  [page 4-24]
4.89 DVthreshold_cell
Available in Developer Edition Only
Synopsis

threshold cell-based data

module DVthreshold_cell { /* sets NULL data for all values below and/or
above min/max threshold level(s) */
Mesh+Cell_Data+Iparam &in { /* input field */
nnodes+req;
};
int+Iparam check_vector;
int+Iparam check_comp;
int+Iparam thresh_vector;
int+Iparam below; /* toggle to turn on lower thresholding */
int+Iparam above; /* toggle to turn on upper thresholding */
float+Iparam min_value; /* lower threshold value */
float+Iparam max_value; /* upper threshold value */
float+Iparam null_value; /* value to set when data is out of range */

int dim => in.ncell_sets;
group+nonotify out_data[dim] {
int ncells => in.cell_set[index_of(out_data)].ncells;
int ncell_data=1;
Data_Array cell_data[ncell_data] {
nvals => ncells;
};
};
group+nonotify out_sets[dim] {
group &out_set => merge(out_data[index_of(out_sets)],
in.cell_set[index_of(out_sets)]);
};
Cells+Cell_Data+nonotify+write out_cd {
*cell_set[];
ncell_sets => array_size(cell_set);
};
Mesh+OPort2+nonotify &out =>merge(out_cd, in);
method+notify_val+notify_inst upd_data_math<status=1> =
"DVthreshold_cell";
};
Description

DVthreshold_cell sets the values of a given component of a cell-based data set to the null value if the value of another component (usually the same one) is above or below a given threshold.

Input Ports
in

Mesh+Cell_Data. The cell data set to be thresholded.

check_vector

int. Selects which component to check. If this component exceeds the threshold(s) at some node, the value of the threshold_component at that node is set to the null data value.

check_comp

int. If the selected component is a vector, this selects which element of that vector to threshold. If the selected component is scalar, this value is ignored.

thresh_vector

int. Selects which component to threshold, based on the value of "check_comp."

below

int. When set (nonzero), values below the selected min value are set to the null value.

above

int. When set (nonzero), values above the selected max value are set to the null value.

min_value

float. The min value to check against.

max_value

float. The max value to check against.

null_value

float. The value to use in the output as the null value. Select a value for this which does not occur in the input data set.

Output Ports
out

The thresholded data set.

Example

Libraries.Main.Mappers.threshold_cell

File

v/dv.v

See also

Related modules

Section 4.88, DVthreshold  [page 4-187]
4.90 DVwrite_image
Synopsis

write an image file from an AVS/Express field

module DVwrite_image {
Mesh_Unif+Dim2+Space2+Node_Data+Vector4+Oparam in; /* in field */
string+Iparam filename; /* name of file to write */
int+Iparam flip; /* invert image in y */
int+Iparam format; /* file format */
int+Iparam filetype; /* binary, ASCII */
int+Iparam depth; /* bits per pixel */
int+Iparam colortype; /* RGB, greyscale, BW */
int+Iparam compresstype; /* compression type to use */
int+Iparam reducetype; /* depth reduction method */
method+notify_val+notify_inst write_image_update = "DVwrite_image_update";
} ;
Description

DVwrite_image writes an image file of a specified format from an AVS/Express Field.

Input
filename

A string. Names the input file to be written. The string can be either the complete absolute pathname, or a relative pathname. If it is relative, it will be interpreted relative to the user's working directory when AVS/Express was started.

flip

Boolean indicating whether to invert the image about the x axis, i.e. in the vertical direction.

format

An integer value indicating the image file format to write. The following image formats are currently supported:

Note: Developer Edition users wishing to create runtimes that include support for writing GIF image format, which uses the patented LZW compression algorithm, must first obtain a license from Unisys Corporation:
WARNING: Use of this software for providing LZW capability for any purpose is not authorized unless user first enters into a license agreement with Unisys under U.S. Patent No. 4,558,302 and foreign counterparts. For information concering licensing, please contact:

Unisys Corporation
Welch Licensing Department - C1SW19
Township Line & Union Meeting Roads
P.O. Box 500
Blue Bell, PA 19422
Once you have entered into such a license agreement with Unisys Corp, runtime generation support for GIF can be enabled in AVS/Express at no additional cost. Contact Advanced Visual Systems customer support for details.

Support for additional image formats can be provided by creating new writers using available API calls (see Appendix A, Adding your own image readers and writers). To obtain a current list of the supported image formats, you can open v/modules.v and search for "Write_Image" - the list can be found in the defined radioBox labels.

filetype

An integer indicating whether the output file should be written in binary or ASCII. This option is only appropriate for certain formats, e.g. PBM.

depth

An integer indicating how many bits per pixel should be written. For many formats this is fixed, e.g. GIF is always 8, AVS .x always 32.

colortype

An integer indicating whether separate red, green and blue values, or grey levels, or dithered black and white 2 level values should be written. This option is only appropriate for certain formats, e.g. GIF.

compressiontype

An integer indicating the type of compression to be used when writing the file. For most formats there is no choice, e.g. GIF is always written using LZW and AVS .x files are always uncompressed. TIFF, however, can support a number of different compression types.

reductiontype

An integer indicating which method to use when the 8 bit red, green and blue values of the input field have to be reduced ("quantized") to 8 bit colormap indices, for example.

Output Ports

none

Example

Libraries.Main.Writers.Write_image

Files

v/dv.v
modules/rd_image.c
modules/image.h

See also

Related modules:

Section 4.91, DVwrite_net_cdf  [page 4-196]
Section 4.66, DVread_image  [page 4-141]

Adding a new writable image format:

Appendix A, Adding your own image readers and writers
4.91 DVwrite_net_cdf
Available in Developer Edition Only
Synopsis

write a data set or object to a netCDF file

module DVwrite_net_cdf {
ilink+nonotify in;
string+Iparam filename;
method+notify_val+notify_inst write_update<status=1> =
"DVwrite_net_cdf";
};
Description

Write_netCDF writes any V object (e.g. an AVS/Express field data set) to a netCDF file.

Input Ports
filename

string. Name of netCDF file to write

in

any. Object containing the elements to be written to the specified netCDF file.

Output Ports

none

Example

Libraries.Main.Writers.Write_netCDF

File

v/dv.v

See also

Related modules

Section 4.67, DVread_net_cdf  [page 4-145]
4.92 DVxform_coord
Available in Developer Edition Only
Synopsis

Transform the node coordinates of a mesh according to the transform specified in the mesh. Return an array containing the transformed coordinates.

module DVxform_coord {
Mesh+Iparam &in {
nnodes+req;
nspace+req;
};
int+Iparam comp[];
int+write coord_nspace;
float+Oparam coord[in.nnodes][coord_nspace];
method+notify_val+notify_inst upd_xform_coord = "DVxform_coord";
};
Description

DVxform_coord takes a mesh as its input and returns an array containing the coordinates of this mesh, transformed according to the transformation matrix in the input mesh.

The output is a 2D array containing the X, Y and/or Z components of the mesh's coordinates after being transformed by the mesh's transformation matrix. If X (0) and Y (1) are selected, it outputs X0, Y0, X1, Y1, and so on. Note that the output coordinates are in general not the same as the coordinates of the mesh itself; they are transformed, so they are in "world coordinates", as you would see them in the viewer, because of the transformation step.

Input Ports
in

Mesh. The input mesh, containing the coordinates and the transformation matrix.

comp

int[]. An array of up to three elements, selecting which of X, Y and/or Z to transform and output. Unselected elements are ignored. The behavior is undefined if this array has zero or more than three elements, or if the values are not in the range [0,2]. 0 selects X, 1 selects Y, and 2 selects Z.

Output Ports
coord

float[][]. The output array, containing the transformed coordinates.

Example

Not available.

File

v/dv.v

See also

Not applicable.


TOC PREV NEXT INDEX

Copyright © 2001 Advanced Visual Systems Inc.
All rights reserved.