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-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::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 
96 public:
97 
98  //- Runtime type information
99  TypeName("writeVTK");
100 
101 
102  // Constructors
103 
104  //- Construct from Time and dictionary
105  writeVTK
106  (
107  const word& name,
108  const Time& t,
109  const dictionary&
110  );
111 
112  //- Disallow default bitwise copy construction
113  writeVTK(const writeVTK&) = delete;
114 
115 
116  //- Destructor
117  virtual ~writeVTK();
118 
119 
120  // Member Functions
121 
122  //- Read the writeVTK data
123  virtual bool read(const dictionary&);
124 
125  //- Execute, currently does nothing
126  virtual bool execute();
127 
128  //- Write the writeVTK
129  virtual bool write();
130 
131 
132  // Member Operators
133 
134  //- Disallow default bitwise assignment
135  void operator=(const writeVTK&) = delete;
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 // ************************************************************************* //
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:158
TypeName("writeVTK")
Runtime type information.
void operator=(const writeVTK &)=delete
Disallow default bitwise assignment.
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)
writeVTK(const word &name, const Time &t, const dictionary &)
Construct from Time and dictionary.
Namespace for OpenFOAM.