Loading...
Searching...
No Matches
slicedFaPatchField.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 OpenFOAM Foundation
9 Copyright (C) 2023 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::slicedFaPatchField
29
30Group
31 grpGenericBoundaryConditions
32
33Description
34 Specialization of faPatchField which creates the underlying
35 faPatchField as a slice of the given complete field.
36
37 The destructor is wrapped to avoid deallocation of the storage of the
38 complete fields when this is destroyed.
39
40 Should only used as a template argument for SlicedGeometricField.
41
42See also
43 Foam::faPatchField
44
45SourceFiles
46 slicedFaPatchField.C
47
48\*---------------------------------------------------------------------------*/
49
50#ifndef Foam_slicedFaPatchField_H
51#define Foam_slicedFaPatchField_H
52
53#include "faPatchField.H"
54#include "processorFaPatch.H"
55
56// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
57
58namespace Foam
59{
60
61/*---------------------------------------------------------------------------*\
62 Class slicedFaPatchField Declaration
63\*---------------------------------------------------------------------------*/
64
65template<class Type>
67:
68 public faPatchField<Type>
69{
70public:
71
72 //- Type for the mesh processor patch
74
75
76 //- Runtime type information
77 TypeName("sliced");
78
79
80 // Constructors
81
82 //- Construct from patch, internal field and field to slice
84 (
85 const faPatch&,
87 const Field<Type>& completeOrBoundaryField,
88 const bool isBoundaryOnly = false
89 );
90
91 //- Construct from patch and internal field. Assign value later.
93 (
94 const faPatch&,
96 );
97
98 //- Construct from patch, internal field and dictionary.
99 //- Not implemented
101 (
102 const faPatch&,
104 const dictionary&
105 );
106
107 //- Construct by mapping the given patch field onto a new patch.
108 //- Not implemented
110 (
112 const faPatch&,
114 const faPatchFieldMapper&
115 );
116
117 //- Construct as copy
119
120 //- Construct as copy setting internal field reference
122 (
125 );
126
127 //- Return clone
128 virtual tmp<faPatchField<Type>> clone() const
129 {
130 return faPatchField<Type>::Clone(*this);
131 }
132
133 //- Clone with an internal field reference
135 (
137 ) const
138 {
139 return faPatchField<Type>::Clone(*this, iF);
140 }
142
143 //- Destructor, resets pointers to avoid deletion of underlying field
144 virtual ~slicedFaPatchField();
145
146
147 // Member Functions
148
149 //- True: this patch field fixes a value.
150 virtual bool fixesValue() const { return true; }
151
152 //- False: this patch field is not altered by assignment.
153 virtual bool assignable() const { return false; }
154
155
156 // Evaluation Functions
157
158 //- Return patch-normal gradient
159 virtual tmp<Field<Type>> snGrad() const;
160
161 //- Return internal field next to patch
162 virtual tmp<Field<Type>> patchInternalField() const;
163
164 //- Retrieve internal field next to patch
165 virtual void patchInternalField(UList<Type>&) const;
166
167 //- Return patchField on the opposite patch of a coupled patch
168 virtual tmp<Field<Type>> patchNeighbourField() const;
170 //- Retrieve neighbour coupled field
171 virtual void patchNeighbourField(UList<Type>&) const;
172
173 //- Initialise the evaluation of the patch field
174 virtual void initEvaluate
175 (
176 const Pstream::commsTypes commsType =
178 )
179 {}
180
181 //- Evaluate the patch field, sets updated() to false
182 virtual void evaluate
183 (
184 const Pstream::commsTypes commsType =
186 )
187 {}
188
189 //- Return the matrix diagonal coefficients corresponding to the
190 // evaluation of the value of this patchField with given weights
191 virtual tmp<Field<Type>> valueInternalCoeffs
192 (
193 const tmp<scalarField>&
194 ) const;
195
196 //- Return the matrix source coefficients corresponding to the
197 // evaluation of the value of this patchField with given weights
198 virtual tmp<Field<Type>> valueBoundaryCoeffs
199 (
200 const tmp<scalarField>&
201 ) const;
202
203 //- Return the matrix diagonal coefficients corresponding to the
204 // evaluation of the gradient of this patchField
205 virtual tmp<Field<Type>> gradientInternalCoeffs() const;
206
207 //- Return the matrix source coefficients corresponding to the
208 // evaluation of the gradient of this patchField
210
211
212 //- Write
213 virtual void write(Ostream&) const;
214
215
216 // Member Operators
218 virtual void operator=(const UList<Type>&) {}
219
220 virtual void operator=(const faPatchField<Type>&) {}
221 virtual void operator+=(const faPatchField<Type>&) {}
222 virtual void operator-=(const faPatchField<Type>&) {}
223 virtual void operator*=(const faPatchField<scalar>&) {}
224 virtual void operator/=(const faPatchField<scalar>&) {}
225
226 virtual void operator+=(const Field<Type>&) {}
227 virtual void operator-=(const Field<Type>&) {}
228
229 virtual void operator*=(const Field<scalar>&) {}
230 virtual void operator/=(const Field<scalar>&) {}
231
232 virtual void operator=(const Type&) {}
233 virtual void operator+=(const Type&) {}
234 virtual void operator-=(const Type&) {}
235 virtual void operator*=(const scalar) {}
236 virtual void operator/=(const scalar) {}
237};
238
239
240// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
241
242} // End namespace Foam
243
244// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
245
246#ifdef NoRepository
247 #include "slicedFaPatchField.C"
248#endif
249
250// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
251
252#endif
253
254// ************************************************************************* //
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
commsTypes
Communications types.
Definition UPstream.H:81
@ buffered
"buffered" : (MPI_Bsend, MPI_Recv)
Definition UPstream.H:82
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
A FieldMapper for finite-area patch fields.
faPatchField<Type> abstract base class. This class gives a fat-interface to all derived classes cover...
faPatchField(const faPatch &, const DimensionedField< Type, areaMesh > &)
Construct from patch and internal field.
static tmp< faPatchField< Type > > Clone(const DerivedPatchField &pf)
Clone a patch field with its own internal field reference.
Finite area patch class. Used for 2-D non-Euclidian finite area method.
Definition faPatch.H:76
virtual tmp< faPatchField< Type > > clone() const
Return clone.
virtual void operator/=(const Field< scalar > &)
virtual bool fixesValue() const
True: this patch field fixes a value.
virtual tmp< Field< Type > > gradientInternalCoeffs() const
Return the matrix diagonal coefficients corresponding to the.
virtual void initEvaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::buffered)
Initialise the evaluation of the patch field.
virtual tmp< Field< Type > > patchInternalField() const
Return internal field next to patch.
virtual void operator+=(const Field< Type > &)
virtual void operator-=(const faPatchField< Type > &)
virtual void operator=(const Type &)
virtual void operator+=(const faPatchField< Type > &)
virtual void operator*=(const Field< scalar > &)
slicedFaPatchField(const faPatch &, const DimensionedField< Type, areaMesh > &, const Field< Type > &completeOrBoundaryField, const bool isBoundaryOnly=false)
Construct from patch, internal field and field to slice.
virtual tmp< Field< Type > > snGrad() const
Return patch-normal gradient.
virtual tmp< Field< Type > > valueInternalCoeffs(const tmp< scalarField > &) const
Return the matrix diagonal coefficients corresponding to the.
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::buffered)
Evaluate the patch field, sets updated() to false.
processorFaPatch processorPatchType
Type for the mesh processor patch.
virtual void operator/=(const scalar)
virtual void operator=(const UList< Type > &)
virtual tmp< Field< Type > > gradientBoundaryCoeffs() const
Return the matrix source coefficients corresponding to the.
virtual tmp< Field< Type > > valueBoundaryCoeffs(const tmp< scalarField > &) const
Return the matrix source coefficients corresponding to the.
virtual void operator-=(const Type &)
virtual ~slicedFaPatchField()
Destructor, resets pointers to avoid deletion of underlying field.
virtual tmp< faPatchField< Type > > clone(const DimensionedField< Type, areaMesh > &iF) const
Clone with an internal field reference.
virtual void operator=(const faPatchField< Type > &)
virtual bool assignable() const
False: this patch field is not altered by assignment.
virtual void operator*=(const scalar)
virtual tmp< Field< Type > > patchNeighbourField() const
Return patchField on the opposite patch of a coupled patch.
virtual void operator-=(const Field< Type > &)
virtual void operator+=(const Type &)
virtual void operator*=(const faPatchField< scalar > &)
virtual void operator/=(const faPatchField< scalar > &)
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