pointFieldDecomposer.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2022 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 public:
55 
56  // Public classes
57 
58  //- Point patch field decomposer class
60  :
62  {
63  // Private Data
64 
65  labelList directAddressing_;
66 
67  //- Does map contain any unmapped values
68  bool hasUnmapped_;
69 
70  public:
71 
72  // Constructors
73 
74  //- Construct given addressing
76  (
77  const pointPatch& completeMeshPatch,
78  const pointPatch& procMeshPatch,
79  const labelList& directAddr
80  );
81 
82 
83  // Member Functions
84 
85  label size() const
86  {
87  return directAddressing_.size();
88  }
89 
90  bool direct() const
91  {
92  return true;
93  }
94 
95  bool hasUnmapped() const
96  {
97  return hasUnmapped_;
98  }
99 
100  const labelUList& directAddressing() const
101  {
102  return directAddressing_;
103  }
104  };
105 
106 
107 private:
108 
109  // Private Data
110 
111  //- Reference to complete mesh
112  const pointMesh& completeMesh_;
113 
114  //- Reference to processor mesh
115  const pointMesh& procMesh_;
116 
117  //- Reference to point addressing
118  const labelList& pointAddressing_;
119 
120  //- List of patch field decomposers
121  PtrList<patchFieldDecomposer> patchFieldDecomposers_;
122 
123 
124 public:
125 
126  // Constructors
127 
128  //- Construct from components
130  (
131  const pointMesh& completeMesh,
132  const pointMesh& procMesh,
133  const labelList& pointAddressing
134  );
135 
136  //- Disallow default bitwise copy construction
138 
139 
140  //- Destructor
142 
143 
144  // Member Functions
145 
146  //- Decompose point field
147  template<class Type>
150  (
152  ) const;
153 
154  //- Decompose a list of fields
155  template<class GeoField>
156  void decomposeFields(const PtrList<GeoField>& fields) const;
157 
158 
159  // Member Operators
160 
161  //- Disallow default bitwise assignment
162  void operator=(const pointFieldDecomposer&) = delete;
163 };
164 
165 
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 
168 } // End namespace Foam
169 
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 
172 #ifdef NoRepository
174 #endif
175 
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 
178 #endif
179 
180 // ************************************************************************* //
void operator=(const pointPatchFieldMapperPatchRef &)=delete
Disallow default bitwise assignment.
void size(const label)
Override size to be inconsistent with allocated storage.
Definition: ListI.H:164
pointFieldDecomposer(const pointMesh &completeMesh, const pointMesh &procMesh, const labelList &pointAddressing)
Construct from components.
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
Point field decomposer.
Info<< "Reading field p_rgh\"<< endl;volScalarField p_rgh(IOobject("p_rgh", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);pressureReference pressureReference(p, p_rgh, pimple.dict(), thermo.incompressible());mesh.schemes().setFluxRequired(p_rgh.name());hydrostaticInitialisation(p_rgh, p, rho, U, gh, ghf, pRef, thermo, pimple.dict());Info<< "Creating field dpdt\"<< endl;volScalarField dpdt(IOobject("dpdt", runTime.timeName(), mesh), mesh, dimensionedScalar(p.dimensions()/dimTime, 0));Info<< "Creating field kinetic energy K\"<< endl;volScalarField K("K", 0.5 *magSqr(U));dimensionedScalar initialMass=fvc::domainIntegrate(rho);multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
Definition: createFields.H:131
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:70
patchFieldDecomposer(const pointPatch &completeMeshPatch, const pointPatch &procMeshPatch, const labelList &directAddr)
Construct given addressing.
bool hasUnmapped() const
Are there unmapped values? I.e. do all size() elements get.
A class for managing temporary objects.
Definition: PtrList.H:53
~pointFieldDecomposer()
Destructor.
Foam::pointPatchFieldMapperPatchRef.
Namespace for OpenFOAM.
void decomposeFields(const PtrList< GeoField > &fields) const
Decompose a list of fields.