conformedFvsPatchField.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::conformedFvsPatchField
26 
27 Description
28  This surface field boundary condition holds data from both the original
29  faces and any associated non-conformal faces, with the latter mapped to the
30  conformal faces in the original patch. It is used during mesh change
31  (between the un-stitch and stitch steps) to ensure that fields relating to
32  both the original and the non-conformal patches are retained and mapped.
33 
34 SourceFiles
35  conformedFvsPatchField.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef conformedFvsPatchField_H
40 #define conformedFvsPatchField_H
41 
42 #include "fvsPatchField.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class conformedFvsPatchField Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 template<class Type>
55 :
56  public fvsPatchField<Type>
57 {
58  // Private Data
59 
60  //- The original patch field
61  autoPtr<fvsPatchField<Type>> origFieldPtr_;
62 
63  //- The associated non-conformal patch field
65 
66 
67  // Private Constructors
68 
69  //- Construct from components
71  (
72  const fvPatch&,
74  autoPtr<fvsPatchField<Type>>&& origFieldPtr,
76  );
77 
78 
79 public:
80 
81  //- Runtime type information
82  TypeName("conformed");
83 
84 
85  // Static Member Functions
86 
87  //- Conform the given boundary field
88  static void conform(typename SurfaceField<Type>::Boundary& bF);
89 
90  //- Un-conform the given boundary field
91  static void unconform(typename SurfaceField<Type>::Boundary& bF);
92 
93 
94  // Constructors
95 
96  //- Construct from patch and internal field
98  (
99  const fvPatch&,
101  );
102 
103  //- Construct from patch, internal field and dictionary
105  (
106  const fvPatch&,
108  const dictionary&
109  );
110 
111  //- Construct by mapping the given conformedFvsPatchField<Type>
112  // onto a new patch
114  (
116  const fvPatch&,
118  const fieldMapper&
119  );
120 
121  //- Disallow copy without setting internal field reference
123  (
125  ) = delete;
126 
127  //- Copy constructor setting internal field reference
129  (
132  );
133 
134  //- Construct and return a clone setting internal field reference
136  (
138  ) const
139  {
141  (
142  new conformedFvsPatchField<Type>(*this, iF)
143  );
144  }
145 
146 
147  // Member Functions
148 
149  // Mapping functions
150 
151  //- Map the given fvsPatchField onto this fvsPatchField
152  virtual void map(const fvsPatchField<Type>&, const fieldMapper&);
153 
154  //- Reset the fvsPatchField to the given fvsPatchField
155  // Used for mesh to mesh mapping
156  virtual void reset(const fvsPatchField<Type>&);
157 
158 
159  //- Write
160  virtual void write(Ostream&) const;
161 };
162 
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 } // End namespace Foam
167 
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 
170 #ifdef NoRepository
171  #include "conformedFvsPatchField.C"
172 #endif
173 
174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 
176 #endif
177 
178 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Generic GeometricBoundaryField class.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
Foam::calculatedFvsPatchField.
This surface field boundary condition holds data from both the original faces and any associated non-...
virtual void write(Ostream &) const
Write.
TypeName("conformed")
Runtime type information.
static void unconform(typename SurfaceField< Type >::Boundary &bF)
Un-conform the given boundary field.
virtual void reset(const fvsPatchField< Type > &)
Reset the fvsPatchField to the given fvsPatchField.
virtual void map(const fvsPatchField< Type > &, const fieldMapper &)
Map the given fvsPatchField onto this fvsPatchField.
static void conform(typename SurfaceField< Type >::Boundary &bF)
Conform the given boundary field.
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
An abstract base class with a fat-interface to all derived classes covering all possible ways in whic...
Definition: fvsPatchField.H:83
tmp< fvsPatchField< Type > > clone() const
Disallow clone without setting internal field reference.
A class for managing temporary objects.
Definition: tmp.H:55
Namespace for OpenFOAM.