coupledPointPatchField.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-2017 OpenFOAM Foundation
9  Copyright (C) 2026 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::coupledPointPatchField
29 
30 Description
31  A Coupled boundary condition for pointField
32 
33 SourceFiles
34  coupledPointPatchField.txx
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef Foam_coupledPointPatchField_H
39 #define Foam_coupledPointPatchField_H
40 
41 #include "pointPatchField.H"
42 #include "coupledPointPatch.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class coupledPointPatchField Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 template<class Type>
55 :
56  public pointPatchField<Type>
57 {
60 
61 public:
62 
63  //- Runtime type information
64  TypeName(coupledPointPatch::typeName_());
65 
66 
67  // Constructors
68 
69  //- Construct from patch and internal field
71  (
72  const pointPatch&,
74  );
75 
76  //- Construct from patch, internal field and dictionary
78  (
79  const pointPatch&,
81  const dictionary& dict
82  );
83 
84  //- Construct by mapping onto a new patch
86  (
87  const this_bctype&,
88  const pointPatch&,
91  );
92 
93  //- Construct as copy setting internal field reference
95  (
96  const this_bctype&,
98  );
99 
100  //- No copy without an internal field
101  [[deprecated("2026-03: soon = delete")]]
103  #ifdef Foam_pointPatchField_copyConstruct
104  : this_bctype(pfld, pfld.internalField()) {}
105  #else
106  = delete;
107  #endif
108 
109  //- Clone with an internal field reference
111  (
113  ) const = 0;
114 
115 
116  // Member Functions
117 
118  // Access
119 
120  //- Return true if this patch field is derived from
121  // coupledFvPatchField<Type>.
122  virtual bool coupled() const
123  {
124  return true;
125  }
126 
127  //- Evaluate the patch field
128  virtual void evaluate
129  (
130  const Pstream::commsTypes commsType =
132  ) = 0;
133 
134  //- Initialise swap of patch point values
135  virtual void initSwapAddSeparated
136  (
137  const Pstream::commsTypes,
138  Field<Type>&
139  ) const
140  {}
141 
142  //- Complete swap of patch point values and add to local values
143  virtual void swapAddSeparated
144  (
145  const Pstream::commsTypes,
146  Field<Type>&
147  ) const = 0;
148 
149 
150  // Member Operators
151 
152  //- Inherit assignment
154 };
155 
156 
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 
159 } // End namespace Foam
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 #ifdef NoRepository
164  #include "coupledPointPatchField.txx"
165 #endif
166 
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 
169 #endif
170 
171 // ************************************************************************* //
dictionary dict
commsTypes
Communications types.
Definition: UPstream.H:81
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:130
Foam::pointPatchFieldMapper.
virtual autoPtr< pointPatchField< Type > > clone() const
No clone without an internal field reference.
friend Ostream & operator(Ostream &, const pointPatchField< Type > &)
Abstract base class for point-mesh patch fields.
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
Definition: Field.H:69
TypeName(coupledPointPatch::typeName_())
Runtime type information.
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::buffered)=0
Evaluate the patch field.
virtual void swapAddSeparated(const Pstream::commsTypes, Field< Type > &) const =0
Complete swap of patch point values and add to local values.
virtual bool coupled() const
Return true if this patch field is derived from.
virtual void initSwapAddSeparated(const Pstream::commsTypes, Field< Type > &) const
Initialise swap of patch point values.
Basic pointPatch represents a set of points from the mesh.
Definition: pointPatch.H:64
A Coupled boundary condition for pointField.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
coupledPointPatchField(const pointPatch &, const DimensionedField< Type, pointMesh > &)
Construct from patch and internal field.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
"buffered" : (MPI_Bsend, MPI_Recv)
const DimensionedField< Type, pointMesh > & internalField() const noexcept
Return const-reference to the dimensioned internal field.
Namespace for OpenFOAM.