FLDget_ncell_sets,FLDset_ncell_sets

Synopsis

get/set the number of cell sets (ncell_sets) in a Cell_Data or Cells


int FLDget_ncell_sets (
OMobj_id field,
int *ncell_sets);

int FLDset_ncell_sets (
OMobj_id field,
int ncell_sets);

Description

These routines get/set the number of cell sets (ncell_sets) in a Cell_Data or Cells group.

Parameters

OMobj_id field

The OMobj_id of a field that contains Cells or Cell_Data.

int *ncell_sets
int ncell_sets

In FLDget_ncell_sets, ncell_sets is a pointer to an integer in which the number of cell sets [0-n] (ncell_sets) will be returned.
In FLDset_ncell_sets, ncell_sets is an integer that sets the number of cell sets (ncell_sets).

Examples

This example, some fragments from modules/ext_face.c shows external faces retrieving the number of cell sets in the input field, setting the number of cell sets in the output field to 1 (0), then looping on the number of input cell sets.

ext_face(obj_id)
OMobj_id obj_id;
{
OMobj_id in, out, out_sets;
...
}
int FUNCext_face (in, out_sets, out)
OMobj_id in, out, out_sets;
{
int cs, os, nc, nsets, ncells, nnodes, cell_nnodes, stat;
...
OMobj_id cell_set, sets_id, out_set;
...
if (FLDget_nnodes(in, &nnodes)!= 1) {
ERR_RETURN("cannot get nnodes");
}
if (FLDget_ncell_sets(in, &nsets)!= 1) {
ERR_RETURN("cannot get nsets");
}
sets_id = OMfind_subobj(out, OMstr_to_name("cell_set"), OM_OBJ_RW);
if (OMis_null_obj(sets_id)) {
ERR_RETURN("cannot get cell sets");
}
OMset_obj_ref(sets_id, OMnull_obj, 0);

if (FLDset_ncell_sets (out_sets, 0)!= 1) {
ERR_RETURN("Error setting ncell_sets");
}
nc=0;

for (cs=0; cs<nsets; cs++) {
if (FLDget_cell_set(in, cs, &cell_set)!= 1) {
ERR_RETURN("cannot get cell set");
}
...

Files

v/fld.v.

See Also

none.