1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
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
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29 Base class for field value -based function objects.
34 \*---------------------------------------------------------------------------*/
40 #include "pointFieldFwd.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 // Forward declaration of classes
54 /*---------------------------------------------------------------------------*\
55 Class fieldValue Declaration
56 \*---------------------------------------------------------------------------*/
65 //- Name of this fieldValue object
68 //- Database this class is registered to
69 const objectRegistry& obr_;
74 //- Switch to send output to Info as well as to file
77 //- Name of source object
80 //- List of field names to operate on
83 //- Output field values flag
86 //- Output file pointer
87 autoPtr<OFstream> outputFilePtr_;
90 // Functions to be over-ridden from IOoutputFilter class
92 //- Make the output file
93 virtual void makeFile();
95 //- Write the output file header
96 virtual void writeFileHeader() = 0;
99 virtual void updateMesh(const mapPolyMesh&);
102 virtual void movePoints(const Field<point>&);
107 //- Run-time type information
108 TypeName("fieldValue");
111 //- Construct from components
115 const objectRegistry& obr,
116 const dictionary& dict,
117 const bool loadFromFiles = false
122 virtual ~fieldValue();
125 // Public member functions
129 //- Return the name of the geometric source
130 inline const word& name() const;
132 //- Return the reference to the object registry
133 inline const objectRegistry& obr() const;
135 //- Return the active flag
136 inline bool active() const;
138 //- Return the switch to send output to Info as well as to file
139 inline const Switch& log() const;
141 //- Return the source name
142 inline const word& sourceName() const;
144 //- Return the list of field names
145 inline const wordList& fields() const;
147 //- Return the output field values flag
148 inline const Switch& valueOutput() const;
150 //- Helper function to return the reference to the mesh
151 inline const fvMesh& mesh() const;
154 // Function object functions
156 //- Read from dictionary
157 virtual void read(const dictionary& dict);
159 //- Write to screen/file
160 virtual void write();
163 virtual void execute();
165 //- Execute the at the final time-loop, currently does nothing
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 } // End namespace Foam
174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 #include "fieldValueI.H"
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 // ************************************************************************* //