minTimeStepCondition.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 | Copyright (C) 2015 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
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
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "minTimeStepCondition.H"
28 #include "Time.H"
29 
30 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
31 
32 namespace Foam
33 {
34  defineTypeNameAndDebug(minTimeStepCondition, 0);
36  (
37  runTimeCondition,
38  minTimeStepCondition,
39  dictionary
40  );
41 }
42 
43 
44 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
45 
47 (
48  const word& name,
49  const objectRegistry& obr,
50  const dictionary& dict,
51  functionObjectState& state
52 )
53 :
54  runTimeCondition(name, obr, dict, state),
55  minValue_(readScalar(dict.lookup("minValue")))
56 {}
57 
58 
59 // * * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * //
60 
62 {}
63 
64 
65 // * * * * * * * * * * * * * * Public Member Functions * * * * * * * * * * * //
66 
68 {
69  bool satisfied = false;
70 
71  if (!active_)
72  {
73  return true;
74  }
75 
76  if (obr_.time().deltaTValue() < minValue_)
77  {
78  satisfied = true;
79  }
80 
81  return satisfied;
82 }
83 
84 
86 {
87  // do nothing
88 }
89 
90 
91 // ************************************************************************* //
Foam::runTimeCondition
Base class for run time conditions.
Definition: runTimeCondition.H:54
Foam::minTimeStepCondition::~minTimeStepCondition
virtual ~minTimeStepCondition()
Destructor.
Definition: minTimeStepCondition.C:61
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::functionObjectState
Base class for function objects, adding functionality to read/write state information (data required ...
Definition: functionObjectState.H:54
Foam::addToRunTimeSelectionTable
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
Foam::minTimeStepCondition::write
virtual void write()
Write.
Definition: minTimeStepCondition.C:85
Foam::objectRegistry
Registry of regIOobjects.
Definition: objectRegistry.H:50
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
readScalar
#define readScalar
Definition: doubleScalar.C:38
Foam::minTimeStepCondition::minTimeStepCondition
minTimeStepCondition(const word &name, const objectRegistry &obr, const dictionary &dict, functionObjectState &state)
Constructor.
Definition: minTimeStepCondition.C:47
Foam::minTimeStepCondition::apply
virtual bool apply()
Apply the condition.
Definition: minTimeStepCondition.C:67
minTimeStepCondition.H
Foam::defineTypeNameAndDebug
defineTypeNameAndDebug(combustionModel, 0)
Foam::name
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47