cyclicAMILduInterfaceField.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-2018 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::cyclicAMILduInterfaceField
26 
27 Description
28  Abstract base class for cyclic AMI coupled interfaces
29 
30 SourceFiles
31  cyclicAMILduInterfaceField.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef cyclicAMILduInterfaceField_H
36 #define cyclicAMILduInterfaceField_H
37 
38 #include "primitiveFieldsFwd.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 /*---------------------------------------------------------------------------*\
46  Class cyclicAMILduInterfaceField Declaration
47 \*---------------------------------------------------------------------------*/
48 
50 {
51 
52 public:
53 
54  //- Runtime type information
55  TypeName("cyclicAMILduInterfaceField");
56 
57 
58  // Constructors
59 
60  //- Construct null
62  {}
63 
64 
65  //- Destructor
67 
68 
69  // Member Functions
70 
71  // Access
72 
73  //- Is the transform required
74  virtual bool doTransform() const = 0;
75 
76  //- Return face transformation tensor
77  virtual const tensorField& forwardT() const = 0;
78 
79  //- Return neighbour-cell transformation tensor
80  virtual const tensorField& reverseT() const = 0;
81 
82  //- Return rank of component for transform
83  virtual int rank() const = 0;
84 
85 
86  //- Transform given patch field
87  template<class Type>
88  void transformCoupleField(Field<Type>& f) const;
89 
90  //- Transform given patch internal field
92  (
93  scalarField& psiInternal,
94  const direction cmpt
95  ) const;
96 };
97 
98 
99 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
100 
101 } // End namespace Foam
102 
103 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
104 
105 #include "tensorField.H"
106 
107 template<class Type>
109 (
110  Field<Type>& f
111 ) const
112 {
113  if (doTransform())
114  {
115  if (forwardT().size() == 1)
116  {
117  transform(f, forwardT()[0], f);
118  }
119  else
120  {
121  transform(f, forwardT(), f);
122  }
123  }
124 }
125 
126 
127 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 
129 #endif
130 
131 // ************************************************************************* //
TypeName("cyclicAMILduInterfaceField")
Runtime type information.
uint8_t direction
Definition: direction.H:45
virtual const tensorField & forwardT() const =0
Return face transformation tensor.
virtual const tensorField & reverseT() const =0
Return neighbour-cell transformation tensor.
Abstract base class for cyclic AMI coupled interfaces.
Forward declarations of the specialisations of Field<T> for scalar, vector and tensor.
virtual bool doTransform() const =0
Is the transform required.
void transformCoupleField(Field< Type > &f) const
Transform given patch field.
virtual int rank() const =0
Return rank of component for transform.
Namespace for OpenFOAM.
dimensionSet transform(const dimensionSet &)
Definition: dimensionSet.C:477