faMeshBoundaryHalo.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) 2021 OpenCFD Ltd.
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::faMeshBoundaryHalo
28
29Description
30 Class for obtaining halo face data for the boundary edges.
31 The ordering follows that natural edge ordering of the underlying
32 primitive patch.
33
34Note
35 The halo faces can be located on-processor or off-processor.
36
37SourceFiles
38 faMeshBoundaryHalo.C
39 faMeshBoundaryHaloTemplates.C
40
41\*---------------------------------------------------------------------------*/
42
43#ifndef faMeshBoundaryHalo_H
44#define faMeshBoundaryHalo_H
45
46#include "mapDistributeBase.H"
47
48// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49
50namespace Foam
51{
52
53// Forward Declarations
54class faMesh;
55
56/*---------------------------------------------------------------------------*\
57 Class faMeshBoundaryHalo Declaration
58\*---------------------------------------------------------------------------*/
61:
63{
64 // Private Data
65
66 //- List of local input mesh faces required
67 labelList inputMeshFaces_;
68
69 //- Internal mapping from boundary index to compact
70 labelList boundaryToCompact_;
71
72
73public:
74
75 // Declare name of the class and its debug switch
76 ClassName("faMeshBoundaryHalo");
77
78
79 // Constructors
80
81 //- Default construct
82 explicit faMeshBoundaryHalo(const label comm = UPstream::worldComm);
83
84 //- Construct from mesh
85 explicit faMeshBoundaryHalo(const faMesh& mesh);
86
87
88 // Member Functions
89
90 //- Clear out all parameters
91 void clear();
92
93 //- Redefine map and connectivity for a mesh
94 void reset(const faMesh& mesh);
95
96 //- The local data size (output)
97 label haloSize() const;
98
99 //- List of local input mesh faces required.
100 // \note will not correspond exactly to the boundary inside faces.
101 // Duplicates have been removed and it also contains the
102 // processor-local neighbour faces, which would otherwise not be
103 // handled by the distribute method.
104 const labelList& inputMeshFaces() const noexcept
105 {
106 return inputMeshFaces_;
107 }
108
109
110 // Other
111
112 //- Distribute sparse data.
113 // On output it is adjusted.
114 template<class Type>
116 (
118 const labelUList& sparseInputLocations,
119 const labelUList& compactOutputMapping
120 ) const;
121
122 //- Distribute sparse data.
123 // On output it is adjusted.
124 template<class Type>
126 (
128 const labelUList& sparseInputLocations
129 ) const;
130
131 //- Distribute sparse data.
132 // The input field one enty per sparse id (inputMeshFaces).
133 // On output it will have for the input sparse
134 // The input field contains location.
135 template<class Type>
136 void distributeSparse(List<Type>& fld) const;
137};
138
139
140// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141
142} // End namespace Foam
143
144// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145
146#ifdef NoRepository
148#endif
149
150// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151
152#endif
153
154// ************************************************************************* //
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))
static label worldComm
Default communicator (all processors)
Definition: UPstream.H:293
Class for obtaining halo face data for the boundary edges. The ordering follows that natural edge ord...
ClassName("faMeshBoundaryHalo")
void reset(const faMesh &mesh)
Redefine map and connectivity for a mesh.
void clear()
Clear out all parameters.
const labelList & inputMeshFaces() const noexcept
List of local input mesh faces required.
label haloSize() const
The local data size (output)
void distributeSparse(List< Type > &fld, const labelUList &sparseInputLocations, const labelUList &compactOutputMapping) const
Distribute sparse data.
Finite area mesh (used for 2-D non-Euclidian finite area method) defined using a patch of faces on a ...
Definition: faMesh.H:100
Class containing processor-to-processor mapping information.
label comm() const noexcept
The communicator used.
#define ClassName(TypeNameString)
Add typeName information from argument TypeNameString to a class.
Definition: className.H:67
dynamicFvMesh & mesh
Namespace for OpenFOAM.
const direction noexcept
Definition: Scalar.H:223