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