All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
extendedCentredCellToFaceStencil.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) 2011-2019 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::extendedCentredCellToFaceStencil
26 
27 Description
28 
29 SourceFiles
30  extendedCentredCellToFaceStencil.C
31 
32 \*---------------------------------------------------------------------------*/
33 
34 #ifndef extendedCentredCellToFaceStencil_H
35 #define extendedCentredCellToFaceStencil_H
36 
38 
39 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
40 
41 namespace Foam
42 {
43 
44 class cellToFaceStencil;
45 
46 /*---------------------------------------------------------------------------*\
47  Class extendedCentredCellToFaceStencil Declaration
48 \*---------------------------------------------------------------------------*/
49 
51 :
53 {
54  // Private Data
55 
56  //- Swap map for getting neighbouring data
57  autoPtr<mapDistribute> mapPtr_;
58 
59  //- Per face the stencil.
60  labelListList stencil_;
61 
62 
63 public:
64 
65  // Constructors
66 
67  //- Construct from uncompacted face stencil
69 
70  //- Disallow default bitwise copy construction
72  (
74  );
75 
76 
77  // Member Functions
78 
79  //- Return reference to the parallel distribution map
80  const mapDistribute& map() const
81  {
82  return mapPtr_();
83  }
84 
85  //- Return reference to the stencil
86  const labelListList& stencil() const
87  {
88  return stencil_;
89  }
90 
91  //- After removing elements from the stencil adapt the schedule (map).
92  void compact();
93 
94  //- Use map to get the data into stencil order
95  template<class T>
97  (
99  List<List<T>>& stencilFld
100  ) const
101  {
103  (
104  map(),
105  stencil(),
106  fld,
107  stencilFld
108  );
109  }
110 
111  //- Sum vol field contributions to create face values
112  template<class Type>
114  (
116  const List<List<scalar>>& stencilWeights
117  ) const
118  {
120  (
121  map(),
122  stencil(),
123  fld,
124  stencilWeights
125  );
126  }
127 
128 
129  // Member Operators
130 
131  //- Disallow default bitwise assignment
132  void operator=(const extendedCentredCellToFaceStencil&) = delete;
133 };
134 
135 
136 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137 
138 } // End namespace Foam
139 
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 
142 #endif
143 
144 // ************************************************************************* //
Calculates/constains the extended cell-to-face stencil.
Generic GeometricField class.
Base class for extended cell-to-face stencils (face values from neighbouring cells) ...
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > weightedSum(const GeometricField< Type, fvPatchField, volMesh > &fld, const List< List< scalar >> &stencilWeights) const
Sum vol field contributions to create face values.
extendedCentredCellToFaceStencil(const cellToFaceStencil &)
Construct from uncompacted face stencil.
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))
static tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > weightedSum(const mapDistribute &map, const labelListList &stencil, const GeometricField< Type, fvPatchField, volMesh > &fld, const List< List< scalar >> &stencilWeights)
Sum vol field contributions to create face values.
void compact()
After removing elements from the stencil adapt the schedule (map).
void operator=(const extendedCentredCellToFaceStencil &)=delete
Disallow default bitwise assignment.
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 labelListList & stencil() const
Return reference to the stencil.
Class containing processor-to-processor mapping information.
void collectData(const GeometricField< T, fvPatchField, volMesh > &fld, List< List< T >> &stencilFld) const
Use map to get the data into stencil order.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
A class for managing temporary objects.
Definition: PtrList.H:53
const mapDistribute & map() const
Return reference to the parallel distribution map.
Namespace for OpenFOAM.