FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

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-2010 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
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your 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, see <http://www.gnu.org/licenses/>.
00023 
00024 Class
00025     Foam::SubDimensionedField
00026 
00027 Description
00028     SubDimensionedField is a DimensionedField obtained as a section of another
00029     DimensionedField.
00030 
00031     Thus it is itself unallocated so that no storage is allocated or
00032     deallocated during its use.  To achieve this behaviour,
00033     SubDimensionedField is derived from SubField rather than Field.
00034 
00035 SourceFiles
00036     SubDimensionedFieldI.H
00037 
00038 \*---------------------------------------------------------------------------*/
00039 
00040 #ifndef SubDimensionedField_H
00041 #define SubDimensionedField_H
00042 
00043 #include <OpenFOAM/Field.H>
00044 #include <OpenFOAM/SubField.H>
00045 
00046 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00047 
00048 namespace Foam
00049 {
00050 
00051 /*---------------------------------------------------------------------------*\
00052                       Class SubDimensionedField Declaration
00053 \*---------------------------------------------------------------------------*/
00054 
00055 template<class Type, class GeoMesh>
00056 class SubDimensionedField
00057 :
00058     public regIOobject,
00059     public SubField<Type>
00060 {
00061 
00062 public:
00063 
00064     // Public typedefs
00065 
00066         typedef typename GeoMesh::Mesh Mesh;
00067         typedef typename Field<Type>::cmptType cmptType;
00068 
00069 
00070     // Constructors
00071 
00072         //- Construct from a SubField
00073         inline SubDimensionedField
00074         (
00075             const SubField<Type>& slist
00076         );
00077 
00078         //- Construct from a UList and size
00079         inline SubDimensionedField
00080         (
00081             const UList<Type>& list,
00082             const label subSize
00083         );
00084 
00085         //- Construct from a UList start and end indices
00086         inline SubDimensionedField
00087         (
00088             const UList<Type>& list,
00089             const label subSize,
00090             const label startIndex
00091         );
00092 
00093         //- Construct as copy
00094         inline SubDimensionedField
00095         (
00096             const SubDimensionedField<cmptType, GeoMesh>& sfield
00097         );
00098 
00099 
00100     // Member functions
00101 
00102         //- Return a null SubDimensionedField
00103         static inline const SubDimensionedField<Type, GeoMesh>& null();
00104 
00105         //- Return a component field of the field
00106         inline tmp<DimensionedField<cmptType, GeoMesh> > component
00107         (
00108             const direction
00109         ) const;
00110 
00111         //- Return the field transpose (only defined for second rank tensors)
00112         tmp<DimensionedField<Type, GeoMesh> > T() const;
00113 
00114 
00115     // Member operators
00116 
00117         //- Assignment
00118         inline void operator=(const SubDimensionedField<Type, GeoMesh>&);
00119 
00120         //- Allow cast to a const DimensionedField<Type, GeoMesh>&
00121         inline operator const DimensionedField<Type, GeoMesh>&() const;
00122 };
00123 
00124 
00125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00126 
00127 } // End namespace Foam
00128 
00129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00130 
00131 #include <OpenFOAM/SubDimensionedFieldI.H>
00132 
00133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00134 
00135 #endif
00136 
00137 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines