FreeFOAM The Cross-Platform CFD Toolkit
processorLduInterface.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 | Copyright (C) 1991-2010 OpenCFD Ltd.
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::processorLduInterface
26 
27 Description
28  An abstract base class for processor coupled interfaces.
29 
30 SourceFiles
31  processorLduInterface.C
32  processorLduInterfaceTemplates.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef processorLduInterface_H
37 #define processorLduInterface_H
38 
39 #include "lduInterface.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class processorLduInterface Declaration
49 \*---------------------------------------------------------------------------*/
50 
52 {
53  // Private data
54 
55  //- Send buffer.
56  // Only sized and used when compressed or non-blocking comms used.
57  mutable List<char> sendBuf_;
58 
59  //- Receive buffer.
60  // Only sized and used when compressed or non-blocking comms used.
61  mutable List<char> receiveBuf_;
62 
63  //- Resize the buffer if required
64  void resizeBuf(List<char>& buf, const label size) const;
65 
66 
67 public:
68 
69  //- Runtime type information
70  TypeName("processorLduInterface");
71 
72 
73  // Constructors
74 
75  //- Construct null
77 
78 
79  // Destructor
80 
81  virtual ~processorLduInterface();
82 
83 
84  // Member Functions
85 
86  // Access
87 
88  //- Return processor number
89  virtual int myProcNo() const = 0;
90 
91  //- Return neigbour processor number
92  virtual int neighbProcNo() const = 0;
93 
94  //- Return face transformation tensor
95  virtual const tensorField& forwardT() const = 0;
96 
97 
98  // Transfer functions
99 
100  //- Raw send function
101  template<class Type>
102  void send
103  (
104  const Pstream::commsTypes commsType,
105  const UList<Type>&
106  ) const;
107 
108  //- Raw field receive function
109  template<class Type>
110  void receive
111  (
112  const Pstream::commsTypes commsType,
113  UList<Type>&
114  ) const;
115 
116  //- Raw field receive function returning field
117  template<class Type>
119  (
120  const Pstream::commsTypes commsType,
121  const label size
122  ) const;
123 
124 
125  //- Raw field send function with data compression
126  template<class Type>
127  void compressedSend
128  (
129  const Pstream::commsTypes commsType,
130  const UList<Type>&
131  ) const;
132 
133  //- Raw field receive function with data compression
134  template<class Type>
135  void compressedReceive
136  (
137  const Pstream::commsTypes commsType,
138  UList<Type>&
139  ) const;
140 
141  //- Raw field receive function with data compression returning field
142  template<class Type>
144  (
145  const Pstream::commsTypes commsType,
146  const label size
147  ) const;
148 };
149 
150 
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 
153 } // End namespace Foam
154 
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 
157 #ifdef NoRepository
159 #endif
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 #endif
164 
165 // ************************ vim: set sw=4 sts=4 et: ************************ //