All Classes Namespaces Files Functions Variables Typedefs Friends Macros Groups
leastSquaresBase.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  Copyright (C) 2019 OpenCFD Ltd.
10  Copyright (C) 2016-2019 ISP RAS (www.ispras.ru) UniCFD Group (www.unicfd.ru)
11 -------------------------------------------------------------------------------
12 License
13  This file is part of QGDsolver library, based on OpenFOAM+.
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
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  You should have received a copy of the GNU General Public License
23  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
24 Class
25  Foam::fvsc::leastSquares::leastSquaresBase
26 Description
27  Base methods for calculating weights and finding neighbours
28 Source file
29  leastSquaresBase.C
30 \*---------------------------------------------------------------------------*/
31 
32 #ifndef leastSquaresBase_H
33 #define leastSquaresBase_H
34 
35 #include "volFields.H"
36 #include "surfaceFields.H"
37 #include "surfaceMesh.H"
38 
39 #include "fvCFD.H"
40 
41 namespace Foam
42 {
43 
44 namespace fvsc
45 {
46 
47 class leastSquaresBase
48 {
49 
50 private:
51 
52  const fvMesh& cMesh_;
53 
54 protected:
55 
56  template <class T>
57  using List2 = List<List<T> >;
58 
59  template <class T>
60  using List3 = List2<List<T> >;
61 
62  template <class T>
63  using labelHashTable = HashTable<T,label,Hash<label>>;
64 
65  typedef
66  HashSet<label,Hash<label>> labelHashSet;
67 
68  template <class T>
69  using Triple = FixedList<T,3>;
70 
71 protected:
72 
73  //Data for internal field
74 
75  // List of neighbour cells for each face
76  labelListList neighbourCells_;
77 
78  // Weights
81 
82  // List of faces with degenerate stencil
83  DynamicList<label> internalDegFaces_;
84 
85  //Data for patches
86  /* For faces connecting 2 processors */
87  List<label> procPairs_; // if >= 0, connects processor through patch
88  List<label> neigProcs_; // No of neighbouring processor
89  labelHashTable<label> idProcPatchPairs_; //hash for processors, connected through the patch
91 
92  /* Least square method weights at processor patches */
95 
96  /* Addressing information */
103 
104  /* Global information about domain decomposition */
105  //labelHashTable <List<label> > pointProcs_; //list of processors containing point (global id)
106  labelHashTable <List<label> > pointCells_; //list of cells containing cell (global id)
108 
109  /* Addressing information for corner neighbouring processors */
113 
114  List<DynamicList<label> > procDegFaces_;
115 
116 protected:
117 
118  void findNeighbours();
119 
120  void calculateWeights();
121 
122 public:
123 
124  leastSquaresBase(const fvMesh& mesh);
125 
127 
128 };
129 
130 }
131 
132 }
133 
134 #endif
135 
136 //
137 //END-OF-FILE
138 //
139 
140 
List< DynamicList< label > > procDegFaces_
HashTable< T, label, Hash< label >> labelHashTable
void calculateWeights()
Compute weights for least squares scheme for gradient calculation.
labelHashTable< label > cellProc_
labelHashTable< label > corProcIds_
labelHashTable< label > idProcPatchPairs_
HashSet< label, Hash< label > > labelHashSet
List2< Triple< label > > corAddr_
Methods calculating of differential operators.
void findNeighbours()
Find neighbour cells for each face (throught face points).
labelHashTable< List< label > > pointCells_
leastSquaresBase(const fvMesh &mesh)
DynamicList< label > internalDegFaces_