|
[Sponsors] |
owner - neighbour relations for processor boundaries |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 4, 2011, 07:57 |
owner - neighbour relations for processor boundaries
|
#1 |
New Member
Roland Engberg
Join Date: Jan 2011
Posts: 14
Rep Power: 15 |
Hi!
I am trying to save cell centred values of a volScalarField to two scalar lists (ownPsi and neighPsi) defined on the cell faces as in the following piece of code: Code:
scalarField ownPsi (mesh.nFaces(), 0.0); scalarField neighPsi (mesh.nFaces(), 0.0); const fvPatchList& patches = psi.mesh().boundary(); forAll(patches, patchI) { const fvPatch& p = patches[patchI]; const polyPatch& pp = p.patch(); if (typeid(pp) == typeid(processorPolyPatch)) { label start = pp.start(); forAll(pp, faceI) { // global face index label gFaceI = start + faceI; label cellI = pp.faceCells()[faceI]; label own = mesh.owner()[gFaceI]; label neigh = mesh.neighbour()[gFaceI]; Pout << "Cell: " << cellI << " owner: " << own << " neigh: " << neigh <<nl; if (cellI == own) { ownPsi[gFaceI] = psi[cellI]; } else { neighPsi[gFaceI] = psi[cellI]; } } } } Thanks in advance! Roland |
|
October 4, 2011, 08:40 |
|
#2 |
Senior Member
Sandeep Menon
Join Date: Mar 2009
Location: Amherst, MA
Posts: 403
Rep Power: 25 |
You appear to be confused - a processor boundary is like any other patch. it does not contain any neighbour information (obviously, because it's a boundary).
In fact, you're pretty lucky to have your code run at all, because the mesh.neighbour() list ends at the number of internal faces in the mesh, and you'd have a nice, pretty seg-fault if the second part of your condition was ever executed. What you can guarantee, however, is that the processor boundary of the other sub-domain (which talks to this boundary patch) will contain an identical number of faces, and both patches have the faces ordered identically within the patch, such that their zeroth points and face centres align geometrically. Since they point in opposite directions (always out of the domain), and the right-hand face-orientation rule, the 1st point corresponds to the (n-1)th point, the 2nd with the (n-2)th point, and so on for face-pairs... |
|
October 4, 2011, 08:49 |
|
#3 |
New Member
Roland Engberg
Join Date: Jan 2011
Posts: 14
Rep Power: 15 |
Hello Sandeep,
thank you for your quick reply! I got it now -- I used to think that the faces of a processor patch would need the owner-neighbour relation. So thank you very much for the clarification! I realised that label mesh.neighbour()[gFaceI]; does not work in this case and forgot to delete it.... Best wishes, Roland |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
area does not match neighbour by ... % -- possible face ordering problem | St.Pacholak | OpenFOAM | 11 | September 4, 2024 04:28 |
Doxygen documentation | Tanay | OpenFOAM Installation | 9 | September 23, 2011 11:40 |
Neighbour search | Steven Chew | Main CFD Forum | 0 | October 18, 2008 02:39 |
Heat Exchangers NTU relations | cfd-dude | Main CFD Forum | 4 | June 9, 2007 01:01 |
Constitutive Relations | eddy | Main CFD Forum | 2 | November 13, 2001 11:27 |