Snip access cellset data

From OpenFOAMWiki

It would be nice to access data in a cell set like this:


to set the value of filter for all the cells in the cellSet to filterID, but unfortunately that's not possible.

The way to do this is:

cellSet filterSet(mesh,filterName,IOobject::MUST_READ,IOobject::NO_WRITE);
for(cellSet::iterator cell=filterSet.begin();cell!=filterSet.end();cell++)

This can be applied to cellSets too.

From this thread in the message board