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-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::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 
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
118 
119  //- Reference to boundary addressing
121 
122  //- List of patch field decomposers
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
175  #include "pointFieldDecomposerDecomposeFields.C"
176 #endif
177 
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 
180 #endif
181 
182 // ************************************************************************* //
Foam::pointFieldDecomposer::patchFieldDecomposer::patchFieldDecomposer
patchFieldDecomposer(const pointPatch &completeMeshPatch, const pointPatch &procMeshPatch, const labelList &directAddr)
Construct given addressing.
Definition: pointFieldDecomposer.C:31
Foam::pointFieldDecomposer::decomposeFields
void decomposeFields(const PtrList< GeoField > &fields) const
Definition: pointFieldDecomposerDecomposeFields.C:100
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
fields
Info<< "Creating field dpdt\n"<< endl;volScalarField dpdt(IOobject("dpdt", runTime.timeName(), mesh), mesh, dimensionedScalar("dpdt", p.dimensions()/dimTime, 0));Info<< "Creating field kinetic energy K\n"<< endl;volScalarField K("K", 0.5 *magSqr(U));volScalarField p_rgh(IOobject("p_rgh", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);p_rgh=p - rho *gh;mesh.setFluxRequired(p_rgh.name());multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
Definition: createFields.H:127
Foam::pointFieldDecomposer::pointFieldDecomposer
pointFieldDecomposer(const pointFieldDecomposer &)
Disallow default bitwise copy construct.
Foam::pointFieldDecomposer::patchFieldDecomposer::directAddressing_
labelList directAddressing_
Definition: pointFieldDecomposer.H:63
Foam::pointPatch
Basic pointPatch represents a set of points from the mesh.
Definition: pointPatch.H:56
Foam::pointFieldDecomposer::operator=
void operator=(const pointFieldDecomposer &)
Disallow default bitwise assignment.
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:83
Foam::pointFieldDecomposer::boundaryAddressing_
const labelList & boundaryAddressing_
Reference to boundary addressing.
Definition: pointFieldDecomposer.H:119
Foam::pointFieldDecomposer::patchFieldDecomposer::directAddressing
const labelUList & directAddressing() const
Definition: pointFieldDecomposer.H:98
Foam::pointFieldDecomposer::completeMesh_
const pointMesh & completeMesh_
Reference to complete mesh.
Definition: pointFieldDecomposer.H:110
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
pointPatchFieldMapperPatchRef.H
Foam::pointFieldDecomposer::pointAddressing_
const labelList & pointAddressing_
Reference to point addressing.
Definition: pointFieldDecomposer.H:116
Foam::PtrList
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: List.H:61
Foam::pointFieldDecomposer::patchFieldDecomposer::hasUnmapped
bool hasUnmapped() const
Are there unmapped values? I.e. do all size() elements get.
Definition: pointFieldDecomposer.H:93
Foam::pointFieldDecomposer::patchFieldDecomposer::direct
bool direct() const
Definition: pointFieldDecomposer.H:88
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::pointMesh
Mesh representing a set of points created from polyMesh.
Definition: pointMesh.H:48
Foam::pointFieldDecomposer::patchFieldDecomposerPtrs_
List< patchFieldDecomposer * > patchFieldDecomposerPtrs_
List of patch field decomposers.
Definition: pointFieldDecomposer.H:122
Foam::pointFieldDecomposer::patchFieldDecomposer
Point patch field decomposer class.
Definition: pointFieldDecomposer.H:57
Foam::pointFieldDecomposer::patchFieldDecomposer::hasUnmapped_
bool hasUnmapped_
Does map contain any unmapped values.
Definition: pointFieldDecomposer.H:66
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
Foam::pointFieldDecomposer::procMesh_
const pointMesh & procMesh_
Reference to processor mesh.
Definition: pointFieldDecomposer.H:113
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::List::size
void size(const label)
Override size to be inconsistent with allocated storage.
Foam::pointPatchFieldMapperPatchRef
Foam::pointPatchFieldMapperPatchRef.
Definition: pointPatchFieldMapperPatchRef.H:45
Foam::GeometricField
Generic GeometricField class.
Definition: surfaceFieldsFwd.H:52
Foam::pointFieldDecomposer
Point field decomposer.
Definition: pointFieldDecomposer.H:51
pointFields.H
pointMesh.H
Foam::pointFieldDecomposer::~pointFieldDecomposer
~pointFieldDecomposer()
Destructor.
Definition: pointFieldDecomposer.C:112