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 Group
25  grpleastSquares
26 Class
27  Foam::fvsc::leastSquares::leastSquaresBase
28 Description
29  Base methods for calculating weights and finding neighbours
30 Source file
31  leastSquaresBase.C
32 \*---------------------------------------------------------------------------*/
33 
34 #ifndef leastSquaresBase_H
35 #define leastSquaresBase_H
36 
37 #include "volFields.H"
38 #include "surfaceFields.H"
39 #include "surfaceMesh.H"
40 
41 #include "fvCFD.H"
42 
43 namespace Foam
44 {
45 
46 namespace fvsc
47 {
48 
49 class leastSquaresBase
50 {
51 
52 private:
53 
54  const fvMesh& cMesh_;
55 
56 protected:
57 
58  template <class T>
59  using List2 = List<List<T> >;
60 
61  template <class T>
62  using List3 = List2<List<T> >;
63 
64  template <class T>
65  using labelHashTable = HashTable<T,label,Hash<label>>;
66 
67  typedef
68  HashSet<label,Hash<label>> labelHashSet;
69 
70  template <class T>
71  using Triple = FixedList<T,3>;
72 
73 protected:
74 
75  //Data for internal field
76 
77  // List of neighbour cells for each face
78  labelListList neighbourCells_;
79 
80  // Weights
83 
84  // List of faces with degenerate stencil
85  DynamicList<label> internalDegFaces_;
86 
87  //Data for patches
88  /* For faces connecting 2 processors */
89  List<label> procPairs_; // if >= 0, connects processor through patch
90  List<label> neigProcs_; // No of neighbouring processor
91  labelHashTable<label> idProcPatchPairs_; //hash for processors, connected through the patch
93 
94  /* Least square method weights at processor patches */
97 
98  /* Addressing information */
105 
106  /* Global information about domain decomposition */
107  //labelHashTable <List<label> > pointProcs_; //list of processors containing point (global id)
108  labelHashTable <List<label> > pointCells_; //list of cells containing cell (global id)
110 
111  /* Addressing information for corner neighbouring processors */
115 
116  List<DynamicList<label> > procDegFaces_;
117 
118 protected:
119 
120  void findNeighbours();
121 
122  void calculateWeights();
123 
124 public:
125 
126  leastSquaresBase(const fvMesh& mesh);
127 
129 
130 };
131 
132 }
133 
134 }
135 
136 #endif
137 
138 //
139 //END-OF-FILE
140 //
141 
142 
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_