SubDimensionedFieldI.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 \*---------------------------------------------------------------------------*/
25 
26 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
27 
28 template<class Type, class GeoMesh>
30 (
31  const SubField<Type>& slist
32 )
33 :
34  SubField<Type>(slist)
35 {}
36 
37 template<class Type, class GeoMesh>
39 (
40  const UList<Type>& list,
41  const label subSize
42 )
43 :
44  SubField<Type>(list, subSize)
45 {}
46 
47 
48 template<class Type, class GeoMesh>
50 (
51  const UList<Type>& list,
52  const label subSize,
53  const label startIndex
54 )
55 :
56  SubField<Type>(list, subSize, startIndex)
57 {}
58 
59 
60 template<class Type, class GeoMesh>
62 (
64 )
65 :
67  SubField<Type>(sfield)
68 {}
69 
70 
71 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
72 
73 template<class Type, class GeoMesh>
76 {
77  return NullObjectRef<SubDimensionedField<Type, GeoMesh>>();
78 }
79 
80 
81 template<class Type, class GeoMesh>
82 inline
84 <
86 >
88 (
89  const direction d
90 ) const
91 {
92  return
93  (
94  reinterpret_cast<const DimensionedField<Type, GeoMesh>&>(*this)
95  ).component(d);
96 }
97 
98 
99 template<class Type, class GeoMesh>
102 {
103  return
104  (
105  reinterpret_cast<const DimensionedField<Type, GeoMesh>&>(*this)
106  ).T();
107 }
108 
109 
110 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
111 
112 template<class Type, class GeoMesh>
113 inline void Foam::SubDimensionedField<Type, GeoMesh>::operator=
114 (
116 )
117 {
118  dimensions() = rhs.dimensions();
120 }
121 
122 
123 template<class Type, class GeoMesh>
124 inline Foam::SubDimensionedField<Type, GeoMesh>::operator
126 {
127  return *(reinterpret_cast<const DimensionedField<Type, GeoMesh>*>(this));
128 }
129 
130 
131 // ************************************************************************* //
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:46
Reference counter for various OpenFOAM components.
Definition: refCount.H:49
tmp< DimensionedField< cmptType, GeoMesh > > component(const direction) const
Return a component field of the field.
Pre-declare related SubField type.
Definition: Field.H:61
Pre-declare SubField and related Field type.
Definition: Field.H:57
SubDimensionedField is a DimensionedField obtained as a section of another DimensionedField.
static const SubDimensionedField< Type, GeoMesh > & null()
Return a null SubDimensionedField.
tmp< DimensionedField< Type, GeoMesh > > T() const
Return the field transpose (only defined for second rank tensors)
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
A class for managing temporary objects.
Definition: PtrList.H:54
SubDimensionedField(const SubField< Type > &slist)
Construct from a SubField.