1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
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
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 \*---------------------------------------------------------------------------*/
27 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
32 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
34 template<class Type, class GeoMesh>
35 inline SubDimensionedField<Type, GeoMesh>::SubDimensionedField
37 const SubField<Type>& slist
43 template<class Type, class GeoMesh>
44 inline SubDimensionedField<Type, GeoMesh>::SubDimensionedField
46 const UList<Type>& list,
50 SubField<Type>(list, subSize)
54 template<class Type, class GeoMesh>
55 inline SubDimensionedField<Type, GeoMesh>::SubDimensionedField
57 const UList<Type>& list,
59 const label startIndex
62 SubField<Type>(list, subSize, startIndex)
66 template<class Type, class GeoMesh>
67 inline SubDimensionedField<Type, GeoMesh>::SubDimensionedField
69 const SubDimensionedField<Type, GeoMesh>& sfield
73 SubField<Type>(sfield)
77 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
79 // Return a null Field
80 template<class Type, class GeoMesh>
81 inline const SubDimensionedField<Type, GeoMesh>&
82 SubDimensionedField<Type, GeoMesh>::null()
84 SubDimensionedField<Type, GeoMesh>* nullPtr
85 = reinterpret_cast<SubDimensionedField<Type, GeoMesh>*>(NULL);
90 template<class Type, class GeoMesh>
91 inline tmp<Field<typename SubDimensionedField<Type, GeoMesh>::cmptType> >
92 SubDimensionedField<Type, GeoMesh>::component
99 reinterpret_cast<const DimensionedField<Type, GeoMesh>&>(*this)
104 template<class Type, class GeoMesh>
105 inline tmp<DimensionedField<Type, GeoMesh> >
106 SubDimensionedField<Type, GeoMesh>::T() const
110 reinterpret_cast<const DimensionedField<Type, GeoMesh>&>(*this)
115 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
117 template<class Type, class GeoMesh>
118 inline void SubDimensionedField<Type, GeoMesh>::operator=
120 const SubDimensionedField<Type, GeoMesh>& rhs
123 dimensions() = rhs.dimensions();
124 SubField<Type>::operator=(rhs);
128 // Allow cast to a const DimensionedField<Type, GeoMesh>&
129 template<class Type, class GeoMesh>
130 inline SubDimensionedField<Type, GeoMesh>::operator
131 const DimensionedField<Type, GeoMesh>&() const
133 return *(reinterpret_cast<const DimensionedField<Type, GeoMesh>*>(this));
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 } // End namespace Foam
141 // ************************************************************************* //