faGlobalMeshData.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) 2016-2017 Wikki Ltd
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::faGlobalMeshData
28 
29 Description
30  Various mesh related information for a parallel run
31 
32 Author
33  Zeljko Tukovic, FMENA
34  Hrvoje Jasak, Wikki Ltd.
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef faGlobalMeshData_H
39 #define faGlobalMeshData_H
40 
41 #include "faProcessorTopology.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 // Class forward declarations
49 class faMesh;
50 
51 /*---------------------------------------------------------------------------*\
52  Class faGlobalMeshData Declaration
53 \*---------------------------------------------------------------------------*/
54 
55 class faGlobalMeshData
56 :
57  public faProcessorTopology
58 {
59  // Private data
60 
61  //- Reference to mesh
62  const faMesh& mesh_;
63 
64  // Globally shared point addressing
65 
66  //- Total number of global points
67  label nGlobalPoints_;
68 
69  //- Indices of local points that are globally shared
70  labelList sharedPointLabels_;
71 
72  //- Indices of globally shared points in the master list
73  // This list contains all the shared points in the mesh
74  labelList sharedPointAddr_;
75 
76  // Private Member Functions
77 
78  //- No copy construct
79  faGlobalMeshData(const faGlobalMeshData&) = delete;
80 
81  //- No copy assignment
82  void operator=(const faGlobalMeshData&) = delete;
83 
84 
85 public:
86 
87  //- Runtime type information
88  ClassName("faGlobalMeshData");
89 
90  //- Construct from mesh
92 
93  //- Destructor
95 
96 
97  // Member Functions
98 
99  // Access
100 
101  //- Return mesh reference
102  const faMesh& mesh() const;
103 
104  // Globally shared point addressing
105 
106  //- Return number of globally shared points
107  label nGlobalPoints() const
108  {
109  return nGlobalPoints_;
110  }
111 
112  //- Return indices of local points that are globally shared
113  const labelList& sharedPointLabels() const
114  {
115  return sharedPointLabels_;
116  }
117 
118  //- Return addressing into the complete globally shared points
119  // list
120  const labelList& sharedPointAddr() const
121  {
122  return sharedPointAddr_;
123  }
124 
125  //- Change global mesh data given a topological change.
126  void updateMesh();
127 };
128 
129 
130 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
131 
132 } // End namespace Foam
133 
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 
136 #endif
137 
138 // ************************************************************************* //
Foam::faGlobalMeshData::sharedPointLabels
const labelList & sharedPointLabels() const
Return indices of local points that are globally shared.
Definition: faGlobalMeshData.H:112
Foam::faGlobalMeshData::mesh
const faMesh & mesh() const
Return mesh reference.
Definition: faGlobalMeshData.C:60
Foam::faGlobalMeshData
Various mesh related information for a parallel run.
Definition: faGlobalMeshData.H:54
Foam::faGlobalMeshData::sharedPointAddr
const labelList & sharedPointAddr() const
Return addressing into the complete globally shared points.
Definition: faGlobalMeshData.H:119
Foam::ProcessorTopology
Determines processor-processor connection. After instantiation contains on all processors the process...
Definition: ProcessorTopology.H:58
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::List< label >
Foam::faMesh
Finite area mesh. Used for 2-D non-Euclidian finite area method.
Definition: faMesh.H:82
Foam::faGlobalMeshData::updateMesh
void updateMesh()
Change global mesh data given a topological change.
Definition: faGlobalMeshData.C:66
Foam::faGlobalMeshData::nGlobalPoints
label nGlobalPoints() const
Return number of globally shared points.
Definition: faGlobalMeshData.H:106
faProcessorTopology.H
Foam::faGlobalMeshData::ClassName
ClassName("faGlobalMeshData")
Runtime type information.
Foam::faGlobalMeshData::~faGlobalMeshData
~faGlobalMeshData()
Destructor.
Definition: faGlobalMeshData.C:54