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 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 LduInterfaceField_H
40 #define 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 
54 /*---------------------------------------------------------------------------*\
55  Class LduInterfaceField Declaration
56 \*---------------------------------------------------------------------------*/
57 
58 template<class Type>
60 :
61  public lduInterfaceField
62 {
63  // Private Member Functions
64 
65  //- No copy construct
66  LduInterfaceField(const LduInterfaceField&) = delete;
67 
68  //- No copy assignment
69  void operator=(const LduInterfaceField&) = delete;
70 
71 
72 public:
73 
74  //- Runtime type information
75  TypeName("LduInterfaceField");
76 
77 
78  // Constructors
79 
80  //- Construct given coupled patch
82  :
84  {}
85 
86 
87  //- Destructor
88  virtual ~LduInterfaceField() = default;
89 
90 
91  // Member Functions
92 
93  // Coupled interface functionality
94 
95  //- Inherit initInterfaceMatrixUpdate from lduInterfaceField
97 
98  //- Initialise neighbour matrix update
100  (
101  Field<Type>&,
102  const bool add,
103  const lduAddressing&,
104  const label interfacei,
105  const Field<Type>&,
106  const scalarField&,
107  const Pstream::commsTypes commsType
108  ) const
109  {}
110 
111  //- Inherit updateInterfaceMatrix from lduInterfaceField
113 
114  //- Update result field based on interface functionality
115  virtual void updateInterfaceMatrix
116  (
117  Field<Type>&,
118  const bool add,
119  const lduAddressing&,
120  const label interfacei,
121  const Field<Type>&,
122  const scalarField&,
123  const Pstream::commsTypes commsType
124  ) const = 0;
125 };
126 
127 
128 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129 
130 } // End namespace Foam
131 
132 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
133 
134 #endif
135 
136 // ************************************************************************* //
Foam::LduInterfaceField::updateInterfaceMatrix
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.
Foam::lduAddressing
The class contains the addressing required by the lduMatrix: upper, lower and losort.
Definition: lduAddressing.H:114
Foam::lduInterfaceField::updateInterfaceMatrix
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
primitiveFieldsFwd.H
Forward declarations of the specialisations of Field<T> for scalar, vector and tensor.
Foam::lduInterface
An abstract base class for implicitly-coupled interfaces e.g. processor and cyclic patches.
Definition: lduInterface.H:54
Foam::LduInterfaceField::initInterfaceMatrixUpdate
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.
Definition: LduInterfaceField.H:99
Foam::Field
Generic templated field type.
Definition: Field.H:63
Foam::LduInterfaceField::~LduInterfaceField
virtual ~LduInterfaceField()=default
Destructor.
Foam::LduInterfaceField::TypeName
TypeName("LduInterfaceField")
Runtime type information.
Foam::LduInterfaceField
An abstract base class for implicitly-coupled interface fields e.g. processor and cyclic patch fields...
Definition: LduInterfaceField.H:58
Foam::add
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
Definition: FieldFieldFunctions.C:939
Pstream.H
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::lduInterfaceField
An abstract base class for implicitly-coupled interface fields e.g. processor and cyclic patch fields...
Definition: lduInterfaceField.H:58
Foam::UPstream::commsTypes
commsTypes
Types of communications.
Definition: UPstream.H:69
Foam::lduInterfaceField::initInterfaceMatrixUpdate
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
Definition: lduInterfaceField.H:139
Foam::foamVersion::patch
const std::string patch
OpenFOAM patch number as a std::string.
lduInterfaceField.H
Foam::LduInterfaceField::LduInterfaceField
LduInterfaceField(const lduInterface &patch)
Construct given coupled patch.
Definition: LduInterfaceField.H:80