distributedUnallocatedDirectFieldMapper.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 | Copyright (C) 2015 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::distributedUnallocatedDirectFieldMapper
26 
27 Description
28  FieldMapper with direct mapping from remote quantities.
29 
30 \*---------------------------------------------------------------------------*/
31 
32 #ifndef distributedUnallocatedDirectFieldMapper_H
33 #define distributedUnallocatedDirectFieldMapper_H
34 
35 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
36 
37 namespace Foam
38 {
39 
40 /*---------------------------------------------------------------------------*\
41  Class distributedUnallocatedDirectFieldMapper Declaration
42 \*---------------------------------------------------------------------------*/
43 
45 :
46  public FieldMapper
47 {
49 
51 
52  bool hasUnmapped_;
53 
54 public:
55 
56  // Constructors
57 
58  //- Construct given addressing
60  (
62  const mapDistributeBase& distMap
63  )
64  :
66  distMap_(distMap),
67  hasUnmapped_(false)
68  {
69  if
70  (
73  && min(directAddressing_) < 0
74  )
75  {
76  hasUnmapped_ = true;
77  }
78  }
79 
80  //- Destructor
82  {}
83 
84 
85  // Member Functions
86 
87  virtual label size() const
88  {
89  return
90  (
94  );
95  }
96 
97  virtual bool direct() const
98  {
99  return true;
100  }
101 
102  virtual bool distributed() const
103  {
104  return true;
105  }
106 
107  virtual const mapDistributeBase& distributeMap() const
108  {
109  return distMap_;
110  }
111 
112  virtual bool hasUnmapped() const
113  {
114  return hasUnmapped_;
115  }
116 
117  virtual const labelUList& directAddressing() const
118  {
119  return directAddressing_;
120  }
121 };
122 
123 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124 
125 } // End namespace Foam
126 
127 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 
129 #endif
130 
131 // ************************************************************************* //
Foam::distributedUnallocatedDirectFieldMapper::directAddressing
virtual const labelUList & directAddressing() const
Definition: distributedUnallocatedDirectFieldMapper.H:116
Foam::distributedUnallocatedDirectFieldMapper
FieldMapper with direct mapping from remote quantities.
Definition: distributedUnallocatedDirectFieldMapper.H:43
Foam::notNull
bool notNull(const T &t)
Return true if t is not a reference to the nullObject of type T.
Definition: nullObjectI.H:46
Foam::distributedUnallocatedDirectFieldMapper::direct
virtual bool direct() const
Definition: distributedUnallocatedDirectFieldMapper.H:96
Foam::distributedUnallocatedDirectFieldMapper::size
virtual label size() const
Definition: distributedUnallocatedDirectFieldMapper.H:86
Foam::distributedUnallocatedDirectFieldMapper::distributeMap
virtual const mapDistributeBase & distributeMap() const
Definition: distributedUnallocatedDirectFieldMapper.H:106
Foam::FieldMapper
Abstract base class to hold the Field mapping addressing and weights.
Definition: FieldMapper.H:45
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Foam::distributedUnallocatedDirectFieldMapper::hasUnmapped
virtual bool hasUnmapped() const
Are there unmapped values? I.e. do all size() elements get.
Definition: distributedUnallocatedDirectFieldMapper.H:111
Foam::distributedUnallocatedDirectFieldMapper::~distributedUnallocatedDirectFieldMapper
virtual ~distributedUnallocatedDirectFieldMapper()
Destructor.
Definition: distributedUnallocatedDirectFieldMapper.H:80
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::distributedUnallocatedDirectFieldMapper::distributedUnallocatedDirectFieldMapper
distributedUnallocatedDirectFieldMapper(const labelUList &directAddressing, const mapDistributeBase &distMap)
Construct given addressing.
Definition: distributedUnallocatedDirectFieldMapper.H:59
Foam::mapDistributeBase::constructSize
label constructSize() const
Constructed data size.
Definition: mapDistributeBase.H:244
Foam::distributedUnallocatedDirectFieldMapper::directAddressing_
const labelUList & directAddressing_
Definition: distributedUnallocatedDirectFieldMapper.H:47
Foam::distributedUnallocatedDirectFieldMapper::distMap_
const mapDistributeBase & distMap_
Definition: distributedUnallocatedDirectFieldMapper.H:49
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:60
Foam::distributedUnallocatedDirectFieldMapper::distributed
virtual bool distributed() const
Definition: distributedUnallocatedDirectFieldMapper.H:101
Foam::mapDistributeBase
Class containing processor-to-processor mapping information.
Definition: mapDistributeBase.H:91
Foam::distributedUnallocatedDirectFieldMapper::hasUnmapped_
bool hasUnmapped_
Definition: distributedUnallocatedDirectFieldMapper.H:51
Foam::UList::size
label size() const
Return the number of elements in the UList.
Definition: UListI.H:299
Foam::min
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)