Sum over non-boundary cells
Hi,
I would like to make a post-process skript where I sum only non-boundary cell values. Does anyone know how this can be done? Example mass (pseudo-code) forAll(mesh.V(), celli) { if cell != boundaryCell { mass = (mesh.V()[celli]*rho[celli]);forAll(mesh.V(), celli) massSum += mass; } } best regards Martin Soder |
Quote:
Create a list of bools for each cell of your mesh and mark each with "true", for example, Code:
Loop over the boundary faces, marking the cell owner (which is a boundary cell) as being non-interior: Code:
const labelUList& owner = mesh.faceOwner(); The easiest is probably to use this as a mask when iterating over all cells: Code:
forAll(mesh.V(), cellI) |
All times are GMT -4. The time now is 16:42. |