Dear all, For some reason, I
For some reason, I need to loop over all faces to do some calculations, that I could not find a way to do with regular field operations.
Then, I decided to do a loop over all owner faces like below, because somehow I needed information from face, owner and neighbour:
Phi is a surfaceScalarField
V is a volScalarField
S is a surfaceScalarField
someComplexOperationsWith(V[owner[f]] , V[neighbour[f]], and S[f])
My first mistake was to assume the boundary faces would be covered in this loop, but later I realized they wouldn't.
My first question is: what happens to processorBoundaryPatches? Are they covered by this loop to garantee that the same code would work for serial and parallel computations? Or do I need to worry about it and do some loop over the boundary like this:
const fvPatchList& patches = mesh.boundary();
const fvPatch& curPatch = patches[patchi];
const fvPatchVectorField& Up = U.boundaryField()[patchi];
label faceCelli = curPatch.faceCells()[i];
Second question is: if I have to do this loop (above), and do some similar operations (as in the owner, faceI loop), how do I get the neighbour[f] field (which lies in a different processor).
Finally, is seems that I do not need to worry with cyclic boundary conditions, meaning that the first loop (forAll(owner,f)) includes all faces of patch cyclic. Am I right?
Thanks a lot,
Hello Luiz, The first loop
The first loop is all fine, and will visit only the internal faces.
The second loop is also fine. You do not want to do anything special on the processor patches, because
would be required all over the code.
In parallel, you wil want each side to do its own bit, referring to local faceCells. On any sort of a coupled patch, deltaCoeffs will be the real one (using neighbour - owner distance across processors) and you need not do anything special. Have a look at ...boundaryCoeffs() and ...internalCoeffs() in any sort of a coupled patch.
|All times are GMT -4. The time now is 06:22.|