initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / OpenFOAM / fields / Fields / Field / SubFieldI.H
blobae9e016ec4c7fd56c1a7148a854fbd95558b7060
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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  * * * * * * * * * * * * * * //
29 template<class Type>
30 inline Foam::SubField<Type>::SubField
32     const SubList<Type>& list
35     SubList<Type>(list)
39 template<class Type>
40 inline Foam::SubField<Type>::SubField
42     const UList<Type>& list
45     SubList<Type>(list, list.size())
49 template<class Type>
50 inline Foam::SubField<Type>::SubField
52     const UList<Type>& list,
53     const label subSize
56     SubList<Type>(list, subSize)
60 template<class Type>
61 inline Foam::SubField<Type>::SubField
63     const UList<Type>& list,
64     const label subSize,
65     const label startIndex
68     SubList<Type>(list, subSize, startIndex)
72 template<class Type>
73 inline Foam::SubField<Type>::SubField
75     const SubField<Type>& sfield
78     refCount(),
79     SubList<Type>(sfield)
83 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
85 template<class Type>
86 inline const Foam::SubField<Type>& Foam::SubField<Type>::null()
88     return *reinterpret_cast< SubField<Type>* >(0);
92 template<class Type>
93 inline Foam::tmp<Foam::Field<typename Foam::SubField<Type>::cmptType> >
94 Foam::SubField<Type>::component
96     const direction d
97 ) const
99     return (reinterpret_cast<const Field<Type>&>(*this)).component(d);
103 template<class Type>
104 inline Foam::tmp<Foam::Field<Type> > Foam::SubField<Type>::T() const
106     return (reinterpret_cast<const Field<Type>&>(*this)).T();
110 // * * * * * * * * * * * * * * * Member Operators  * * * * * * * * * * * * * //
112 template<class Type>
113 inline void Foam::SubField<Type>::operator=(const SubField<Type>& rhs)
115     UList<Type>::operator=(rhs);
119 template<class Type>
120 inline Foam::SubField<Type>::operator const Foam::Field<Type>&() const
122     return *reinterpret_cast< const Field<Type>* >(this);
126 // ************************************************************************* //