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 | 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
26Class
27 Foam::SubDimensionedField
28
29Description
30 SubDimensionedField is a DimensionedField obtained as a section of another
31 DimensionedField.
32
33 Thus it is itself unallocated so that no storage is allocated or
34 deallocated during its use. To achieve this behaviour,
35 SubDimensionedField is derived from SubField rather than Field.
36
37SourceFiles
38 SubDimensionedFieldI.H
39
40\*---------------------------------------------------------------------------*/
41
42#ifndef SubDimensionedField_H
43#define SubDimensionedField_H
44
45#include "Field.H"
46#include "SubField.H"
47
48// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49
50namespace Foam
51{
52
53/*---------------------------------------------------------------------------*\
54 Class SubDimensionedField Declaration
55\*---------------------------------------------------------------------------*/
56
57template<class Type, class GeoMesh>
59:
60 public regIOobject,
61 public SubField<Type>
62{
63
64public:
65
66 // Public typedefs
68 typedef typename GeoMesh::Mesh Mesh;
69 typedef typename Field<Type>::cmptType cmptType;
70
71
72 // Constructors
73
74 //- Construct from a SubField
75 inline SubDimensionedField(const SubField<Type>& sfield);
76
77 //- Construct from a UList and size
79 (
80 const UList<Type>& list,
81 const label subSize
82 );
83
84 //- Construct from a UList start and end indices
86 (
87 const UList<Type>& list,
88 const label subSize,
89 const label startIndex
90 );
91
92 //- Construct from UList and a (start,size) range.
93 // The range is subsetted with the list size itself to ensure that the
94 // result always addresses a valid section of the list.
96 (
97 const UList<Type>& list,
98 const labelRange& range
99 );
100
101 //- Construct from UList and a (start,size) range, but bypassing
102 //- run-time range checking.
104 (
105 const labelRange& range,
106 const UList<Type>& list
107 );
108
109
110 //- Construct as copy
112 (
114 );
115
116
117 // Member functions
118
119 //- Return a null SubDimensionedField
120 static inline const SubDimensionedField<Type, GeoMesh>& null();
121
122 //- Return a component field of the field
124 (
125 const direction d
126 ) const;
127
128 //- Return the field transpose (only defined for second rank tensors)
130
131
132 // Member operators
133
134 //- Assignment
135 inline void operator=(const SubDimensionedField<Type, GeoMesh>& rhs);
136
137 //- Allow cast to a const DimensionedField<Type, GeoMesh>&
138 inline operator const DimensionedField<Type, GeoMesh>&() const;
139};
140
141
142// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143
144} // End namespace Foam
145
146// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147
148#include "SubDimensionedFieldI.H"
149
150// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151
152#endif
153
154// ************************************************************************* //
scalar range
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
MESH Mesh
Definition: GeoMesh.H:62
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)
tmp< DimensionedField< cmptType, GeoMesh > > component(const direction d) const
Return a component field of the field.
Field< Type >::cmptType cmptType
static const SubDimensionedField< Type, GeoMesh > & null()
Return a null SubDimensionedField.
SubDimensionedField(const SubDimensionedField< cmptType, GeoMesh > &sfield)
Construct as copy.
void operator=(const SubDimensionedField< Type, GeoMesh > &rhs)
Assignment.
SubField is a Field obtained as a section of another Field, without its own allocation....
Definition: SubField.H:62
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
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
Definition: edge.H:66
A range or interval of labels defined by a start and a size.
Definition: labelRange.H:58
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:76
A class for managing temporary objects.
Definition: tmp.H:65
Namespace for OpenFOAM.
uint8_t direction
Definition: direction.H:56