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-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::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 
68 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
69 
70 namespace Foam
71 {
72 namespace functionObjects
73 {
74 
75 /*---------------------------------------------------------------------------*\
76  Class writeVTK Declaration
77 \*---------------------------------------------------------------------------*/
78 
79 class writeVTK
80 :
81  public fvMeshFunctionObject
82 {
83  // Private Data
84 
85  //- Names of objects
86  wordList objectNames_;
87 
88 
89  // Private Member Functions
90 
91  template<class GeoField>
92  UPtrList<const GeoField> lookupFields() const;
93 
94 
95 public:
96 
97  //- Runtime type information
98  TypeName("writeVTK");
99 
100 
101  // Constructors
102 
103  //- Construct from Time and dictionary
104  writeVTK
105  (
106  const word& name,
107  const Time& t,
108  const dictionary&
109  );
110 
111  //- Disallow default bitwise copy construction
112  writeVTK(const writeVTK&) = delete;
113 
114 
115  //- Destructor
116  virtual ~writeVTK();
117 
118 
119  // Member Functions
120 
121  //- Read the writeVTK data
122  virtual bool read(const dictionary&);
123 
124  //- Return the list of fields required
125  virtual wordList fields() const;
126 
127  //- Execute, currently does nothing
128  virtual bool execute();
129 
130  //- Write the writeVTK
131  virtual bool write();
132 
133 
134  // Member Operators
135 
136  //- Disallow default bitwise assignment
137  void operator=(const writeVTK&) = delete;
138 };
139 
140 
141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142 
143 } // End namespace functionObjects
144 } // End namespace Foam
145 
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147 
148 #endif
149 
150 // ************************************************************************* //
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:76
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
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:96
void operator=(const writeVTK &)=delete
Disallow default bitwise assignment.
virtual wordList fields() const
Return the list of fields required.
virtual bool execute()
Execute, currently does nothing.
virtual ~writeVTK()
Destructor.
virtual bool write()
Write the writeVTK.
virtual bool read(const dictionary &)
Read the writeVTK data.
TypeName("writeVTK")
Runtime type information.
writeVTK(const word &name, const Time &t, const dictionary &)
Construct from Time and dictionary.
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
List< word > wordList
A List of words.
Definition: fileName.H:54
void writeVTK(OFstream &os, const Type &value)