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