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 -------------------------------------------------------------------------------
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::processorLduInterfaceField
29 
30 Description
31  Abstract base class for processor coupled interfaces.
32 
33 SourceFiles
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 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class processorLduInterfaceField Declaration
51 \*---------------------------------------------------------------------------*/
52 
54 {
55 public:
56 
57  //- Runtime type information
58  TypeName("processorLduInterfaceField");
59 
60 
61  // Constructors
62 
63  //- Default construct
64  processorLduInterfaceField() = default;
65 
66 
67  //- Destructor
68  virtual ~processorLduInterfaceField() = default;
69 
70 
71  // Member Functions
72 
73  // Access
74 
75  //- Return communicator used for comms
76  virtual label comm() const = 0;
77 
78  //- Return processor number
79  virtual int myProcNo() const = 0;
80 
81  //- Return neighbour processor number
82  virtual int neighbProcNo() const = 0;
83 
84  //- Is the transform required
85  virtual bool doTransform() const = 0;
86 
87  //- Return face transformation tensor
88  virtual const tensorField& forwardT() const = 0;
89 
90  //- Return rank of component for transform
91  virtual int rank() const = 0;
92 
93 
94  //- Transform given patch field
95  template<class Type>
96  void transformCoupleField(Field<Type>& f) const;
97 
98  //- Transform given patch component field
100  (
102  const direction cmpt
103  ) const;
104 };
105 
106 
107 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
108 
109 } // End namespace Foam
110 
111 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
112 
113 #include "tensorField.H"
114 
115 template<class Type>
117 (
118  Field<Type>& f
119 ) const
120 {
121  if (doTransform())
122  {
123  if (forwardT().size() == 1)
124  {
125  transform(f, forwardT()[0], f);
126  }
127  else
128  {
129  transform(f, forwardT(), f);
130  }
131  }
132 }
133 
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136 
137 #endif
138 
139 // ************************************************************************* //
virtual bool doTransform() const =0
Is the transform required.
uint8_t direction
Definition: direction.H:46
virtual ~processorLduInterfaceField()=default
Destructor.
virtual int rank() const =0
Return rank of component for transform.
Abstract base class for processor coupled interfaces.
Forward declarations of the specialisations of Field<T> for scalar, vector and tensor.
virtual const tensorField & forwardT() const =0
Return face transformation tensor.
void transformCoupleField(Field< Type > &f) const
Transform given patch field.
virtual int myProcNo() const =0
Return processor number.
virtual int neighbProcNo() const =0
Return neighbour processor number.
labelList f(nPoints)
TypeName("processorLduInterfaceField")
Runtime type information.
virtual label comm() const =0
Return communicator used for comms.
processorLduInterfaceField()=default
Default construct.
dimensionSet transform(const dimensionSet &ds)
Return the argument; transformations do not change the dimensions.
Definition: dimensionSet.C:521
Namespace for OpenFOAM.