Finding list of cells according to a condition
Hello,
I need to find the labelList of cells that respect a certain condition in my simulation, in order to use it in setValues to exclude the equations of those cells from the matrix. Is there any easy way to do this, excluding looping and checking? Thanks in advance. |
I usually use a labelHashSet to do this. You'll still have to loop through all cells to test for the condition, but when you do, add the cell index to the hashSet. At the end of the loop, you can use the toc() method in HashSet to obtain a labelList of cell indices.
Code:
labelHashSet conditionCells; |
Thanks :-)
|
Quote:
how do you now use your labellist with setValues? I tried it as it was shown in http://http://www.cfd-online.com/Forums/openfoam-solving/59266-how-force-fixed-value-variable-one-cell-2.html#post196058 but it didn't work. Thanks in advance! |
Quote:
Best, |
All times are GMT -4. The time now is 05:25. |