FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

checkFaceAddressingComp.H

Go to the documentation of this file.
00001 {
00002     // Foam version 2.1 changes the addressing of faces in faceProcAddressing
00003     // The following code checks and modifies the addressing for cases where
00004     // the decomposition has been done with the foam2.0 and earlier tools, but
00005     // the reconstruction is attempted with version 2.1 or later
00006 
00007     label minFaceIndex = labelMax;
00008 
00009     PtrList<labelIOList>& faceProcAddressing = procMeshes.faceProcAddressing();
00010 
00011     forAll (faceProcAddressing, procI)
00012     {
00013         const labelList& curFaceAddr = faceProcAddressing[procI];
00014 
00015         forAll (curFaceAddr, faceI)
00016         {
00017             if (mag(curFaceAddr[faceI]) < minFaceIndex)
00018             {
00019                 minFaceIndex = mag(curFaceAddr[faceI]);
00020             }
00021         }
00022     }
00023 
00024     if (minFaceIndex < 1)
00025     {
00026         WarningIn(args.executable())
00027             << "parallel decomposition addressing." << endl
00028             << "It looks like you are trying to reconstruct the case "
00029             << "decomposed with an earlier version of FOAM, which could\n"
00030             << "potentially cause compatibility problems.  The code will "
00031             << "attempt to update the addressing automatically; in case of\n"
00032             << "failure, please repeat the decomposition of the case using "
00033             << "the current version fo decomposePar"
00034             << endl;
00035 
00036         forAll (faceProcAddressing, procI)
00037         {
00038             labelList& curFaceAddr = faceProcAddressing[procI];
00039 
00040             forAll (curFaceAddr, faceI)
00041             {
00042                 curFaceAddr[faceI] += sign(curFaceAddr[faceI]);
00043             }
00044 
00045             faceProcAddressing[procI].write();
00046         }
00047     }
00048 }
00049 
00050 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines