lduPrimitiveProcessorInterface.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 OpenFOAM Foundation
9  Copyright (C) 2019 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
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 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::lduPrimitiveProcessorInterface
29 
30 Description
31  Concrete implementation of processor interface. Used to temporarily store
32  settings.
33 
34 SourceFiles
35  lduPrimitiveProcessorInterface.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef lduPrimitiveProcessorInterface_H
40 #define lduPrimitiveProcessorInterface_H
41 
42 #include "GAMGInterface.H"
43 #include "processorLduInterface.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class lduPrimitiveProcessorInterface Declaration
52 \*---------------------------------------------------------------------------*/
53 
55 :
56  public lduInterface,
58 {
59  // Private data
60 
61  const labelList faceCells_;
62 
63  //- My processor rank in communicator
64  label myProcNo_;
65 
66  //- Neighbouring processor rank in communicator
67  label neighbProcNo_;
68 
69  //- Transformation tensor
70  tensorField forwardT_;
71 
72  //- Message tag used for sending
73  int tag_;
74 
75  //- Communicator to use for parallel communication
76  const label comm_;
77 
78 
79  // Private Member Functions
80 
81  //- No copy construct
83  (
85  ) = delete;
86 
87  //- No copy assignment
88  void operator=(const lduPrimitiveProcessorInterface&) = delete;
89 
90 
91 public:
92 
93  //- Runtime type information
94  TypeName("calculatedProcessor");
95 
96 
97  // Constructors
98 
99  //- Construct from components
101  (
102  const labelUList& faceCells,
103  const label myProcNo,
104  const label neighbProcNo,
105  const tensorField& forwardT,
106  const int tag,
107  const label comm = UPstream::worldComm
108  );
109 
110 
111  //- Destructor
112  virtual ~lduPrimitiveProcessorInterface() = default;
113 
114 
115  // Member Functions
116 
117  // Access
118 
119  //- Return faceCell addressing
120  virtual const labelUList& faceCells() const
121  {
122  return faceCells_;
123  }
124 
125 
126  // Interface transfer functions
127 
128  //- Return the values of the given internal data adjacent to
129  // the interface as a field
131  (
132  const labelUList& internalData
133  ) const;
134 
135  //- Initialise neighbour field transfer
136  virtual void initInternalFieldTransfer
137  (
138  const Pstream::commsTypes commsType,
139  const labelUList& iF
140  ) const;
141 
142  //- Transfer and return internal field adjacent to the interface
144  (
145  const Pstream::commsTypes commsType,
146  const labelUList& iF
147  ) const;
148 
149 
150  // Processor interface functions
151 
152  //- Return communicator used for sending
153  virtual label comm() const
154  {
155  return comm_;
156  }
157 
158  //- Return processor number (rank in communicator)
159  virtual int myProcNo() const
160  {
161  return myProcNo_;
162  }
163 
164  //- Return neighbour processor number (rank in communicator)
165  virtual int neighbProcNo() const
166  {
167  return neighbProcNo_;
168  }
169 
170  //- Return face transformation tensor
171  virtual const tensorField& forwardT() const
172  {
173  return forwardT_;
174  }
175 
176  //- Return message tag used for sending
177  virtual int tag() const
178  {
179  return tag_;
180  }
181 
182 
183  // Edit
184 
185  //- Return message tag used for sending
186  int& tag()
187  {
188  return tag_;
189  }
190 };
191 
192 
193 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
194 
195 } // End namespace Foam
196 
197 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198 
199 #endif
200 
201 // ************************************************************************* //
Foam::lduPrimitiveProcessorInterface
Concrete implementation of processor interface. Used to temporarily store settings.
Definition: lduPrimitiveProcessorInterface.H:53
Foam::lduPrimitiveProcessorInterface::forwardT
virtual const tensorField & forwardT() const
Return face transformation tensor.
Definition: lduPrimitiveProcessorInterface.H:170
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::lduPrimitiveProcessorInterface::comm
virtual label comm() const
Return communicator used for sending.
Definition: lduPrimitiveProcessorInterface.H:152
Foam::lduPrimitiveProcessorInterface::interfaceInternalField
virtual tmp< labelField > interfaceInternalField(const labelUList &internalData) const
Return the values of the given internal data adjacent to.
Definition: lduPrimitiveProcessorInterface.C:64
Foam::lduInterface
An abstract base class for implicitly-coupled interfaces e.g. processor and cyclic patches.
Definition: lduInterface.H:54
Foam::processorLduInterface
An abstract base class for processor coupled interfaces.
Definition: processorLduInterface.H:53
Foam::lduPrimitiveProcessorInterface::neighbProcNo
virtual int neighbProcNo() const
Return neighbour processor number (rank in communicator)
Definition: lduPrimitiveProcessorInterface.H:164
Foam::lduPrimitiveProcessorInterface::internalFieldTransfer
virtual tmp< labelField > internalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &iF) const
Transfer and return internal field adjacent to the interface.
Definition: lduPrimitiveProcessorInterface.C:90
Foam::lduPrimitiveProcessorInterface::initInternalFieldTransfer
virtual void initInternalFieldTransfer(const Pstream::commsTypes commsType, const labelUList &iF) const
Initialise neighbour field transfer.
Definition: lduPrimitiveProcessorInterface.C:79
Foam::lduPrimitiveProcessorInterface::tag
int & tag()
Return message tag used for sending.
Definition: lduPrimitiveProcessorInterface.H:185
processorLduInterface.H
Foam::lduPrimitiveProcessorInterface::faceCells
virtual const labelUList & faceCells() const
Return faceCell addressing.
Definition: lduPrimitiveProcessorInterface.H:119
GAMGInterface.H
Foam::Field< tensor >
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::UPstream::commsTypes
commsTypes
Types of communications.
Definition: UPstream.H:69
Foam::UPstream::worldComm
static label worldComm
Default communicator (all processors)
Definition: UPstream.H:295
Foam::List< label >
Foam::UList< label >
Foam::lduPrimitiveProcessorInterface::myProcNo
virtual int myProcNo() const
Return processor number (rank in communicator)
Definition: lduPrimitiveProcessorInterface.H:158
Foam::faceCells
Smooth ATC in cells next to a set of patches supplied by type.
Definition: faceCells.H:56
Foam::lduPrimitiveProcessorInterface::~lduPrimitiveProcessorInterface
virtual ~lduPrimitiveProcessorInterface()=default
Destructor.
Foam::lduPrimitiveProcessorInterface::TypeName
TypeName("calculatedProcessor")
Runtime type information.
Foam::lduPrimitiveProcessorInterface::tag
virtual int tag() const
Return message tag used for sending.
Definition: lduPrimitiveProcessorInterface.H:176