1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
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/>.
25 Foam::SubDimensionedField
28 SubDimensionedField is a DimensionedField obtained as a section of another
31 Thus it is itself unallocated so that no storage is allocated or
32 deallocated during its use. To achieve this behaviour,
33 SubDimensionedField is derived from SubField rather than Field.
36 SubDimensionedFieldI.H
38 \*---------------------------------------------------------------------------*/
40 #ifndef SubDimensionedField_H
41 #define SubDimensionedField_H
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 /*---------------------------------------------------------------------------*\
52 Class SubDimensionedField Declaration
53 \*---------------------------------------------------------------------------*/
55 template<class Type, class GeoMesh>
56 class SubDimensionedField
66 typedef typename GeoMesh::Mesh Mesh;
67 typedef typename Field<Type>::cmptType cmptType;
72 //- Construct from a SubField
73 inline SubDimensionedField
75 const SubField<Type>& slist
78 //- Construct from a UList and size
79 inline SubDimensionedField
81 const UList<Type>& list,
85 //- Construct from a UList start and end indices
86 inline SubDimensionedField
88 const UList<Type>& list,
90 const label startIndex
94 inline SubDimensionedField
96 const SubDimensionedField<cmptType, GeoMesh>& sfield
102 //- Return a null SubDimensionedField
103 static inline const SubDimensionedField<Type, GeoMesh>& null();
105 //- Return a component field of the field
106 inline tmp<DimensionedField<cmptType, GeoMesh> > component
111 //- Return the field transpose (only defined for second rank tensors)
112 tmp<DimensionedField<Type, GeoMesh> > T() const;
118 inline void operator=(const SubDimensionedField<Type, GeoMesh>&);
120 //- Allow cast to a const DimensionedField<Type, GeoMesh>&
121 inline operator const DimensionedField<Type, GeoMesh>&() const;
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
127 } // End namespace Foam
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
131 #include "SubDimensionedFieldI.H"
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137 // ************************************************************************* //