Loading...
Searching...
No Matches
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-------------------------------------------------------------------------------
11License
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
30#include "IOmanip.H"
31
32// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
33
34template<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
74template<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
94template<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// ************************************************************************* //
Istream and Ostream manipulators taking arguments.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition PtrList.H:67
dynamicFvMesh & mesh
const auto & io
auto & name
type
Types of root.
Definition Roots.H:53
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.
messageStream Info
Information stream (stdout output on master, null elsewhere).
void collectFieldList(const UPtrList< GeoField > &fieldList, const label patchi, HashTable< word > &fieldToType)
void outputFieldList(const UPtrList< GeoField > &fieldList, const label patchi)
constexpr char nl
The newline '\n' character (0x0a).
Definition Ostream.H:50
constexpr char tab
The tab '\t' character(0x09).
Definition Ostream.H:49
multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
#define forAll(list, i)
Loop across all elements in list.
Definition stdFoam.H:299