waveModel.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2017-2019 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 "waveModel.H"
27 #include "Time.H"
29 
30 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
31 
32 namespace Foam
33 {
34  defineTypeNameAndDebug(waveModel, 0);
35  defineRunTimeSelectionTable(waveModel, objectRegistry);
36 }
37 
38 
39 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
40 
42 :
43  db_(wave.db_),
44  amplitude_(wave.amplitude_, false)
45 {}
46 
47 
49 (
50  const objectRegistry& db,
51  const dictionary& dict
52 )
53 :
54  db_(db),
55  amplitude_(Function1<scalar>::New("amplitude", dict))
56 {}
57 
58 
59 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
60 
62 {}
63 
64 
65 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
66 
67 Foam::scalar Foam::waveModel::g() const
68 {
70 }
71 
72 
74 {
75  writeEntry(os, amplitude_());
76 }
77 
78 
79 // ************************************************************************* //
Run-time selectable general function of one variable.
Definition: Function1.H:52
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
const Type & lookupObject(const word &name) const
Lookup and return the object of the given Type.
Generic base class for waves. Derived classes must implement field functions which return the elevati...
Definition: waveModel.H:56
const Type & value() const
Return const reference to value.
scalar g() const
Get the (scalar) value of gravity.
Definition: waveModel.C:67
waveModel(const waveModel &wave)
Construct a copy.
Definition: waveModel.C:41
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
defineTypeNameAndDebug(combustionModel, 0)
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
Definition: HashTableIO.C:96
virtual ~waveModel()
Destructor.
Definition: waveModel.C:61
dimensioned< scalar > mag(const dimensioned< Type > &)
Registry of regIOobjects.
virtual void write(Ostream &os) const
Write.
Definition: waveModel.C:73
Namespace for OpenFOAM.