lduInterfaceField.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) 2011-2013 OpenFOAM Foundation
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::lduInterfaceField
26 
27 Description
28  An abstract base class for implicitly-coupled interface fields
29  e.g. processor and cyclic patch fields.
30 
31 SourceFiles
32  lduInterfaceField.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef lduInterfaceField_H
37 #define lduInterfaceField_H
38 
39 #include "lduInterface.H"
40 #include "primitiveFieldsFwd.H"
41 #include "Pstream.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 class lduMatrix;
51 
52 /*---------------------------------------------------------------------------*\
53  Class lduInterfaceField Declaration
54 \*---------------------------------------------------------------------------*/
55 
57 {
58  // Private data
59 
60  //- Reference to the coupled patch this field is defined for
61  const lduInterface& interface_;
62 
63  //- Update index used so that updateInterfaceMatrix is called only once
64  // during the construction of the matrix
65  bool updatedMatrix_;
66 
67 
68  // Private Member Functions
69 
70  //- Disallow default bitwise copy construct
72 
73  //- Disallow default bitwise assignment
74  void operator=(const lduInterfaceField&);
75 
76 
77 public:
78 
79  //- Runtime type information
80  TypeName("lduInterfaceField");
81 
82 
83  // Constructors
84 
85  //- Construct given coupled patch
86  lduInterfaceField(const lduInterface& patch)
87  :
88  interface_(patch),
89  updatedMatrix_(false)
90  {}
91 
92 
93  //- Destructor
94  virtual ~lduInterfaceField();
95 
96 
97  // Member Functions
98 
99  // Access
100 
101  //- Return the interface
102  const lduInterface& interface() const
103  {
104  return interface_;
105  }
106 
107  //- Return the interface type
108  virtual const word& interfaceFieldType() const
109  {
110  return type();
111  }
112 
113 
114  // Coupled interface matrix update
115 
116  //- Whether matrix has been updated
117  bool updatedMatrix() const
118  {
119  return updatedMatrix_;
120  }
121 
122  //- Whether matrix has been updated
123  bool& updatedMatrix()
124  {
125  return updatedMatrix_;
126  }
127 
128  //- Is all data available
129  virtual bool ready() const
130  {
131  return true;
132  }
133 
134  //- Initialise neighbour matrix update
136  (
137  scalarField&,
138  const scalarField&,
139  const scalarField&,
140  const direction,
141  const Pstream::commsTypes commsType
142  ) const
143  {}
144 
145  //- Update result field based on interface functionality
146  virtual void updateInterfaceMatrix
147  (
148  scalarField&,
149  const scalarField&,
150  const scalarField&,
151  const direction,
152  const Pstream::commsTypes commsType
153  ) const = 0;
154 };
155 
156 
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 
159 } // End namespace Foam
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 #endif
164 
165 // ************************************************************************* //
uint8_t direction
Definition: direction.H:46
const lduInterface & interface() const
Return the interface.
commsTypes
Types of communications.
Definition: UPstream.H:64
TypeName("lduInterfaceField")
Runtime type information.
An abstract base class for implicitly-coupled interface fields e.g. processor and cyclic patch fields...
virtual bool ready() const
Is all data available.
Forward declarations of the specialisations of Field<T> for scalar, vector and tensor.
virtual const word & interfaceFieldType() const
Return the interface type.
A class for handling words, derived from string.
Definition: word.H:59
virtual void initInterfaceMatrixUpdate(scalarField &, const scalarField &, const scalarField &, const direction, const Pstream::commsTypes commsType) const
Initialise neighbour matrix update.
bool updatedMatrix() const
Whether matrix has been updated.
virtual ~lduInterfaceField()
Destructor.
virtual void updateInterfaceMatrix(scalarField &, const scalarField &, const scalarField &, const direction, const Pstream::commsTypes commsType) const =0
Update result field based on interface functionality.
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
Definition: POSIX.C:461
An abstract base class for implicitly-coupled interfaces e.g. processor and cyclic patches...
Definition: lduInterface.H:53
Namespace for OpenFOAM.