fileFieldSelection.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) 2017-2019 OpenCFD Ltd.
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 Class
27  Foam::functionObjects::fileFieldSelection
28 
29 Description
30  Helper class to manage file-based field selections
31 
32 SourceFiles
33  fieldSelection.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef functionObjects_fileFieldSelection_H
38 #define functionObjects_fileFieldSelection_H
39 
40 #include "fieldSelection.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 class IOobjectList;
48 
49 namespace functionObjects
50 {
51 
52 /*---------------------------------------------------------------------------*\
53  Class fileFieldSelection Declaration
54 \*---------------------------------------------------------------------------*/
55 
57 :
58  public fieldSelection
59 {
60 private:
61 
62  // Private Member Functions
63 
64  //- No copy construct
65  fileFieldSelection(const fileFieldSelection&) = delete;
66 
67 
68 protected:
69 
70  // Protected Member Functions
71 
72  //- Add registered GeometricField types to selection
73  template<template<class> class PatchType, class MeshType>
75 
76  //- Add registered Internal types to selection
78 
79  //- Add registered uniform types to selection
81 
82  //- Add objects of a given type
83  template<class Type>
84  void addFromFile
85  (
86  const IOobjectList& allFileObjects,
88  ) const;
89 
90 
91 public:
92 
93  //- Construct from object registry
95  (
96  const objectRegistry& obr,
97  const bool includeComponents = false
98  );
99 
100 
101  //- Destructor
102  virtual ~fileFieldSelection() = default;
103 
104 
105  // Member Functions
106 
107  //- Update the selection
108  virtual bool updateSelection();
109 };
110 
111 
112 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
113 
114 } // End namespace functionObjects
115 } // End namespace Foam
116 
117 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
118 
119 #ifdef NoRepository
121 #endif
122 
123 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124 
125 #endif
126 
127 // ************************************************************************* //
Foam::functionObjects::fileFieldSelection::~fileFieldSelection
virtual ~fileFieldSelection()=default
Destructor.
fileFieldSelectionTemplates.C
Foam::DynamicList
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Definition: DynamicList.H:55
Foam::functionObjects::fileFieldSelection::addGeoFieldTypes
void addGeoFieldTypes(DynamicList< fieldInfo > &set) const
Add registered GeometricField types to selection.
Definition: fileFieldSelectionTemplates.C:59
Foam::functionObjects::fieldSelection
Helper class to manage field selections.
Definition: fieldSelection.H:63
Foam::objectRegistry
Registry of regIOobjects.
Definition: objectRegistry.H:60
Foam::functionObjects::fileFieldSelection::addFromFile
void addFromFile(const IOobjectList &allFileObjects, DynamicList< fieldInfo > &set) const
Add objects of a given type.
Definition: fileFieldSelectionTemplates.C:36
Foam::functionObjects::fileFieldSelection
Helper class to manage file-based field selections.
Definition: fileFieldSelection.H:55
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::IOobjectList
List of IOobjects with searching and retrieving facilities.
Definition: IOobjectList.H:55
Foam::functionObjects::fileFieldSelection::updateSelection
virtual bool updateSelection()
Update the selection.
Definition: fileFieldSelection.C:86
fieldSelection.H
Foam::functionObjects::fileFieldSelection::addUniformFieldTypes
void addUniformFieldTypes(DynamicList< fieldInfo > &set) const
Add registered uniform types to selection.
Definition: fileFieldSelection.C:56
Foam::List< fieldInfo >::set
std::enable_if< std::is_same< bool, TypeT >::value, bool >::type set(const label i, bool val=true)
A bitSet::set() method for a list of bool.
Definition: List.H:341
Foam::functionObjects::fileFieldSelection::addInternalFieldTypes
void addInternalFieldTypes(DynamicList< fieldInfo > &set) const
Add registered Internal types to selection.
Definition: fileFieldSelection.C:39