cellCellStencilObject.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) 2017-2019 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::cellCellStencilObject
28
29Description
30
31SourceFiles
32
33\*---------------------------------------------------------------------------*/
34
35#ifndef cellCellStencilObject_H
36#define cellCellStencilObject_H
37
38#include "cellCellStencil.H"
39#include "MeshObject.H"
40
41// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42
43namespace Foam
44{
45
46class cellCellStencilObject;
47typedef MeshObject
48<
49 fvMesh,
52> Stencil;
53
54/*---------------------------------------------------------------------------*\
55 Class cellCellStencilObject Declaration
56\*---------------------------------------------------------------------------*/
59:
60 public Stencil,
61 public cellCellStencil
62{
63 // Private data
64
65 autoPtr<cellCellStencil> stencilPtr_;
66
67
68public:
70 TypeName("cellCellStencilObject");
71
72 // Constructors
73
74 //- Construct with mesh
76 (
77 const fvMesh& mesh,
78 const bool update = true
79 )
80 :
82 <
83 fvMesh,
86 >(mesh),
88 stencilPtr_
89 (
91 (
92 mesh,
93 mesh.schemesDict().subDict
94 (
95 "oversetInterpolation"
96 ),
97 update
98 )
99 )
100 {}
101
102
103 //- Destructor
104 virtual ~cellCellStencilObject() = default;
105
106
107 // Member Functions
108
109 //- Callback for geometry motion
110 virtual bool movePoints()
111 {
112 return stencilPtr_().update();
113 }
114
115 //- Update stencils. Return false if nothing changed.
116 virtual bool update()
117 {
118 return stencilPtr_().update();
119 }
120
121 //- Return the cell type list
122 virtual const labelUList& cellTypes() const
123 {
124 return stencilPtr_().cellTypes();
125 }
126
127 //- Indices of interpolated cells
128 virtual const labelUList& interpolationCells() const
129 {
130 return stencilPtr_().interpolationCells();
131 }
132
133 //- Return a communication schedule
134 virtual const mapDistribute& cellInterpolationMap() const
135 {
136 return stencilPtr_().cellInterpolationMap();
137 }
138
139 //- Per interpolated cell the neighbour cells (in terms of slots as
140 // constructed by above cellInterpolationMap) to interpolate
141 virtual const labelListList& cellStencil() const
142 {
143 return stencilPtr_().cellStencil();
144 }
145
146 //- Weights for cellStencil
147 virtual const List<scalarList>& cellInterpolationWeights() const
148 {
149 return stencilPtr_().cellInterpolationWeights();
150 }
151
152 //- Per interpolated cell the interpolation factor. (0 = use
153 // calculated, 1 = use interpolated)
154 virtual const scalarList& cellInterpolationWeight() const
155 {
156 return stencilPtr_().cellInterpolationWeight();
157 }
158
159 //- Calculate weights for a single acceptor
160 virtual void stencilWeights
161 (
162 const point& sample,
163 const pointList& donorCcs,
164 scalarList& weights
165 ) const
166 {
167 stencilPtr_().stencilWeights(sample, donorCcs, weights);
168 }
169
170 //- Return the names of any (stencil or mesh specific) fields that
171 // should not be interpolated
172 virtual const wordHashSet& nonInterpolatedFields() const
173 {
174 return stencilPtr_().nonInterpolatedFields();
175 }
176};
177
178
179// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180
181} // End namespace Foam
182
183// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184
185#endif
186
187// ************************************************************************* //
Minimal example by using system/controlDict.functions:
Templated abstract base-class for optional mesh objects used to automate their allocation to the mesh...
Definition: MeshObject.H:91
static const Type & New(const Mesh &mesh, Args &&... args)
Get existing or create a new MeshObject.
Definition: MeshObject.C:48
const Mesh & mesh() const
Definition: MeshObject.H:122
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
virtual bool update()
Update stencils. Return false if nothing changed.
virtual const wordHashSet & nonInterpolatedFields() const
Return the names of any (stencil or mesh specific) fields that.
virtual const labelUList & interpolationCells() const
Indices of interpolated cells.
virtual ~cellCellStencilObject()=default
Destructor.
virtual bool movePoints()
Callback for geometry motion.
virtual const mapDistribute & cellInterpolationMap() const
Return a communication schedule.
virtual const scalarList & cellInterpolationWeight() const
Per interpolated cell the interpolation factor. (0 = use.
virtual const labelUList & cellTypes() const
Return the cell type list.
virtual const List< scalarList > & cellInterpolationWeights() const
Weights for cellStencil.
cellCellStencilObject(const fvMesh &mesh, const bool update=true)
Construct with mesh.
virtual const labelListList & cellStencil() const
Per interpolated cell the neighbour cells (in terms of slots as.
TypeName("cellCellStencilObject")
virtual void stencilWeights(const point &sample, const pointList &donorCcs, scalarList &weights) const
Calculate weights for a single acceptor.
Calculation of interpolation stencils.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
Class containing processor-to-processor mapping information.
Namespace for OpenFOAM.
MeshObject< fvMesh, Foam::MoveableMeshObject, cellCellStencilObject > Stencil
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73