dimFieldDecomposerDecomposeFields.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2016 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 \*---------------------------------------------------------------------------*/
27 
28 #include "dimFieldDecomposer.H"
29 
30 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
31 
32 template<class Type>
35 (
36  const DimensionedField<Type, volMesh>& field
37 ) const
38 {
39  // Create and map the internal field values
40  Field<Type> mappedField(field, cellAddressing_);
41 
42  // Create the field for the processor
43  return tmp<DimensionedField<Type, volMesh>>
44  (
45  new DimensionedField<Type, volMesh>
46  (
47  IOobject
48  (
49  field.name(),
50  procMesh_.time().timeName(),
51  procMesh_,
54  false
55  ),
56  procMesh_,
57  field.dimensions(),
58  mappedField
59  )
60  );
61 }
62 
63 
64 template<class GeoField>
66 (
67  const PtrList<GeoField>& fields
68 ) const
69 {
70  forAll(fields, fieldi)
71  {
72  decomposeField(fields[fieldi])().write();
73  }
74 }
75 
76 
77 // ************************************************************************* //
Foam::IOobject::NO_WRITE
Definition: IOobject.H:130
Foam::dimFieldDecomposer::decomposeFields
void decomposeFields(const PtrList< GeoField > &fields) const
Decompose llist of fields.
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:59
Foam::Time::timeName
static word timeName(const scalar t, const int precision=precision_)
Definition: Time.C:785
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:296
dimFieldDecomposer.H
field
rDeltaTY field()
Foam::dimFieldDecomposer::decomposeField
tmp< DimensionedField< Type, volMesh > > decomposeField(const DimensionedField< Type, volMesh > &field) const
Decompose field.
Foam::vtk::write
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
Definition: foamVtkOutputTemplates.C:35
Foam::fvMesh::time
const Time & time() const
Return the top-level database.
Definition: fvMesh.H:248
Foam::IOobject::NO_READ
Definition: IOobject.H:123
fields
multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
Definition: createFields.H:97