Merge branch 'master' of ssh://git.code.sf.net/p/foam-extend/foam-extend-3.2
[foam-extend-3.2.git] / applications / utilities / parallelProcessing / decomposePar / lagrangianFieldDecomposer.H
blob5319a72efbdf36b2c2fbe61af94d270c78aa916f
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | foam-extend: Open Source CFD
4    \\    /   O peration     | Version:     3.2
5     \\  /    A nd           | Web:         http://www.foam-extend.org
6      \\/     M anipulation  | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
8 License
9     This file is part of foam-extend.
11     foam-extend 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 3 of the License, or (at your
14     option) any later version.
16     foam-extend is distributed in the hope that it will be useful, but
17     WITHOUT ANY WARRANTY; without even the implied warranty of
18     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19     General Public License for more details.
21     You should have received a copy of the GNU General Public License
22     along with foam-extend.  If not, see <http://www.gnu.org/licenses/>.
24 Class
25     Foam::lagrangianFieldDecomposer
27 Description
28     Lagrangian field decomposer.
30 SourceFiles
31     lagrangianFieldDecomposer.C
32     lagrangianFieldDecomposerDecomposeFields.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef lagrangianFieldDecomposer_H
37 #define lagrangianFieldDecomposer_H
39 #include "CloudTemplate.H"
40 #include "indexedParticle.H"
41 #include "passiveParticle.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 namespace Foam
48 class IOobjectList;
50 /*---------------------------------------------------------------------------*\
51                     Class lagrangianFieldDecomposer Declaration
52 \*---------------------------------------------------------------------------*/
54 class lagrangianFieldDecomposer
56     // Private data
58         //- Reference to processor mesh
59         const polyMesh& procMesh_;
61         //- Lagrangian positions for this processor
62         Cloud<passiveParticle> positions_;
64         //- The indices of the particles on this processor
65         labelList particleIndices_;
68     // Private Member Functions
70         //- Disallow default bitwise copy construct
71         lagrangianFieldDecomposer(const lagrangianFieldDecomposer&);
73         //- Disallow default bitwise assignment
74         void operator=(const lagrangianFieldDecomposer&);
77 public:
79     // Constructors
81         //- Construct from components
82         lagrangianFieldDecomposer
83         (
84             const polyMesh& mesh,
85             const polyMesh& procMesh,
86             const labelList& cellProcAddressing,
87             const word& cloudName,
88             const Cloud<indexedParticle>& lagrangianPositions,
89             const List<SLList<indexedParticle*>*>& cellParticles
90         );
93     // Member Functions
95         // Read the fields and hold on the pointer list
96         template<class Type>
97         static void readFields
98         (
99             const label cloudI,
100             const IOobjectList& lagrangianObjects,
101             PtrList<PtrList<IOField<Type> > >& lagrangianFields
102 //            PtrList<IOField<Type> >& lagrangianFields
103         );
105         //- Decompose volume field
106         template<class Type>
107         tmp<IOField<Type> > decomposeField
108         (
109             const word& cloudName,
110             const IOField<Type>& field
111         ) const;
113         template<class GeoField>
114         void decomposeFields
115         (
116             const word& cloudName,
117             const PtrList<GeoField>& fields
118         ) const;
122 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124 } // End namespace Foam
126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 #ifdef NoRepository
129 #   include "lagrangianFieldDecomposerDecomposeFields.C"
130 #endif
132 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 #endif
136 // ************************************************************************* //