extendedCellToFaceStencil.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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2016 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::extendedCellToFaceStencil
28 
29 Description
30  Calculates/constains the extended cell-to-face stencil.
31 
32  The stencil is a list of indices into either cells or boundary faces
33  in a compact way. (element 0 is owner, 1 is neighbour). The index numbering
34  is
35  - cells first
36  - then all (non-empty patch) boundary faces
37 
38  When used in evaluation is a two stage process:
39  - collect the data (cell data and non-empty boundaries) into a
40  single field
41  - (parallel) distribute the field
42  - sum the weights*field.
43 
44 SourceFiles
45  extendedCellToFaceStencil.C
46  extendedCellToFaceStencilTemplates.C
47 
48 \*---------------------------------------------------------------------------*/
49 
50 #ifndef extendedCellToFaceStencil_H
51 #define extendedCellToFaceStencil_H
52 
53 #include "mapDistribute.H"
54 #include "volFields.H"
55 #include "surfaceFields.H"
56 
57 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
58 
59 namespace Foam
60 {
61 
62 class globalIndex;
63 
64 /*---------------------------------------------------------------------------*\
65  Class extendedCellToFaceStencil Declaration
66 \*---------------------------------------------------------------------------*/
67 
69 {
70 protected:
71 
72  // Protected data
73 
74  const polyMesh& mesh_;
75 
76 
77  // Protected member functions
78 
79  //- Write some statistics about stencil
80  static void writeStencilStats
81  (
82  Ostream& os,
83  const labelListList& stencil,
84  const mapDistribute& map
85  );
86 
87 
88 public:
89 
90  // Declare name of the class and its debug switch
91  ClassName("extendedCellToFaceStencil");
92 
93 
94  // Constructors
95 
96  //- Construct from mesh
97  explicit extendedCellToFaceStencil(const polyMesh&);
98 
99 
100  // Member Functions
101 
102  //- Use map to get the data into stencil order
103  template<class T>
104  static void collectData
105  (
106  const mapDistribute& map,
107  const labelListList& stencil,
109  List<List<T>>& stencilFld
110  );
111 
112  //- Sum vol field contributions to create face values
113  template<class Type>
116  (
117  const mapDistribute& map,
118  const labelListList& stencil,
120  const List<List<scalar>>& stencilWeights
121  );
122 };
123 
124 
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126 
127 } // End namespace Foam
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 #ifdef NoRepository
133 #endif
134 
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136 
137 #endif
138 
139 // ************************************************************************* //
volFields.H
Foam::extendedCellToFaceStencil::collectData
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.
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::extendedCellToFaceStencil::extendedCellToFaceStencil
extendedCellToFaceStencil(const polyMesh &)
Construct from mesh.
Definition: extendedCellToFaceStencil.C:101
surfaceFields.H
Foam::surfaceFields.
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::mapDistribute
Class containing processor-to-processor mapping information.
Definition: mapDistribute.H:163
fld
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< ' ';}gmvFile<< nl;for(const word &name :lagrangianScalarNames){ IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Definition: gmvOutputLagrangian.H:23
os
OBJstream os(runTime.globalPath()/outputName)
Foam::extendedCellToFaceStencil
Calculates/constains the extended cell-to-face stencil.
Definition: extendedCellToFaceStencil.H:67
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
mapDistribute.H
Foam::List< labelList >
Foam::extendedCellToFaceStencil::writeStencilStats
static void writeStencilStats(Ostream &os, const labelListList &stencil, const mapDistribute &map)
Write some statistics about stencil.
Definition: extendedCellToFaceStencil.C:43
Foam::extendedCellToFaceStencil::ClassName
ClassName("extendedCellToFaceStencil")
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::GeometricField
Generic GeometricField class.
Definition: areaFieldsFwd.H:53
extendedCellToFaceStencilTemplates.C
Foam::extendedCellToFaceStencil::weightedSum
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.
Foam::extendedCellToFaceStencil::mesh_
const polyMesh & mesh_
Definition: extendedCellToFaceStencil.H:73