pointFieldDecomposer.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) 2011-2016 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::pointFieldDecomposer
26 
27 Description
28  Point field decomposer.
29 
30 SourceFiles
31  pointFieldDecomposer.C
32  pointFieldDecomposerDecomposeFields.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef pointFieldDecomposer_H
37 #define pointFieldDecomposer_H
38 
39 #include "pointMesh.H"
41 #include "pointFields.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class pointFieldDecomposer Declaration
50 \*---------------------------------------------------------------------------*/
51 
53 {
54 
55 public:
56 
57  //- Point patch field decomposer class
59  :
61  {
62  // Private data
63 
64  labelList directAddressing_;
65 
66  //- Does map contain any unmapped values
67  bool hasUnmapped_;
68 
69  public:
70 
71  // Constructors
72 
73  //- Construct given addressing
75  (
76  const pointPatch& completeMeshPatch,
77  const pointPatch& procMeshPatch,
78  const labelList& directAddr
79  );
80 
81 
82  // Member functions
83 
84  label size() const
85  {
86  return directAddressing_.size();
87  }
88 
89  bool direct() const
90  {
91  return true;
92  }
93 
94  bool hasUnmapped() const
95  {
96  return hasUnmapped_;
97  }
98 
99  const labelUList& directAddressing() const
100  {
101  return directAddressing_;
102  }
103  };
104 
105 
106 private:
107 
108  // Private data
109 
110  //- Reference to complete mesh
111  const pointMesh& completeMesh_;
112 
113  //- Reference to processor mesh
114  const pointMesh& procMesh_;
115 
116  //- Reference to point addressing
117  const labelList& pointAddressing_;
118 
119  //- Reference to boundary addressing
120  const labelList& boundaryAddressing_;
121 
122  //- List of patch field decomposers
123  List<patchFieldDecomposer*> patchFieldDecomposerPtrs_;
124 
125 
126  // Private Member Functions
127 
128  //- Disallow default bitwise copy construct
130 
131  //- Disallow default bitwise assignment
132  void operator=(const pointFieldDecomposer&);
133 
134 
135 public:
136 
137  // Constructors
138 
139  //- Construct from components
141  (
142  const pointMesh& completeMesh,
143  const pointMesh& procMesh,
144  const labelList& pointAddressing,
145  const labelList& boundaryAddressing
146  );
147 
148 
149  //- Destructor
151 
152 
153  // Member Functions
154 
155  //- Decompose point field
156  template<class Type>
159  (
161  ) const;
162 
163  template<class GeoField>
164  void decomposeFields(const PtrList<GeoField>& fields) const;
165 };
166 
167 
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 
170 } // End namespace Foam
171 
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 
174 #ifdef NoRepository
176 #endif
177 
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 
180 #endif
181 
182 // ************************************************************************* //
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
void size(const label)
Override size to be inconsistent with allocated storage.
Definition: ListI.H:76
Generic GeometricField class.
multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
Definition: createFields.H:97
Mesh representing a set of points created from polyMesh.
Definition: pointMesh.H:48
tmp< GeometricField< Type, pointPatchField, pointMesh > > decomposeField(const GeometricField< Type, pointPatchField, pointMesh > &) const
Decompose point field.
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
bool hasUnmapped() const
Are there unmapped values? I.e. do all size() elements get.
Point field decomposer.
Basic pointPatch represents a set of points from the mesh.
Definition: pointPatch.H:56
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: List.H:62
patchFieldDecomposer(const pointPatch &completeMeshPatch, const pointPatch &procMeshPatch, const labelList &directAddr)
Construct given addressing.
A class for managing temporary objects.
Definition: PtrList.H:54
~pointFieldDecomposer()
Destructor.
Foam::pointPatchFieldMapperPatchRef.
void decomposeFields(const PtrList< GeoField > &fields) const
Namespace for OpenFOAM.