1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend 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 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
24 \*---------------------------------------------------------------------------*/
26 #include "functionObject.H"
27 #include "dictionary.H"
28 #include "dlLibraryTable.H"
30 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
32 defineRunTimeSelectionTable(Foam::functionObject, dictionary);
34 Foam::debug::debugSwitch
35 Foam::functionObject::debug
42 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
44 Foam::functionObject::functionObject(const word& name)
50 // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
52 Foam::autoPtr<Foam::functionObject> Foam::functionObject::New
56 const dictionary& functionDict
59 word functionType(functionDict.lookup("type"));
63 Info<< "Selecting function " << functionType << endl;
70 dictionaryConstructorTablePtr_
73 if (!dictionaryConstructorTablePtr_)
78 "(const word& name, const Time&, const dictionary&)"
79 ) << "Unknown function type "
80 << functionType << nl << nl
81 << "Table of functionObjects is empty" << endl
85 dictionaryConstructorTable::iterator cstrIter =
86 dictionaryConstructorTablePtr_->find(functionType);
88 if (cstrIter == dictionaryConstructorTablePtr_->end())
93 "(const word& name, const Time&, const dictionary&)"
94 ) << "Unknown function type "
95 << functionType << nl << nl
96 << "Valid functions are : " << nl
97 << dictionaryConstructorTablePtr_->sortedToc() << endl
101 return autoPtr<functionObject>(cstrIter()(name, t, functionDict));
105 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
107 Foam::functionObject::~functionObject()
111 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
113 const Foam::word& Foam::functionObject::name() const
119 bool Foam::functionObject::end()
125 Foam::autoPtr<Foam::functionObject> Foam::functionObject::iNew::operator()
132 return functionObject::New(name, time_, dict);
136 // ************************************************************************* //