extendedCentredFaceToCellStencil.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) 2011 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::extendedCentredFaceToCellStencil
26 
27 Description
28 
29 SourceFiles
30  extendedCentredFaceToCellStencil.C
31 
32 \*---------------------------------------------------------------------------*/
33 
34 #ifndef extendedCentredFaceToCellStencil_H
35 #define extendedCentredFaceToCellStencil_H
36 
38 
39 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
40 
41 namespace Foam
42 {
43 
44 class faceToCellStencil;
45 
46 /*---------------------------------------------------------------------------*\
47  Class extendedCentredFaceToCellStencil Declaration
48 \*---------------------------------------------------------------------------*/
49 
51 :
53 {
54  // Private data
55 
56  //- Swap map for getting neigbouring data
58 
59  //- Per face the stencil.
61 
62 
63  // Private Member Functions
64 
65  //- Disallow default bitwise copy construct
67  (
69  );
70 
71  //- Disallow default bitwise assignment
73 
74 
75 public:
76 
77  // Constructors
78 
79  //- Construct from uncompacted face stencil
81 
82 
83  // Member Functions
84 
85  //- Return reference to the parallel distribution map
86  const mapDistribute& map() const
87  {
88  return mapPtr_();
89  }
90 
91  //- Return reference to the stencil
92  const labelListList& stencil() const
93  {
94  return stencil_;
95  }
96 
97  //- After removing elements from the stencil adapt the schedule (map).
98  void compact();
99 
100  //- Use map to get the data into stencil order
101  template<class T>
103  (
105  List<List<T> >& stencilFld
106  ) const
107  {
109  (
110  map(),
111  stencil(),
112  fld,
113  stencilFld
114  );
115  }
116 
117  //- Sum surface field contributions to create cell values
118  template<class Type>
120  (
122  const List<List<scalar> >& stencilWeights
123  ) const
124  {
126  (
127  map(),
128  stencil(),
129  fld,
130  stencilWeights
131  );
132  }
133 
134 };
135 
136 
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138 
139 } // End namespace Foam
140 
141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142 
143 #endif
144 
145 // ************************************************************************* //
Foam::extendedCentredFaceToCellStencil::stencil_
labelListList stencil_
Per face the stencil.
Definition: extendedCentredFaceToCellStencil.H:59
Foam::extendedCentredFaceToCellStencil
Definition: extendedCentredFaceToCellStencil.H:49
Foam::extendedCentredFaceToCellStencil::compact
void compact()
After removing elements from the stencil adapt the schedule (map).
Definition: extendedCentredFaceToCellStencil.C:57
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
Foam::extendedFaceToCellStencil
Note: transformations on coupled patches not supported. Problem is the positions of cells reachable t...
Definition: extendedFaceToCellStencil.H:54
Foam::extendedCentredFaceToCellStencil::extendedCentredFaceToCellStencil
extendedCentredFaceToCellStencil(const extendedCentredFaceToCellStencil &)
Disallow default bitwise copy construct.
Foam::mapDistribute
Class containing processor-to-processor mapping information.
Definition: mapDistribute.H:152
fld
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))
Foam::extendedCentredFaceToCellStencil::collectData
void collectData(const GeometricField< T, fvsPatchField, surfaceMesh > &fld, List< List< T > > &stencilFld) const
Use map to get the data into stencil order.
Definition: extendedCentredFaceToCellStencil.H:102
Foam::extendedCentredFaceToCellStencil::stencil
const labelListList & stencil() const
Return reference to the stencil.
Definition: extendedCentredFaceToCellStencil.H:91
Foam::extendedFaceToCellStencil::weightedSum
static tmp< GeometricField< Type, fvPatchField, volMesh > > weightedSum(const mapDistribute &map, const labelListList &stencil, const GeometricField< Type, fvsPatchField, surfaceMesh > &fld, const List< List< scalar > > &stencilWeights)
Sum surface field contributions to create cell values.
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::extendedCentredFaceToCellStencil::map
const mapDistribute & map() const
Return reference to the parallel distribution map.
Definition: extendedCentredFaceToCellStencil.H:85
Foam::extendedCentredFaceToCellStencil::mapPtr_
autoPtr< mapDistribute > mapPtr_
Swap map for getting neigbouring data.
Definition: extendedCentredFaceToCellStencil.H:56
Foam::extendedFaceToCellStencil::collectData
static void collectData(const mapDistribute &map, const labelListList &stencil, const GeometricField< T, fvsPatchField, surfaceMesh > &fld, List< List< T > > &stencilFld)
Use map to get the data into stencil order.
Foam::extendedCentredFaceToCellStencil::operator=
void operator=(const extendedCentredFaceToCellStencil &)
Disallow default bitwise assignment.
extendedFaceToCellStencil.H
Foam::autoPtr
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:117
Foam::faceToCellStencil
baseclass for extended cell centred addressing. Contains per cell a list of neighbouring faces in glo...
Definition: faceToCellStencil.H:54
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
Foam::GeometricField
Generic GeometricField class.
Definition: surfaceFieldsFwd.H:52
Foam::extendedCentredFaceToCellStencil::weightedSum
tmp< GeometricField< Type, fvPatchField, volMesh > > weightedSum(const GeometricField< Type, fvsPatchField, surfaceMesh > &fld, const List< List< scalar > > &stencilWeights) const
Sum surface field contributions to create cell values.
Definition: extendedCentredFaceToCellStencil.H:119