1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
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 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
30 inline Foam::SubField<Type>::SubField
32 const SubList<Type>& list
40 inline Foam::SubField<Type>::SubField
42 const UList<Type>& list
45 SubList<Type>(list, list.size())
50 inline Foam::SubField<Type>::SubField
52 const UList<Type>& list,
56 SubList<Type>(list, subSize)
61 inline Foam::SubField<Type>::SubField
63 const UList<Type>& list,
65 const label startIndex
68 SubList<Type>(list, subSize, startIndex)
73 inline Foam::SubField<Type>::SubField
75 const SubField<Type>& sfield
83 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
86 inline const Foam::SubField<Type>& Foam::SubField<Type>::null()
88 return *reinterpret_cast< SubField<Type>* >(0);
93 inline Foam::tmp<Foam::Field<typename Foam::SubField<Type>::cmptType> >
94 Foam::SubField<Type>::component
99 return (reinterpret_cast<const Field<Type>&>(*this)).component(d);
104 inline Foam::tmp<Foam::Field<Type> > Foam::SubField<Type>::T() const
106 return (reinterpret_cast<const Field<Type>&>(*this)).T();
110 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
113 inline void Foam::SubField<Type>::operator=(const SubField<Type>& rhs)
115 UList<Type>::operator=(rhs);
120 inline Foam::SubField<Type>::operator const Foam::Field<Type>&() const
122 return *reinterpret_cast< const Field<Type>* >(this);
126 // ************************************************************************* //