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-2022 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 polyTopoChangeMap;
54 class polyMeshMap;
55 
56 /*---------------------------------------------------------------------------*\
57  Class IOOutputFilter Declaration
58 \*---------------------------------------------------------------------------*/
59 
60 template<class OutputFilter>
61 class IOOutputFilter
62 :
63  public IOdictionary,
64  public OutputFilter
65 {
66 
67 public:
68 
69  // Constructors
70 
71  //- Construct from an IOobject for IOdictionary
72  // Allow the possibility to load fields from files
74  (
75  const word& outputFilterName,
76  const IOobject& ioDict,
77  const bool loadFromFile = false
78  );
79 
80  //- Construct for given objectRegistry and dictionary
81  // Allow dictionary to be optional
82  // Allow the possibility to load fields from files
84  (
85  const word& outputFilterName,
86  const objectRegistry&,
87  const word& dictName = OutputFilter::typeName() + "Dict",
89  const bool loadFromFile = false
90  );
91 
92  //- Construct for given objectRegistry and dictionary
93  // Dictionary read from full path.
94  // Allow the possibility to load fields from files
96  (
97  const word& outputFilterName,
98  const objectRegistry&,
99  const fileName& dictName,
101  const bool loadFromFile = false
102  );
103 
104  //- Disallow default bitwise copy construction
105  IOOutputFilter(const IOOutputFilter&) = delete;
106 
107 
108  //- Destructor
109  virtual ~IOOutputFilter();
110 
111 
112  // Member Functions
113 
114  //- Return name
115  virtual const word& name() const;
116 
117  //- Inherit read from OutputFilter
118  using OutputFilter::read;
119 
120  //- Read output filter properties
121  virtual bool read();
122 
123  //- Inherit write from regIOobject
124  using regIOobject::write;
125 
126  //- Sample and write
127  virtual bool write(const bool write = true);
128 
129  //- Update topology using the given map
130  virtual void movePoints(const polyMesh& mesh);
131 
132  //- Update topology using the given map
133  virtual void topoChange(const polyTopoChangeMap& map);
134 
135  //- Update from another mesh using the given map
136  virtual void mapMesh(const polyMeshMap&);
137 
138 
139  // Member Operators
140 
141  //- Disallow default bitwise assignment
142  void operator=(const IOOutputFilter&) = delete;
143 };
144 
145 
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147 
148 } // End namespace Foam
149 
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151 
152 #ifdef NoRepository
153  #include "IOOutputFilter.C"
154 #endif
155 
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 
158 #endif
159 
160 // ************************************************************************* //
IOdictionary wrapper around OutputFilter to allow them to read from their associated dictionaries.
virtual ~IOOutputFilter()
Destructor.
virtual void movePoints(const polyMesh &mesh)
Update topology using the given map.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
virtual bool write(const bool write=true) const
Inherit write from regIOobject.
void operator=(const IOOutputFilter &)=delete
Disallow default bitwise assignment.
virtual const word & name() const
Return name.
virtual void topoChange(const polyTopoChangeMap &map)
Update topology using the given map.
IOOutputFilter(const word &outputFilterName, const IOobject &ioDict, const bool loadFromFile=false)
Construct from an IOobject for IOdictionary.
virtual bool read()
Read output filter properties.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:57
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:99
readOption
Enumeration defining the read options.
Definition: IOobject.H:117
@ MUST_READ_IF_MODIFIED
Definition: IOobject.H:119
const word dictName() const
Return the local dictionary name (final part of scoped name)
Definition: dictionary.H:121
A class for handling file names.
Definition: fileName.H:82
Registry of regIOobjects.
Class containing mesh-to-mesh mapping information.
Definition: polyMeshMap.H:51
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:80
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
virtual bool write(const bool write=true) const
Write using setting from DB.
A class for handling words, derived from string.
Definition: word.H:62
void read(Istream &, label &, const dictionary &)
In-place read with dictionary lookup.
Namespace for OpenFOAM.