1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2008 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("interval", interval_);
40 dict_.readIfPresent("enabled", execution_);
44 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
46 template<class OutputFilter>
47 Foam::OutputFilterFunctionObject<OutputFilter>::OutputFilterFunctionObject
51 const dictionary& dict
58 regionName_(polyMesh::defaultRegion),
67 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
69 template<class OutputFilter>
70 bool Foam::OutputFilterFunctionObject<OutputFilter>::start()
80 new IOOutputFilter<OutputFilter>
83 time_.lookupObject<objectRegistry>(regionName_),
95 time_.lookupObject<objectRegistry>(regionName_),
106 template<class OutputFilter>
107 bool Foam::OutputFilterFunctionObject<OutputFilter>::execute()
109 if (execution_ && (interval_ <= 1 || !(time_.timeIndex() % interval_)) )
118 template<class OutputFilter>
119 void Foam::OutputFilterFunctionObject<OutputFilter>::on()
125 template<class OutputFilter>
126 void Foam::OutputFilterFunctionObject<OutputFilter>::off()
132 template<class OutputFilter>
133 bool Foam::OutputFilterFunctionObject<OutputFilter>::read
135 const dictionary& dict
150 // ************************************************************************* //