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-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::extendedCellToFaceStencil
28
29Description
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
44SourceFiles
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
59namespace Foam
60{
61
62class globalIndex;
63
64/*---------------------------------------------------------------------------*\
65 Class extendedCellToFaceStencil Declaration
66\*---------------------------------------------------------------------------*/
69{
70protected:
71
72 // Protected data
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
88public:
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// ************************************************************************* //
Info<< nl<< "Wrote faMesh in vtk format: "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.mesh().time().globalPath()/"finiteArea-edges"));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
Generic GeometricField class.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
Calculates/constains the extended cell-to-face stencil.
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.
static void writeStencilStats(Ostream &os, const labelListList &stencil, const mapDistribute &map)
Write some statistics about stencil.
ClassName("extendedCellToFaceStencil")
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.
Class containing processor-to-processor mapping information.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
A class for managing temporary objects.
Definition: tmp.H:65
#define ClassName(TypeNameString)
Add typeName information from argument TypeNameString to a class.
Definition: className.H:67
OBJstream os(runTime.globalPath()/outputName)
Namespace for OpenFOAM.
Foam::surfaceFields.