jumpCyclicFvPatchField.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-2024 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::jumpCyclicFvPatchField
26 
27 Description
28  This boundary condition provides a base class for cyclic conditions with a
29  specified "jump" (or offset) between the sides
30 
31 See also
32  Foam::cyclicFvPatchField
33 
34 SourceFiles
35  jumpCyclicFvPatchField.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef jumpCyclicFvPatchField_H
40 #define jumpCyclicFvPatchField_H
41 
42 #include "cyclicFvPatchField.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class jumpCyclicFvPatchField Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 template<class Type>
55 :
56  public cyclicFvPatchField<Type>
57 {
58  // Private Member Functions
59 
60  //- Update result field based on interface functionality
61  template<class ... Cmpt>
62  void updateInterfaceMatrixCmpts
63  (
64  Field<Type>& result,
65  const Field<Type>& psi,
66  const scalarField& coeffs,
67  const Pstream::commsTypes comms,
68  const Cmpt ... cmpt
69  ) const;
70 
71 
72 public:
73 
74  //- Runtime type information
75  TypeName("jumpCyclic");
76 
77 
78  // Constructors
79 
80  //- Construct from patch and internal field
82  (
83  const fvPatch&,
85  );
86 
87  //- Construct from patch, internal field and dictionary
89  (
90  const fvPatch&,
92  const dictionary&
93  );
94 
95  //- Construct by mapping given jumpCyclicFvPatchField onto a new patch
97  (
99  const fvPatch&,
101  const fieldMapper&
102  );
103 
104  //- Disallow copy without setting internal field reference
106 
107  //- Copy constructor setting internal field reference
109  (
112  );
113 
114 
115  // Member Functions
116 
117  // Access
118 
119  //- Return the interface type
120  virtual const word& interfaceFieldType() const
121  {
123  }
124 
125  //- Return the "jump" in value applied to the opposite field when
126  // transforming to this side
127  virtual tmp<Field<Type>> jump() const = 0;
128 
129 
130  // Evaluation functions
131 
132  //- Return neighbour coupled given internal cell data
134  (
135  const Pstream::commsTypes
136  ) const;
137 
138  //- Update result field based on interface functionality
139  virtual void updateInterfaceMatrix
140  (
141  scalarField& result,
142  const scalarField& psi,
143  const scalarField& coeffs,
144  const direction cmpt,
145  const Pstream::commsTypes comms
146  ) const;
147 
148  //- Update result field based on interface functionality
149  virtual void updateInterfaceMatrix
150  (
151  Field<Type>& result,
152  const Field<Type>& psi,
153  const scalarField& coeffs,
154  const Pstream::commsTypes comms
155  ) const;
156 };
157 
158 
159 //- Update result field based on interface functionality
160 template<>
162 (
163  scalarField& result,
164  const scalarField& psi,
165  const scalarField& coeffs,
166  const direction cmpt,
167  const Pstream::commsTypes comms
168 ) const;
169 
170 
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 
173 } // End namespace Foam
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 
177 #ifdef NoRepository
178  #include "jumpCyclicFvPatchField.C"
179 #endif
180 
181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 
183 #endif
184 
185 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Pre-declare SubField and related Field type.
Definition: Field.H:83
virtual void updateInterfaceMatrix(scalarField &, const scalarField &, const scalarField &, const direction, const Pstream::commsTypes commsType) const=0
Inherit updateInterfaceMatrix from lduInterfaceField.
commsTypes
Types of communications.
Definition: UPstream.H:65
This boundary condition enforces a cyclic condition between a pair of boundaries.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
Abstract base class for field mapping.
Definition: fieldMapper.H:48
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:64
This boundary condition provides a base class for cyclic conditions with a specified "jump" (or offse...
virtual tmp< Field< Type > > patchNeighbourField(const Pstream::commsTypes) const
Return neighbour coupled given internal cell data.
jumpCyclicFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
virtual tmp< Field< Type > > jump() const =0
Return the "jump" in value applied to the opposite field when.
TypeName("jumpCyclic")
Runtime type information.
virtual const word & interfaceFieldType() const
Return the interface type.
A class for managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:62
const volScalarField & psi
Namespace for OpenFOAM.
uint8_t direction
Definition: direction.H:45
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488