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-2018 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  // Private Member Functions
66 
67  // Disallow default bitwise copy construct and assignment
69  void operator=(const IOOutputFilter&);
70 
71 
72 public:
73 
74  // Constructors
75 
76  //- Construct from an IOobject for IOdictionary
77  // Allow the possibility to load fields from files
79  (
80  const word& outputFilterName,
81  const IOobject& ioDict,
82  const bool loadFromFile = false
83  );
84 
85  //- Construct for given objectRegistry and dictionary
86  // Allow dictionary to be optional
87  // Allow the possibility to load fields from files
89  (
90  const word& outputFilterName,
91  const objectRegistry&,
92  const word& dictName = OutputFilter::typeName() + "Dict",
94  const bool loadFromFile = false
95  );
96 
97  //- Construct for given objectRegistry and dictionary
98  // Dictionary read from full path.
99  // Allow the possibility to load fields from files
101  (
102  const word& outputFilterName,
103  const objectRegistry&,
104  const fileName& dictName,
106  const bool loadFromFile = false
107  );
108 
109 
110  //- Destructor
111  virtual ~IOOutputFilter();
112 
113 
114  // Member Functions
115 
116  //- Return name
117  virtual const word& name() const;
118 
119  //- Inherit read from OutputFilter
120  using OutputFilter::read;
121 
122  //- Read output filter properties
123  virtual bool read();
124 
125  //- Inherit write from regIOobject
126  using regIOobject::write;
127 
128  //- Sample and write
129  virtual bool write(const bool valid = true);
130 
131  //- Update for changes of mesh
132  virtual void updateMesh(const mapPolyMesh& mpm);
133 
134  //- Update for changes of mesh
135  virtual void movePoints(const polyMesh& mesh);
136 };
137 
138 
139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140 
141 } // End namespace Foam
142 
143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144 
145 #ifdef NoRepository
146  #include "IOOutputFilter.C"
147 #endif
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 #endif
152 
153 // ************************************************************************* //
virtual bool read()
Read output filter properties.
A class for handling file names.
Definition: fileName.H:69
virtual void updateMesh(const mapPolyMesh &mpm)
Update for changes of mesh.
void read(Istream &, label &, const dictionary &)
In-place read with dictionary lookup.
readOption
Enumeration defining the read options.
Definition: IOobject.H:107
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:115
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...
virtual bool write(const bool valid=true)
Sample and write.
virtual void movePoints(const polyMesh &mesh)
Update for changes of mesh.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
Registry of regIOobjects.
virtual bool write(const bool valid=true) const
Write using setting from DB.
virtual ~IOOutputFilter()
Destructor.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:92
Namespace for OpenFOAM.