Loading...
Searching...
No Matches
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-2024 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::slicedFvsPatchField
29
30Description
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
39SourceFiles
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
52namespace Foam
53{
54
55/*---------------------------------------------------------------------------*\
56 Class slicedFvsPatchField Declaration
57\*---------------------------------------------------------------------------*/
58
59template<class Type>
61:
62 public fvsPatchField<Type>
63{
64public:
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.
93 // Not implemented.
95 (
96 const fvPatch&,
98 const dictionary&
99 );
100
101 //- Construct by mapping the given sliced patch field onto a new patch
102 // Not implemented.
104 (
106 const fvPatch&,
108 const fvPatchFieldMapper&
109 );
110
111 //- Construct as copy
113
114 //- Construct as copy setting internal field reference
116 (
119 );
120
121 //- Return clone
122 virtual tmp<fvsPatchField<Type>> clone() const
123 {
124 return fvsPatchField<Type>::Clone(*this);
125 }
126
127 //- Clone with an internal field reference
129 (
131 ) const
132 {
133 return fvsPatchField<Type>::Clone(*this, iF);
134 }
135
136
137 //- Destructor, resets pointers to avoid deletion of underlying field
138 virtual ~slicedFvsPatchField();
139
140
141 // Member Functions
142
143 //- True: this patch field fixes a value.
144 virtual bool fixesValue() const { return true; }
146 //- False: this patch field is not altered by assignment.
147 virtual bool assignable() const { return false; }
148
149 //- Write includes "value" entry
150 virtual void write(Ostream&) const;
151
152
153 // Member Operators
154
155 virtual void operator=(const UList<Type>&) {}
156
157 virtual void operator=(const fvsPatchField<Type>&) {}
158 virtual void operator+=(const fvsPatchField<Type>&) {}
159 virtual void operator-=(const fvsPatchField<Type>&) {}
160 virtual void operator*=(const fvsPatchField<scalar>&) {}
161 virtual void operator/=(const fvsPatchField<scalar>&) {}
162
163 virtual void operator+=(const Field<Type>&) {}
164 virtual void operator-=(const Field<Type>&) {}
166 virtual void operator*=(const Field<scalar>&) {}
167 virtual void operator/=(const Field<scalar>&) {}
168
169 virtual void operator=(const Type&) {}
170 virtual void operator+=(const Type&) {}
171 virtual void operator-=(const Type&) {}
172 virtual void operator*=(const scalar) {}
173 virtual void operator/=(const scalar) {}
174};
175
176
177// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178
179} // End namespace Foam
181// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183#ifdef NoRepository
185#endif
187// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189#endif
190
191// ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
Definition Field.H:172
constexpr Field() noexcept
Default construct.
Definition FieldI.H:24
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition UList.H:89
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
A FieldMapper for finite-volume patch fields.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition fvPatch.H:71
fvsPatchField(const fvPatch &, const DimensionedField< Type, surfaceMesh > &)
Construct from patch and internal field.
static tmp< fvsPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
virtual void operator=(const fvsPatchField< Type > &)
virtual void operator/=(const Field< scalar > &)
virtual bool fixesValue() const
True: this patch field fixes a value.
virtual void operator-=(const fvsPatchField< Type > &)
processorFvPatch processorPatchType
The mesh processor patch type.
virtual void operator*=(const fvsPatchField< scalar > &)
virtual tmp< fvsPatchField< Type > > clone(const DimensionedField< Type, surfaceMesh > &iF) const
Clone with an internal field reference.
virtual void operator+=(const Field< Type > &)
virtual void operator=(const Type &)
virtual void operator*=(const Field< scalar > &)
virtual tmp< fvsPatchField< Type > > clone() const
Return clone.
virtual void operator/=(const scalar)
virtual void operator=(const UList< Type > &)
virtual void operator+=(const fvsPatchField< Type > &)
virtual void operator-=(const 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.
virtual bool assignable() const
False: this patch field is not altered by assignment.
virtual void operator/=(const fvsPatchField< scalar > &)
virtual void operator*=(const scalar)
virtual ~slicedFvsPatchField()
Destructor, resets pointers to avoid deletion of underlying field.
virtual void operator-=(const Field< Type > &)
virtual void operator+=(const Type &)
TypeName("sliced")
Runtime type information.
A class for managing temporary objects.
Definition tmp.H:75
Namespace for OpenFOAM.
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68