SubDimensionedField.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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
19  for more details.
20 
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/>.
23 
24 Class
25  Foam::SubDimensionedField
26 
27 Description
28  SubDimensionedField is a DimensionedField obtained as a section of another
29  DimensionedField.
30 
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.
34 
35 SourceFiles
36  SubDimensionedFieldI.H
37 
38 \*---------------------------------------------------------------------------*/
39 
40 #ifndef SubDimensionedField_H
41 #define SubDimensionedField_H
42 
43 #include "Field.H"
44 #include "SubField.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 /*---------------------------------------------------------------------------*\
52  Class SubDimensionedField Declaration
53 \*---------------------------------------------------------------------------*/
54 
55 template<class Type, class GeoMesh>
57 :
58  public regIOobject,
59  public SubField<Type>
60 {
61 
62 public:
63 
64  // Public typedefs
65 
66  typedef typename GeoMesh::Mesh Mesh;
67  typedef typename Field<Type>::cmptType cmptType;
68 
69 
70  // Constructors
71 
72  //- Construct from a SubField
73  inline SubDimensionedField
74  (
75  const SubField<Type>& slist
76  );
77 
78  //- Construct from a UList and size
79  inline SubDimensionedField
80  (
81  const UList<Type>& list,
82  const label subSize
83  );
84 
85  //- Construct from a UList start and end indices
86  inline SubDimensionedField
87  (
88  const UList<Type>& list,
89  const label subSize,
90  const label startIndex
91  );
92 
93  //- Construct as copy
94  inline SubDimensionedField
95  (
97  );
98 
99 
100  // Member functions
101 
102  //- Return a null SubDimensionedField
103  static inline const SubDimensionedField<Type, GeoMesh>& null();
104 
105  //- Return a component field of the field
107  (
108  const direction
109  ) const;
110 
111  //- Return the field transpose (only defined for second rank tensors)
113 
114 
115  // Member operators
116 
117  //- Assignment
118  inline void operator=(const SubDimensionedField<Type, GeoMesh>&);
119 
120  //- Allow cast to a const DimensionedField<Type, GeoMesh>&
121  inline operator const DimensionedField<Type, GeoMesh>&() const;
122 };
123 
124 
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126 
127 } // End namespace Foam
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 #include "SubDimensionedFieldI.H"
132 
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 
135 #endif
136 
137 // ************************************************************************* //
void operator=(const SubDimensionedField< Type, GeoMesh > &)
Assignment.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
uint8_t direction
Definition: direction.H:45
pTraits< Type >::cmptType cmptType
Component type.
Definition: Field.H:86
Pre-declare related SubField type.
Definition: Field.H:61
tmp< DimensionedField< Type, GeoMesh > > T() const
Return the field transpose (only defined for second rank tensors)
SubDimensionedField is a DimensionedField obtained as a section of another DimensionedField.
static const SubDimensionedField< Type, GeoMesh > & null()
Return a null SubDimensionedField.
MESH Mesh
Definition: GeoMesh.H:61
Field< Type >::cmptType cmptType
tmp< DimensionedField< cmptType, GeoMesh > > component(const direction) const
Return a component field of the field.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:65
A class for managing temporary objects.
Definition: PtrList.H:53
SubDimensionedField(const SubField< Type > &slist)
Construct from a SubField.
Namespace for OpenFOAM.