OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

timeActivatedExplicitSource.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM; if not, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Class
00026     Foam::timeActivatedExplicitSource
00027 
00028 Description
00029     Base class for field sources. Provides:
00030     - name
00031     - references to mesh and time
00032     - dimensions
00033     - volume type
00034     - startTime
00035     - duration
00036     - read (from <sourceName>Properties dictionary)
00037 
00038 SourceFiles
00039     timeActivatedExplicitSource.C
00040 
00041 \*---------------------------------------------------------------------------*/
00042 
00043 #ifndef timeActivatedExplicitSource_H
00044 #define timeActivatedExplicitSource_H
00045 
00046 #include "IOdictionary.H"
00047 #include "autoPtr.H"
00048 #include "fvMesh.H"
00049 #include "Time.H"
00050 #include "NamedEnum.H"
00051 
00052 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00053 
00054 namespace Foam
00055 {
00056 
00057 /*---------------------------------------------------------------------------*\
00058                 Class timeActivatedExplicitSource Declaration
00059 \*---------------------------------------------------------------------------*/
00060 
00061 class timeActivatedExplicitSource
00062 :
00063     public IOdictionary
00064 {
00065 public:
00066 
00067     enum volumeType
00068     {
00069         vtSpecific,
00070         vtAbsolute
00071     };
00072 
00073     static const NamedEnum<volumeType, 2> volumeTypeNames_;
00074 
00075 
00076 private:
00077 
00078     // Private Member Functions
00079 
00080         //- Disallow default bitwise copy construct
00081         timeActivatedExplicitSource(const timeActivatedExplicitSource&);
00082 
00083         //- Disallow default bitwise assignment
00084         void operator=(const timeActivatedExplicitSource&);
00085 
00086 
00087 protected:
00088 
00089     // Protected data
00090 
00091         //- Reference to the mesh
00092         const fvMesh& mesh_;
00093 
00094         //- Reference to time database
00095         const Time& runTime_;
00096 
00097 
00098         // Source properties
00099 
00100             //- Name of the source
00101             word name_;
00102 
00103             //- Active flag
00104             Switch active_;
00105 
00106             //- Dimensions
00107             const dimensionSet dimensions_;
00108 
00109             //- Volume type
00110             volumeType volumeType_;
00111 
00112             //- Time start [s]
00113             scalar timeStart_;
00114 
00115             //- Duration [s]
00116             scalar duration_;
00117 
00118 
00119 public:
00120 
00121     // Constructors
00122 
00123         //- Construct from explicit source name and mesh
00124         timeActivatedExplicitSource
00125         (
00126             const word&,
00127             const fvMesh&,
00128             const dimensionSet&
00129         );
00130 
00131 
00132     // Member Functions
00133 
00134         // Access
00135 
00136             //- Return the reference to the mesh
00137             virtual const fvMesh& mesh() const;
00138 
00139             //- Return the reference to the time database
00140             virtual const Time& runTime() const;
00141 
00142             //- Return the source name
00143             virtual const word& name() const;
00144 
00145             //- Return the active flag
00146             virtual const Switch& active() const;
00147 
00148             //- Return the dimensions
00149             virtual const dimensionSet& dimensions() const;
00150 
00151             //- Return the volume type
00152             virtual const volumeType& volume() const;
00153 
00154             //- Return the start time
00155             virtual scalar timeStart() const;
00156 
00157             //- Return the duration
00158             virtual scalar duration() const;
00159 
00160 
00161         //- Read properties dictionary
00162         virtual bool read();
00163 };
00164 
00165 
00166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00167 
00168 } // End namespace Foam
00169 
00170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00171 
00172 #endif
00173 
00174 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd