calculate the magnitude of a vector field
group DVmagnitude {
int+IPort2 component = 0;
Mesh+Node_Data+IPort2 ∈
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);
};
DVmagnitude calculates the magnitude of a vector field.
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.
The input is a reference to a field with any mesh and Node_Data.
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".
The equation used to compute the magnitude is:
where a1, a2, etc. are the individual vector subcomponents within the selected component.