timeActivatedExplicitSource.C
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include "timeActivatedExplicitSource.H"
00028 #include "volFields.H"
00029
00030
00031
00032 template<>
00033 const char* Foam::NamedEnum
00034 <
00035 Foam::timeActivatedExplicitSource::volumeType,
00036 2
00037 >::names[] =
00038 {
00039 "specific",
00040 "absolute"
00041 };
00042
00043 const Foam::NamedEnum<Foam::timeActivatedExplicitSource::volumeType, 2>
00044 Foam::timeActivatedExplicitSource::volumeTypeNames_;
00045
00046
00047
00048
00049 Foam::timeActivatedExplicitSource::timeActivatedExplicitSource
00050 (
00051 const word& name,
00052 const fvMesh& mesh,
00053 const dimensionSet& dims
00054 )
00055 :
00056 IOdictionary
00057 (
00058 IOobject
00059 (
00060 name + "Properties",
00061 mesh.time().constant(),
00062 mesh,
00063 IOobject::MUST_READ,
00064 IOobject::NO_WRITE
00065 )
00066 ),
00067 mesh_(mesh),
00068 runTime_(mesh.time()),
00069 name_(name),
00070 active_(lookup("active")),
00071 dimensions_(dims),
00072 volumeType_(volumeTypeNames_.read(lookup("volumeType"))),
00073 timeStart_(readScalar(lookup("timeStart"))),
00074 duration_(readScalar(lookup("duration")))
00075 {}
00076
00077
00078
00079
00080 const Foam::fvMesh& Foam::timeActivatedExplicitSource::mesh() const
00081 {
00082 return mesh_;
00083 }
00084
00085
00086 const Foam::Time& Foam::timeActivatedExplicitSource::runTime() const
00087 {
00088 return runTime_;
00089 }
00090
00091
00092 const Foam::word& Foam::timeActivatedExplicitSource::name() const
00093 {
00094 return name_;
00095 }
00096
00097
00098 const Foam::Switch& Foam::timeActivatedExplicitSource::active() const
00099 {
00100 return active_;
00101 }
00102
00103
00104 const Foam::dimensionSet& Foam::timeActivatedExplicitSource::dimensions() const
00105 {
00106 return dimensions_;
00107 }
00108
00109
00110 const Foam::timeActivatedExplicitSource::volumeType&
00111 Foam::timeActivatedExplicitSource::volume() const
00112 {
00113 return volumeType_;
00114 }
00115
00116
00117 Foam::scalar Foam::timeActivatedExplicitSource::timeStart() const
00118 {
00119 return timeStart_;
00120 }
00121
00122
00123 Foam::scalar Foam::timeActivatedExplicitSource::duration() const
00124 {
00125 return duration_;
00126 }
00127
00128
00129 bool Foam::timeActivatedExplicitSource::read()
00130 {
00131 if (regIOobject::read())
00132 {
00133 lookup("active") >> active_;
00134 if (active_)
00135 {
00136 volumeType_ = volumeTypeNames_.read(lookup("volumeType"));
00137 lookup("timeStart") >> duration_;
00138 lookup("duration") >> duration_;
00139 return true;
00140 }
00141 else
00142 {
00143 return false;
00144 }
00145 }
00146 else
00147 {
00148 return false;
00149 }
00150 }
00151
00152
00153
00154
00155
Copyright © 2000-2009 OpenCFD Ltd