writeVTK.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 | Copyright (C) 2016 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::functionObjects::writeVTK
26 
27 Group
28  grpUtilitiesFunctionObjects
29 
30 Description
31  This functionObject writes objects registered to the database in VTK format
32  using the foamToVTK library.
33 
34  Currently only the writing of the cell-values of volFields is supported but
35  support for other field types, patch fields, Lagrangian data etc. will be
36  added.
37 
38  Example of function object specification:
39  \verbatim
40  writeVTK1
41  {
42  type writeVTK;
43  libs ("libutilityFunctionObjects.so");
44  ...
45  objectNames (obj1 obj2);
46  }
47  \endverbatim
48 
49 Usage
50  \table
51  Property | Description | Required | Default value
52  type | type name: writeVTK | yes |
53  objectNames | objects to write | yes |
54  \endtable
55 
56 See also
57  Foam::functionObjects::fvMeshFunctionObject
58  Foam::functionObjects::timeControl
59 
60 SourceFiles
61  writeVTK.C
62  IOwriteVTK.H
63 
64 \*---------------------------------------------------------------------------*/
65 
66 #ifndef functionObjects_writeVTK_H
67 #define functionObjects_writeVTK_H
68 
69 #include "fvMeshFunctionObject.H"
70 #include "wordReList.H"
71 
72 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
73 
74 namespace Foam
75 {
76 namespace functionObjects
77 {
78 
79 /*---------------------------------------------------------------------------*\
80  Class writeVTK Declaration
81 \*---------------------------------------------------------------------------*/
82 
83 class writeVTK
84 :
85  public fvMeshFunctionObject
86 {
87  // Private data
88 
89  //- Names of objects
90  wordReList objectNames_;
91 
92 
93  // Private Member Functions
94 
95  template<class GeoField>
96  UPtrList<const GeoField> lookupFields() const;
97 
98  //- Disallow default bitwise copy construct
99  writeVTK(const writeVTK&);
100 
101  //- Disallow default bitwise assignment
102  void operator=(const writeVTK&);
103 
104 
105 public:
106 
107  //- Runtime type information
108  TypeName("writeVTK");
109 
110 
111  // Constructors
112 
113  //- Construct from Time and dictionary
114  writeVTK
115  (
116  const word& name,
117  const Time& t,
118  const dictionary&
119  );
120 
121 
122  //- Destructor
123  virtual ~writeVTK();
124 
125 
126  // Member Functions
127 
128  //- Read the writeVTK data
129  virtual bool read(const dictionary&);
130 
131  //- Execute, currently does nothing
132  virtual bool execute();
133 
134  //- Write the writeVTK
135  virtual bool write();
136 };
137 
138 
139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140 
141 } // End namespace functionObjects
142 } // End namespace Foam
143 
144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 
146 #ifdef NoRepository
147  #include "writeVTKTemplates.C"
148 #endif
149 
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151 
152 #endif
153 
154 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
TypeName("writeVTK")
Runtime type information.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:68
const word & name() const
Return the name of this functionObject.
This functionObject writes objects registered to the database in VTK format using the foamToVTK libra...
Definition: writeVTK.H:97
A class for handling words, derived from string.
Definition: word.H:59
virtual ~writeVTK()
Destructor.
virtual bool write()
Write the writeVTK.
virtual bool read(const dictionary &)
Read the writeVTK data.
virtual bool execute()
Execute, currently does nothing.
List< wordRe > wordReList
A List of wordRe (word or regular expression)
Definition: wordReList.H:50
void writeVTK(OFstream &os, const Type &value)
Namespace for OpenFOAM.