Loading...
Searching...
No Matches
FixedList.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 Copyright (C) 2017-2025 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::FixedList
29
30Description
31 A 1D vector of objects of type <T> with a fixed length <N>.
32
33SourceFiles
34 FixedList.C
35 FixedListI.H
36 FixedListIO.C
37
38\*---------------------------------------------------------------------------*/
39
40#ifndef Foam_FixedList_H
41#define Foam_FixedList_H
42
43#include "bool.H"
44#include "label.H"
45#include "uLabel.H"
46#include "zero.H"
47#include "stdFoam.H"
48#include "nullObject.H"
49#include "Hash.H"
50#include "ListPolicy.H" // Also includes "contiguous"
51#include "autoPtr.H"
52
53#include <limits>
54
55// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56
57namespace Foam
58{
59
60// Forward Declarations
61
62template<class T, unsigned N> class FixedList;
63template<class T> class UList;
64
65template<class T, unsigned N>
67
68template<class T, unsigned N>
70
71
72/*---------------------------------------------------------------------------*\
73 Class FixedList Declaration
74\*---------------------------------------------------------------------------*/
75
76template<class T, unsigned N>
77class FixedList
78{
79 static_assert
80 (
81 N && N <= std::numeric_limits<int>::max(),
82 "Size must be positive (non-zero) and fit as a signed int value"
83 );
84
85 // Private Data
86
87 //- Vector of values of type T of length N.
88 T v_[N];
89
90
91protected:
92
93 // Protected Member Functions
94
95 //- Write the FixedList with its compound type
96 void writeEntry(Ostream& os) const;
97
98
99public:
100
101 // STL Type Definitions
102
103 //- The value type the FixedList contains
104 typedef T value_type;
106 //- The pointer type for non-const access to value_type items
107 typedef T* pointer;
108
109 //- The pointer type for const access to value_type items
110 typedef const T* const_pointer;
111
112 //- The type used for storing into value_type objects
113 typedef T& reference;
114
115 //- The type used for reading from constant value_type objects.
116 typedef const T& const_reference;
117
118 //- Random access iterator for traversing FixedList
119 typedef T* iterator;
121 //- Random access iterator for traversing FixedList
122 typedef const T* const_iterator;
123
124 //- The type to represent the size of a FixedList
125 typedef label size_type;
126
127 //- The difference between iterator objects
128 typedef label difference_type;
129
130 //- Reverse iterator (non-const access)
131 typedef std::reverse_iterator<iterator> reverse_iterator;
132
133 //- Reverse iterator (const access)
134 typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
136
137 // Static Functions
138
139 //- Return a null FixedList (reference to a nullObject).
140 //- Read/write access is questionable
141 static const FixedList<T, N>& null() noexcept
142 {
144 }
146
147 // Constructors
148
149 //- Default construct
150 FixedList() = default;
151
152 //- Construct and initialize all entries to given value
153 inline explicit FixedList(const T& val);
154
155 //- Construct and initialize all entries to zero
156 inline explicit FixedList(Foam::zero);
157
158 //- Copy construct
159 inline FixedList(const FixedList<T, N>& list);
160
161 //- Move construct by using move assignment for the individual
162 //- list elements
163 inline FixedList(FixedList<T, N>&& list);
165 //- Construct from an initializer list. Runtime size check
166 inline FixedList(std::initializer_list<T> list);
167
168 //- Construct from UList. Runtime size check
169 inline explicit FixedList(const UList<T>& list);
170
171 //- Copy construct from a subset of the input. No size check
172 template<unsigned AnyNum>
173 inline FixedList
174 (
176 const FixedList<label, N>& indices
177 );
178
179 //- Copy construct from a subset of the input. No size check
181 (
182 const UList<T>& list,
183 const FixedList<label, N>& indices
184 );
186 //- Construct from Istream
187 explicit FixedList(Istream& is);
188
189 //- Clone
191
192
193 // Member Functions
194
195 // Access
197 //- Return pointer to the underlying array serving as data storage.
198 inline const T* cdata() const noexcept;
199
200 //- Return pointer to the underlying array serving as data storage.
201 inline T* data() noexcept;
202
203 //- Return pointer to the underlying array serving as data storage,
204 // reinterpreted as byte data
205 // \note Only meaningful for contiguous data
206 inline const char* cdata_bytes() const noexcept;
207
208 //- Return pointer to the underlying array serving as data storage,
209 // reinterpreted as byte data
210 // \note Only meaningful for contiguous data
211 inline char* data_bytes() noexcept;
213 //- Number of contiguous bytes for the list data,
214 // \note Only meaningful for contiguous data
215 inline static std::streamsize size_bytes() noexcept;
216
217 //- Number of contiguous bytes for the list data,
218 //- runtime FatalError if type is not contiguous
219 static std::streamsize byteSize();
220
221 //- Element access using compile-time indexing
222 template<unsigned Index>
223 inline T& get() noexcept;
224
225 //- Element access using compile-time indexing
226 template<unsigned Index>
227 inline const T& get() const noexcept;
228
229 //- Access first element of the list, position [0]
230 inline T& front() noexcept;
231
232 //- Access first element of the list, position [0]
233 inline const T& front() const noexcept;
234
235 //- Access last element of the list, position [N-1]
236 inline T& back() noexcept;
237
238 //- Access last element of the list, position [N-1]
239 inline const T& back() const noexcept;
240
241 //- Return the forward circular index, i.e. next index
242 //- which returns to the first at the end of the list
243 inline label fcIndex(const label i) const noexcept;
244
245 //- Return forward circular value (ie, next value in the list)
246 inline const T& fcValue(const label i) const;
247
248 //- Return forward circular value (ie, next value in the list)
249 inline T& fcValue(const label i);
251 //- Return the reverse circular index, i.e. previous index
252 //- which returns to the last at the beginning of the list
253 inline label rcIndex(const label i) const noexcept;
254
255 //- Return reverse circular value (ie, previous value in the list)
256 inline const T& rcValue(const label i) const;
257
258 //- Return reverse circular value (ie, previous value in the list)
259 inline T& rcValue(const label i);
260
261
262 // Check
263
264 //- Check start is within valid range [0,size)
265 inline void checkStart(const label start) const;
267 //- Check size is identical to template parameter N
268 inline void checkSize(const label size) const;
269
270 //- Check index is within valid range [0,N)
271 inline void checkIndex(const label i) const;
272
273 //- True if all entries have identical values, and list is non-empty
274 inline bool uniform() const;
275
276
277 // Search
278
279 //- True if the value is contained in the list.
280 inline bool contains(const T& val) const;
281
282 //- Is the value contained in the list?
283 // \param val The value to search for
284 // \param pos The first position to examine (no-op if -ve)
285 // \param len The length of the search region (-ve until the end)
286 // \return true if found.
287 inline bool contains(const T& val, label pos, label len = -1) const;
288
289 //- Find index of the first occurrence of the value.
290 // \param val The value to search for
291 // \return position in list or -1 if not found.
292 label find(const T& val) const;
293
294 //- Find index of the first occurrence of the value.
295 // \param val The value to search for
296 // \param pos The first position to examine (no-op if -ve)
297 // \param len The length of the search region (-ve until the end)
298 // \return position in list or -1 if not found.
299 label find(const T& val, label pos, label len = -1) const;
300
301 //- Find index of the last occurrence of the value.
302 // Any occurrences after the end pos are ignored.
303 // Linear search.
304 // \return position in list or -1 if not found.
305 label rfind(const T& val, label pos = -1) const;
307
308 // Edit
309
310 //- Dummy function, to make FixedList consistent with List
311 //- Any resizing is ignored (Fatal with bad sizing in full debug).
312 inline void resize(const label n);
313
314 //- Set val for \em all elements.
315 //- Any resizing is ignored (Fatal with bad sizing in full debug).
316 inline void resize_fill(const label n, const T& val);
318 //- Dummy function, to make FixedList consistent with List
319 //- Any resizing is ignored (Fatal with bad sizing in full debug).
320 inline void resize_nocopy(const label n);
321
322 //- Dummy function, to make FixedList consistent with List
323 void setSize(const label n) { this->resize(n); }
324
325 //- Assign all entries to the given value
326 inline void fill(const T& val);
328 //- Assign all entries to zero
329 inline void fill(Foam::zero);
330
331 //- Move element to the first position.
332 void moveFirst(const label i);
334 //- Move element to the last position.
335 void moveLast(const label i);
336
337 //- Swap element with the first element.
338 void swapFirst(const label i);
339
340 //- Swap element with the last element.
341 void swapLast(const label i);
342
343 //- Transfer by swapping using a move assignment for the content
344 //- of the individual list elements
345 inline void transfer(FixedList<T, N>& list);
346
347
348 // Member Operators
349
350 //- Return element of FixedList
351 inline T& operator[](const label i);
352
353 //- Return element of constant FixedList
354 inline const T& operator[](const label i) const;
355
356 //- Assignment to UList operator. Takes linear time
357 inline void operator=(const UList<T>& list);
358
359 //- Assignment to an initializer list. Takes linear time
360 inline void operator=(std::initializer_list<T> list);
362 //- Assign all entries to the given value. fill()
363 inline void operator=(const T& val);
364
365 //- Assign all entries to zero. fill()
366 inline void operator=(Foam::zero);
367
368 //- Copy assignment
369 inline void operator=(const FixedList<T, N>& list);
370
371 //- Move assignment
372 inline void operator=(FixedList<T, N>&& list);
373
375 // Random access iterator (non-const)
376
377 //- Return an iterator to begin traversing the FixedList
378 inline iterator begin() noexcept;
379
380 //- Return an iterator to end traversing the FixedList
381 inline iterator end() noexcept;
382
383 //- Return iterator at offset i from begin,
384 //- clamped to [0,N] range
385 inline iterator begin(const int i) noexcept;
386
387
388 // Random access iterator (const)
389
390 //- Return const_iterator to begin traversing the constant FixedList
391 inline const_iterator cbegin() const noexcept;
393 //- Return const_iterator to end traversing the constant FixedList
394 inline const_iterator cend() const noexcept;
395
396 //- Return const_iterator to begin traversing the constant FixedList
397 inline const_iterator begin() const noexcept;
398
399 //- Return const_iterator to end traversing the constant FixedList
400 inline const_iterator end() const noexcept;
401
402 //- Return const_iterator at offset i from begin,
403 //- clamped to [0,N] range
404 inline const_iterator cbegin(const int i) const noexcept;
405
406 //- Return const_iterator at offset i from begin,
407 //- clamped to [0,N] range
408 inline const_iterator begin(const int i) const noexcept;
409
410
411 // Reverse iterator (non-const)
412
413 //- Return reverse_iterator to begin reverse traversing the FixedList
414 inline reverse_iterator rbegin();
415
416 //- Return reverse_iterator to end reverse traversing the FixedList
417 inline reverse_iterator rend();
418
419
420 // Reverse iterator (const)
421
422 //- Return const_reverse_iterator to begin reverse traversing FixedList
423 inline const_reverse_iterator crbegin() const;
424
425 //- Return const_reverse_iterator to end reverse traversing FixedList
427
428 //- Return const_reverse_iterator to begin reverse traversing FixedList
429 inline const_reverse_iterator rbegin() const;
430
431 //- Return const_reverse_iterator to end reverse traversing FixedList
433
434
435 // STL Member Functions
436
437 //- Always false since zero-sized FixedList is compile-time disabled.
438 static constexpr bool empty() noexcept { return !N; }
439
440 //- Return the number of elements in the FixedList
441 static constexpr label size() noexcept { return N; }
443 //- The dimensioned size (template parameter N) of the FixedList
444 static constexpr unsigned max_size() noexcept { return N; }
445
446 //- Swap lists by swapping the content of the individual list elements
447 // Essentially std::swap_ranges
448 inline void swap(FixedList<T, N>& other);
449
450
451 // STL Member Operators
453 //- Equality operation on FixedLists of the same type.
454 // Returns true when the FixedLists are element-wise equal
455 // (using FixedList::value_type::operator==). Takes linear time
456 bool operator==(const FixedList<T, N>& list) const;
458 //- The opposite of the equality operation. Takes linear time
459 bool operator!=(const FixedList<T, N>& list) const;
460
461 //- Compare two FixedLists lexicographically. Takes linear time
462 bool operator<(const FixedList<T, N>& list) const;
463
464 //- Compare two FixedLists lexicographically. Takes linear time
465 bool operator>(const FixedList<T, N>& list) const;
466
467 //- Return true if !(a > b). Takes linear time
468 bool operator<=(const FixedList<T, N>& list) const;
469
470 //- Return true if !(a < b). Takes linear time
471 bool operator>=(const FixedList<T, N>& list) const;
472
474 // Reading/writing
475
476 //- Read from Istream, discarding contents of existing List
478
479 //- Write the list as a dictionary entry with keyword
480 void writeEntry(const word& keyword, Ostream& os) const;
482 //- Write List, with line-breaks in ASCII when length exceeds shortLen.
483 // Using '0' suppresses line-breaks entirely.
484 Ostream& writeList(Ostream& os, const label shortLen=0) const;
485
487 // IOstream Operators
488
489 //- Use the readList() method to read contents from Istream.
490 friend Istream& operator>> <T, N>
492 Istream& is,
493 FixedList<T, N>& list
494 );
495
497 // Hashing
498
499 //- Hashing functor for FixedList.
500 struct hasher
502 inline unsigned operator()
503 (
504 const FixedList<T, N>& obj,
505 unsigned seed=0
506 ) const
507 {
508 if constexpr (is_contiguous_v<T>)
509 {
510 return Foam::Hasher(obj.cdata(), obj.size_bytes(), seed);
512 else
513 {
514 Foam::Hash<T> op;
515 for (const T& val : obj)
517 seed = op(val, seed);
518 }
519 return seed;
520 }
521 }
522 };
523
524 //- Deprecated(2021-04) hashing functor. Use hasher()
525 // \deprecated(2021-04) - use hasher() functor
526 template<class Unused=bool>
527 struct Hash : FixedList<T, N>::hasher
528 {
529 FOAM_DEPRECATED_FOR(2021-04, "hasher()") Hash() {}
530 };
531
532
533 // Housekeeping
534
535 //- Access first element of the list, position [0] - front()
536 T& first() noexcept { return front(); }
537
538 //- Access first element of the list, position [0] - front()
539 const T& first() const noexcept { return front(); }
540
541 //- Access last element of the list, position [N-1] - back()
542 T& last() noexcept { return back(); }
544 //- Access last element of the list, position [N-1] - back()
545 const T& last() const noexcept { return back(); }
546
547 //- Same as contains()
548 bool found(const T& val, label pos = 0) const
549 {
550 return this->contains(val, pos);
551 }
552
554 //- Deprecated: copy construct from C-array
555 explicit FixedList(const T list[N]) { std::copy_n(list, N, v_); }
556
557 //- Deprecated: assignment from C-array
558 // \deprecated(2023-08) - use other assignment operators
559 void operator=(const T list[N]) { std::copy_n(list, N, v_); }
560};
561
562
563// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
565//- FixedList is contiguous if the type is contiguous
566template<class T, unsigned N>
567struct is_contiguous<FixedList<T, N>> : is_contiguous<T> {};
568
569//- Check for FixedList of labels
570template<class T, unsigned N>
572
573//- Check for FixedList of scalars
574template<class T, unsigned N>
576
577//- Hashing for FixedList data
578template<class T, unsigned N>
579struct Hash<FixedList<T, N>> : FixedList<T, N>::hasher {};
580
581
582// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
584//- Read List contents from Istream, list must have the proper size!
585template<class T, unsigned N>
587{
588 return list.readList(is);
589}
590
592//- Write List to Ostream, as per FixedList::writeList() with default length.
593// The default short-length is given by Foam::ListPolicy::short_length
594template<class T, unsigned N>
598}
599
600
601// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
602
603} // End namespace Foam
604
605// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
607namespace Foam
608{
609
610//- Swap FixedList contents - see FixedList::swap().
611// Essentially std::swap_ranges
612template<class T, unsigned N>
613inline void Swap(FixedList<T, N>& a, FixedList<T, N>& b)
615 a.swap(b);
616}
617
618} // End namespace Foam
620
621// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
622
623#include "FixedListI.H"
625// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
626
627#ifdef NoRepository
628 #include "FixedList.C"
629 #include "FixedListIO.C"
630#endif
632// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
633
634#endif
635
636// ************************************************************************* //
bool found
label n
System bool.
A 1D vector of objects of type <T> with a fixed length <N>.
Definition FixedList.H:73
const_iterator cend() const noexcept
void moveLast(const label i)
Move element to the last position.
Definition FixedList.C:122
FixedList(const FixedList< T, AnyNum > &list, const FixedList< label, N > &indices)
Copy construct from a subset of the input. No size check.
Definition FixedListI.H:75
FixedList(std::initializer_list< T > list)
Construct from an initializer list. Runtime size check.
Definition FixedListI.H:57
label size_type
The type to represent the size of a FixedList.
Definition FixedList.H:140
const T & operator[](const label i) const
Return element of constant FixedList.
Definition FixedListI.H:409
void swap(FixedList< T, N > &other)
Swap lists by swapping the content of the individual list elements.
Definition FixedListI.H:368
void operator=(Foam::zero)
Assign all entries to zero. fill().
Definition FixedListI.H:442
void swapLast(const label i)
Swap element with the last element.
Definition FixedList.C:146
FixedList(Foam::zero)
Construct and initialize all entries to zero.
Definition FixedListI.H:34
FixedList(const UList< T > &list)
Construct from UList. Runtime size check.
Definition FixedListI.H:65
label difference_type
The difference between iterator objects.
Definition FixedList.H:145
void operator=(const FixedList< T, N > &list)
Copy assignment.
Definition FixedListI.H:449
void setSize(const label n)
Definition FixedList.H:437
void resize_nocopy(const label n)
bool operator>=(const FixedList< T, N > &list) const
Return true if !(a < b). Takes linear time.
Definition FixedList.C:213
const_reverse_iterator crbegin() const
bool found(const T &val, label pos=0) const
Same as contains().
Definition FixedList.H:768
void resize_fill(const label n, const scalar &val)
static std::streamsize size_bytes() noexcept
void operator=(const UList< T > &list)
Assignment to UList operator. Takes linear time.
Definition FixedListI.H:419
char * data_bytes() noexcept
T value_type
The value type the FixedList contains.
Definition FixedList.H:105
static constexpr label size() noexcept
Definition FixedList.H:619
const T * const_iterator
Random access iterator for traversing FixedList.
Definition FixedList.H:135
const_iterator cbegin() const noexcept
const T & last() const noexcept
Access last element of the list, position [N-1] - back().
Definition FixedList.H:763
void checkIndex(const label i) const
void swapFirst(const label i)
Swap element with the first element.
Definition FixedList.C:134
void fill(const T &val)
Assign all entries to the given value.
Definition FixedListI.H:342
T * iterator
Random access iterator for traversing FixedList.
Definition FixedList.H:130
T & first() noexcept
Access first element of the list, position [0] - front().
Definition FixedList.H:748
void operator=(const T &val)
Assign all entries to the given value. fill().
Definition FixedListI.H:435
std::reverse_iterator< const_iterator > const_reverse_iterator
Reverse iterator (const access).
Definition FixedList.H:155
bool contains(const scalar &val) const
const scalar & rcValue(const label i) const
bool operator<(const FixedList< T, N > &list) const
Compare two FixedLists lexicographically. Takes linear time.
Definition FixedList.C:176
T & last() noexcept
Access last element of the list, position [N-1] - back().
Definition FixedList.H:758
scalar & get() noexcept
const_reverse_iterator crend() const
void transfer(FixedList< T, N > &list)
Transfer by swapping using a move assignment for the content of the individual list elements.
Definition FixedListI.H:384
const T * cdata() const noexcept
Return pointer to the underlying array serving as data storage.
Definition FixedListI.H:113
const T * const_pointer
The pointer type for const access to value_type items.
Definition FixedList.H:115
static const FixedList< T, N > & null() noexcept
Return a null FixedList (reference to a nullObject). Read/write access is questionable.
Definition FixedList.H:164
void fill(Foam::zero)
Assign all entries to zero.
Definition FixedListI.H:350
T * pointer
The pointer type for non-const access to value_type items.
Definition FixedList.H:110
label rfind(const scalar &val, label pos=-1) const
static std::streamsize byteSize()
scalar & back() noexcept
void resize(const label n)
iterator end() noexcept
void writeEntry(const word &keyword, Ostream &os) const
Write the list as a dictionary entry with keyword.
Definition FixedListIO.C:62
const scalar & fcValue(const label i) const
void operator=(const T list[N])
Deprecated: assignment from C-array.
Definition FixedList.H:784
FixedList(const FixedList< T, N > &list)
Copy construct.
Definition FixedListI.H:41
static constexpr unsigned max_size() noexcept
The dimensioned size (template parameter N) of the FixedList.
Definition FixedList.H:624
bool operator<=(const FixedList< T, N > &list) const
Return true if !(a > b). Takes linear time.
Definition FixedList.C:206
label rcIndex(const label i) const noexcept
std::reverse_iterator< iterator > reverse_iterator
Reverse iterator (non-const access).
Definition FixedList.H:150
bool operator!=(const FixedList< T, N > &list) const
The opposite of the equality operation. Takes linear time.
Definition FixedList.C:192
T & reference
The type used for storing into value_type objects.
Definition FixedList.H:120
void operator=(FixedList< T, N > &&list)
Move assignment.
Definition FixedListI.H:462
scalar * data() noexcept
FixedList(const T list[N])
Deprecated: copy construct from C-array.
Definition FixedList.H:777
void checkSize(const label size) const
const char * cdata_bytes() const noexcept
void writeEntry(Ostream &os) const
Write the FixedList with its compound type.
Definition FixedListIO.C:30
const T & first() const noexcept
Access first element of the list, position [0] - front().
Definition FixedList.H:753
void operator=(std::initializer_list< T > list)
Assignment to an initializer list. Takes linear time.
Definition FixedListI.H:427
FixedList(FixedList< T, N > &&list)
Move construct by using move assignment for the individual list elements.
Definition FixedListI.H:49
void moveFirst(const label i)
Move element to the first position.
Definition FixedList.C:110
Ostream & writeList(Ostream &os, const label shortLen=0) const
Write List, with line-breaks in ASCII when length exceeds shortLen.
Definition FixedListIO.C:78
scalar & front() noexcept
Istream & readList(Istream &is)
Read from Istream, discarding contents of existing List.
FixedList(Istream &is)
Construct from Istream.
Definition FixedListIO.C:52
bool operator==(const FixedList< T, N > &list) const
Equality operation on FixedLists of the same type.
Definition FixedList.C:162
reverse_iterator rbegin()
T & operator[](const label i)
Return element of FixedList.
Definition FixedListI.H:399
FixedList()=default
Default construct.
bool operator>(const FixedList< T, N > &list) const
Compare two FixedLists lexicographically. Takes linear time.
Definition FixedList.C:199
reverse_iterator rend()
label find(const scalar &val) const
static constexpr bool empty() noexcept
Definition FixedList.H:614
FixedList(const UList< T > &list, const FixedList< label, N > &indices)
Copy construct from a subset of the input. No size check.
Definition FixedListI.H:89
iterator begin() noexcept
Return an iterator to begin traversing the FixedList.
Definition FixedListI.H:478
FixedList(const T &val)
Construct and initialize all entries to given value.
Definition FixedListI.H:27
const T & const_reference
The type used for reading from constant value_type objects.
Definition FixedList.H:125
label fcIndex(const label i) const noexcept
void checkStart(const label start) const
autoPtr< FixedList< T, N > > clone() const
Clone.
Definition FixedListI.H:103
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition Istream.H:60
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
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:89
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
A class for handling words, derived from Foam::string.
Definition word.H:66
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
Definition zero.H:58
const volScalarField & T
OBJstream os(runTime.globalPath()/outputName)
Namespace for OpenFOAM.
dimensionedScalar pos(const dimensionedScalar &ds)
const T & NullObjectRef() noexcept
Const reference (of type T) to the nullObject.
Definition nullObject.H:228
unsigned Hasher(const void *data, size_t len, unsigned seed=0)
Bob Jenkins's 96-bit mixer hashing function (lookup3).
Definition Hasher.C:575
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces).
void Swap(DynamicList< T, SizeMinA > &a, DynamicList< T, SizeMinB > &b)
Exchange contents of lists - see DynamicList::swap().
Istream & operator>>(Istream &, directionInfo &)
const direction noexcept
Definition scalarImpl.H:265
constexpr bool is_contiguous_v
The is_contiguous value of Type (after stripping of qualifiers).
Definition contiguous.H:77
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
volScalarField & b
Includes some common C++ headers, defines global macros and templates used in multiple places by Open...
#define FOAM_DEPRECATED_FOR(since, replacement)
Definition stdFoam.H:43
Deprecated(2021-04) hashing functor. Use hasher().
Definition FixedList.H:738
FOAM_DEPRECATED_FOR(2021-04, "hasher()") Hash()
Definition FixedList.H:739
Hashing functor for FixedList.
Definition FixedList.H:708
Hash function class. The default definition is for primitives. Non-primitives used to hash entries on...
Definition Hash.H:48
Number of items before requiring line-breaks in the list output.
Definition ListPolicy.H:56
A template class to specify if a data type is composed solely of Foam::label elements.
Definition contiguous.H:82
A template class to specify if a data type is composed solely of Foam::scalar elements.
Definition contiguous.H:87
A template class to specify that a data type can be considered as being contiguous in memory.
Definition contiguous.H:70
const Vector< label > N(dict.get< Vector< label > >("N"))