1 /*---------------------------------------------------------------------------*\
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 -------------------------------------------------------------------------------
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 \*---------------------------------------------------------------------------*/
26 #include "lagrangianFieldDecomposer.H"
27 #include "IOobjectList.H"
29 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
34 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
37 void lagrangianFieldDecomposer::readFields
40 const IOobjectList& lagrangianObjects,
41 PtrList<PtrList<IOField<Type> > >& lagrangianFields
44 // Search list of objects for lagrangian fields
45 IOobjectList lagrangianTypeObjects
47 lagrangianObjects.lookupClass(IOField<Type>::typeName)
53 new PtrList<IOField<Type> >
55 lagrangianTypeObjects.size()
59 label lagrangianFieldi=0;
60 forAllIter(IOobjectList, lagrangianTypeObjects, iter)
62 lagrangianFields[cloudI].set
65 new IOField<Type>(*iter())
72 tmp<IOField<Type> > lagrangianFieldDecomposer::decomposeField
74 const word& cloudName,
75 const IOField<Type>& field
78 // Create and map the internal field values
79 Field<Type> procField(field, particleIndices_);
81 // Create the field for the processor
82 return tmp<IOField<Type> >
89 procMesh_.time().timeName(),
90 cloud::prefix/cloudName,
101 template<class GeoField>
102 void lagrangianFieldDecomposer::decomposeFields
104 const word& cloudName,
105 const PtrList<GeoField>& fields
108 if (particleIndices_.size())
110 forAll (fields, fieldI)
112 decomposeField(cloudName, fields[fieldI])().write();
118 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
120 } // End namespace Foam
122 // ************************************************************************* //