|
|
|
UniformDimensionedField.CGo 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) 2009-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 \*---------------------------------------------------------------------------*/ 00026 00027 #include "UniformDimensionedField.H" 00028 00029 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // 00030 00031 template<class Type> 00032 Foam::UniformDimensionedField<Type>::UniformDimensionedField 00033 ( 00034 const IOobject& io, 00035 const dimensioned<Type>& dt 00036 ) 00037 : 00038 regIOobject(io), 00039 dimensioned<Type>(dt) 00040 {} 00041 00042 00043 template<class Type> 00044 Foam::UniformDimensionedField<Type>::UniformDimensionedField 00045 ( 00046 const UniformDimensionedField<Type>& rdt 00047 ) 00048 : 00049 regIOobject(rdt), 00050 dimensioned<Type>(rdt) 00051 {} 00052 00053 00054 template<class Type> 00055 Foam::UniformDimensionedField<Type>::UniformDimensionedField 00056 ( 00057 const IOobject& io 00058 ) 00059 : 00060 regIOobject(io), 00061 dimensioned<Type>(regIOobject::name(), dimless, pTraits<Type>::zero) 00062 { 00063 dictionary dict(readStream(typeName)); 00064 this->dimensions().reset(dict.lookup("dimensions")); 00065 this->value() = dict.lookup("value"); 00066 } 00067 00068 00069 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // 00070 00071 template<class Type> 00072 Foam::UniformDimensionedField<Type>::~UniformDimensionedField() 00073 {} 00074 00075 00076 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // 00077 00078 template<class Type> 00079 bool Foam::UniformDimensionedField<Type>::writeData(Ostream& os) const 00080 { 00081 os.writeKeyword("dimensions") << this->dimensions() << token::END_STATEMENT 00082 << nl; 00083 os.writeKeyword("value") << this->value() << token::END_STATEMENT 00084 << nl << nl; 00085 00086 return (os.good()); 00087 } 00088 00089 00090 // * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * // 00091 00092 template<class Type> 00093 void Foam::UniformDimensionedField<Type>::operator= 00094 ( 00095 const UniformDimensionedField<Type>& rhs 00096 ) 00097 { 00098 dimensioned<Type>::operator=(rhs); 00099 } 00100 00101 00102 template<class Type> 00103 void Foam::UniformDimensionedField<Type>::operator= 00104 ( 00105 const dimensioned<Type>& rhs 00106 ) 00107 { 00108 dimensioned<Type>::operator=(rhs); 00109 } 00110 00111 00112 // ************************************************************************* // |