extendedCellToFaceStencil.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-2018 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::extendedCellToFaceStencil
26 
27 Description
28  Calculates/constains the extended cell-to-face stencil.
29 
30  The stencil is a list of indices into either cells or boundary faces
31  in a compact way. (element 0 is owner, 1 is neighbour). The index numbering
32  is
33  - cells first
34  - then all (non-empty patch) boundary faces
35 
36  When used in evaluation is a two stage process:
37  - collect the data (cell data and non-empty boundaries) into a
38  single field
39  - (parallel) distribute the field
40  - sum the weights*field.
41 
42 SourceFiles
43  extendedCellToFaceStencil.C
44  extendedCellToFaceStencilTemplates.C
45 
46 \*---------------------------------------------------------------------------*/
47 
48 #ifndef extendedCellToFaceStencil_H
49 #define extendedCellToFaceStencil_H
50 
51 #include "mapDistribute.H"
52 #include "volFields.H"
53 #include "surfaceFields.H"
54 
55 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56 
57 namespace Foam
58 {
59 
60 class globalIndex;
61 
62 /*---------------------------------------------------------------------------*\
63  Class extendedCellToFaceStencil Declaration
64 \*---------------------------------------------------------------------------*/
65 
67 {
68 protected:
69 
70  // Protected data
71 
72  const polyMesh& mesh_;
73 
74 
75  // Protected member functions
76 
77  //- Write some statistics about stencil
78  static void writeStencilStats
79  (
80  Ostream& os,
81  const labelListList& stencil,
82  const mapDistribute& map
83  );
84 
85 
86 public:
87 
88  // Declare name of the class and its debug switch
89  ClassName("extendedCellToFaceStencil");
90 
91 
92  // Constructors
93 
94  //- Construct from mesh
95  explicit extendedCellToFaceStencil(const polyMesh&);
96 
97 
98  // Member Functions
99 
100  //- Use map to get the data into stencil order
101  template<class T>
102  static void collectData
103  (
104  const mapDistribute& map,
105  const labelListList& stencil,
107  List<List<T>>& stencilFld
108  );
109 
110  //- Sum vol field contributions to create face values
111  template<class Type>
114  (
115  const mapDistribute& map,
116  const labelListList& stencil,
118  const List<List<scalar>>& stencilWeights
119  );
120 };
121 
122 
123 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124 
125 } // End namespace Foam
126 
127 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 
129 #ifdef NoRepository
131 #endif
132 
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 
135 #endif
136 
137 // ************************************************************************* //
Foam::surfaceFields.
Calculates/constains the extended cell-to-face stencil.
Generic GeometricField class.
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.
extendedCellToFaceStencil(const polyMesh &)
Construct from mesh.
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.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
Class containing processor-to-processor mapping information.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
static void writeStencilStats(Ostream &os, const labelListList &stencil, const mapDistribute &map)
Write some statistics about stencil.
A class for managing temporary objects.
Definition: PtrList.H:53
ClassName("extendedCellToFaceStencil")
Namespace for OpenFOAM.