Loading...
Searching...
No Matches
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,2024 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 Foam_cellCellStencilObject_H
36#define Foam_cellCellStencilObject_H
37
38#include "cellCellStencil.H"
39#include "MeshObject.H"
40
41// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42
43namespace Foam
44{
45
46// Typedefs
49
51/*---------------------------------------------------------------------------*\
52 Class cellCellStencilObject Declaration
53\*---------------------------------------------------------------------------*/
54
56:
57 public Stencil,
58 public cellCellStencil
59{
60 // Private Data
61
63
64
65public:
66
67 TypeName("cellCellStencilObject");
68
69
70 // Constructors
71
72 //- Construct with mesh
74 (
75 const fvMesh& mesh,
76 const bool update = true
77 )
78 :
80 cellCellStencil(mesh),
81 stencilPtr_
82 (
83 cellCellStencil::New
84 (
85 mesh,
86 mesh.schemesDict().subDict
87 (
88 "oversetInterpolation"
89 ),
90 update
91 )
92 )
93 {}
94
95
96 //- Destructor
97 virtual ~cellCellStencilObject() = default;
98
99
100 // Member Functions
101
102 //- Callback for geometry motion
103 virtual bool movePoints();
104
105 //- Update stencils. Return false if nothing changed.
106 virtual bool update()
107 {
108 return stencilPtr_().update();
110
111 //- Return the cell type list
112 virtual const labelUList& cellTypes() const
113 {
114 return stencilPtr_().cellTypes();
115 }
116
117 //- Indices of interpolated cells
118 virtual const labelUList& interpolationCells() const
119 {
120 return stencilPtr_().interpolationCells();
121 }
122
123 //- Return a communication schedule
124 virtual const mapDistribute& cellInterpolationMap() const
126 return stencilPtr_().cellInterpolationMap();
127 }
128
129 //- Per interpolated cell the neighbour cells (in terms of slots as
130 // constructed by above cellInterpolationMap) to interpolate
131 virtual const labelListList& cellStencil() const
132 {
133 return stencilPtr_().cellStencil();
134 }
135
136 //- Weights for cellStencil
137 virtual const List<scalarList>& cellInterpolationWeights() const
138 {
139 return stencilPtr_().cellInterpolationWeights();
140 }
141
142 //- Per interpolated cell the interpolation factor. (0 = use
143 // calculated, 1 = use interpolated)
144 virtual const scalarList& cellInterpolationWeight() const
145 {
146 return stencilPtr_().cellInterpolationWeight();
147 }
148
149 //- Calculate weights for a single acceptor
150 virtual void stencilWeights
152 const point& sample,
153 const pointList& donorCcs,
154 scalarList& weights
155 ) const
156 {
157 stencilPtr_().stencilWeights(sample, donorCcs, weights);
158 }
159
160 //- Return the names of any (stencil or mesh specific) fields that
161 // should not be interpolated
162 virtual const wordHashSet& nonInterpolatedFields() const
163 {
164 return stencilPtr_().nonInterpolatedFields();
165 }
166};
167
168
169// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170
171} // End namespace Foam
172
173// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174
175#endif
176
177// ************************************************************************* //
Minimal example by using system/controlDict.functions:
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition List.H:72
Templated abstract base-class for optional mesh objects used to automate their allocation to the mesh...
Definition MeshObject.H:155
static FOAM_NO_DANGLING_REFERENCE const cellCellStencilObject & New(const fvMesh &mesh, Args &&... args)
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
virtual bool movePoints()
Callback for geometry motion.
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 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.
Mesh data needed to do the Finite Volume discretisation.
Definition fvMesh.H:85
Class containing processor-to-processor mapping information.
Namespace for OpenFOAM.
HashSet< word, Hash< word > > wordHashSet
A HashSet of words, uses string hasher.
Definition HashSet.H:80
List< labelList > labelListList
List of labelList.
Definition labelList.H:38
List< point > pointList
List of point.
Definition pointList.H:32
vector point
Point is a vector.
Definition point.H:37
UList< label > labelUList
A UList of labels.
Definition UList.H:75
List< scalar > scalarList
List of scalar.
Definition scalarList.H:32
MeshObject< fvMesh, MoveableMeshObject, cellCellStencilObject > Stencil
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68