1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
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/>.
24 \*---------------------------------------------------------------------------*/
26 #include "pointFieldDecomposer.H"
27 #include "processorPointPatchFields.H"
29 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
32 Foam::tmp<Foam::GeometricField<Type, Foam::pointPatchField, Foam::pointMesh> >
33 Foam::pointFieldDecomposer::decomposeField
35 const GeometricField<Type, pointPatchField, pointMesh>& field
38 // Create and map the internal field values
39 Field<Type> internalField(field.internalField(), pointAddressing_);
41 // Create a list of pointers for the patchFields
42 PtrList<pointPatchField<Type> > patchFields(boundaryAddressing_.size());
44 // Create and map the patch field values
45 forAll(boundaryAddressing_, patchi)
47 if (patchFieldDecomposerPtrs_[patchi])
52 pointPatchField<Type>::New
54 field.boundaryField()[boundaryAddressing_[patchi]],
55 procMesh_.boundary()[patchi],
56 DimensionedField<Type, pointMesh>::null(),
57 *patchFieldDecomposerPtrs_[patchi]
66 new processorPointPatchField<Type>
68 procMesh_.boundary()[patchi],
69 DimensionedField<Type, pointMesh>::null()
75 // Create the field for the processor
76 return tmp<GeometricField<Type, pointPatchField, pointMesh> >
78 new GeometricField<Type, pointPatchField, pointMesh>
83 procMesh_().time().timeName(),
97 template<class GeoField>
98 void Foam::pointFieldDecomposer::decomposeFields
100 const PtrList<GeoField>& fields
103 forAll(fields, fieldI)
105 decomposeField(fields[fieldI])().write();
110 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
112 // ************************************************************************* //