extendedCentredCellToCellStencil.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::extendedCentredCellToCellStencil
26 
27 Description
28 
29 SourceFiles
30  extendedCentredCellToCellStencil.C
31 
32 \*---------------------------------------------------------------------------*/
33 
34 #ifndef extendedCentredCellToCellStencil_H
35 #define extendedCentredCellToCellStencil_H
36 
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 class cellToCellStencil;
46 
47 /*---------------------------------------------------------------------------*\
48  Class extendedCentredCellToCellStencil Declaration
49 \*---------------------------------------------------------------------------*/
50 
52 :
54 {
55  // Private Data
56 
57  //- Swap map for getting neighbouring data
59 
60  //- Per cell the stencil.
61  labelListList stencil_;
62 
63 
64 public:
65 
66  // Constructors
67 
68  //- Construct from uncompacted cell stencil
70 
71  //- Disallow default bitwise copy construction
73  (
75  );
76 
77 
78  // Member Functions
79 
80  //- Return reference to the parallel distribution map
81  const distributionMap& map() const
82  {
83  return mapPtr_();
84  }
85 
86  //- Return reference to the stencil
87  const labelListList& stencil() const
88  {
89  return stencil_;
90  }
91 
92  //- After removing elements from the stencil adapt the schedule (map).
93  void compact();
94 
95  //- Use map to get the data into stencil order
96  template<class Type>
98  (
100  List<List<Type>>& stencilFld
101  ) const
102  {
104  (
105  map(),
106  stencil(),
107  fld,
108  stencilFld
109  );
110  }
111 
112  //- Sum vol field contributions to create cell values
113  template<class Type, class WeightType>
114  tmp
115  <
117  <
119  fvPatchField,
120  volMesh
121  >
123  (
125  const List<List<WeightType>>& stencilWeights
126  ) const
127  {
129  (
130  map(),
131  stencil(),
132  fld,
133  stencilWeights
134  );
135  }
136 
137 
138  // Member Operators
139 
140  //- Disallow default bitwise assignment
141  void operator=(const extendedCentredCellToCellStencil&) = delete;
142 };
143 
144 
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 
147 } // End namespace Foam
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 #endif
152 
153 // ************************************************************************* //
static void collectData(const distributionMap &map, const labelListList &stencil, const GeometricField< T, fvPatchField, volMesh > &fld, List< List< T >> &stencilFld)
Use map to get the data into stencil order.
tmp< GeometricField< typename outerProduct< WeightType, Type >::type, fvPatchField, volMesh > > weightedSum(const GeometricField< Type, fvPatchField, volMesh > &fld, const List< List< WeightType >> &stencilWeights) const
Sum vol field contributions to create cell values.
Baseclass for cell-to-cell stencils.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:66
typeOfRank< typename pTraits< arg1 >::cmptType, direction(pTraits< arg1 >::rank)+direction(pTraits< arg2 >::rank) >::type type
Definition: products.H:90
Generic GeometricField class.
Mesh data needed to do the Finite Volume discretisation.
Definition: volMesh.H:53
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< ' ';}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< ' ';}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< ' ';}gmvFile<< nl;forAll(lagrangianScalarNames, i){ const word &name=lagrangianScalarNames[i];IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
void collectData(const GeometricField< Type, fvPatchField, volMesh > &fld, List< List< Type >> &stencilFld) const
Use map to get the data into stencil order.
extendedCentredCellToCellStencil(const cellToCellStencil &)
Construct from uncompacted cell stencil.
const distributionMap & map() const
Return reference to the parallel distribution map.
Class containing processor-to-processor mapping information.
static tmp< GeometricField< typename outerProduct< WeightType, Type >::type, fvPatchField, volMesh > > weightedSum(const distributionMap &map, const labelListList &stencil, const GeometricField< Type, fvPatchField, volMesh > &fld, const List< List< WeightType >> &stencilWeights)
Sum surface field contributions to create cell values.
void operator=(const extendedCentredCellToCellStencil &)=delete
Disallow default bitwise assignment.
const labelListList & stencil() const
Return reference to the stencil.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
void compact()
After removing elements from the stencil adapt the schedule (map).
A class for managing temporary objects.
Definition: PtrList.H:53
Namespace for OpenFOAM.
baseclass for extended cell centred addressing. Contains per cell a list of neighbouring cells and/or...