lduInterfaceField.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2020 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 public:
69 
70  //- Runtime type information
71  TypeName("lduInterfaceField");
72 
73 
74  // Constructors
75 
76  //- Construct given coupled patch
77  lduInterfaceField(const lduInterface& patch)
78  :
79  interface_(patch),
80  updatedMatrix_(false)
81  {}
82 
83  //- Disallow default bitwise copy construction
84  lduInterfaceField(const lduInterfaceField&) = delete;
85 
86 
87  //- Destructor
88  virtual ~lduInterfaceField();
89 
90 
91  // Member Functions
92 
93  // Access
94 
95  //- Return the interface
96  const lduInterface& interface() const
97  {
98  return interface_;
99  }
100 
101  //- Return the interface type
102  virtual const word& interfaceFieldType() const
103  {
104  return type();
105  }
106 
107 
108  // Coupled interface matrix update
109 
110  //- Whether matrix has been updated
111  bool updatedMatrix() const
112  {
113  return updatedMatrix_;
114  }
115 
116  //- Whether matrix has been updated
117  bool& updatedMatrix()
118  {
119  return updatedMatrix_;
120  }
121 
122  //- Is all data available
123  virtual bool ready() const
124  {
125  return true;
126  }
127 
128  //- Initialise neighbour matrix update
129  virtual void initInterfaceMatrixUpdate
130  (
131  scalarField&,
132  const scalarField&,
133  const scalarField&,
134  const direction,
135  const Pstream::commsTypes commsType
136  ) const
137  {}
138 
139  //- Update result field based on interface functionality
140  virtual void updateInterfaceMatrix
141  (
142  scalarField&,
143  const scalarField&,
144  const scalarField&,
145  const direction,
146  const Pstream::commsTypes commsType
147  ) const = 0;
148 
149 
150  // Member Operators
151 
152  //- Disallow default bitwise assignment
153  void operator=(const lduInterfaceField&) = delete;
154 };
155 
156 
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 
159 } // End namespace Foam
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 #endif
164 
165 // ************************************************************************* //
commsTypes
Types of communications.
Definition: UPstream.H:65
An abstract base class for implicitly-coupled interface fields e.g. processor and cyclic patch fields...
TypeName("lduInterfaceField")
Runtime type information.
virtual bool ready() const
Is all data available.
lduInterfaceField(const lduInterface &patch)
Construct given coupled patch.
const lduInterface & interface() const
Return the interface.
void operator=(const lduInterfaceField &)=delete
Disallow default bitwise assignment.
virtual ~lduInterfaceField()
Destructor.
virtual void initInterfaceMatrixUpdate(scalarField &, const scalarField &, const scalarField &, const direction, const Pstream::commsTypes commsType) const
Initialise neighbour matrix update.
virtual const word & interfaceFieldType() const
Return the interface type.
virtual void updateInterfaceMatrix(scalarField &, const scalarField &, const scalarField &, const direction, const Pstream::commsTypes commsType) const =0
Update result field based on interface functionality.
bool updatedMatrix() const
Whether matrix has been updated.
An abstract base class for implicitly-coupled interfaces e.g. processor and cyclic patches.
Definition: lduInterface.H:54
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
uint8_t direction
Definition: direction.H:45
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488
Forward declarations of the specialisations of Field<T> for scalar, vector and tensor.