IOOutputFilter.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::IOOutputFilter
26 
27 Description
28  IOdictionary wrapper around OutputFilter to allow them to read from
29  their associated dictionaries.
30 
31 Note
32  The IOobject or the objectRegistry will normally have to be
33  derived from a fvMesh for a subsequent cast (within OutputFilter)
34  to work correctly.
35 
36 SourceFiles
37  IOOutputFilter.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef IOOutputFilter_H
42 #define IOOutputFilter_H
43 
44 #include "IOdictionary.H"
45 #include "pointFieldFwd.H"
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 
52 // Forward declaration of classes
53 class mapPolyMesh;
54 
55 /*---------------------------------------------------------------------------*\
56  Class IOOutputFilter Declaration
57 \*---------------------------------------------------------------------------*/
58 
59 template<class OutputFilter>
60 class IOOutputFilter
61 :
62  public IOdictionary,
63  public OutputFilter
64 {
65 
66 public:
67 
68  // Constructors
69 
70  //- Construct from an IOobject for IOdictionary
71  // Allow the possibility to load fields from files
73  (
74  const word& outputFilterName,
75  const IOobject& ioDict,
76  const bool loadFromFile = false
77  );
78 
79  //- Construct for given objectRegistry and dictionary
80  // Allow dictionary to be optional
81  // Allow the possibility to load fields from files
83  (
84  const word& outputFilterName,
85  const objectRegistry&,
86  const word& dictName = OutputFilter::typeName() + "Dict",
88  const bool loadFromFile = false
89  );
90 
91  //- Construct for given objectRegistry and dictionary
92  // Dictionary read from full path.
93  // Allow the possibility to load fields from files
95  (
96  const word& outputFilterName,
97  const objectRegistry&,
98  const fileName& dictName,
100  const bool loadFromFile = false
101  );
102 
103  //- Disallow default bitwise copy construction
104  IOOutputFilter(const IOOutputFilter&) = delete;
105 
106 
107  //- Destructor
108  virtual ~IOOutputFilter();
109 
110 
111  // Member Functions
112 
113  //- Return name
114  virtual const word& name() const;
115 
116  //- Inherit read from OutputFilter
117  using OutputFilter::read;
118 
119  //- Read output filter properties
120  virtual bool read();
121 
122  //- Inherit write from regIOobject
123  using regIOobject::write;
124 
125  //- Sample and write
126  virtual bool write(const bool write = true);
127 
128  //- Update for changes of mesh
129  virtual void updateMesh(const mapPolyMesh& mpm);
130 
131  //- Update for changes of mesh
132  virtual void movePoints(const polyMesh& mesh);
133 
134 
135  // Member Operators
136 
137  //- Disallow default bitwise assignment
138  void operator=(const IOOutputFilter&) = delete;
139 };
140 
141 
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143 
144 } // End namespace Foam
145 
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147 
148 #ifdef NoRepository
149  #include "IOOutputFilter.C"
150 #endif
151 
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 
154 #endif
155 
156 // ************************************************************************* //
virtual bool read()
Read output filter properties.
A class for handling file names.
Definition: fileName.H:79
virtual void updateMesh(const mapPolyMesh &mpm)
Update for changes of mesh.
virtual bool write(const bool write=true)
Sample and write.
void read(Istream &, label &, const dictionary &)
In-place read with dictionary lookup.
readOption
Enumeration defining the read options.
Definition: IOobject.H:107
IOOutputFilter(const word &outputFilterName, const IOobject &ioDict, const bool loadFromFile=false)
Construct from an IOobject for IOdictionary.
virtual const word & name() const
Return name.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:158
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:52
const word dictName() const
Return the local dictionary name (final part of scoped name)
Definition: dictionary.H:123
dynamicFvMesh & mesh
A class for handling words, derived from string.
Definition: word.H:59
IOdictionary wrapper around OutputFilter to allow them to read from their associated dictionaries...
void operator=(const IOOutputFilter &)=delete
Disallow default bitwise assignment.
virtual void movePoints(const polyMesh &mesh)
Update for changes of mesh.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
virtual bool write(const bool write=true) const
Write using setting from DB.
Registry of regIOobjects.
virtual ~IOOutputFilter()
Destructor.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:92
Namespace for OpenFOAM.