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 
56 public:
57 
58  //- Runtime type information
59  TypeName("processorLduInterfaceField");
60 
61 
62  // Constructors
63 
64  //- Construct null
65  processorLduInterfaceField() = default;
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>
97  void transformCoupleField(Field<Type>& f) const;
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 
116 template<class Type>
118 (
119  Field<Type>& f
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 // ************************************************************************* //
Foam::processorLduInterfaceField::transformCoupleField
void transformCoupleField(Field< Type > &f) const
Transform given patch field.
Definition: processorLduInterfaceField.H:117
primitiveFieldsFwd.H
Forward declarations of the specialisations of Field<T> for scalar, vector and tensor.
Foam::processorLduInterfaceField::neighbProcNo
virtual int neighbProcNo() const =0
Return neighbour processor number.
Foam::processorLduInterfaceField::myProcNo
virtual int myProcNo() const =0
Return processor number.
typeInfo.H
Foam::processorLduInterfaceField::TypeName
TypeName("processorLduInterfaceField")
Runtime type information.
Foam::transform
dimensionSet transform(const dimensionSet &ds)
Return the argument; transformations do not change the dimensions.
Definition: dimensionSet.C:521
Foam::processorLduInterfaceField::processorLduInterfaceField
processorLduInterfaceField()=default
Construct null.
Foam::processorLduInterfaceField::comm
virtual label comm() const =0
Return communicator used for comms.
Foam::Field< tensor >
Foam::processorLduInterfaceField::doTransform
virtual bool doTransform() const =0
Is the transform required.
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
tensorField.H
f
labelList f(nPoints)
Foam::processorLduInterfaceField::~processorLduInterfaceField
virtual ~processorLduInterfaceField()=default
Destructor.
Foam::processorLduInterfaceField::rank
virtual int rank() const =0
Return rank of component for transform.
Foam::direction
uint8_t direction
Definition: direction.H:52
Foam::processorLduInterfaceField
Abstract base class for processor coupled interfaces.
Definition: processorLduInterfaceField.H:52
Foam::processorLduInterfaceField::forwardT
virtual const tensorField & forwardT() const =0
Return face transformation tensor.