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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2016 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 \*---------------------------------------------------------------------------*/
27 
28 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
29 
30 template<class Type, class GeoMesh>
32 (
33  const SubField<Type>& sfield
34 )
35 :
36  SubField<Type>(sfield)
37 {}
38 
39 
40 template<class Type, class GeoMesh>
42 (
43  const UList<Type>& list,
44  const label subSize
45 )
46 :
47  SubField<Type>(list, subSize)
48 {}
49 
50 
51 template<class Type, class GeoMesh>
53 (
54  const UList<Type>& list,
55  const label subSize,
56  const label startIndex
57 )
58 :
59  SubField<Type>(list, subSize, startIndex)
60 {}
61 
62 
63 template<class Type, class GeoMesh>
65 (
66  const UList<Type>& list,
67  const labelRange& range
68 )
69 :
70  SubField<Type>(list, range)
71 {}
72 
73 
74 template<class Type, class GeoMesh>
76 (
77  const labelRange& range,
78  const UList<Type>& list
79 )
80 :
81  SubField<Type>(range, list)
82 {}
83 
84 
85 template<class Type, class GeoMesh>
87 (
89 )
90 :
91  refCount(),
92  SubField<Type>(sfield)
93 {}
94 
95 
96 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
97 
98 template<class Type, class GeoMesh>
101 {
102  return NullObjectRef<SubDimensionedField<Type, GeoMesh>>();
103 }
104 
105 
106 template<class Type, class GeoMesh>
107 inline
108 Foam::tmp
109 <
111 >
113 (
114  const direction d
115 ) const
116 {
117  return
118  (
119  reinterpret_cast<const DimensionedField<Type, GeoMesh>&>(*this)
120  ).component(d);
121 }
122 
123 
124 template<class Type, class GeoMesh>
127 {
128  return
129  (
130  reinterpret_cast<const DimensionedField<Type, GeoMesh>&>(*this)
131  ).T();
132 }
133 
134 
135 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
136 
137 template<class Type, class GeoMesh>
139 (
141 )
142 {
143  dimensions() = rhs.dimensions();
145 }
146 
147 
148 template<class Type, class GeoMesh>
151 {
152  return *(reinterpret_cast<const DimensionedField<Type, GeoMesh>*>(this));
153 }
154 
155 
156 // ************************************************************************* //
Foam::SubDimensionedField::T
tmp< DimensionedField< Type, GeoMesh > > T() const
Return the field transpose (only defined for second rank tensors)
Definition: SubDimensionedFieldI.H:126
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::refCount
Reference counter for various OpenFOAM components.
Definition: refCount.H:50
Foam::SubDimensionedField::null
static const SubDimensionedField< Type, GeoMesh > & null()
Return a null SubDimensionedField.
Definition: SubDimensionedFieldI.H:100
Foam::SubField
SubField is a Field obtained as a section of another Field, without its own allocation....
Definition: Field.H:64
Foam::Field
Generic templated field type.
Definition: Field.H:63
Foam::labelRange
A range or interval of labels defined by a start and a size.
Definition: labelRange.H:55
Foam::SubDimensionedField
SubDimensionedField is a DimensionedField obtained as a section of another DimensionedField.
Definition: SubDimensionedField.H:57
Foam::SubField::operator=
void operator=(const SubField< Type > &)
Copy assign via UList operator. Takes linear time.
Definition: SubFieldI.H:145
range
scalar range
Definition: LISASMDCalcMethod1.H:12
Foam::UList< Type >
Foam::direction
uint8_t direction
Definition: direction.H:52
Foam::SubDimensionedField::component
tmp< DimensionedField< cmptType, GeoMesh > > component(const direction d) const
Return a component field of the field.
Foam::SubDimensionedField::SubDimensionedField
SubDimensionedField(const SubField< Type > &sfield)
Construct from a SubField.
Definition: SubDimensionedFieldI.H:32
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54