processorFvsPatchField.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-2016 OpenFOAM Foundation
9  Copyright (C) 2024 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::processorFvsPatchField
29 
30 Description
31  This boundary condition enables processor communication across patches.
32 
33  The "value" entry is MUST_READ.
34 
35  Example of the boundary condition specification:
36  \verbatim
37  <patchName>
38  {
39  type processor;
40  value uniform (0 0 0); // Mandatory
41  }
42  \endverbatim
43 
44 SourceFiles
45  processorFvsPatchField.C
46 
47 \*---------------------------------------------------------------------------*/
48 
49 #ifndef Foam_processorFvsPatchField_H
50 #define Foam_processorFvsPatchField_H
51 
52 #include "coupledFvsPatchField.H"
53 #include "processorFvPatch.H"
54 
55 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56 
57 namespace Foam
58 {
59 
60 /*---------------------------------------------------------------------------*\
61  Class processorFvsPatch Declaration
62 \*---------------------------------------------------------------------------*/
63 
64 template<class Type>
66 :
67  public coupledFvsPatchField<Type>
68 {
69  // Private Data
70 
71  //- Local reference cast into the processor patch
72  const processorFvPatch& procPatch_;
73 
74 
75 public:
76 
77  //- Runtime type information
78  TypeName(processorFvPatch::typeName_());
79 
80 
81  // Constructors
82 
83  //- Construct from patch and internal field
85  (
86  const fvPatch&,
88  );
89 
90  //- Construct from patch and internal field and patch field
92  (
93  const fvPatch&,
95  const Field<Type>&
96  );
97 
98  //- Construct from patch, internal field and dictionary.
99  //- The "value" entry is MUST_READ.
101  (
102  const fvPatch&,
104  const dictionary&
105  );
106 
107  //- Construct by mapping given processorFvsPatchField onto a new patch
109  (
111  const fvPatch&,
113  const fvPatchFieldMapper&
114  );
115 
116  //- Construct as copy
118 
119  //- Construct as copy setting internal field reference
121  (
124  );
125 
126  //- Return clone
127  virtual tmp<fvsPatchField<Type>> clone() const
128  {
129  return fvsPatchField<Type>::Clone(*this);
130  }
131 
132  //- Clone with an internal field reference
134  (
136  ) const
137  {
138  return fvsPatchField<Type>::Clone(*this, iF);
139  }
141 
142  //- Destructor
143  virtual ~processorFvsPatchField() = default;
144 
145 
146  // Member Functions
147 
148  //- True if running parallel
149  virtual bool coupled() const
150  {
151  return UPstream::parRun();
152  }
153 };
154 
155 
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 
158 } // End namespace Foam
159 
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 
162 #ifdef NoRepository
163  #include "processorFvsPatchField.C"
164 #endif
165 
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 
168 #endif
169 
170 // ************************************************************************* //
TypeName(processorFvPatch::typeName_())
Runtime type information.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
static tmp< fvsPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
virtual ~processorFvsPatchField()=default
Destructor.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:70
static bool & parRun() noexcept
Test if this a parallel run.
Definition: UPstream.H:1061
virtual tmp< fvsPatchField< Type > > clone() const
Return clone.
This boundary condition enables processor communication across patches.
Generic templated field type.
Definition: Field.H:62
A FieldMapper for finite-volume patch fields.
Processor patch.
Abstract base class for coupled patches.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
processorFvsPatchField(const fvPatch &, const DimensionedField< Type, surfaceMesh > &)
Construct from patch and internal field.
virtual bool coupled() const
True if running parallel.
A class for managing temporary objects.
Definition: HashPtrTable.H:50
Namespace for OpenFOAM.