stepUpdate.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2007-2019 PCOpt/NTUA
9  Copyright (C) 2013-2019 FOSS GP
10  Copyright (C) 2019-2021 OpenCFD Ltd.
11 -------------------------------------------------------------------------------
12 License
13  This file is part of OpenFOAM.
14 
15  OpenFOAM is free software: you can redistribute it and/or modify it
16  under the terms of the GNU General Public License as published by
17  the Free Software Foundation, either version 3 of the License, or
18  (at your option) any later version.
19 
20  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
21  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
22  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23  for more details.
24 
25  You should have received a copy of the GNU General Public License
26  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
27 
28 \*---------------------------------------------------------------------------*/
29 
30 #include "stepUpdate.H"
31 
32 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
33 
34 namespace Foam
35 {
38 }
39 
40 
41 // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
42 
44 {
45  return dict_.optionalSubDict(type() + "Coeffs");
46 }
47 
48 
49 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
50 
51 Foam::stepUpdate::stepUpdate(const dictionary& dict)
52 :
53  dict_(dict)
54 {}
55 
56 
57 // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * //
58 
60 {
61  const word type =
62  dict.getOrDefault<word>("stepUpdateType", "bisection");
63 
64  Info<< "stepUpdate type : " << type << endl;
65 
66  auto* ctorPtr = dictionaryConstructorTable(type);
67 
68  if (!ctorPtr)
69  {
71  (
72  dict,
73  "stepUpdate",
74  type,
75  *dictionaryConstructorTablePtr_
76  ) << exit(FatalIOError);
77  }
78 
79  return autoPtr<stepUpdate>(ctorPtr(dict));
80 }
81 
82 
83 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * //
84 
85 void Foam::stepUpdate::setDeriv(const scalar deriv)
86 {
87  // Does nothing in base
88 }
89 
90 
91 void Foam::stepUpdate::setNewMeritValue(const scalar value)
92 {
93  // Does nothing in base
94 }
95 
96 
97 void Foam::stepUpdate::setOldMeritValue(const scalar value)
98 {
99  // Does nothing in base
100 }
101 
102 
103 // ************************************************************************* //
Foam::stepUpdate::setDeriv
virtual void setDeriv(const scalar deriv)
Definition: stepUpdate.C:78
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:63
Foam::defineRunTimeSelectionTable
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
Foam::FatalIOError
IOerror FatalIOError
Foam::endl
Ostream & endl(Ostream &os)
Definition: Ostream.H:381
Foam::stepUpdate::New
static autoPtr< stepUpdate > New(const dictionary &dict)
Definition: stepUpdate.C:52
Foam::stepUpdate::coeffsDict
const dictionary & coeffsDict()
Definition: stepUpdate.C:36
FatalIOErrorInLookup
#define FatalIOErrorInLookup(ios, lookupTag, lookupName, lookupTable)
Definition: error.H:502
Foam::stepUpdate::setNewMeritValue
virtual void setNewMeritValue(const scalar value)
Definition: stepUpdate.C:84
Foam::Info
messageStream Info
stepUpdate.H
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:119
Foam
Definition: atmBoundaryLayer.C:26
Foam::stepUpdate::setOldMeritValue
virtual void setOldMeritValue(const scalar value)
Definition: stepUpdate.C:90
Foam::exit
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:125
Foam::autoPtr< Foam::stepUpdate >
Foam::stepUpdate::dict_
const dictionary dict_
Definition: stepUpdate.H:56
Foam::type
fileName::Type type(const fileName &name, const bool followLink=true)
Definition: POSIX.C:717
Foam::dictionary::optionalSubDict
const dictionary & optionalSubDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Definition: dictionary.C:570
Foam::stepUpdate
Abstract base class for step update methods used in line search.
Definition: stepUpdate.H:50
Foam::dictionary::getOrDefault
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
Definition: dictionaryTemplates.C:141
Foam::defineTypeNameAndDebug
defineTypeNameAndDebug(combustionModel, 0)