1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2004-2010 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
13 the Free Software Foundation, either version 3 of the License, or
14 (at your 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, see <http://www.gnu.org/licenses/>.
24 \*---------------------------------------------------------------------------*/
26 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
29 inline Foam::SubField<Type>::SubField
31 const SubList<Type>& list
39 inline Foam::SubField<Type>::SubField
41 const UList<Type>& list
44 SubList<Type>(list, list.size())
49 inline Foam::SubField<Type>::SubField
51 const UList<Type>& list,
55 SubList<Type>(list, subSize)
60 inline Foam::SubField<Type>::SubField
62 const UList<Type>& list,
64 const label startIndex
67 SubList<Type>(list, subSize, startIndex)
72 inline Foam::SubField<Type>::SubField
74 const SubField<Type>& sfield
82 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
85 inline const Foam::SubField<Type>& Foam::SubField<Type>::null()
87 return *reinterpret_cast< SubField<Type>* >(0);
92 inline Foam::tmp<Foam::Field<typename Foam::SubField<Type>::cmptType> >
93 Foam::SubField<Type>::component
98 return (reinterpret_cast<const Field<Type>&>(*this)).component(d);
103 inline Foam::tmp<Foam::Field<Type> > Foam::SubField<Type>::T() const
105 return (reinterpret_cast<const Field<Type>&>(*this)).T();
109 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
112 inline void Foam::SubField<Type>::operator=(const SubField<Type>& rhs)
114 UList<Type>::operator=(rhs);
119 inline Foam::SubField<Type>::operator const Foam::Field<Type>&() const
121 return *reinterpret_cast< const Field<Type>* >(this);
125 // ************************************************************************* //