FieldI.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) 2018-2021 OpenCFD Ltd.
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// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
29
30template<class Type>
32{
33 return NullObjectRef<Field<Type>>();
34}
35
36
37// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
38
39template<class Type>
40inline constexpr Foam::Field<Type>::Field() noexcept
41:
42 List<Type>()
43{}
44
45
46template<class Type>
47inline Foam::Field<Type>::Field(const label len)
48:
49 List<Type>(len)
50{}
51
52
53template<class Type>
54inline Foam::Field<Type>::Field(const label len, const Type& val)
55:
56 List<Type>(len, val)
57{}
58
59
60template<class Type>
61inline Foam::Field<Type>::Field(const label len, const Foam::zero)
62:
63 List<Type>(len, Zero)
64{}
65
66
67template<class Type>
68inline Foam::Field<Type>::Field(const Foam::one, const Type& val)
69:
70 List<Type>(Foam::one{}, val)
71{}
72
73
74template<class Type>
75inline Foam::Field<Type>::Field(const Foam::one, Type&& val)
76:
77 List<Type>(Foam::one{}, std::move(val))
78{}
79
80
81template<class Type>
83:
84 List<Type>(Foam::one{}, Zero)
85{}
86
87
88template<class Type>
90:
91 List<Type>(fld)
92{}
93
94
95template<class Type>
97:
98 List<Type>(list)
99{}
100
101
102template<class Type>
103template<class Addr>
105:
106 List<Type>(list)
107{}
108
110template<class Type>
113 List<Type>()
114{
116}
117
119template<class Type>
122 List<Type>()
123{
125}
126
128template<class Type>
129template<int SizeMin>
132 List<Type>()
133{
135}
136
138template<class Type>
140:
141 List<Type>(fld, reuse)
142{}
143
144
145template<class Type>
147:
148 List<Type>(tfld.constCast(), tfld.movable())
149{
150 tfld.clear();
151}
152
153
154template<class Type>
156:
157 List<Type>(is)
158{}
159
160
161template<class Type>
163{
164 return tmp<Field<Type>>::New(*this);
165}
166
167
168// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
169
170template<class Type>
172{
174}
175
176
177template<class Type>
179{
181}
182
183
184template<class Type>
185template<class Addr>
187(
189)
190{
192}
193
194
195template<class Type>
197{
199}
200
201
202template<class Type>
204{
206}
207
208
209template<class Type>
210template<int SizeMin>
212{
214}
215
216
217template<class Type>
218inline void Foam::Field<Type>::operator=(const Type& val)
219{
221}
222
223
224template<class Type>
226{
229
230
231// ************************************************************************* //
Info<< nl<< "Wrote faMesh in vtk format: "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.mesh().time().globalPath()/"finiteArea-edges"));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Definition: DynamicList.H:72
Generic templated field type.
Definition: Field.H:82
static const Field< Type > & null()
Return nullObject reference Field.
Definition: FieldI.H:31
void operator=(const Field< Type > &)
Copy assignment.
Definition: Field.C:641
constexpr Field() noexcept
Default construct.
Definition: FieldI.H:40
tmp< Field< Type > > clone() const
Clone.
Definition: FieldI.H:162
Base for lists with indirect addressing, templated on the list contents type and the addressing type....
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: List.H:77
void operator=(const UList< T > &a)
Assignment to UList operator. Takes linear time.
Definition: List.C:480
void clear()
Clear the list, i.e. set size to zero.
Definition: ListI.H:116
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
A class representing the concept of 1 (one) that can be used to avoid manipulating objects known to b...
Definition: one.H:62
A class for managing temporary objects.
Definition: tmp.H:65
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
Definition: zero.H:63
Namespace for OpenFOAM.
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:131
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.