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-2023 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  ) = delete;
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>
97  void collectData
98  (
99  const VolField<Type>& fld,
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>
116  (
117  const VolField<Type>& fld,
118  const List<List<WeightType>>& stencilWeights
119  ) const
120  {
122  (
123  map(),
124  stencil(),
125  fld,
126  stencilWeights
127  );
128  }
129 
130 
131  // Member Operators
132 
133  //- Disallow default bitwise assignment
134  void operator=(const extendedCentredCellToCellStencil&) = delete;
135 };
136 
137 
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 
140 } // End namespace Foam
141 
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143 
144 #endif
145 
146 // ************************************************************************* //
Generic GeometricField class.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
baseclass for extended cell centred addressing. Contains per cell a list of neighbouring cells and/or...
Class containing processor-to-processor mapping information.
Baseclass for cell-to-cell stencils.
static tmp< VolField< typename outerProduct< WeightType, Type >::type > > weightedSum(const distributionMap &map, const labelListList &stencil, const VolField< Type > &fld, const List< List< WeightType >> &stencilWeights)
Sum surface field contributions to create cell values.
static void collectData(const distributionMap &map, const labelListList &stencil, const VolField< Type > &fld, List< List< Type >> &stencilFld)
Use map to get the data into stencil order.
void compact()
After removing elements from the stencil adapt the schedule (map).
const distributionMap & map() const
Return reference to the parallel distribution map.
const labelListList & stencil() const
Return reference to the stencil.
tmp< VolField< typename outerProduct< WeightType, Type >::type > > weightedSum(const VolField< Type > &fld, const List< List< WeightType >> &stencilWeights) const
Sum vol field contributions to create cell values.
extendedCentredCellToCellStencil(const cellToCellStencil &)
Construct from uncompacted cell stencil.
void collectData(const VolField< Type > &fld, List< List< Type >> &stencilFld) const
Use map to get the data into stencil order.
void operator=(const extendedCentredCellToCellStencil &)=delete
Disallow default bitwise assignment.
A class for managing temporary objects.
Definition: tmp.H:55
gmvFile<< "tracers "<< particles.size()<< nl;{ pointField positions(particles.size());label particlei=0;forAllConstIter(Cloud< passiveParticle >, particles, iter) { positions[particlei++]=iter().position(mesh);} for(i=0;i< pTraits< point >::nComponents;i++) { forAll(positions, particlei) { gmvFile<< component(positions[particlei], i)<< ' ';} gmvFile<< nl;}}forAll(lagrangianScalarNames, i){ const word &name=lagrangianScalarNames[i];IOField< scalar > fld(IOobject(name, runTime.name(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Namespace for OpenFOAM.