Go to the documentation of this file.00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 
00029 #include "lagrangianFieldDecomposer.H"
00030 
00031 
00032 
00033 
00034 namespace Foam
00035 {
00036 
00037 
00038 
00039 
00040 lagrangianFieldDecomposer::lagrangianFieldDecomposer
00041 (
00042     const polyMesh& mesh,
00043     const polyMesh& procMesh,
00044     const labelList& cellProcAddressing,
00045     const word& cloudName,
00046     const Cloud<indexedParticle>& lagrangianPositions,
00047     const List<SLList<indexedParticle*>*>& cellParticles
00048 )
00049 :
00050     procMesh_(procMesh),
00051     positions_(procMesh, cloudName, false),
00052     particleIndices_(lagrangianPositions.size())
00053 {
00054     label pi = 0;
00055 
00056     forAll(cellProcAddressing, procCelli)
00057     {
00058         label celli = cellProcAddressing[procCelli];
00059 
00060         if (cellParticles[celli])
00061         {
00062             SLList<indexedParticle*>& particlePtrs = *cellParticles[celli];
00063 
00064             forAllIter(SLList<indexedParticle*>, particlePtrs, iter)
00065             {
00066                 const indexedParticle& ppi = *iter();
00067                 particleIndices_[pi++] = ppi.index();
00068 
00069                 positions_.append
00070                 (
00071                     new passiveParticle
00072                     (
00073                         positions_,
00074                         ppi.position(),
00075                         procCelli
00076                     )
00077                 );
00078             }
00079         }
00080     }
00081 
00082     particleIndices_.setSize(pi);
00083 
00084     IOPosition<passiveParticle>(positions_).write();
00085 }
00086 
00087 
00088 
00089 
00090 } 
00091 
00092