directPointPatchFieldMapper.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) 2013 OpenFOAM Foundation
9  Copyright (C) 2019 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
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 
27 Class
28  Foam::directPointPatchFieldMapper
29 
30 Description
31  direct pointPatchFieldMapper
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef directPointPatchFieldMapper_H
36 #define directPointPatchFieldMapper_H
37 
38 #include "pointPatchFieldMapper.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 /*---------------------------------------------------------------------------*\
46  Class directPointPatchFieldMapper Declaration
47 \*---------------------------------------------------------------------------*/
48 
50 :
52 {
53 
54  //- Addressing from new back to old
55  const labelUList& directAddressing_;
56 
57  //- Does map contain any unmapped values
58  bool hasUnmapped_;
59 
60 
61 public:
62 
63  // Constructors
64 
65  //- Construct given addressing
67  :
68  directAddressing_(directAddressing),
69  hasUnmapped_(directAddressing_.size() && min(directAddressing_) < 0)
70  {}
71 
72 
73  //- Destructor
74  virtual ~directPointPatchFieldMapper() = default;
75 
76 
77  // Member Functions
78 
79  label size() const
80  {
81  return directAddressing_.size();
82  }
83 
84  bool direct() const
85  {
86  return true;
87  }
88 
89  bool hasUnmapped() const
90  {
91  return hasUnmapped_;
92  }
93 
94  const labelUList& directAddressing() const
95  {
96  return directAddressing_;
97  }
98 };
99 
100 
101 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
102 
103 } // End namespace Foam
104 
105 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
106 
107 #endif
108 
109 // ************************************************************************* //
Foam::directPointPatchFieldMapper::directPointPatchFieldMapper
directPointPatchFieldMapper(const labelUList &directAddressing)
Definition: directPointPatchFieldMapper.H:59
pointPatchFieldMapper.H
Foam::directPointPatchFieldMapper::hasUnmapped
bool hasUnmapped() const
Definition: directPointPatchFieldMapper.H:82
Foam::min
label min(const labelHashSet &set, label minValue=labelMax)
Definition: hashSets.C:26
Foam::pointPatchFieldMapper
Foam::pointPatchFieldMapper.
Definition: pointPatchFieldMapper.H:42
Foam::directPointPatchFieldMapper::directAddressing
const labelUList & directAddressing() const
Definition: directPointPatchFieldMapper.H:87
Foam::directPointPatchFieldMapper::~directPointPatchFieldMapper
virtual ~directPointPatchFieldMapper()=default
Foam::directPointPatchFieldMapper::direct
bool direct() const
Definition: directPointPatchFieldMapper.H:77
Foam
Definition: atmBoundaryLayer.C:26
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:99
Foam::directPointPatchFieldMapper::size
label size() const
Definition: directPointPatchFieldMapper.H:72
Foam::UList::size
void size(const label n)
Definition: UList.H:110
Foam::labelUList
UList< label > labelUList
A UList of labels.
Definition: UList.H:81
Foam::directPointPatchFieldMapper
direct pointPatchFieldMapper
Definition: directPointPatchFieldMapper.H:42