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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2016 OpenFOAM Foundation
9  Copyright (C) 2019-2022 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::LduInterfaceField
29 
30 Description
31  An abstract base class for implicitly-coupled interface fields
32  e.g. processor and cyclic patch fields.
33 
34 SourceFiles
35  LduInterfaceField.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef Foam_LduInterfaceField_H
40 #define Foam_LduInterfaceField_H
41 
42 #include "lduInterfaceField.H"
43 #include "primitiveFieldsFwd.H"
44 #include "Pstream.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 // Forward Declarations
52 class lduMatrix;
53 template<class Type> class LduInterfaceField;
54 
55 /*---------------------------------------------------------------------------*\
56  Class LduInterfaceField Declaration
57 \*---------------------------------------------------------------------------*/
58 
59 template<class Type>
61 :
62  public lduInterfaceField
63 {
64  // Private Member Functions
65 
66  //- No copy construct
67  LduInterfaceField(const LduInterfaceField&) = delete;
68 
69  //- No copy assignment
70  void operator=(const LduInterfaceField&) = delete;
71 
72 
73 public:
74 
75  //- Runtime type information
76  TypeName("LduInterfaceField");
77 
78 
79  // Constructors
80 
81  //- Construct given coupled patch
83  :
85  {}
86 
87 
88  //- Destructor
89  virtual ~LduInterfaceField() = default;
90 
91 
92  // Member Functions
93 
94  // Coupled interface functionality
95 
96  //- Inherit initInterfaceMatrixUpdate from lduInterfaceField
98 
99  //- Initialise neighbour matrix update
100  virtual void initInterfaceMatrixUpdate
101  (
102  Field<Type>&,
103  const bool add,
104  const lduAddressing&,
105  const label interfacei,
106  const Field<Type>&,
107  const scalarField&,
108  const Pstream::commsTypes commsType
109  ) const
110  {}
111 
112  //- Inherit updateInterfaceMatrix from lduInterfaceField
114 
115  //- Update result field based on interface functionality
116  virtual void updateInterfaceMatrix
117  (
118  Field<Type>&,
119  const bool add,
120  const lduAddressing&,
121  const label interfacei,
122  const Field<Type>&,
123  const scalarField&,
124  const Pstream::commsTypes commsType
125  ) const = 0;
126 };
127 
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 } // End namespace Foam
132 
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 
135 #endif
136 
137 // ************************************************************************* //
TypeName("LduInterfaceField")
Runtime type information.
virtual void initInterfaceMatrixUpdate(solveScalarField &result, const bool add, const lduAddressing &, const label interfacei, const solveScalarField &psiInternal, const scalarField &coeffs, const direction cmpt, const Pstream::commsTypes commsType) const
Initialise neighbour matrix update. Add/subtract coupled contributions to matrix. ...
commsTypes
Communications types.
Definition: UPstream.H:72
virtual ~LduInterfaceField()=default
Destructor.
An abstract base class for implicitly-coupled interface fields e.g. processor and cyclic patch fields...
An abstract base class for implicitly-coupled interface fields e.g. processor and cyclic patch fields...
virtual void updateInterfaceMatrix(solveScalarField &result, const bool add, const lduAddressing &, const label interfacei, const solveScalarField &psiInternal, const scalarField &coeffs, const direction cmpt, const Pstream::commsTypes commsType) const =0
Update result field based on interface functionality. Add/subtract coupled contributions to matrix...
Forward declarations of the specialisations of Field<T> for scalar, vector and tensor.
Generic templated field type.
Definition: Field.H:62
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
virtual void updateInterfaceMatrix(Field< Type > &, const bool add, const lduAddressing &, const label interfacei, const Field< Type > &, const scalarField &, const Pstream::commsTypes commsType) const =0
Update result field based on interface functionality.
lduMatrix is a general matrix class in which the coefficients are stored as three arrays...
Definition: lduMatrix.H:79
lduInterfaceField(const lduInterfaceField &)=delete
No copy construct.
virtual void initInterfaceMatrixUpdate(Field< Type > &, const bool add, const lduAddressing &, const label interfacei, const Field< Type > &, const scalarField &, const Pstream::commsTypes commsType) const
Initialise neighbour matrix update.
const std::string patch
OpenFOAM patch number as a std::string.
An abstract base class for implicitly-coupled interfaces e.g. processor and cyclic patches...
Definition: lduInterface.H:53
The class contains the addressing required by the lduMatrix: upper, lower and losort.
Namespace for OpenFOAM.