1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-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
25 \*---------------------------------------------------------------------------*/
27 #include "OutputFilterFunctionObject.H"
28 #include "IOOutputFilter.H"
30 #include "addToRunTimeSelectionTable.H"
32 // * * * * * * * * * * * * * * * Private Members * * * * * * * * * * * * * * //
34 template<class OutputFilter>
35 void Foam::OutputFilterFunctionObject<OutputFilter>::readDict()
37 dict_.readIfPresent("region", regionName_);
38 dict_.readIfPresent("dictionary", dictName_);
39 dict_.readIfPresent("enabled", enabled_);
43 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
45 template<class OutputFilter>
46 Foam::OutputFilterFunctionObject<OutputFilter>::OutputFilterFunctionObject
50 const dictionary& dict
56 regionName_(polyMesh::defaultRegion),
59 outputControl_(t, dict)
65 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
67 template<class OutputFilter>
68 void Foam::OutputFilterFunctionObject<OutputFilter>::on()
74 template<class OutputFilter>
75 void Foam::OutputFilterFunctionObject<OutputFilter>::off()
81 template<class OutputFilter>
82 bool Foam::OutputFilterFunctionObject<OutputFilter>::start()
92 new IOOutputFilter<OutputFilter>
95 time_.lookupObject<objectRegistry>(regionName_),
107 time_.lookupObject<objectRegistry>(regionName_),
118 template<class OutputFilter>
119 bool Foam::OutputFilterFunctionObject<OutputFilter>::execute()
125 if (enabled_ && outputControl_.output())
135 template<class OutputFilter>
136 bool Foam::OutputFilterFunctionObject<OutputFilter>::end()
142 if (enabled_ && outputControl_.output())
152 template<class OutputFilter>
153 bool Foam::OutputFilterFunctionObject<OutputFilter>::read
155 const dictionary& dict
161 outputControl_.read(dict);
172 // ************************************************************************* //