AssemblyFvPatch.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::AssemblyFvPatch
28
29Description
30 An assembly of lduMatrix that is specific inter-region coupling
31 through mapped patches.
32
33SourceFiles
34 AssemblyFvPatch.C
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef AssemblyFvPatch_H
39#define AssemblyFvPatch_H
40
41
42#include "cyclicFvPatch.H"
43#include "cyclicAMIFvPatch.H"
44
45// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46
47namespace Foam
48{
49
50/*---------------------------------------------------------------------------*\
51 Class AssemblyFvPatch Declaration
52\*---------------------------------------------------------------------------*/
53
54template<class CyclicType>
56:
57 public CyclicType
58{
59protected:
60
61 // Protected Data
62
63 //- Nbr faceCell
65
66 //- Local faceCells
67 const labelList& faceCells_;
68
69 //- Nbr patch ID
70 label nbrPatchID_;
71
72 //- Non-overlap patch ID
74
75
76public:
77
78 //- Runtime type information
79 TypeName(CyclicType::typeName_());
80
81
82 // Constructors
83
84 //- Construct from components
86 (
87 const polyPatch& patch,
88 const fvBoundaryMesh& bm,
89 const labelList& nrbFaceCells,
90 const labelList& faceCells,
91 const label nbrPatchID,
92 const label nonOverPatchID = -1
93 )
94 :
95 CyclicType(patch, bm),
96 nrbFaceCells_(nrbFaceCells),
98 nbrPatchID_(nbrPatchID),
99 nonOverlapPatchID_(nonOverPatchID)
100 {}
101
102
103 //- Destructor
104 virtual ~AssemblyFvPatch() = default;
105
106
107 // Member Functions
108
109 //- Return neighbour field
111 (
112 const Pstream::commsTypes commsType,
113 const labelUList& internalData
114 ) const
115 {
117 auto& pif = tpif.ref();
118
119 forAll(pif, facei)
120 {
121 pif[facei] = internalData[nrbFaceCells_[facei]];
122 }
123
124 return tpif;
125 }
126
127 //- Return neighbour
128 virtual label neighbPatchID() const
129 {
130 return nbrPatchID_;
131 }
132
133 //- Return non-overlap patch ID for ACMI
134 virtual label nonOverlapPatchID() const
135 {
136 return nonOverlapPatchID_;
137 }
138
139 //- Return non-overlapping fvPatch for ACMI
140 virtual const fvPatch& nonOverlapPatch() const
141 {
142 return this->boundaryMesh()[nonOverlapPatchID_];
143 }
144
145 //- Return nbr patch
146 virtual const CyclicType& neighbPatch() const
147 {
148 return refCast<const CyclicType>
149 (
151 );
152 }
153
154 //- Return faceCells
155 virtual const labelUList& faceCells() const
156 {
157 return faceCells_;
158 }
159};
160
161// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162
163} // End namespace Foam
164
165// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167#define makeAssemblyFvPatch(Type) \
168 \
169 defineNamedTemplateTypeNameAndDebug(AssemblyFvPatch<Type>, 0); \
170
171
172// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173
174#endif
175
176// ************************************************************************* //
An assembly of lduMatrix that is specific inter-region coupling through mapped patches.
virtual ~AssemblyFvPatch()=default
Destructor.
virtual const CyclicType & neighbPatch() const
Return nbr patch.
const labelList & nrbFaceCells_
Nbr faceCell.
virtual label neighbPatchID() const
Return neighbour.
virtual const labelUList & faceCells() const
Return faceCells.
virtual tmp< labelField > internalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &internalData) const
Return neighbour field.
AssemblyFvPatch(const polyPatch &patch, const fvBoundaryMesh &bm, const labelList &nrbFaceCells, const labelList &faceCells, const label nbrPatchID, const label nonOverPatchID=-1)
Construct from components.
label nbrPatchID_
Nbr patch ID.
virtual const fvPatch & nonOverlapPatch() const
Return non-overlapping fvPatch for ACMI.
TypeName(CyclicType::typeName_())
Runtime type information.
virtual label nonOverlapPatchID() const
Return non-overlap patch ID for ACMI.
const labelList & faceCells_
Local faceCells.
label nonOverlapPatchID_
Non-overlap patch ID.
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
Definition: Time.C:717
void size(const label n)
Older name for setAddressableSize.
Definition: UList.H:114
commsTypes
Types of communications.
Definition: UPstream.H:67
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface....
Definition: boundaryMesh.H:63
Smooth ATC in cells next to a set of patches supplied by type.
Definition: faceCells.H:59
Foam::fvBoundaryMesh.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:71
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:75
A class for managing temporary objects.
Definition: tmp.H:65
Namespace for OpenFOAM.
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:333
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73