OpenFOAM logo
The Open Source CFD Toolbox
  Programmer’s C++ Doxygen OpenCFD Solutions Contact OpenFOAM

SubDimensionedField.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2007 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM; if not, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Class
00026     SubDimensionedField
00027 
00028 Description
00029     SubDimensionedField is a DimensionedField obtained as a section of another
00030     DimensionedField.  Thus it is itself unallocated so that no storage is
00031     allocated or de-allocated during it's use.  To achieve this behaviour,
00032     SubDimensionedField is derived from SubField rather than Field.
00033 
00034 SourceFiles
00035     SubDimensionedFieldI.H
00036 
00037 \*---------------------------------------------------------------------------*/
00038 
00039 #ifndef SubDimensionedField_H
00040 #define SubDimensionedField_H
00041 
00042 #include "Field.H"
00043 #include "SubField.H"
00044 
00045 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00046 
00047 namespace Foam
00048 {
00049 
00050 /*---------------------------------------------------------------------------*\
00051                       Class SubDimensionedField Declaration
00052 \*---------------------------------------------------------------------------*/
00053 
00054 template<class Type, class GeoMesh>
00055 class SubDimensionedField
00056 :
00057     public regIOobject,
00058     public SubField<Type>
00059 {
00060 
00061 public:
00062 
00063     // Public typedefs
00064 
00065         typedef typename GeoMesh::Mesh Mesh;
00066         typedef typename Field<Type>::cmptType cmptType;
00067 
00068 
00069     // Constructors
00070 
00071         //- Construct from a SubField
00072         inline SubDimensionedField
00073         (
00074             const SubField<Type>& slist
00075         );
00076 
00077         //- Construct from a UList and size
00078         inline SubDimensionedField
00079         (
00080             const UList<Type>& list,
00081             const label subSize
00082         );
00083 
00084         //- Construct from a UList start and end indices
00085         inline SubDimensionedField
00086         (
00087             const UList<Type>& list,
00088             const label subSize,
00089             const label startIndex
00090         );
00091 
00092         //- Construct as copy
00093         inline SubDimensionedField
00094         (
00095             const SubDimensionedField<cmptType, GeoMesh>& sfield
00096         );
00097 
00098 
00099     // Member functions
00100 
00101         //- Return a null SubDimensionedField
00102         static inline SubDimensionedField<Type, GeoMesh>& null();
00103 
00104         //- Return a component field of the field
00105         inline tmp<DimensionedField<cmptType, GeoMesh> > component
00106         (
00107             const direction
00108         ) const;
00109 
00110         //- Return the field transpose (only defined for second rank tensors)
00111         tmp<DimensionedField<Type, GeoMesh> > T() const;
00112 
00113 
00114     // Member operators
00115 
00116         //- Assignment
00117         inline void operator=(const SubDimensionedField<Type, GeoMesh>&);
00118 
00119         //- Allow cast to a const DimensionedField<Type, GeoMesh>&
00120         inline operator const DimensionedField<Type, GeoMesh>&() const;
00121 };
00122 
00123 
00124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00125 
00126 } // End namespace Foam
00127 
00128 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00129 
00130 #include "SubDimensionedFieldI.H"
00131 
00132 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00133 
00134 #endif
00135 
00136 // ************************************************************************* //
Copyright © 2000-2007 OpenCFD Ltd