directPointPatchFieldMapper.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2019 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::directPointPatchFieldMapper
26 
27 Description
28  direct PointPatchFieldMapper
29 
30 \*---------------------------------------------------------------------------*/
31 
32 #ifndef directPointPatchFieldMapper_H
33 #define directPointPatchFieldMapper_H
34 
35 #include "pointPatchFieldMapper.H"
36 
37 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
38 
39 namespace Foam
40 {
41 
42 /*---------------------------------------------------------------------------*\
43  Class directPointPatchFieldMapper Declaration
44 \*---------------------------------------------------------------------------*/
45 
47 :
49 {
50 
51  //- Addressing from new back to old
52  const labelUList& directAddressing_;
53 
54  //- Does map contain any unmapped values
55  bool hasUnmapped_;
56 
57 
58 public:
59 
60  // Constructors
61 
62  //- Construct given addressing
64  :
65  directAddressing_(directAddressing),
66  hasUnmapped_(false)
67  {
68  if (directAddressing_.size() && min(directAddressing_) < 0)
69  {
70  hasUnmapped_ = true;
71  }
72  }
73 
74  //- Destructor
76  {}
77 
78 
79  // Member Functions
80 
81  label size() const
82  {
83  return directAddressing_.size();
84  }
85 
86  bool direct() const
87  {
88  return true;
89  }
90 
91  bool hasUnmapped() const
92  {
93  return hasUnmapped_;
94  }
95 
96  const labelUList& directAddressing() const
97  {
98  return directAddressing_;
99  }
100 };
101 
102 
103 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
104 
105 } // End namespace Foam
106 
107 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
108 
109 #endif
110 
111 // ************************************************************************* //
bool hasUnmapped() const
Are there unmapped values? I.e. do all size() elements get.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
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:60
label size() const
Return the number of elements in the UList.
Definition: UListI.H:311
directPointPatchFieldMapper(const labelUList &directAddressing)
Construct given addressing.
Namespace for OpenFOAM.