processorLduInterfaceField.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-2014 OpenFOAM Foundation
9 Copyright (C) 2019 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::processorLduInterfaceField
29
30Description
31 Abstract base class for processor coupled interfaces.
32
33SourceFiles
34 processorLduInterfaceField.C
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef processorLduInterfaceField_H
39#define processorLduInterfaceField_H
40
41#include "primitiveFieldsFwd.H"
42#include "typeInfo.H"
43
44// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45
46namespace Foam
47{
48
49/*---------------------------------------------------------------------------*\
50 Class processorLduInterfaceField Declaration
51\*---------------------------------------------------------------------------*/
54{
55
56public:
57
58 //- Runtime type information
59 TypeName("processorLduInterfaceField");
60
61
62 // Constructors
63
64 //- Construct null
66
67
68 //- Destructor
69 virtual ~processorLduInterfaceField() = default;
70
71
72 // Member Functions
73
74 // Access
75
76 //- Return communicator used for comms
77 virtual label comm() const = 0;
78
79 //- Return processor number
80 virtual int myProcNo() const = 0;
81
82 //- Return neighbour processor number
83 virtual int neighbProcNo() const = 0;
84
85 //- Is the transform required
86 virtual bool doTransform() const = 0;
87
88 //- Return face transformation tensor
89 virtual const tensorField& forwardT() const = 0;
90
91 //- Return rank of component for transform
92 virtual int rank() const = 0;
93
94
95 //- Transform given patch field
96 template<class Type>
98
99 //- Transform given patch component field
101 (
103 const direction cmpt
104 ) const;
105};
106
107
108// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
109
110} // End namespace Foam
111
112// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
113
114#include "tensorField.H"
115
116template<class Type>
118(
120) const
121{
122 if (doTransform())
123 {
124 if (forwardT().size() == 1)
125 {
126 transform(f, forwardT()[0], f);
127 }
128 else
129 {
130 transform(f, forwardT(), f);
131 }
132 }
133}
134
135
136// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137
138#endif
139
140// ************************************************************************* //
Abstract base class for processor coupled interfaces.
virtual label comm() const =0
Return communicator used for comms.
virtual int neighbProcNo() const =0
Return neighbour processor number.
TypeName("processorLduInterfaceField")
Runtime type information.
processorLduInterfaceField()=default
Construct null.
virtual int myProcNo() const =0
Return processor number.
virtual int rank() const =0
Return rank of component for transform.
virtual const tensorField & forwardT() const =0
Return face transformation tensor.
virtual ~processorLduInterfaceField()=default
Destructor.
virtual bool doTransform() const =0
Is the transform required.
void transformCoupleField(Field< Type > &f) const
Transform given patch field.
Namespace for OpenFOAM.
dimensionSet transform(const dimensionSet &ds)
Return the argument; transformations do not change the dimensions.
Definition: dimensionSet.C:536
uint8_t direction
Definition: direction.H:56
Forward declarations of the specialisations of Field<T> for scalar, vector and tensor.
labelList f(nPoints)
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73