DVgrad


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:

 

fh794033.gif  

Files

v/dv.v
modules/grad.c

Example

Libraries.Main.Filters.gradient

See also