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 -------------------------------------------------------------------------------
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>
31 inline constexpr Foam::Field<Type>::Field() noexcept
32 {}
33 
34 
35 template<class Type>
36 inline Foam::Field<Type>::Field(const label len)
37 :
38  List<Type>(len)
39 {}
40 
41 
42 template<class Type>
43 inline Foam::Field<Type>::Field(const label len, const Type& val)
44 :
45  List<Type>(len, val)
46 {}
47 
48 
49 template<class Type>
50 inline Foam::Field<Type>::Field(const label len, Foam::zero)
51 :
52  List<Type>(len, Foam::zero{})
53 {}
54 
55 
56 template<class Type>
57 inline Foam::Field<Type>::Field(Foam::one, const Type& val)
58 :
59  List<Type>(Foam::one{}, val)
60 {}
61 
62 
63 template<class Type>
65 :
66  List<Type>(Foam::one{}, std::move(val))
67 {}
68 
69 
70 template<class Type>
72 :
73  List<Type>(Foam::one{}, Foam::zero{})
74 {}
75 
76 
77 template<class Type>
79 :
80  List<Type>(fld)
81 {}
82 
83 
84 template<class Type>
85 inline Foam::Field<Type>::Field(const UList<Type>& list)
86 :
87  List<Type>(list)
88 {}
89 
90 
91 template<class Type>
92 template<class Addr>
94 :
95  List<Type>(list)
96 {}
97 
98 
99 template<class Type>
101 :
102  List<Type>(std::move(static_cast<List<Type>&>(fld)))
103 {}
104 
105 
106 template<class Type>
108 :
109  List<Type>(std::move(list))
110 {}
111 
112 
113 template<class Type>
114 template<int SizeMin>
116 :
117  List<Type>()
118 {
119  List<Type>::transfer(list);
120 }
121 
122 
123 template<class Type>
125 :
126  List<Type>(fld, reuse)
127 {}
128 
129 
130 template<class Type>
131 inline Foam::Field<Type>::Field(const tmp<Field<Type>>& tfld)
132 :
133  List<Type>(tfld.constCast(), tfld.movable())
134 {
135  tfld.clear();
136 }
137 
138 
139 template<class Type>
141 :
142  List<Type>(is)
143 {}
144 
145 
146 template<class Type>
148 {
149  return tmp<Field<Type>>::New(*this);
150 }
151 
152 
153 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
154 
155 template<class Type>
157 {
159 }
160 
161 
162 template<class Type>
164 {
166 }
167 
168 
169 template<class Type>
170 template<class Addr>
171 inline void Foam::Field<Type>::operator=
172 (
174 )
175 {
177 }
178 
179 
180 template<class Type>
182 {
184 }
185 
186 
187 template<class Type>
189 {
191 }
192 
193 
194 template<class Type>
195 template<int SizeMin>
197 {
199 }
200 
201 
202 template<class Type>
203 inline void Foam::Field<Type>::operator=(const Type& val)
204 {
206 }
207 
208 
209 template<class Type>
211 {
213 }
214 
215 
216 // ************************************************************************* //
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: BitOps.H:56
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
SubField is a Field obtained as a section of another Field, without its own allocation. SubField is derived from a SubList rather than a List.
Definition: Field.H:70
Base for lists with indirect addressing, templated on the list contents type and the addressing type...
void rhs(fvMatrix< typename Expr::value_type > &m, const Expr &expression)
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
Definition: DynamicList.H:51
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
Definition: Field.H:69
void clear()
Clear the list, i.e. set size to zero.
Definition: ListI.H:133
tmp< Field< Type > > clone() const
Clone.
Definition: FieldI.H:140
const direction noexcept
Definition: scalarImpl.H:265
void operator=(const Field< Type > &)
Copy assignment.
Definition: Field.C:781
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< ' ';}gmvFile<< nl;for(const word &name :lagrangianScalarNames){ IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
Definition: zero.H:57
constexpr Field() noexcept
Default construct.
Definition: FieldI.H:24
A class for managing temporary objects.
Definition: HashPtrTable.H:50
A non-counting (dummy) refCount.
Definition: refCount.H:55
Namespace for OpenFOAM.
A class representing the concept of 1 (one) that can be used to avoid manipulating objects known to b...
Definition: one.H:56