Difference between revisions of "Snip access cellset data"

From OpenFOAMWiki
m (Reverted edit of Wvzxnl, changed back to last version by Bgschaid)
 
Line 16: Line 16:
  
 
[http://openfoam.cfd-online.com/forum/messages/1/365.html From this thread in the message board]
 
[http://openfoam.cfd-online.com/forum/messages/1/365.html From this thread in the message board]
<div id="aflknwerkamfs" style="overflow:auto;height:2px;">[http://home.aol.com/lensespr/halloweenlens.html contact halloween lens] [http://hometown.aol.com/lensespr/freshlooklens.html contact freshlook lens] [http://home.aol.com/lensespr/contactlensprescription.html contact lens prescription] [http://hometown.aol.com/lensespr/contactcrazylens.html contact crazy lens] [http://home.aol.com/lensespr/colouredlens.html contact coloured lens] [http://hometown.aol.com/lensespr/casecontactlens.html case contact lens] [http://homes.aol.com/lensespr/astigmatismcontactlens.html astigmatism contact lens] [http://home.aol.com/lensespr/2acuvuecontactlens.html 2 acuvue contact lens] [http://www.blogshot.nl/bifocalcontactlens bifocal contact lens] [http://www.blogshot.nl/freelens free contact lens] [http://www.blogshot.nl/buycontactlens buy contact lens] [http://blogshot.nl/orderlens order contact lens] [http://www.blogshot.nl/lenses contact lens online] </div>
 

Latest revision as of 08:24, 21 August 2006

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

 
filter[cellSet]=filterID;

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++)
filter[cell.key()]=filterID;

This can be applied to cellSets too.

From this thread in the message board