TOC PREV NEXT INDEX

DVclamp_cell

Synopsis

clamp Cell_Data to min/max values

module DVclamp_cell { /* clamps data to min/max values */
Mesh+Cell_Data+Iparam &in { /* input field */
xform+nonotify;
};
/* It always clamps the first cell data component */
int+Iparam component; /* which vector 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 */
int dim => in.ncell_sets;
group+nonotify out_data[dim] {
int ncells => in.cell_set[index_of(out_data)].ncells;
/* Output always has a single cell data component */
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_clamp = "DVclamp_cell_update";
};

Description

DVclamp transforms the values in one component of a Cell_Data object as follows: If above is set, then any value above max_value is set to max_value.    If below is set, then any value below min_value is set to min_value. Otherwise, the values are not changed.If both above and below are on, then the output field's selected component values are all in this range:min_value <= value <= max_valueNull data values are not affected.

Input

&in

A reference to an input field that contains a Cell_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_valuemax_value

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

Output

out

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

Example

Not available.

File

v/dv.v

See also

DVthreshold
DVclamp

TOC PREV NEXT INDEX