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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2016 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::pointFieldDecomposer
28 
29 Description
30  Point field decomposer.
31 
32 SourceFiles
33  pointFieldDecomposer.C
34  pointFieldDecomposerDecomposeFields.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef pointFieldDecomposer_H
39 #define pointFieldDecomposer_H
40 
41 #include "pointMesh.H"
43 #include "pointFields.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class pointFieldDecomposer Declaration
52 \*---------------------------------------------------------------------------*/
53 
55 {
56 
57 public:
58 
59  //- Point patch field decomposer class
61  :
63  {
64  // Private data
65 
66  labelList directAddressing_;
67 
68  //- Does map contain any unmapped values
69  bool hasUnmapped_;
70 
71  public:
72 
73  // Constructors
74 
75  //- Construct given addressing
77  (
78  const pointPatch& completeMeshPatch,
79  const pointPatch& procMeshPatch,
80  const labelList& directAddr
81  );
82 
83 
84  // Member functions
85 
86  label size() const
87  {
88  return directAddressing_.size();
89  }
90 
91  bool direct() const
92  {
93  return true;
94  }
95 
96  bool hasUnmapped() const
97  {
98  return hasUnmapped_;
99  }
100 
101  const labelUList& directAddressing() const
102  {
103  return directAddressing_;
104  }
105  };
106 
107 
108 private:
109 
110  // Private data
111 
112  //- Reference to complete mesh
113  const pointMesh& completeMesh_;
114 
115  //- Reference to processor mesh
116  const pointMesh& procMesh_;
117 
118  //- Reference to point addressing
119  const labelList& pointAddressing_;
120 
121  //- Reference to boundary addressing
122  const labelList& boundaryAddressing_;
123 
124  //- List of patch field decomposers
125  List<patchFieldDecomposer*> patchFieldDecomposerPtrs_;
126 
127 
128  // Private Member Functions
129 
130  //- No copy construct
132 
133  //- No copy assignment
134  void operator=(const pointFieldDecomposer&) = delete;
135 
136 
137 public:
138 
139  // Constructors
140 
141  //- Construct from components
143  (
144  const pointMesh& completeMesh,
145  const pointMesh& procMesh,
146  const labelList& pointAddressing,
147  const labelList& boundaryAddressing
148  );
149 
150 
151  //- Destructor
153 
154 
155  // Member Functions
156 
157  //- Decompose point field
158  template<class Type>
161  (
163  ) const;
164 
165  template<class GeoField>
166  void decomposeFields(const PtrList<GeoField>& fields) const;
167 };
168 
169 
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 
172 } // End namespace Foam
173 
174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 
176 #ifdef NoRepository
178 #endif
179 
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 
182 #endif
183 
184 // ************************************************************************* //
Foam::pointFieldDecomposer::patchFieldDecomposer::patchFieldDecomposer
patchFieldDecomposer(const pointPatch &completeMeshPatch, const pointPatch &procMeshPatch, const labelList &directAddr)
Construct given addressing.
Foam::pointFieldDecomposer::decomposeFields
void decomposeFields(const PtrList< GeoField > &fields) const
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::pointPatch
Basic pointPatch represents a set of points from the mesh.
Definition: pointPatch.H:58
Foam::pointFieldDecomposer::decomposeField
tmp< GeometricField< Type, pointPatchField, pointMesh > > decomposeField(const GeometricField< Type, pointPatchField, pointMesh > &) const
Decompose point field.
Foam::pointFieldDecomposer::patchFieldDecomposer::size
label size() const
Definition: pointFieldDecomposer.H:85
Foam::pointFieldDecomposer::patchFieldDecomposer::directAddressing
const labelUList & directAddressing() const
Definition: pointFieldDecomposer.H:100
pointPatchFieldMapperPatchRef.H
Foam::PtrList
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: List.H:62
Foam::pointFieldDecomposer::patchFieldDecomposer::hasUnmapped
bool hasUnmapped() const
Are there unmapped values? I.e. do all size() elements get.
Definition: pointFieldDecomposer.H:95
Foam::pointFieldDecomposer::patchFieldDecomposer::direct
bool direct() const
Definition: pointFieldDecomposer.H:90
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::pointMesh
Mesh representing a set of points created from polyMesh.
Definition: pointMesh.H:50
Foam::pointFieldDecomposer::patchFieldDecomposer
Point patch field decomposer class.
Definition: pointFieldDecomposer.H:59
Foam::List< label >
Foam::UList< label >
pointFieldDecomposerDecomposeFields.C
Foam::pointPatchFieldMapperPatchRef
Foam::pointPatchFieldMapperPatchRef.
Definition: pointPatchFieldMapperPatchRef.H:47
Foam::GeometricField
Generic GeometricField class.
Definition: areaFieldsFwd.H:53
Foam::pointFieldDecomposer
Point field decomposer.
Definition: pointFieldDecomposer.H:53
pointFields.H
pointMesh.H
fields
multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
Definition: createFields.H:97
Foam::pointFieldDecomposer::~pointFieldDecomposer
~pointFieldDecomposer()
Destructor.