FLDget_nnodes,FLDset_nnodes

Synopsis

get/set the number of nodes (nnodes) in a Node_Data or Grid

Common Version:

int FLDset_nnodes (
OMobj_id field,
xp_long nnodes);

Wide Version:

int FLDget_nnodes (
OMobj_id field,
xp_long *nnodes);

Narrow Version:

int FLDget_nnodes_n (
OMobj_id field,
int *nnodes);

Description

These routines set and get the number of nodes (nnodes) in a Node_Data or Grid. Because nvals within a Data_Array is defined as nvals = nnodes, it also automatically tells you the range of the first array index in the Node_Data's or Grid's Data_Array values array.

Parameters

OMobj_id field

The OMobj_id of a field that contains a Node_Data or Grid subobject.

xp_long *nnodes
xp_long nnodes
int *nnodes
int nnodes

In FLDget_nnodes, nnodes is a pointer to an integer in which the number of nodes will be returned.
In FLDset_nnodes, nnodes is an integer that sets the number of nodes.

Examples

This example, a fragment from modules/clamp.c, shows clamp retrieving the nnodes from its input field object, and immediately setting the nnodes in its output field object to the same value.


int FUNCclamp (in, comp, below, min_val, above, max_val, out)
OMobj_id in, out;
...
{
int nnodes, size, veclen;
...
if (FLDget_nnodes(in, &nnodes)!= 1) {
ERR_RETURN("cannot get nnodes");
}
if (FLDset_nnodes (out, nnodes)!= 1) {
ERR_RETURN("Error setting nnodes");
}
...

Files

v/fld.v.

See Also

FLDget_node_data_ncomp
FLDset_node_data_comp