BUGFIX: Illegal use of uninitialised value (backport)
[foam-extend-3.2.git] / applications / utilities / parallelProcessing / decomposePar / lagrangianFieldDecomposer.H
blob1611ac4a64c61b8cf3430db683aa8cd919fcb033
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright held by original author
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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 the
13     Free Software Foundation; either version 2 of the License, or (at your
14     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
19     for more details.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Class
26     Foam::lagrangianFieldDecomposer
28 Description
29     Lagrangian field decomposer.
31 SourceFiles
32     lagrangianFieldDecomposer.C
33     lagrangianFieldDecomposerDecomposeFields.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef lagrangianFieldDecomposer_H
38 #define lagrangianFieldDecomposer_H
40 #include "Cloud.H"
41 #include "indexedParticle.H"
42 #include "passiveParticle.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 namespace Foam
49 class IOobjectList;
51 /*---------------------------------------------------------------------------*\
52                     Class lagrangianFieldDecomposer Declaration
53 \*---------------------------------------------------------------------------*/
55 class lagrangianFieldDecomposer
57     // Private data
59         //- Reference to processor mesh
60         const polyMesh& procMesh_;
62         //- Lagrangian positions for this processor
63         Cloud<passiveParticle> positions_;
65         //- The indices of the particles on this processor
66         labelList particleIndices_;
69     // Private Member Functions
71         //- Disallow default bitwise copy construct
72         lagrangianFieldDecomposer(const lagrangianFieldDecomposer&);
74         //- Disallow default bitwise assignment
75         void operator=(const lagrangianFieldDecomposer&);
78 public:
80     // Constructors
82         //- Construct from components
83         lagrangianFieldDecomposer
84         (
85             const polyMesh& mesh,
86             const polyMesh& procMesh,
87             const labelList& cellProcAddressing,
88             const word& cloudName,
89             const Cloud<indexedParticle>& lagrangianPositions,
90             const List<SLList<indexedParticle*>*>& cellParticles
91         );
94     // Member Functions
96         // Read the fields and hold on the pointer list
97         template<class Type>
98         static void readFields
99         (
100             const label cloudI,
101             const IOobjectList& lagrangianObjects,
102             PtrList<PtrList<IOField<Type> > >& lagrangianFields
103 //            PtrList<IOField<Type> >& lagrangianFields
104         );
106         //- Decompose volume field
107         template<class Type>
108         tmp<IOField<Type> > decomposeField
109         (
110             const word& cloudName,
111             const IOField<Type>& field
112         ) const;
114         template<class GeoField>
115         void decomposeFields
116         (
117             const word& cloudName,
118             const PtrList<GeoField>& fields
119         ) const;
123 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125 } // End namespace Foam
127 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129 #ifdef NoRepository
130 #   include "lagrangianFieldDecomposerDecomposeFields.C"
131 #endif
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 #endif
137 // ************************************************************************* //