slicedFvsPatchField.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) 2023 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::slicedFvsPatchField
29 
30 Description
31  Specialization of fvsPatchField which creates the underlying
32  fvsPatchField as a slice of the given complete field.
33 
34  The destructor is wrapped to avoid deallocation of the storage of the
35  complete fields when this is destroyed.
36 
37  Should only used as a template argument for SlicedGeometricField.
38 
39 SourceFiles
40  slicedFvsPatchField.C
41 
42 \*---------------------------------------------------------------------------*/
43 
44 #ifndef Foam_slicedFvsPatchField_H
45 #define Foam_slicedFvsPatchField_H
46 
47 #include "fvsPatchField.H"
48 #include "processorFvPatch.H"
49 
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 
52 namespace Foam
53 {
54 
55 /*---------------------------------------------------------------------------*\
56  Class slicedFvsPatchField Declaration
57 \*---------------------------------------------------------------------------*/
58 
59 template<class Type>
61 :
62  public fvsPatchField<Type>
63 {
64 public:
65 
66  //- The mesh processor patch type
68 
69 
70  //- Runtime type information
71  TypeName("sliced");
72 
73 
74  // Constructors
75 
76  //- Construct from patch, internal field and field to slice
78  (
79  const fvPatch&,
81  const Field<Type>& completeOrBoundaryField,
82  const bool isBoundaryOnly = false
83  );
84 
85  //- Construct from patch and internal field
87  (
88  const fvPatch&,
90  );
91 
92  //- Construct from patch, internal field and dictionary
94  (
95  const fvPatch&,
97  const dictionary&
98  );
99 
100  //- Construct by mapping the given sliced patch field onto a new patch
102  (
104  const fvPatch&,
106  const fvPatchFieldMapper&
107  );
108 
109  //- Construct as copy
111 
112  //- Construct and return a clone
113  virtual tmp<fvsPatchField<Type>> clone() const;
114 
115  //- Construct as copy setting internal field reference
117  (
120  );
121 
122  //- Construct and return a clone setting internal field reference
124  (
126  ) const;
127 
128 
129  //- Destructor
130  virtual ~slicedFvsPatchField<Type>();
131 
132 
133  // Member Functions
134 
135  //- True: this patch field fixes a value.
136  virtual bool fixesValue() const { return true; }
137 
138 
139  // Member Operators
140 
141  virtual void operator=(const UList<Type>&) {}
142 
143  virtual void operator=(const fvsPatchField<Type>&) {}
144  virtual void operator+=(const fvsPatchField<Type>&) {}
145  virtual void operator-=(const fvsPatchField<Type>&) {}
146  virtual void operator*=(const fvsPatchField<scalar>&) {}
147  virtual void operator/=(const fvsPatchField<scalar>&) {}
148 
149  virtual void operator+=(const Field<Type>&) {}
150  virtual void operator-=(const Field<Type>&) {}
151 
152  virtual void operator*=(const Field<scalar>&) {}
153  virtual void operator/=(const Field<scalar>&) {}
154 
155  virtual void operator=(const Type&) {}
156  virtual void operator+=(const Type&) {}
157  virtual void operator-=(const Type&) {}
158  virtual void operator*=(const scalar) {}
159  virtual void operator/=(const scalar) {}
160 };
161 
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 } // End namespace Foam
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 #ifdef NoRepository
170  #include "slicedFvsPatchField.C"
171 #endif
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 #endif
177 // ************************************************************************* //
virtual void operator=(const UList< Type > &)
virtual tmp< fvsPatchField< Type > > clone() const
Construct and return a clone.
virtual bool fixesValue() const
True: this patch field fixes a value.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
TypeName("sliced")
Runtime type information.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:70
virtual void operator-=(const fvsPatchField< Type > &)
slicedFvsPatchField(const fvPatch &, const DimensionedField< Type, surfaceMesh > &, const Field< Type > &completeOrBoundaryField, const bool isBoundaryOnly=false)
Construct from patch, internal field and field to slice.
Generic templated field type.
Definition: Field.H:62
A FieldMapper for finite-volume patch fields.
processorFvPatch processorPatchType
The mesh processor patch type.
Processor patch.
virtual void operator*=(const fvsPatchField< scalar > &)
virtual void operator+=(const fvsPatchField< Type > &)
virtual void operator/=(const fvsPatchField< scalar > &)
Specialization of fvsPatchField which creates the underlying fvsPatchField as a slice of the given co...
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: areaFieldsFwd.H:42
A class for managing temporary objects.
Definition: HashPtrTable.H:50
An abstract base class with a fat-interface to all derived classes covering all possible ways in whic...
Namespace for OpenFOAM.