trackingInverseDistanceCellCellStencil.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 -------------------------------------------------------------------------------
10 License
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 
26 Class
27  Foam::cellCellStencils::trackingInverseDistance
28 
29 Description
30  Inverse-distance-weighted interpolation stencil.
31 
32 SourceFiles
33  trackingInverseDistanceCellCellStencil.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef cellCellStencils_trackingInverseDistance_H
38 #define cellCellStencils_trackingInverseDistance_H
39 
41 #include "globalIndex.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 class voxelMeshSearch;
49 
50 namespace cellCellStencils
51 {
52 
53 /*---------------------------------------------------------------------------*\
54  Class trackingInverseDistance Declaration
55 \*---------------------------------------------------------------------------*/
56 
58 :
59  public inverseDistance
60 {
61 protected:
62 
63  // Protected data
64 
65  //- Global indexing for cells
67 
68  //- Current (global) donor cell
70 
71  //- Subset according to zone
73 
74 
75 
76  // Protected Member Functions
77 
78  //- Mark voxels of patchTypes with type of patch face
79  static bool markBoundaries
80  (
81  const fvMesh& mesh,
82  const vector& smallVec,
83 
84  const boundBox& bb,
85  labelVector& nDivs,
87 
88  const labelList& cellMap,
89  labelList& patchCellTypes
90  );
91 
92  //- Mark all cells overlapping (a voxel covered by) a src patch
93  // with type HOLE
95  (
96  PstreamBuffers& pBufs,
97 
98  // Voxel mesh for patches
99  const List<treeBoundBoxList>& patchBb,
100  const List<labelVector>& patchDivisions,
101  const PtrList<PackedList<2>>& patchParts,
102 
103  const label srcI,
104  const label tgtI,
105  labelList& allCellTypes
106  ) const;
107 
108  void markDonors
109  (
110  PstreamBuffers& pBufs,
112  const PtrList<voxelMeshSearch>& meshSearches,
113  const labelList& allCellTypes,
114 
115  const label srcI,
116  const label tgtI,
117  labelListList& allStencil,
118  labelList& allDonor
119  ) const;
120 
121 
122 private:
123 
124  // Private Member Functions
125 
126  //- No copy construct
128 
129  //- No copy assignment
130  void operator=(const trackingInverseDistance&) = delete;
131 
132 
133 public:
134 
135  //- Runtime type information
136  TypeName("trackingInverseDistance");
137 
138 
139  // Constructors
140 
141  //- Construct from fvMesh
142  trackingInverseDistance(const fvMesh&, const dictionary&, const bool);
143 
144 
145  //- Destructor
146  virtual ~trackingInverseDistance();
147 
148 
149  // Member Functions
150 
151  //- Update stencils. Return false if nothing changed.
152  virtual bool update();
153 
154 };
155 
156 
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 
159 } // End namespace cellCellStencils
160 } // End namespace Foam
161 
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 
164 #endif
165 
166 // ************************************************************************* //
inverseDistanceCellCellStencil.H
Foam::cellCellStencils::inverseDistance
Inverse-distance-weighted interpolation stencil.
Definition: inverseDistanceCellCellStencil.H:67
Foam::cellCellStencils::trackingInverseDistance::markPatchesAsHoles
void markPatchesAsHoles(PstreamBuffers &pBufs, const List< treeBoundBoxList > &patchBb, const List< labelVector > &patchDivisions, const PtrList< PackedList< 2 >> &patchParts, const label srcI, const label tgtI, labelList &allCellTypes) const
Mark all cells overlapping (a voxel covered by) a src patch.
Definition: trackingInverseDistanceCellCellStencil.C:197
Foam::cellCellStencils::trackingInverseDistance::~trackingInverseDistance
virtual ~trackingInverseDistance()
Destructor.
Definition: trackingInverseDistanceCellCellStencil.C:563
globalIndex.H
Foam::cellCellStencils::trackingInverseDistance
Inverse-distance-weighted interpolation stencil.
Definition: trackingInverseDistanceCellCellStencil.H:56
Foam::PstreamBuffers
Buffers for inter-processor communications streams (UOPstream, UIPstream).
Definition: PstreamBuffers.H:88
meshBb
List< treeBoundBox > meshBb(1, treeBoundBox(boundBox(coarseMesh.points(), false)).extend(rndGen, 1e-3))
Foam::cellCellStencils::trackingInverseDistance::globalCells_
globalIndex globalCells_
Global indexing for cells.
Definition: trackingInverseDistanceCellCellStencil.H:65
Foam::cellCellStencils::trackingInverseDistance::markDonors
void markDonors(PstreamBuffers &pBufs, const List< treeBoundBoxList > &meshBb, const PtrList< voxelMeshSearch > &meshSearches, const labelList &allCellTypes, const label srcI, const label tgtI, labelListList &allStencil, labelList &allDonor) const
Definition: trackingInverseDistanceCellCellStencil.C:323
Foam::cellCellStencils::trackingInverseDistance::update
virtual bool update()
Update stencils. Return false if nothing changed.
Definition: trackingInverseDistanceCellCellStencil.C:569
Foam::cellCellStencils::trackingInverseDistance::markBoundaries
static bool markBoundaries(const fvMesh &mesh, const vector &smallVec, const boundBox &bb, labelVector &nDivs, PackedList< 2 > &patchTypes, const labelList &cellMap, labelList &patchCellTypes)
Mark voxels of patchTypes with type of patch face.
Definition: trackingInverseDistanceCellCellStencil.C:55
patchTypes
wordList patchTypes(nPatches)
Foam::cellCellStencils::trackingInverseDistance::globalDonor_
labelList globalDonor_
Current (global) donor cell.
Definition: trackingInverseDistanceCellCellStencil.H:68
Foam::PtrList
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: List.H:59
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::globalIndex
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
Definition: globalIndex.H:68
Foam::cellCellStencils::trackingInverseDistance::TypeName
TypeName("trackingInverseDistance")
Runtime type information.
Foam::cellCellStencils::trackingInverseDistance::meshParts_
PtrList< fvMeshSubset > meshParts_
Subset according to zone.
Definition: trackingInverseDistanceCellCellStencil.H:71
Foam::Vector< scalar >
Foam::List< label >
Foam::PackedList< 2 >
Foam::boundBox
A bounding box defined in terms of min/max extrema points.
Definition: boundBox.H:63