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
26 Foam::SubDimensionedField
29 SubDimensionedField is a DimensionedField obtained as a section of another
32 Thus it is itself unallocated so that no storage is allocated or
33 deallocated during its use. To achieve this behaviour,
34 SubDimensionedField is derived from SubField rather than Field.
37 SubDimensionedFieldI.H
39 \*---------------------------------------------------------------------------*/
41 #ifndef SubDimensionedField_H
42 #define SubDimensionedField_H
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 /*---------------------------------------------------------------------------*\
53 Class SubDimensionedField Declaration
54 \*---------------------------------------------------------------------------*/
56 template<class Type, class GeoMesh>
57 class SubDimensionedField
67 typedef typename GeoMesh::Mesh Mesh;
68 typedef typename Field<Type>::cmptType cmptType;
73 //- Construct from a SubField
74 inline SubDimensionedField
76 const SubField<Type>& slist
79 //- Construct from a UList and size
80 inline SubDimensionedField
82 const UList<Type>& list,
86 //- Construct from a UList start and end indices
87 inline SubDimensionedField
89 const UList<Type>& list,
91 const label startIndex
95 inline SubDimensionedField
97 const SubDimensionedField<cmptType, GeoMesh>& sfield
103 //- Return a null SubDimensionedField
104 static inline const SubDimensionedField<Type, GeoMesh>& null();
106 //- Return a component field of the field
107 inline tmp<DimensionedField<cmptType, GeoMesh> > component
112 //- Return the field transpose (only defined for second rank tensors)
113 tmp<DimensionedField<Type, GeoMesh> > T() const;
119 inline void operator=(const SubDimensionedField<Type, GeoMesh>&);
121 //- Allow cast to a const DimensionedField<Type, GeoMesh>&
122 inline operator const DimensionedField<Type, GeoMesh>&() const;
126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 } // End namespace Foam
130 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 #include "SubDimensionedFieldI.H"
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138 // ************************************************************************* //