All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
cyclicLduInterfaceField.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::cyclicLduInterfaceField
26 
27 Description
28  Abstract base class for cyclic coupled interfaces.
29 
30 SourceFiles
31  cyclicLduInterfaceField.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef cyclicLduInterfaceField_H
36 #define cyclicLduInterfaceField_H
37 
38 #include "primitiveFieldsFwd.H"
39 #include "transformer.H"
40 #include "typeInfo.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class cyclicLduInterfaceField Declaration
49 \*---------------------------------------------------------------------------*/
50 
52 {
53 
54 public:
55 
56  //- Runtime type information
57  TypeName("cyclicLduInterfaceField");
58 
59 
60  // Constructors
61 
62  //- Construct given coupled patch
64  {}
65 
66 
67  //- Destructor
68  virtual ~cyclicLduInterfaceField();
69 
70 
71  // Member Functions
72 
73  // Access
74 
75  //- Return the transformation
76  virtual const transformer& transform() const = 0;
77 
78  //- Is the transform required
79  bool transforms() const
80  {
81  return transform().transforms() && rank() != 0;
82  }
83 
84  //- Return rank of component for transform
85  virtual int rank() const = 0;
86 
87 
88  //- Transform given patch field
89  template<class Type>
90  void transformCoupleField(Field<Type>& f) const;
91 
92  //- Transform given patch component field
94  (
95  scalarField& f,
96  const direction cmpt
97  ) const;
98 };
99 
100 
101 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
102 
103 } // End namespace Foam
104 
105 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
106 
107 #include "tensorField.H"
108 
109 template<class Type>
111 (
112  Field<Type>& f
113 ) const
114 {
115  if (transforms())
116  {
117  transform().transform(f, f);
118  }
119 }
120 
121 
122 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
123 
124 #endif
125 
126 // ************************************************************************* //
void transformCoupleField(Field< Type > &f) const
Transform given patch field.
Vector-tensor class used to perform translations, rotations and scaling operations in 3D space...
Definition: transformer.H:83
bool transforms() const
Is the transform required.
cyclicLduInterfaceField()
Construct given coupled patch.
bool transforms() const
Return true if the transformer transforms a type.
Definition: transformerI.H:133
virtual int rank() const =0
Return rank of component for transform.
uint8_t direction
Definition: direction.H:45
virtual ~cyclicLduInterfaceField()
Destructor.
virtual const transformer & transform() const =0
Return the transformation.
Forward declarations of the specialisations of Field<T> for scalar, vector and tensor.
Pre-declare SubField and related Field type.
Definition: Field.H:56
Type transform(const Type &) const
Transform the given type.
Abstract base class for cyclic coupled interfaces.
Namespace for OpenFOAM.
TypeName("cyclicLduInterfaceField")
Runtime type information.