SliceList.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) 2019 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 Class
27  Foam::SliceList
28 
29 Description
30  A List with indirect slice addressing.
31 
32 SourceFiles
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef SliceList_H
37 #define SliceList_H
38 
39 #include "IndirectListAddressing.H"
40 #include "IndirectListBase.H"
41 #include "sliceRange.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class SliceList Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 template<class T>
53 class SliceList
54 :
55  private IndirectListAddressing<sliceRange>,
56  public IndirectListBase<T, sliceRange>
57 {
58 public:
59 
60  // Constructors
61 
62  //- Copy construct from values list and slicing
63  SliceList(const UList<T>& values, const sliceRange& addr)
64  :
67  (
68  values,
70  )
71  {}
72 
73 
74  // Member Functions
75 
76  //- The list addressing
78 
79 
80  // Member Operators
81 
82  //- Use standard assignment operations
84 };
85 
86 
87 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
88 
89 } // End namespace Foam
90 
91 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
92 
93 #endif
94 
95 // ************************************************************************* //
Foam::IndirectListAddressing::addressing
const Addr & addressing() const noexcept
Const access to the addressing.
Definition: IndirectListAddressing.H:76
sliceRange.H
Foam::IndirectListAddressing
A class for storing list addressing (labels, slices etc), which are normally to used by IndirectList....
Definition: IndirectListAddressing.H:48
Foam::HashTableOps::values
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
Definition: HashOps.H:149
Foam::SliceList::addressing
const Addr & addressing() const noexcept
The list addressing.
Definition: IndirectListAddressing.H:76
IndirectListBase.H
Foam::T
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Definition: FieldFieldFunctions.C:58
Foam::SliceList::SliceList
SliceList(const UList< T > &values, const sliceRange &addr)
Copy construct from values list and slicing.
Definition: SliceList.H:62
IndirectListAddressing.H
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::sliceRange
A set of labels defined by a start, a length and a stride.
Definition: sliceRange.H:58
Foam::UList
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: HashTable.H:103
Foam::IndirectListBase
Base for lists with indirect addressing, templated on the list contents type and the addressing type....
Definition: IndirectListBase.H:56