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-------------------------------------------------------------------------------
10License
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
30template<class Type, class GeoMesh>
32(
33 const SubField<Type>& sfield
34)
35:
36 SubField<Type>(sfield)
37{}
38
39
40template<class Type, class GeoMesh>
42(
43 const UList<Type>& list,
44 const label subSize
45)
46:
47 SubField<Type>(list, subSize)
48{}
49
50
51template<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
63template<class Type, class GeoMesh>
65(
66 const UList<Type>& list,
67 const labelRange& range
68)
69:
70 SubField<Type>(list, range)
71{}
72
73
74template<class Type, class GeoMesh>
76(
77 const labelRange& range,
78 const UList<Type>& list
79)
80:
81 SubField<Type>(range, list)
82{}
83
84
85template<class Type, class GeoMesh>
87(
89)
90:
91 refCount(),
92 SubField<Type>(sfield)
93{}
94
95
96// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
97
98template<class Type, class GeoMesh>
101{
102 return NullObjectRef<SubDimensionedField<Type, GeoMesh>>();
103}
104
105
106template<class Type, class GeoMesh>
107inline
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
124template<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
137template<class Type, class GeoMesh>
139(
141)
142{
143 dimensions() = rhs.dimensions();
145}
146
147
148template<class Type, class GeoMesh>
151{
152 return *(reinterpret_cast<const DimensionedField<Type, GeoMesh>*>(this));
153}
154
155
156// ************************************************************************* //
scalar range
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Generic templated field type.
Definition: Field.H:82
SubDimensionedField is a DimensionedField obtained as a section of another DimensionedField.
tmp< DimensionedField< Type, GeoMesh > > T() const
Return the field transpose (only defined for second rank tensors)
static const SubDimensionedField< Type, GeoMesh > & null()
Return a null SubDimensionedField.
SubField is a Field obtained as a section of another Field, without its own allocation....
Definition: SubField.H:62
void operator=(const SubField< Type > &)
Copy assign via UList operator. Takes linear time.
Definition: SubFieldI.H:145
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: UList.H:94
A range or interval of labels defined by a start and a size.
Definition: labelRange.H:58
Reference counter for various OpenFOAM components.
Definition: refCount.H:51
A class for managing temporary objects.
Definition: tmp.H:65
uint8_t direction
Definition: direction.H:56