extendedCentredCellToCellStencil.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 | Copyright (C) 2013-2016 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 neigbouring data
58  autoPtr<mapDistribute> mapPtr_;
59 
60  //- Per cell the stencil.
61  labelListList stencil_;
62 
63 
64  // Private Member Functions
65 
66  //- Disallow default bitwise copy construct
68  (
70  );
71 
72  //- Disallow default bitwise assignment
73  void operator=(const extendedCentredCellToCellStencil&);
74 
75 
76 public:
77 
78  // Constructors
79 
80  //- Construct from uncompacted cell stencil
82 
83 
84  // Member Functions
85 
86  //- Return reference to the parallel distribution map
87  const mapDistribute& map() const
88  {
89  return mapPtr_();
90  }
91 
92  //- Return reference to the stencil
93  const labelListList& stencil() const
94  {
95  return stencil_;
96  }
97 
98  //- After removing elements from the stencil adapt the schedule (map).
99  void compact();
100 
101  //- Use map to get the data into stencil order
102  template<class Type>
104  (
106  List<List<Type>>& stencilFld
107  ) const
108  {
110  (
111  map(),
112  stencil(),
113  fld,
114  stencilFld
115  );
116  }
117 
118  //- Sum vol field contributions to create cell values
119  template<class Type, class WeightType>
120  tmp
121  <
123  <
125  fvPatchField,
126  volMesh
127  >
129  (
131  const List<List<WeightType>>& stencilWeights
132  ) const
133  {
135  (
136  map(),
137  stencil(),
138  fld,
139  stencilWeights
140  );
141  }
142 };
143 
144 
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 
147 } // End namespace Foam
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 #endif
152 
153 // ************************************************************************* //
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.
static void collectData(const mapDistribute &map, const labelListList &stencil, const GeometricField< T, fvPatchField, volMesh > &fld, List< List< T >> &stencilFld)
Use map to get the data into stencil order.
const mapDistribute & map() const
Return reference to the parallel distribution map.
Class containing processor-to-processor mapping information.
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
static tmp< GeometricField< typename outerProduct< WeightType, Type >::type, fvPatchField, volMesh > > weightedSum(const mapDistribute &map, const labelListList &stencil, const GeometricField< Type, fvPatchField, volMesh > &fld, const List< List< WeightType >> &stencilWeights)
Sum surface field contributions to create cell values.
Namespace for OpenFOAM.
baseclass for extended cell centred addressing. Contains per cell a list of neighbouring cells and/or...