CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Reconstructing undecomposed faceZone in parallel (https://www.cfd-online.com/Forums/openfoam-programming-development/117507-reconstructing-undecomposed-facezone-parallel.html)

cliffoi May 9, 2013 12:08

Reconstructing undecomposed faceZone in parallel
 
Hi all,
I have a decomposed case where several faceZones have been split over several processors. I need to reconstruct the original undecomposed faceZone in parallel so that the original face ordering is consistent.
I know that I can used faceProcAddr to map the decomposed faceZone to the undecomposed (global) face Ids, but I'm not sure how to access the undecomposed faceZone list from each processor so that I can reorder the faces correctly.
Do I need to create a dummy objectRegistry to force IOobject to point to the undecomposed mesh directories and read in the undecomposed faceZoneMesh? I really hope there's an easier way than this.
Alternatively I know that OpenFOAM-1.6-ext supports global faceZones when decomposing the mesh but I'm not sure if the ordering of the faces is consistent in this case.

Any suggestions would be appreciated.

Ivor

bigphil August 30, 2013 10:29

Quote:

Originally Posted by cliffoi (Post 426383)
Hi all,
I have a decomposed case where several faceZones have been split over several processors. I need to reconstruct the original undecomposed faceZone in parallel so that the original face ordering is consistent.
I know that I can used faceProcAddr to map the decomposed faceZone to the undecomposed (global) face Ids, but I'm not sure how to access the undecomposed faceZone list from each processor so that I can reorder the faces correctly.
Do I need to create a dummy objectRegistry to force IOobject to point to the undecomposed mesh directories and read in the undecomposed faceZoneMesh? I really hope there's an easier way than this.
Alternatively I know that OpenFOAM-1.6-ext supports global faceZones when decomposing the mesh but I'm not sure if the ordering of the faces is consistent in this case.

Any suggestions would be appreciated.

Ivor

Hi Ivor,

just came across this thread and have some thoughts which may be useful:

I use globalFaceZones in OpenFOAM-1.6-ext, so I can create the global face zone field whenever I need it and get the local field back from the global too, here's an example which will make things clearer:
Code:

    // local patch U field
    vectorField localU = U.boundaryField()[patchID];
   
    // put local U into globalU
    const label patchStart
      = mesh.boundaryMesh()[patchID].start();
    vectorField globalU(mesh.faceZones()[faceZoneID].size(), vector::zero);
    forAll(localU, i)
      {
        globalU[mesh.faceZones()[faceZoneID].whichFace(patchStart + i)] =
          localU[i];
      }

    // sync parallel data
    // sum because each face is only on one proc
    reduce(globalU, sumOp<vectorField>());

    // now I can do some calculation with globalU
    // DO SOMETHING HERE WITH GLOBALU

    // now put global field back into local
    forAll(localU, i)
      {
        localU[i] =
          globalU
          [
          mesh.faceZones()[faceZoneID].whichFace(patchStart + i)
          ];
      }


Hope it helps,
Philip


All times are GMT -4. The time now is 08:13.