volPointInterpolationAdjoint.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  Copyright (C) 2016-2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::volPointInterpolationAdjoint
29 
30 Description
31  Interpolate from cell centres to points (vertices) using inverse distance
32  weighting
33 
34 SourceFiles
35  volPointInterpolationAdjoint.C
36  volPointInterpolate.C
37 
38 \*---------------------------------------------------------------------------*/
39 
40 #ifndef volPointInterpolationAdjoint_H
41 #define volPointInterpolationAdjoint_H
42 
43 #include "MeshObject.H"
44 #include "scalarList.H"
45 #include "volFields.H"
46 #include "pointFields.H"
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 
53 // Forward Declarations
54 class fvMesh;
55 class pointMesh;
56 
57 /*---------------------------------------------------------------------------*\
58  Class volPointInterpolationAdjoint Declaration
59 \*---------------------------------------------------------------------------*/
60 
62 :
63  public MeshObject
64  <
65  fvMesh,
66  UpdateableMeshObject,
67  volPointInterpolationAdjoint
68  >
69 {
70  // Private Typedefs
71 
72  typedef MeshObject
73  <
74  fvMesh,
78 
79 
80 protected:
81 
82  // Protected data
83 
84  //- Boundary addressing
86 
87  //- Per boundary face whether is on non-coupled, non-empty patch
89 
90  //- Per mesh(!) point whether is on non-coupled, non-empty patch (on
91  // any processor)
93 
94  //- Per mesh(!) point whether is on symmetry plane
95  // any processor)
97 
98  //- Per boundary point the weights per pointFaces.
100 
102  // Protected Member Functions
103 
104  //- Construct addressing over all boundary faces
105  void calcBoundaryAddressing();
107  //- Make weights for points on uncoupled patches
108  void makeBoundaryWeights(scalarField& sumWeights);
109 
110  //- Construct all point weighting factors
111  void makeWeights();
112 
113  //- Helper: push master point data to collocated points
114  template<class Type>
115  void pushUntransformedData(List<Type>&) const;
116 
117  //- Get boundary field in same order as boundary faces. Field is
118  // zero on all coupled and empty patches
119  template<class Type>
121  (
123  ) const;
124 
125  //- Add separated contributions
126  template<class Type>
127  void addSeparated
128  (
130  ) const;
131 
132  //- No copy construct
134 
135  //- No copy assignment
136  void operator=(const volPointInterpolationAdjoint&) = delete;
137 
138 
139 public:
140 
141  // Declare name of the class and its debug switch
142  ClassName("volPointInterpolationAdjoint");
143 
144 
145  // Constructors
146 
147  //- Construct given fvMesh
148  explicit volPointInterpolationAdjoint(const fvMesh&);
149 
150 
151  //- Destructor
153 
154 
155  // Member functions
156 
157  // Edit
158 
159  //- Update mesh topology using the morph engine
160  void updateMesh(const mapPolyMesh&);
161 
162  //- Correct weighting factors for moving mesh.
163  bool movePoints();
164 
165 
166  // Interpolation Functions
167 
168  //- Interpolate sensitivties from points to faces
169  // conditions
170  template<class Type>
172  (
175  const labelHashSet& patchIDs
176  ) const;
177 
178  template<class Type>
180  (
183  ) const;
184 
185  //- Interpolate sensitivties from points to faces
187  (
188  const vectorField& pf,
189  vectorField& vf,
190  const labelHashSet& patchIDs
191  ) const;
192 };
193 
194 
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 
197 } // End namespace Foam
198 
199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200 
201 #ifdef NoRepository
203 #endif
204 
205 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
206 
207 #endif
208 
209 // ************************************************************************* //
const labelList patchIDs(pbm.indices(polyPatchNames, true))
bitSet isPatchPoint_
Per mesh(!) point whether is on non-coupled, non-empty patch (on.
void calcBoundaryAddressing()
Construct addressing over all boundary faces.
void updateMesh(const mapPolyMesh &)
Update mesh topology using the morph engine.
Generic GeometricField class.
void operator=(const volPointInterpolationAdjoint &)=delete
No copy assignment.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:158
bitSet isSymmetryPoint_
Per mesh(!) point whether is on symmetry plane.
autoPtr< primitivePatch > boundaryPtr_
Boundary addressing.
Interpolate from cell centres to points (vertices) using inverse distance weighting.
Templated abstract base-class for optional mesh objects used to automate their allocation to the mesh...
Definition: MeshObject.H:152
void addSeparated(GeometricField< Type, pointPatchField, pointMesh > &) const
Add separated contributions.
void interpolateBoundaryField(const GeometricField< Type, fvPatchField, volMesh > &vf, GeometricField< Type, pointPatchField, pointMesh > &pf) const
void makeWeights()
Construct all point weighting factors.
bool movePoints()
Correct weighting factors for moving mesh.
bitSet boundaryIsPatchFace_
Per boundary face whether is on non-coupled, non-empty patch.
ClassName("volPointInterpolationAdjoint")
void pushUntransformedData(List< Type > &) const
Helper: push master point data to collocated points.
Generic GeometricBoundaryField class.
void makeBoundaryWeights(scalarField &sumWeights)
Make weights for points on uncoupled patches.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
Definition: bitSet.H:59
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
volPointInterpolationAdjoint(const volPointInterpolationAdjoint &)=delete
No copy construct.
tmp< Field< Type > > flatBoundaryField(const GeometricField< Type, fvPatchField, volMesh > &vf) const
Get boundary field in same order as boundary faces. Field is.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
A class for managing temporary objects.
Definition: HashPtrTable.H:50
void interpolateSensitivitiesField(const GeometricField< Type, pointPatchField, pointMesh > &pf, typename GeometricField< Type, fvPatchField, volMesh >::Boundary &vf, const labelHashSet &patchIDs) const
Interpolate sensitivties from points to faces.
scalarListList boundaryPointWeights_
Per boundary point the weights per pointFaces.
Namespace for OpenFOAM.
UpdateableMeshObject(const word &objName, const objectRegistry &obr)
Construct from name and instance on registry.
Definition: MeshObject.H:354