Loading...
Searching...
No Matches
pointVolInterpolation.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) Wikki Ltd
9 Copyright (C) 2019 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
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
28Class
29 Foam::pointVolInterpolation
30
31Description
32
33SourceFiles
34 pointVolInterpolation.C
35 pointVolInterpolate.C
36
37\*---------------------------------------------------------------------------*/
38
39#ifndef Foam_pointVolInterpolation_H
40#define Foam_pointVolInterpolation_H
41
42#include "primitiveFieldsFwd.H"
44#include "volFieldsFwd.H"
45#include "pointFieldsFwd.H"
46#include "scalarList.H"
47#include "tmp.H"
48#include "className.H"
49#include "FieldFields.H"
50
51// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52
53namespace Foam
54{
55
56// Forward Declarations
57class fvMesh;
58class pointMesh;
60/*---------------------------------------------------------------------------*\
61 Class pointVolInterpolation Declaration
62\*---------------------------------------------------------------------------*/
63
65{
66 // Private Data
67
68 const pointMesh& pointMesh_;
69
70 const fvMesh& fvMesh_;
71
72 //- Interpolation scheme weighting factor array.
73 mutable std::unique_ptr<FieldField<Field, scalar>> volWeightsPtr_;
74
75 //- Primitive patch interpolators
76 mutable PtrList<primitivePatchInterpolation> patchInterpolators_;
77
78
79 // Private Member Functions
80
81 //- Return patch interpolators
82 const PtrList<primitivePatchInterpolation>& patchInterpolators() const;
83
84 //- Construct point weighting factors
85 void makeWeights() const;
86
87 //- Clear addressing
88 void clearAddressing() const;
89
90 //- Clear geometry
91 void clearGeom() const;
92
93
94protected:
95
96 const pointMesh& pMesh() const noexcept { return pointMesh_; }
97
98 const fvMesh& vMesh() const noexcept { return fvMesh_; }
99
100
101public:
102
103 // Declare name of the class and it's debug switch
104 ClassName("pointVolInterpolation");
106
107 // Constructors
108
109 //- Construct given pointMesh and fvMesh.
110 pointVolInterpolation(const pointMesh&, const fvMesh&);
112
113 //- Destructor
115
116
117 // Member Functions
118
119 // Access
120
121 //- Return reference to weights arrays.
122 // This also constructs the weighting factors if necessary.
124
125
126 // Edit
127
128 //- Update mesh topology using the morph engine
129 void updateTopology();
130
131 //- Correct weighting factors for moving mesh.
132 bool movePoints();
133
134
135 // Interpolation functions
136
137 //- Interpolate from pointField to volField
138 // using inverse distance weighting
139 template<class Type>
140 void interpolate
141 (
144 ) const;
145
146 //- Interpolate pointField returning volField
147 // using inverse distance weighting
148 template<class Type>
150 (
152 ) const;
153
154 //- Interpolate tmp<pointField> returning volField
155 // using inverse distance weighting
156 template<class Type>
158 (
160 ) const;
161};
162
163
164// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165
166} // End namespace Foam
167
168// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169
170#ifdef NoRepository
171# include "pointVolInterpolate.C"
172#endif
174// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175
176#endif
177
178// ************************************************************************* //
A field of fields is a PtrList of fields with reference counting.
Definition FieldField.H:77
Generic GeometricField class.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition PtrList.H:67
Mesh data needed to do the Finite Volume discretisation.
Definition fvMesh.H:85
Mesh representing a set of points created from polyMesh.
Definition pointMesh.H:49
bool movePoints()
Correct weighting factors for moving mesh.
const FieldField< Field, scalar > & volWeights() const
Return reference to weights arrays.
ClassName("pointVolInterpolation")
tmp< GeometricField< Type, fvPatchField, volMesh > > interpolate(const GeometricField< Type, pointPatchField, pointMesh > &) const
Interpolate pointField returning volField.
pointVolInterpolation(const pointMesh &, const fvMesh &)
Construct given pointMesh and fvMesh.
const fvMesh & vMesh() const noexcept
const pointMesh & pMesh() const noexcept
void interpolate(const GeometricField< Type, pointPatchField, pointMesh > &, GeometricField< Type, fvPatchField, volMesh > &) const
Interpolate from pointField to volField.
void updateTopology()
Update mesh topology using the morph engine.
tmp< GeometricField< Type, fvPatchField, volMesh > > interpolate(const tmp< GeometricField< Type, pointPatchField, pointMesh > > &) const
Interpolate tmp<pointField> returning volField.
A class for managing temporary objects.
Definition tmp.H:75
Macro definitions for declaring ClassName(), NamespaceName(), etc.
#define ClassName(TypeNameString)
Add typeName information from argument TypeNameString to a class.
Definition className.H:74
Namespace for OpenFOAM.
const direction noexcept
Definition scalarImpl.H:265
Forwards and collection of common point field types.
Forward declarations of the specialisations of Field<T> for scalar, vector and tensor.
Forwards and collection of common volume field types.