1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by
13 the Free Software Foundation, either version 3 of the License, or
14 (at your option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 Lagrangian field decomposer.
27 \*---------------------------------------------------------------------------*/
29 #include "lagrangianFieldDecomposer.H"
31 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
33 // Construct from components
34 Foam::lagrangianFieldDecomposer::lagrangianFieldDecomposer
37 const polyMesh& procMesh,
38 const labelList& faceProcAddressing,
39 const labelList& cellProcAddressing,
40 const word& cloudName,
41 const Cloud<indexedParticle>& lagrangianPositions,
42 const List<SLList<indexedParticle*>*>& cellParticles
46 positions_(procMesh, cloudName, false),
47 particleIndices_(lagrangianPositions.size())
51 // faceProcAddressing not required currently
52 // labelList decodedProcFaceAddressing(faceProcAddressing.size());
54 // forAll(faceProcAddressing, i)
56 // decodedProcFaceAddressing[i] = mag(faceProcAddressing[i]) - 1;
59 forAll(cellProcAddressing, procCelli)
61 label celli = cellProcAddressing[procCelli];
63 if (cellParticles[celli])
65 SLList<indexedParticle*>& particlePtrs = *cellParticles[celli];
67 forAllConstIter(SLList<indexedParticle*>, particlePtrs, iter)
69 const indexedParticle& ppi = *iter();
70 particleIndices_[pi++] = ppi.index();
72 // label mappedTetFace = findIndex
74 // decodedProcFaceAddressing,
78 // if (mappedTetFace == -1)
82 // "Foam::lagrangianFieldDecomposer"
83 // "::lagrangianFieldDecomposer"
85 // "const polyMesh& mesh, "
86 // "const polyMesh& procMesh, "
87 // "const labelList& faceProcAddressing, "
88 // "const labelList& cellProcAddressing, "
89 // "const word& cloudName, "
90 // "const Cloud<indexedParticle>& "
91 // "lagrangianPositions, "
92 // "const List<SLList<indexedParticle*>*>& "
95 // ) << "Face lookup failure." << nl
96 // << abort(FatalError);
113 particleIndices_.setSize(pi);
115 IOPosition<Cloud<passiveParticle> >(positions_).write();
119 // ************************************************************************* //