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);
These routines get/set the number of cell sets (ncell_sets) in a Cell_Data or Cells group.
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");
}
...