FreeFOAM The Cross-Platform CFD Toolkit
processorFvPatch.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::processorFvPatch
26 
27 Description
28  Processor patch.
29 
30 SourceFiles
31  processorFvPatch.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef processorFvPatch_H
36 #define processorFvPatch_H
37 
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class processorFvPatch Declaration
49 \*---------------------------------------------------------------------------*/
50 
52 :
53  public coupledFvPatch,
55 {
56  // Private Data
57 
58  const processorPolyPatch& procPolyPatch_;
59 
60 
61 protected:
62 
63  // Protected Member functions
64 
65  //- Make patch weighting factors
66  void makeWeights(scalarField&) const;
67 
68  //- Make patch face - neighbour cell distances
69  void makeDeltaCoeffs(scalarField&) const;
70 
71 
72 public:
73 
74  //- Runtime type information
75  TypeName(processorPolyPatch::typeName_());
76 
77 
78  // Constructors
79 
80  //- Construct from components
82  :
83  coupledFvPatch(patch, bm),
84  procPolyPatch_(refCast<const processorPolyPatch>(patch))
85  {}
86 
87 
88  // Member functions
89 
90  //- Return processor number
91  int myProcNo() const
92  {
93  return procPolyPatch_.myProcNo();
94  }
95 
96  //- Return neigbour processor number
97  int neighbProcNo() const
98  {
99  return procPolyPatch_.neighbProcNo();
100  }
101 
102  //- Return true if running parallel
103  virtual bool coupled() const
104  {
105  if (Pstream::parRun())
106  {
107  return true;
108  }
109  else
110  {
111  return false;
112  }
113  }
114 
115  //- Return face transformation tensor
116  virtual const tensorField& forwardT() const
117  {
118  return procPolyPatch_.forwardT();
119  }
120 
121  //- Return delta (P to N) vectors across coupled patch
122  tmp<vectorField> delta() const;
123 
124 
125  // Interface transfer functions
126 
127  //- Return the values of the given internal data adjacent to
128  // the interface as a field
130  (
131  const unallocLabelList& internalData
132  ) const;
133 
134  //- Initialise interface data transfer
135  virtual void initTransfer
136  (
137  const Pstream::commsTypes commsType,
138  const unallocLabelList& interfaceData
139  ) const;
140 
141  //- Transfer and return neighbour field
142  virtual tmp<labelField> transfer
143  (
144  const Pstream::commsTypes commsType,
145  const unallocLabelList& interfaceData
146  ) const;
147 
148  //- Initialise neighbour field transfer
149  virtual void initInternalFieldTransfer
150  (
151  const Pstream::commsTypes commsType,
152  const unallocLabelList& internalData
153  ) const;
154 
155  //- Return neighbour field
157  (
158  const Pstream::commsTypes commsType,
159  const unallocLabelList& internalData
160  ) const;
161 };
162 
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 } // End namespace Foam
167 
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 
170 #endif
171 
172 // ************************ vim: set sw=4 sts=4 et: ************************ //