1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
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 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
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 \*---------------------------------------------------------------------------*/
30 // * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
33 Foam::tmp<Foam::IOField<Type> > Foam::reconstructLagrangianField
35 const word& cloudName,
37 const PtrList<fvMesh>& meshes,
41 // Construct empty field on mesh
42 tmp<IOField<Type> > tfield
49 mesh.time().timeName(),
50 cloud::prefix/cloudName,
58 Field<Type>& field = tfield();
62 // Check object on local mesh
63 IOobject localIOobject
66 meshes[i].time().timeName(),
67 cloud::prefix/cloudName,
73 if (localIOobject.headerOk())
75 IOField<Type> fieldi(localIOobject);
77 label offset = field.size();
78 field.setSize(offset + fieldi.size());
82 field[offset + j] = fieldi[j];
92 void Foam::reconstructLagrangianFields
94 const word& cloudName,
96 const PtrList<fvMesh>& meshes,
97 const IOobjectList& objects
100 word fieldClassName(IOField<Type>::typeName);
102 IOobjectList fields = objects.lookupClass(fieldClassName);
106 Info<< " Reconstructing lagrangian "
107 << fieldClassName << "s\n" << endl;
109 forAllIter(IOobjectList, fields, fieldIter)
111 Info<< " " << fieldIter()->name() << endl;
112 reconstructLagrangianField<Type>
126 // ************************************************************************* //