distributedUnallocatedDirectFvPatchFieldMapper.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::distributedUnallocatedDirectFvPatchFieldMapper
26 
27 Description
28  FieldMapper with direct mapping from remote quantities.
29 
30 \*---------------------------------------------------------------------------*/
31 
32 #ifndef distributedUnallocatedDirectFvPatchFieldMapper_H
33 #define distributedUnallocatedDirectFvPatchFieldMapper_H
34 
35 #include "fvPatchFieldMapper.H"
36 
37 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
38 
39 namespace Foam
40 {
41 
42 /*---------------------------------------------------------------------------*\
43  Class distributedUnallocatedDirectFvPatchFieldMapper Declaration
44 \*---------------------------------------------------------------------------*/
45 
47 :
48  public fvPatchFieldMapper
49 {
51 
53 
54  bool hasUnmapped_;
55 
56 public:
57 
58  // Constructors
59 
60  //- Construct given addressing
62  (
64  const mapDistributeBase& distMap
65  )
66  :
68  distMap_(distMap),
69  hasUnmapped_(false)
70  {
71  if
72  (
75  && min(directAddressing_) < 0
76  )
77  {
78  hasUnmapped_ = true;
79  }
80  }
81 
82  //- Destructor
84  {}
85 
86 
87  // Member Functions
88 
89  virtual label size() const
90  {
91  return
92  (
96  );
97  }
98 
99  virtual bool direct() const
100  {
101  return true;
102  }
103 
104  virtual bool distributed() const
105  {
106  return true;
107  }
108 
109  virtual const mapDistributeBase& distributeMap() const
110  {
111  return distMap_;
112  }
113 
114  virtual bool hasUnmapped() const
115  {
116  return hasUnmapped_;
117  }
118 
119  virtual const labelUList& directAddressing() const
120  {
121  return directAddressing_;
122  }
123 };
124 
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126 
127 } // End namespace Foam
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 #endif
132 
133 // ************************************************************************* //
Foam::distributedUnallocatedDirectFvPatchFieldMapper::distributed
virtual bool distributed() const
Definition: distributedUnallocatedDirectFvPatchFieldMapper.H:103
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::distributedUnallocatedDirectFvPatchFieldMapper::directAddressing
virtual const labelUList & directAddressing() const
Definition: distributedUnallocatedDirectFvPatchFieldMapper.H:118
Foam::distributedUnallocatedDirectFvPatchFieldMapper::distributedUnallocatedDirectFvPatchFieldMapper
distributedUnallocatedDirectFvPatchFieldMapper(const labelUList &directAddressing, const mapDistributeBase &distMap)
Construct given addressing.
Definition: distributedUnallocatedDirectFvPatchFieldMapper.H:61
fvPatchFieldMapper.H
Foam::distributedUnallocatedDirectFvPatchFieldMapper::hasUnmapped
virtual bool hasUnmapped() const
Are there unmapped values? I.e. do all size() elements get.
Definition: distributedUnallocatedDirectFvPatchFieldMapper.H:113
Foam::distributedUnallocatedDirectFvPatchFieldMapper::direct
virtual bool direct() const
Definition: distributedUnallocatedDirectFvPatchFieldMapper.H:98
Foam::distributedUnallocatedDirectFvPatchFieldMapper::directAddressing_
const labelUList & directAddressing_
Definition: distributedUnallocatedDirectFvPatchFieldMapper.H:49
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::distributedUnallocatedDirectFvPatchFieldMapper::distributeMap
virtual const mapDistributeBase & distributeMap() const
Definition: distributedUnallocatedDirectFvPatchFieldMapper.H:108
Foam::distributedUnallocatedDirectFvPatchFieldMapper::~distributedUnallocatedDirectFvPatchFieldMapper
virtual ~distributedUnallocatedDirectFvPatchFieldMapper()
Destructor.
Definition: distributedUnallocatedDirectFvPatchFieldMapper.H:82
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::distributedUnallocatedDirectFvPatchFieldMapper::size
virtual label size() const
Definition: distributedUnallocatedDirectFvPatchFieldMapper.H:88
Foam::mapDistributeBase::constructSize
label constructSize() const
Constructed data size.
Definition: mapDistributeBase.H:244
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::distributedUnallocatedDirectFvPatchFieldMapper::hasUnmapped_
bool hasUnmapped_
Definition: distributedUnallocatedDirectFvPatchFieldMapper.H:53
Foam::distributedUnallocatedDirectFvPatchFieldMapper::distMap_
const mapDistributeBase & distMap_
Definition: distributedUnallocatedDirectFvPatchFieldMapper.H:51
Foam::mapDistributeBase
Class containing processor-to-processor mapping information.
Definition: mapDistributeBase.H:91
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:45
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 > &)
Foam::distributedUnallocatedDirectFvPatchFieldMapper
FieldMapper with direct mapping from remote quantities.
Definition: distributedUnallocatedDirectFvPatchFieldMapper.H:45