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  Copyright (C) 2023 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 \*---------------------------------------------------------------------------*/
28 
29 #include "patchSummaryTemplates.H"
30 #include "IOmanip.H"
31 
32 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
33 
34 template<class GeoField>
36 (
37  const IOobjectList& objects,
38  const typename GeoField::Mesh& mesh
39 )
40 {
41  const UPtrList<const IOobject> fieldObjects
42  (
43  objects.csorted<GeoField>()
44  );
45 
46  PtrList<GeoField> fields(fieldObjects.size());
47 
48  label nFields = 0;
49  for (const IOobject& io : fieldObjects)
50  {
51  if (!nFields)
52  {
53  Info<< " " << GeoField::typeName << " (";
54  }
55  else
56  {
57  Info<< ' ';
58  }
59  Info<< io.name();
60 
61  fields.emplace_set(nFields, io, mesh);
62  ++nFields;
63  }
64 
65  if (nFields)
66  {
67  Info<< ')' << nl;
68  }
69 
70  return fields;
71 }
72 
73 
74 template<class GeoField>
76 (
77  const UPtrList<GeoField>& fieldList,
78  const label patchi
79 )
80 {
81  forAll(fieldList, fieldi)
82  {
83  if (fieldList.set(fieldi))
84  {
85  Info<< " " << pTraits<typename GeoField::value_type>::typeName
86  << tab << tab
87  << fieldList[fieldi].name() << tab << tab
88  << fieldList[fieldi].boundaryField()[patchi].type() << nl;
89  }
90  }
91 }
92 
93 
94 template<class GeoField>
96 (
97  const UPtrList<GeoField>& fieldList,
98  const label patchi,
99  HashTable<word>& fieldToType
100 )
101 {
102  forAll(fieldList, fieldi)
103  {
104  if (fieldList.set(fieldi))
105  {
106  fieldToType.insert
107  (
108  fieldList[fieldi].name(),
109  fieldList[fieldi].boundaryField()[patchi].type()
110  );
111  }
112  }
113 }
114 
115 
116 // ************************************************************************* //
type
Types of root.
Definition: Roots.H:52
constexpr char nl
The newline &#39;\n&#39; character (0x0a)
Definition: Ostream.H:50
constexpr char tab
The tab &#39;\t&#39; character(0x09)
Definition: Ostream.H:49
void outputFieldList(const UPtrList< GeoField > &fieldList, const label patchi)
multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
Definition: createFields.H:97
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:421
dynamicFvMesh & mesh
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition: exprTraits.C:127
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const NameMatchPredicate &selectedFields, DynamicList< regIOobject *> &storedObjects)
Read the selected GeometricFields of the templated type and store on the objectRegistry.
Istream and Ostream manipulators taking arguments.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
Definition: List.H:55
messageStream Info
Information stream (stdout output on master, null elsewhere)
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, IOobject::NO_REGISTER)
void collectFieldList(const UPtrList< GeoField > &fieldList, const label patchi, HashTable< word > &fieldToType)