如何创建一个list装符合条件的单元
-
DynamicList<label> xxxCells(0); const scalarField& alpha1In(alpha1.ref()); forAll(alpha1In, cellI) { // alpha1 is liquid fraction, this condition equals to vapor fraction > 0.5 if (alpha1In[cellI] <= 0.5) { xxxCells.append(cellI); } } // Usage of 'xxxCells' list if (xxxCells.size()) { forAll(xxxCells, ci) { const label globalCellId(xxxCells[ci]); // Do whatever you want from here } }