Iterate over nearing cells of a specified cell
Hi FOAMers,
I've implemented a user-interpolation in OpenFOAM , but to compute the distance of the current cell to near cells, i have to iterate over all cells which can be costly. So do you have any suggestion on how to iterate over a specified radius of a cell(or coordinate), and not over all cells. (to reduce computation cost) What i'm doing : Code:
forAll(U,cellI) Code:
forAll(iterate over nearing cells of point[XX].x()) |
Good evening ooo
You should be able to construct what you want using the following methods in the mesh class: Code:
mesh.cellCells(); Kind regards, Niels |
Quote:
Having 2 cell layers (or maximum 3) is enough for me so i'm using this code.(if it works, then i continue to removing duplication by uniqueOrder...) It gives no compilation error, but segmentation error in running. Do you know what's the problem? Code:
labelListList cellCells; |
You never define the size of cellCells, and afterward you to assign something to the ceellI'th array of cellCells, but it still does not have a size.
If I understand the code correct, the append works on the nested labelList, and not on the outer list. Kind regards, Niels |
Thank you.
Using dynamic labelLists solved the problem. |
All times are GMT -4. The time now is 04:16. |