GeometricBoundaryField.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-2023 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::GeometricBoundaryField
26 
27 Description
28  Generic GeometricBoundaryField class.
29 
30 SourceFiles
31  GeometricBoundaryField.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef GeometricBoundaryField_H
36 #define GeometricBoundaryField_H
37 
38 #include "dimensionedTypes.H"
39 #include "DimensionedField.H"
40 #include "FieldField.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 class dictionary;
48 
49 // Forward declaration of friend functions and operators
50 
51 template<class Type, template<class> class PatchField, class GeoMesh>
52 class GeometricField;
53 
54 /*---------------------------------------------------------------------------*\
55  Class GeometricBoundaryField Declaration
56 \*---------------------------------------------------------------------------*/
57 
58 template<class Type, template<class> class PatchField, class GeoMesh>
60 :
61  public FieldField<PatchField, Type>
62 {
63 public:
64 
65  // Public Typedefs
66 
67  //- Type of boundary mesh on which this boundary is instantiated
68  typedef typename GeoMesh::BoundaryMesh BoundaryMesh;
69 
70  //- Type of the internal field from which this GeometricField is derived
72 
73 
74 private:
75 
76  // Private Data
77 
78  //- Reference to BoundaryMesh for which this field is defined
79  const BoundaryMesh& bmesh_;
80 
81 
82 public:
83 
84  // Constructors
85 
86  //- Construct from a BoundaryMesh
88 
89  //- Construct from a BoundaryMesh,
90  // reference to the internal field
91  // and a patch field type
93  (
94  const BoundaryMesh&,
95  const Internal&,
96  const word&
97  );
98 
99  //- Construct from a BoundaryMesh,
100  // reference to the internal field
101  // and a wordList of patch field types and optionally
102  // the actual patch types (to override constraint patches)
104  (
105  const BoundaryMesh&,
106  const Internal&,
107  const wordList& wantedPatchTypes,
108  const wordList& actualPatchTypes = wordList()
109  );
110 
111  //- Construct from a BoundaryMesh,
112  // reference to the internal field
113  // and a PtrList<PatchField<Type>>
115  (
116  const BoundaryMesh&,
117  const Internal&,
118  const PtrList<PatchField<Type>>&
119  );
120 
121  //- Construct as copy setting the reference to the internal field
123 
124  //- Copy constructor deleted
125  // as it would not set the internalField reference correctly
127 
128  //- Move constructor deleted
129  // as it would not set the internalField reference correctly
131 
132  //- Construct from dictionary
134  (
135  const BoundaryMesh&,
136  const Internal&,
137  const dictionary&
138  );
139 
140 
141  // Member Functions
142 
143  //- Read the boundary field
144  void readField(const Internal& field, const dictionary& dict);
145 
146  //- Update the boundary condition coefficients
147  void updateCoeffs();
148 
149  //- Evaluate boundary conditions
150  void evaluate();
151 
152  //- Return a list of the patch field types
153  wordList types() const;
154 
155  //- Return BoundaryField of the cell values neighbouring
156  // the boundary
158 
159  //- Return BoundaryField of the values on the other side of couples
161 
162  //- Return a list of pointers for each patch field with only those
163  // pointing to interfaces being set
165 
166  //- Return a list of pointers for each patch field with only those
167  // pointing to interfaces being set
169 
170  //- Reset the boundary field contents to the given field
171  // Used for mesh to mesh mapping
173 
174  //- Write boundary field as dictionary entry
175  void writeEntry(const word& keyword, Ostream& os) const;
176 
177 
178  // Member Operators
179 
180  //- Assignment operator
181  void operator=(const GeometricBoundaryField&);
182 
183  //- Move assignment operator
185 
186  //- Assignment to FieldField<PatchField, Type>
188 
189  //- Assignment to FieldField<OtherPatchField, Type>
190  template<template<class> class OtherPatchField>
192 
193  //- Assignment to Type
194  void operator=(const Type&);
195 
196 
197  //- Forced assignment to
198  // BoundaryField<Type, PatchField, BoundaryMesh>
199  void operator==(const GeometricBoundaryField&);
200 
201  //- Forced assignment to FieldField<PatchField, Type>
203 
204  //- Forced assignment to FieldField<OtherPatchField, Type>
205  template<template<class> class OtherPatchField>
207 
208  //- Forced assignment to Type
209  void operator==(const Type&);
210 };
211 
212 
213 template<class Type, template<class> class PatchField, class GeoMesh>
214 Ostream& operator<<
215 (
216  Ostream&,
218 );
219 
220 
221 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
222 
223 } // End namespace Foam
224 
225 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
226 
227 #ifdef NoRepository
228  #include "GeometricBoundaryField.C"
229 #endif
230 
231 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
232 
233 #endif
234 
235 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Generic field type.
Definition: FieldField.H:77
Generic mesh wrapper used by volMesh, surfaceMesh, pointMesh etc.
Definition: GeoMesh.H:47
MESH::BoundaryMesh BoundaryMesh
Definition: GeoMesh.H:62
Generic GeometricBoundaryField class.
lduInterfaceFieldPtrsList scalarInterfaces() const
Return a list of pointers for each patch field with only those.
DimensionedField< Type, GeoMesh > Internal
Type of the internal field from which this GeometricField is derived.
void readField(const Internal &field, const dictionary &dict)
Read the boundary field.
wordList types() const
Return a list of the patch field types.
tmp< GeometricBoundaryField > boundaryNeighbourField() const
Return BoundaryField of the values on the other side of couples.
void evaluate()
Evaluate boundary conditions.
LduInterfaceFieldPtrsList< Type > interfaces() const
Return a list of pointers for each patch field with only those.
void operator==(const GeometricBoundaryField &)
Forced assignment to.
void writeEntry(const word &keyword, Ostream &os) const
Write boundary field as dictionary entry.
void updateCoeffs()
Update the boundary condition coefficients.
GeoMesh::BoundaryMesh BoundaryMesh
Type of boundary mesh on which this boundary is instantiated.
tmp< GeometricBoundaryField > boundaryInternalField() const
Return BoundaryField of the cell values neighbouring.
void reset(const GeometricBoundaryField< Type, PatchField, GeoMesh > &)
Reset the boundary field contents to the given field.
GeometricBoundaryField(const BoundaryMesh &)
Construct from a BoundaryMesh.
void operator=(const GeometricBoundaryField &)
Assignment operator.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: PtrList.H:75
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
A class for managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
List< word > wordList
A List of words.
Definition: fileName.H:54
dictionary dict