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