FreeFOAM The Cross-Platform CFD Toolkit
processorGAMGInterfaceField.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::processorGAMGInterfaceField
26 
27 Description
28  GAMG agglomerated processor interface field.
29 
30 SourceFiles
31  processorGAMGInterfaceField.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef processorGAMGInterfaceField_H
36 #define processorGAMGInterfaceField_H
37 
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class processorGAMGInterfaceField Declaration
49 \*---------------------------------------------------------------------------*/
50 
52 :
53  public GAMGInterfaceField,
55 {
56  // Private data
57 
58  //- Local reference cast into the processor interface
59  const processorGAMGInterface& procInterface_;
60 
61  //- Is the transform required
62  bool doTransform_;
63 
64  //- Rank of component for transformation
65  int rank_;
66 
67 
68  // Private Member Functions
69 
70  //- Disallow default bitwise copy construct
72 
73  //- Disallow default bitwise assignment
74  void operator=(const processorGAMGInterfaceField&);
75 
76 
77 public:
78 
79  //- Runtime type information
80  TypeName("processor");
81 
82 
83  // Constructors
84 
85  //- Construct from GAMG interface and fine level interface field
87  (
88  const GAMGInterface& GAMGCp,
89  const lduInterfaceField& fineInterface
90  );
91 
92 
93  // Destructor
94 
96 
97 
98  // Member Functions
99 
100  // Access
101 
102  //- Return size
103  label size() const
104  {
105  return procInterface_.size();
106  }
107 
108 
109  // Interface matrix update
110 
111  //- Initialise neighbour matrix update
112  virtual void initInterfaceMatrixUpdate
113  (
114  const scalarField& psiInternal,
115  scalarField& result,
116  const lduMatrix& m,
117  const scalarField& coeffs,
118  const direction cmpt,
119  const Pstream::commsTypes commsType
120  ) const;
121 
122  //- Update result field based on interface functionality
123  virtual void updateInterfaceMatrix
124  (
125  const scalarField& psiInternal,
126  scalarField& result,
127  const lduMatrix&,
128  const scalarField& coeffs,
129  const direction cmpt,
130  const Pstream::commsTypes commsType
131  ) const;
132 
133 
134  //- Processor interface functions
135 
136  //- Return processor number
137  virtual int myProcNo() const
138  {
139  return procInterface_.myProcNo();
140  }
141 
142  //- Return neigbour processor number
143  virtual int neighbProcNo() const
144  {
145  return procInterface_.neighbProcNo();
146  }
147 
148  //- Does the interface field perform the transfromation
149  virtual bool doTransform() const
150  {
151  return doTransform_;
152  }
153 
154  //- Return face transformation tensor
155  virtual const tensorField& forwardT() const
156  {
157  return procInterface_.forwardT();
158  }
159 
160  //- Return rank of component for transform
161  virtual int rank() const
162  {
163  return rank_;
164  }
165 };
166 
167 
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 
170 } // End namespace Foam
171 
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 
174 #endif
175 
176 // ************************ vim: set sw=4 sts=4 et: ************************ //