patchSummaryTemplates.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 "patchSummaryTemplates.H"
29 #include "IOmanip.H"
30 
31 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
32 
33 template<class GeoField>
35 (
36  PtrList<GeoField>& fieldList,
37  const IOobject& obj,
38  const label fieldi,
39  const typename GeoField::Mesh& mesh
40 )
41 {
42  if (obj.isHeaderClass<GeoField>())
43  {
44  fieldList.set
45  (
46  fieldi,
47  new GeoField(obj, mesh)
48  );
49  Info<< " " << GeoField::typeName << tab << obj.name() << endl;
50  }
51 }
52 
53 
54 template<class GeoField>
56 (
57  const PtrList<GeoField>& fieldList,
58  const label patchi
59 )
60 {
61  forAll(fieldList, fieldi)
62  {
63  if (fieldList.set(fieldi))
64  {
65  Info<< " " << pTraits<typename GeoField::value_type>::typeName
66  << tab << tab
67  << fieldList[fieldi].name() << tab << tab
68  << fieldList[fieldi].boundaryField()[patchi].type() << nl;
69  }
70  }
71 }
72 
73 
74 template<class GeoField>
76 (
77  const PtrList<GeoField>& fieldList,
78  const label patchi,
79  HashTable<word>& fieldToType
80 )
81 {
82  forAll(fieldList, fieldi)
83  {
84  if (fieldList.set(fieldi))
85  {
86  fieldToType.insert
87  (
88  fieldList[fieldi].name(),
89  fieldList[fieldi].boundaryField()[patchi].type()
90  );
91  }
92  }
93 }
94 
95 
96 // ************************************************************************* //
void addToFieldList(PtrList< GeoField > &fieldList, const IOobject &obj, const label fieldi, const typename GeoField::Mesh &mesh)
type
Types of root.
Definition: Roots.H:52
constexpr char nl
The newline &#39;\n&#39; character (0x0a)
Definition: Ostream.H:49
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:487
constexpr char tab
The tab &#39;\t&#39; character(0x09)
Definition: Ostream.H:48
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:414
dynamicFvMesh & mesh
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:52
void collectFieldList(const PtrList< GeoField > &fieldList, const label patchi, HashTable< word > &fieldToType)
Istream and Ostream manipulators taking arguments.
messageStream Info
Information stream (stdout output on master, null elsewhere)
void outputFieldList(const PtrList< GeoField > &fieldList, const label patchi)