Loading...
Searching...
No Matches
readFields.H
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) 2016-2023 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
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
26InClass
27 Foam::readFields
28
29Description
30 Helper routines for reading a field or fields, optionally with
31 a mesh subset (using fvMeshSubsetProxy).
32
33SourceFiles
34 readFields.txx
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef FoamToVTK_readFields_H
39#define FoamToVTK_readFields_H
40
41#include "fvMeshSubsetProxy.H"
42#include "objectRegistry.H"
43#include "IOobjectList.H"
44#include "PtrList.H"
45
46// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47
48namespace Foam
49{
50
51//- Get the field or return nullptr
52template<class GeoField>
54(
55 const IOobject* io,
56 const typename GeoField::Mesh& mesh,
57 const bool syncPar
58);
59
60
61//- Get the field and subset it, or return nullptr
62template<class GeoField>
64(
65 const IOobject* io,
66 const fvMeshSubsetProxy& proxy,
67 const bool syncPar,
68 objectRegistry* cache = nullptr
69);
70
71
72//- Get the named field from the objects, or return nullptr.
73template<class GeoField>
75(
76 const typename GeoField::Mesh& mesh,
77 const IOobjectList& objects,
78 const word& fieldName,
79 const bool syncPar
80);
81
82
83//- Return the named field from the optional cache (if found),
84//- or get it from the objects and subset it (add to cache).
85//- Return nullptr if nothing worked.
86template<class GeoField>
88(
89 const fvMeshSubsetProxy& proxy,
90 const IOobjectList& objects,
91 const word& fieldName,
92 const bool syncPar,
93 objectRegistry* cache = nullptr
94);
95
96
97//- Read the fields, and return as a pointer list
98template<class GeoField>
100(
101 const typename GeoField::Mesh& mesh,
102 const IOobjectList& objects
103);
104
106//- Read the fields, optionally subset, and return as a pointer list
107template<class GeoField>
109(
110 const fvMeshSubsetProxy& proxy,
111 const IOobjectList& objects
112);
113
114
115} // End namespace Foam
117// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
118
119#ifdef NoRepository
120 #include "readFields.txx"
121#endif
122
123// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124
125#endif
126
127// ************************************************************************* //
List of IOobjects with searching and retrieving facilities. Implemented as a HashTable,...
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition IOobject.H:191
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition PtrList.H:67
Simple proxy for holding a mesh, or mesh-subset. The subMeshes are currently limited to cellSet or ce...
Registry of regIOobjects.
A class for managing temporary objects.
Definition tmp.H:75
A class for handling words, derived from Foam::string.
Definition word.H:66
dynamicFvMesh & mesh
const auto & io
Namespace for OpenFOAM.
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.
tmp< GeoField > getField(const IOobject &io, const typename GeoField::Mesh &mesh)
Get the field or FatalError.
Definition readFields.H:51