Loading...
Searching...
No Matches
faPatchField.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) 2016-2017 Wikki Ltd
9 Copyright (C) 2019-2025 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::faPatchField
29
30Description
31 faPatchField<Type> abstract base class. This class gives a fat-interface
32 to all derived classes covering all possible ways in which they might be
33 used. The first level of derivation is to basic patchFields which cover
34 zero-gradient, fixed-gradient, fixed-value and mixed conditions. The next
35 level of derivation covers all the specialised typed with specific
36 evaluation procedures, particularly with respect to specific fields.
37
38Author
39 Zeljko Tukovic, FMENA
40 Hrvoje Jasak, Wikki Ltd.
41
42SourceFiles
43 faPatchField.C
44 faPatchFieldBase.C
45 faPatchFieldNew.C
46
47\*---------------------------------------------------------------------------*/
48
49#ifndef Foam_faPatchField_H
50#define Foam_faPatchField_H
51
52#include "faPatch.H"
53#include "DimensionedField.H"
54#include "fieldTypes.H"
55#include "scalarField.H"
56
57// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
58
59namespace Foam
60{
61
62// Forward Declarations
63class dictionary;
64class objectRegistry;
66class areaMesh;
67
68template<class Type> class faPatchField;
69template<class Type> class calculatedFaPatchField;
70template<class Type> class zeroGradientFaPatchField;
71
72template<class Type>
74
75/*---------------------------------------------------------------------------*\
76 Class faPatchFieldBase Declaration
77\*---------------------------------------------------------------------------*/
78
79//- Template invariant parts for faPatchField
81{
82 // Private Data
83
84 //- Reference to patch
85 const faPatch& patch_;
86
87 //- Update index used so that updateCoeffs is called only once during
88 //- the construction of the matrix
89 bool updated_;
90
91 //- Optional patch type
92 // Used to allow specified boundary conditions to be applied
93 // to constraint patches by providing the constraint
94 // patch type as 'patchType'
95 word patchType_;
96
97
98protected:
99
100 // Protected Member Functions
101
102 //- Read dictionary entries.
103 // Useful when initially constructed without a dictionary
104 virtual void readDict(const dictionary& dict);
105
106
107public:
108
109 //- Debug switch to disallow the use of generic faPatchField
110 static int disallowGenericPatchField;
111
112 //- Runtime type information
113 TypeName("faPatchField");
114
115
116 // Constructors
117
118 //- Construct from patch
119 explicit faPatchFieldBase(const faPatch& p);
120
121 //- Construct from patch and patch type
122 explicit faPatchFieldBase(const faPatch& p, const word& patchType);
123
124 //- Construct from patch and dictionary
125 faPatchFieldBase(const faPatch& p, const dictionary& dict);
126
127 //- Copy construct with new patch
129
130 //- Copy construct
132
133
134 //- Destructor
135 virtual ~faPatchFieldBase() = default;
136
137
138 // Static Member Functions
139
140 //- The type name for \c empty patch fields
141 static const word& emptyType() noexcept
142 {
144 }
145
146 //- The type name for \c calculated patch fields
147 static const word& calculatedType() noexcept
148 {
150 }
151
152 //- The type name for \c extrapolatedCalculated patch fields
153 //- combines \c zero-gradient and \c calculated
154 static const word& extrapolatedCalculatedType() noexcept
155 {
157 }
159 //- The type name for \c zeroGradient patch fields
160 static const word& zeroGradientType() noexcept
161 {
163 }
164
165 //- The type name for \c zeroValue patch fields
167 {
169 }
170
171
172 // Member Functions
173
174 // Attributes
175
176 //- True if the patch field fixes a value.
177 // Needed to check if a level has to be specified while solving
178 // Poissons equations.
179 virtual bool fixesValue() const
180 {
181 return false;
182 }
184 //- True if the patch field is coupled
185 virtual bool coupled() const
186 {
187 return false;
188 }
189
190
191 // Access
192
193 //- The associated objectRegistry
194 const objectRegistry& db() const;
195
196 //- Return the patch
197 const faPatch& patch() const noexcept
198 {
199 return patch_;
200 }
201
202 //- The optional patch type
203 const word& patchType() const noexcept
204 {
205 return patchType_;
206 }
207
208 //- The optional patch type
209 word& patchType() noexcept
210 {
211 return patchType_;
212 }
213
214 //- True if the type does not correspond to the constraint type
215 virtual bool constraintOverride() const
216 {
217 return !patchType_.empty() && patchType_ != type();
218 }
219
220
221 // Solution
222
223 //- True if the boundary condition has already been updated
224 bool updated() const noexcept
225 {
226 return updated_;
227 }
228
229 //- Set updated state
230 void setUpdated(bool state) noexcept
231 {
232 updated_ = state;
233 }
234
235 //- True if the matrix has already been manipulated.
236 //- Currently always false for faPatchField
237 bool manipulatedMatrix() const noexcept
238 {
239 return false;
240 }
241
242 //- Set matrix manipulated state. Currently a no-op for faPatchField
243 void setManipulated(bool state) noexcept
244 {}
245
246
247 // Check
248
249 //- Check that patches are identical
250 void checkPatch(const faPatchFieldBase& rhs) const;
251};
252
253
254/*---------------------------------------------------------------------------*\
255 Class faPatchField Declaration
256\*---------------------------------------------------------------------------*/
257
258template<class Type>
259class faPatchField
260:
261 public faPatchFieldBase,
262 public Field<Type>
264public:
265
266 // Public Data Types
267
268 //- The patch type for the patch field
269 typedef faPatch Patch;
270
271 //- The value_type for the patch field
272 typedef Type value_type;
273
274 //- The component type for patch field
275 typedef typename pTraits<Type>::cmptType cmptType;
276
277 //- The internal field type associated with the patch field
279
280 //- Type for a \em calculated patch
283
284private:
285
286 // Private Data
287
288 //- Reference to internal field
289 const DimensionedField<Type, areaMesh>& internalField_;
290
292protected:
293
294 // Protected Member Functions
295
296 //- Read the "value" entry into \c *this.
297 // The reading can be optional (default), mandatory etc.
298 // \returns True on success
300 (
301 const dictionary& dict,
303 );
304
305 //- Write *this field as a "value" entry
306 void writeValueEntry(Ostream& os) const
307 {
308 Field<Type>::writeEntry("value", os);
309 }
310
311 //- Assign the patch field from the internal field
312 void extrapolateInternal();
313
314
315public:
316
317 // Declare run-time constructor selection tables
318
320 (
321 tmp,
323 patch,
324 (
325 const faPatch& p,
327 ),
328 (p, iF)
329 );
330
332 (
333 tmp,
335 patchMapper,
336 (
337 const faPatchField<Type>& ptf,
338 const faPatch& p,
340 const faPatchFieldMapper& m
341 ),
342 (dynamic_cast<const faPatchFieldType&>(ptf), p, iF, m)
343 );
346 (
347 tmp,
350 (
351 const faPatch& p,
353 const dictionary& dict
354 ),
355 (p, iF, dict)
356 );
357
358
359 // Constructors
360
361 //- Construct from patch and internal field
363 (
364 const faPatch&,
366 );
367
368 //- Construct from patch, internal field and value
370 (
371 const faPatch&,
373 const Type& value
374 );
375
376 //- Construct from patch, internal field and patch field
378 (
379 const faPatch&,
381 const Field<Type>& pfld
382 );
383
384 //- Construct from patch, internal field and patch field
386 (
387 const faPatch&,
390 );
391
392 //- Construct from patch, internal field and dictionary.
393 // \note older versions have always treated "value" as optional
395 (
396 const faPatch&,
398 const dictionary& dict,
401 );
402
403 //- Construct by mapping the given faPatchField onto a new patch
405 (
406 const faPatchField<Type>&,
407 const faPatch&,
409 const faPatchFieldMapper&
410 );
411
412 //- Copy construct onto a new patch with internal field reference
413 //- and specified value
415 (
416 const faPatchField<Type>& pfld,
417 const faPatch& p,
419 const Type& value
420 );
421
422 //- Copy construct with internal field reference
424 (
425 const faPatchField<Type>& pfld,
427 );
428
429 //- Copy construct
431 :
432 faPatchField<Type>(pfld, pfld.internalField())
433 {}
434
435
436 //- Clone patch field with its own internal field reference
437 virtual tmp<faPatchField<Type>> clone() const
438 {
440 (
441 new faPatchField<Type>(*this, this->internalField_)
442 );
443 }
444
445 //- Clone with an internal field reference
447 (
449 ) const
452 (
453 new faPatchField<Type>(*this, iF)
454 );
455 }
456
457
458 // Factory Methods
459
460 //- Clone a patch field with its own internal field reference
461 template<class DerivedPatchField>
463 (
464 const DerivedPatchField& pf
465 )
466 {
468 (
469 new DerivedPatchField(pf)
470 );
471 }
472
473 //- Clone a patch field with an internal field reference
474 template<class DerivedPatchField>
476 (
477 const DerivedPatchField& pf,
479 )
480 {
483 new DerivedPatchField(pf, iF)
484 );
485 }
486
487 //- Return a pointer to a new patchField created on freestore given
488 //- patch and internal field
489 // (does not set the patch field values)
491 (
492 const word& patchFieldType,
493 const word& actualPatchType,
494 const faPatch&,
496 );
497
498 //- Return a pointer to a new patchField created on freestore given
499 //- patch and internal field
500 // (does not set the patch field values)
502 (
503 const word& patchFieldType,
504 const faPatch&,
506 );
507
508 //- Return a pointer to a new patchField created on freestore from
509 //- a given faPatchField mapped onto a new patch
511 (
512 const faPatchField<Type>&,
513 const faPatch&,
515 const faPatchFieldMapper&
516 );
518 //- Return a pointer to a new patchField created on freestore
519 //- from dictionary
521 (
522 const faPatch&,
524 const dictionary&
525 );
527 //- Return a pointer to a new calculatedFaPatchField created on
528 //- freestore without setting patchField values
530 (
531 const faPatch& p
532 );
533
534 //- Return a pointer to a new calculatedFaPatchField created on
535 //- freestore without setting patchField values
536 template<class AnyType>
538 (
539 const faPatchField<AnyType>& pf
540 );
541
542
543 //- Destructor
544 virtual ~faPatchField() = default;
545
547 // Member Functions
548
549 // Access
550
551 //- Return const-reference to the dimensioned internal field
553 {
554 return internalField_;
555 }
556
557 //- Return const-reference to the internal field values
558 const Field<Type>& primitiveField() const noexcept
559 {
560 return internalField_;
561 }
562
563
564 // Mapping
565
566 //- Map (and resize as needed) from self given a mapping object
567 virtual void autoMap
568 (
569 const faPatchFieldMapper&
570 );
571
572 //- Reverse map the given faPatchField onto this faPatchField
573 virtual void rmap
574 (
575 const faPatchField<Type>&,
576 const labelList&
577 );
578
580 // Evaluation Functions
581
582 //- Return patch-normal gradient
583 virtual tmp<Field<Type>> snGrad() const;
584
585 //- Retrieve patch-normal gradient [contiguous storage]
586 virtual void snGrad(UList<Type>& result) const;
587
588 //- Return patch-normal gradient for coupled-patches
589 //- using the deltaCoeffs provided
590 virtual tmp<Field<Type>> snGrad
591 (
592 const scalarField& deltaCoeffs
593 ) const
594 {
596 return *this;
598
599 //- Retrieve patch-normal gradient for coupled-patches
600 //- using the deltaCoeffs provided [contiguous storage]
601 virtual void snGrad
602 (
603 const scalarField& deltaCoeffs,
605 ) const
606 {
608 }
609
610 //- Return internal field next to patch
612
613 //- Retrieve internal field next to patch
614 // \param [out] pfld The extracted patch field.
615 virtual void patchInternalField(UList<Type>& pfld) const;
616
617 //- Return patchField on the opposite patch of a coupled patch
618 virtual tmp<Field<Type>> patchNeighbourField() const
619 {
621 return *this;
623
624 //- Retrieve patchField on the opposite patch of a coupled patch
625 virtual void patchNeighbourField(UList<Type>&) const
626 {
628 }
629
630 //- Update the coefficients associated with the patch field
631 // Sets Updated to true
632 virtual void updateCoeffs();
633
634 //- Initialise the evaluation of the patch field
635 virtual void initEvaluate
636 (
637 const Pstream::commsTypes commsType =
639 )
640 {}
641
642 //- Evaluate the patch field, sets updated() to false
643 virtual void evaluate
644 (
645 const Pstream::commsTypes commsType =
647 );
648
649 //- Initialise the evaluation of the patch field after a local
650 // operation
651 virtual void initEvaluateLocal
652 (
653 const Pstream::commsTypes commsType =
656 {}
657
658 //- Evaluate the patch field after a local operation (e.g. *=)
659 virtual void evaluateLocal
660 (
661 const Pstream::commsTypes commsType =
663 )
664 {}
665
666 //- Return the matrix diagonal coefficients corresponding to the
667 //- evaluation of the value of this patchField with given weights
669 (
670 const tmp<scalarField>&
671 ) const
672 {
674 return *this;
675 }
676
677 //- Return the matrix source coefficients corresponding to the
678 //- evaluation of the value of this patchField with given weights
680 (
681 const tmp<scalarField>&
682 ) const
683 {
685 return *this;
686 }
687
688 //- Return the matrix diagonal coefficients corresponding to the
689 //- evaluation of the gradient of this patchField
691 {
693 return *this;
694 }
695
696 //- Return the matrix source coefficients corresponding to the
697 //- evaluation of the gradient of this patchField
699 {
701 return *this;
702 }
703
704
705 // Contiguous storage
706
707 //- Retrieve the matrix diagonal coefficients corresponding to the
708 //- evaluation of the value of this patchField with given weights
709 virtual void valueInternalCoeffs
710 (
711 const tmp<Field<scalar>>&,
713 ) const
714 {
716 }
717
718 //- Retrieve the matrix source coefficients corresponding to the
719 //- evaluation of the value of this patchField with given weights
720 virtual void valueBoundaryCoeffs
721 (
722 const tmp<Field<scalar>>&,
724 ) const
725 {
727 }
728
729 //- Retrieve the matrix diagonal coefficients corresponding to the
730 //- evaluation of the gradient of this patchField
731 virtual void gradientInternalCoeffs(UList<Type>&) const
732 {
734 }
735
736 //- Retrieve the matrix diagonal coefficients corresponding to the
737 //- evaluation of the gradient of this coupled patchField
738 //- using the deltaCoeffs provided
739 virtual void gradientInternalCoeffs
740 (
741 const scalarField& deltaCoeffs,
743 ) const
744 {
746 }
747
748 //- Retrieve the matrix source coefficients corresponding to the
749 //- evaluation of the gradient of this patchField
750 virtual void gradientBoundaryCoeffs(UList<Type>&) const
751 {
753 }
754
755 //- Retrieve the matrix source coefficients corresponding to the
756 //- evaluation of the gradient of this coupled patchField
757 //- using the deltaCoeffs provided
758 virtual void gradientBoundaryCoeffs
759 (
760 const scalarField& deltaCoeffs,
762 ) const
763 {
765 }
766
767
768 // Other
769
770 //- Write
771 virtual void write(Ostream& os) const;
772
773 //- Check against given patch field
774 void check(const faPatchField<Type>&) const;
775
776
777 // Member Operators
778
779 virtual void operator=(const UList<Type>&);
781 virtual void operator=(const faPatchField<Type>&);
782 virtual void operator+=(const faPatchField<Type>&);
783 virtual void operator-=(const faPatchField<Type>&);
784 virtual void operator*=(const faPatchField<scalar>&);
785 virtual void operator/=(const faPatchField<scalar>&);
786
787 virtual void operator+=(const Field<Type>&);
788 virtual void operator-=(const Field<Type>&);
789
790 virtual void operator*=(const Field<scalar>&);
791 virtual void operator/=(const Field<scalar>&);
792
793 virtual void operator=(const Type&);
794 virtual void operator+=(const Type&);
795 virtual void operator-=(const Type&);
796 virtual void operator*=(const scalar);
797 virtual void operator/=(const scalar);
798
799
800 // Force an assignment irrespective of form of patch
801
802 virtual void operator==(const faPatchField<Type>&);
803 virtual void operator==(const Field<Type>&);
804 virtual void operator==(const Type&);
805
806 // Prevent automatic comparison rewriting (c++20)
807 bool operator!=(const faPatchField<Type>&) const = delete;
808 bool operator!=(const Field<Type>&) const = delete;
809 bool operator!=(const Type&) const = delete;
810
811
812 // Ostream Operator
813
814 friend Ostream& operator<< <Type>(Ostream&, const faPatchField<Type>&);
815};
817
818// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
819
820} // End namespace Foam
821
822// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
823
824#ifdef NoRepository
825 #include "faPatchField.C"
826 #include "faPatchFieldNew.C"
829#endif
830
831// Runtime selection macros
832#include "faPatchFieldMacros.H"
833
834// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
835
836#endif
837
838// ************************************************************************* //
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
void writeEntry(const word &keyword, Ostream &os) const
Write the field as a dictionary entry.
Definition Field.C:754
constexpr Field() noexcept
Default construct.
Definition FieldI.H:24
readOption
Enumeration defining read preferences.
@ LAZY_READ
Reading is optional [identical to READ_IF_PRESENT].
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
Mesh data needed to do the Finite Area discretisation.
Definition areaFaMesh.H:50
Author Zeljko Tukovic, FMENA Hrvoje Jasak, Wikki Ltd.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
Template invariant parts for faPatchField.
virtual bool fixesValue() const
True if the patch field fixes a value.
virtual bool coupled() const
True if the patch field is coupled.
static const word & zeroValueType() noexcept
The type name for zeroValue patch fields.
static const word & calculatedType() noexcept
The type name for calculated patch fields.
faPatchFieldBase(const faPatch &p)
Construct from patch.
virtual ~faPatchFieldBase()=default
Destructor.
const objectRegistry & db() const
The associated objectRegistry.
virtual void readDict(const dictionary &dict)
Read dictionary entries.
void setManipulated(bool state) noexcept
Set matrix manipulated state. Currently a no-op for faPatchField.
void setUpdated(bool state) noexcept
Set updated state.
static const word & extrapolatedCalculatedType() noexcept
The type name for extrapolatedCalculated patch fields combines zero-gradient and calculated.
static int disallowGenericPatchField
Debug switch to disallow the use of generic faPatchField.
const word & patchType() const noexcept
The optional patch type.
bool manipulatedMatrix() const noexcept
True if the matrix has already been manipulated. Currently always false for faPatchField.
virtual bool constraintOverride() const
True if the type does not correspond to the constraint type.
bool updated() const noexcept
True if the boundary condition has already been updated.
word & patchType() noexcept
The optional patch type.
static const word & zeroGradientType() noexcept
The type name for zeroGradient patch fields.
static const word & emptyType() noexcept
The type name for empty patch fields.
const faPatch & patch() const noexcept
Return the patch.
void checkPatch(const faPatchFieldBase &rhs) const
Check that patches are identical.
TypeName("faPatchField")
Runtime type information.
A FieldMapper for finite-area patch fields.
faPatchField<Type> abstract base class. This class gives a fat-interface to all derived classes cover...
static tmp< faPatchField< Type > > New(const word &patchFieldType, const faPatch &, const DimensionedField< Type, areaMesh > &)
Return a pointer to a new patchField created on freestore given patch and internal field.
virtual tmp< faPatchField< Type > > clone() const
Clone patch field with its own internal field reference.
virtual tmp< Field< Type > > valueBoundaryCoeffs(const tmp< scalarField > &) const
Return the matrix source coefficients corresponding to the evaluation of the value of this patchField...
virtual void valueBoundaryCoeffs(const tmp< Field< scalar > > &, UList< Type > &) const
Retrieve the matrix source coefficients corresponding to the evaluation of the value of this patchFie...
virtual void operator/=(const Field< scalar > &)
virtual tmp< Field< Type > > snGrad(const scalarField &deltaCoeffs) const
Return patch-normal gradient for coupled-patches using the deltaCoeffs provided.
virtual tmp< Field< Type > > patchNeighbourField() const
Return patchField on the opposite patch of a coupled patch.
faPatchField(const faPatchField< Type > &pfld, const DimensionedField< Type, areaMesh > &iF)
Copy construct with internal field reference.
virtual void operator=(const faPatchField< Type > &)
faPatchField(const faPatch &, const DimensionedField< Type, areaMesh > &)
Construct from patch and internal field.
virtual void operator=(const Type &)
virtual ~faPatchField()=default
Destructor.
virtual tmp< Field< Type > > valueInternalCoeffs(const tmp< scalarField > &) const
Return the matrix diagonal coefficients corresponding to the evaluation of the value of this patchFie...
virtual void operator-=(const Type &)
static tmp< faPatchField< Type > > New(const faPatch &, const DimensionedField< Type, areaMesh > &, const dictionary &)
Return a pointer to a new patchField created on freestore from dictionary.
Type value_type
The value_type for the patch field.
static tmp< faPatchField< Type > > Clone(const DerivedPatchField &pf)
Clone a patch field with its own internal field reference.
virtual void gradientBoundaryCoeffs(const scalarField &deltaCoeffs, UList< Type > &) const
Retrieve the matrix source coefficients corresponding to the evaluation of the gradient of this coupl...
static tmp< faPatchField< Type > > New(const faPatchField< Type > &, const faPatch &, const DimensionedField< Type, areaMesh > &, const faPatchFieldMapper &)
Return a pointer to a new patchField created on freestore from a given faPatchField mapped onto a new...
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.
static tmp< faPatchField< Type > > New(const word &patchFieldType, const word &actualPatchType, const faPatch &, const DimensionedField< Type, areaMesh > &)
Return a pointer to a new patchField created on freestore given patch and internal field.
faPatchField(const faPatch &, const DimensionedField< Type, areaMesh > &, const Type &value)
Construct from patch, internal field and value.
virtual void rmap(const faPatchField< Type > &, const labelList &)
Reverse map the given faPatchField onto this faPatchField.
virtual void patchNeighbourField(UList< Type > &) const
Retrieve patchField on the opposite patch of a coupled patch.
faPatchField(const faPatchField< Type > &pfld)
Copy construct.
faPatch Patch
The patch type for the patch field.
void writeValueEntry(Ostream &os) const
Write *this field as a "value" entry.
virtual void operator*=(const Field< scalar > &)
virtual void operator==(const Field< Type > &)
virtual void operator==(const faPatchField< Type > &)
virtual tmp< Field< Type > > snGrad() const
Return patch-normal gradient.
virtual void operator/=(const faPatchField< scalar > &)
virtual void operator-=(const faPatchField< Type > &)
virtual void operator+=(const Field< Type > &)
virtual void initEvaluateLocal(const Pstream::commsTypes commsType=Pstream::commsTypes::buffered)
Initialise the evaluation of the patch field after a local.
const Field< Type > & primitiveField() const noexcept
Return const-reference to the internal field values.
declareRunTimeSelectionTable(tmp, faPatchField, dictionary,(const faPatch &p, const DimensionedField< Type, areaMesh > &iF, const dictionary &dict),(p, iF, dict))
virtual void operator+=(const Type &)
virtual void evaluateLocal(const Pstream::commsTypes commsType=Pstream::commsTypes::buffered)
Evaluate the patch field after a local operation (e.g. *=).
virtual void gradientBoundaryCoeffs(UList< Type > &) const
Retrieve the matrix source coefficients corresponding to the evaluation of the gradient of this patch...
virtual void operator-=(const Field< Type > &)
virtual void operator=(const UList< Type > &)
calculatedFaPatchField< Type > Calculated
Type for a calculated patch.
static tmp< faPatchField< Type > > NewCalculatedType(const faPatch &p)
Return a pointer to a new calculatedFaPatchField created on freestore without setting patchField valu...
pTraits< Type >::cmptType cmptType
The component type for patch field.
virtual void write(Ostream &os) const
Write.
virtual tmp< Field< Type > > gradientInternalCoeffs() const
Return the matrix diagonal coefficients corresponding to the evaluation of the gradient of this patch...
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
const DimensionedField< scalar, areaMesh > & internalField() const noexcept
bool operator!=(const faPatchField< Type > &) const =delete
declareRunTimeSelectionTable(tmp, faPatchField, patchMapper,(const faPatchField< Type > &ptf, const faPatch &p, const DimensionedField< Type, areaMesh > &iF, const faPatchFieldMapper &m),(dynamic_cast< const faPatchFieldType & >(ptf), p, iF, m))
declareRunTimeSelectionTable(tmp, faPatchField, patch,(const faPatch &p, const DimensionedField< Type, areaMesh > &iF),(p, iF))
faPatchField(const faPatch &, const DimensionedField< Type, areaMesh > &, const Field< Type > &pfld)
Construct from patch, internal field and patch field.
virtual void gradientInternalCoeffs(const scalarField &deltaCoeffs, UList< Type > &) const
Retrieve the matrix diagonal coefficients corresponding to the evaluation of the gradient of this cou...
faPatchField(const faPatch &, const DimensionedField< Type, areaMesh > &, Field< Type > &&pfld)
Construct from patch, internal field and patch field.
virtual void patchInternalField(UList< Type > &pfld) const
Retrieve internal field next to patch.
virtual void snGrad(UList< Type > &result) const
Retrieve patch-normal gradient [contiguous storage].
virtual void operator/=(const scalar)
faPatchField(const faPatchField< Type > &pfld, const faPatch &p, const DimensionedField< Type, areaMesh > &iF, const Type &value)
Copy construct onto a new patch with internal field reference and specified value.
virtual void operator+=(const faPatchField< Type > &)
virtual void snGrad(const scalarField &deltaCoeffs, UList< Type > &) const
Retrieve patch-normal gradient for coupled-patches using the deltaCoeffs provided [contiguous storage...
bool operator!=(const Field< Type > &) const =delete
virtual void autoMap(const faPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
virtual tmp< faPatchField< Type > > clone(const DimensionedField< Type, areaMesh > &iF) const
Clone with an internal field reference.
virtual void valueInternalCoeffs(const tmp< Field< scalar > > &, UList< Type > &) const
Retrieve the matrix diagonal coefficients corresponding to the evaluation of the value of this patchF...
bool operator!=(const Type &) const =delete
void check(const faPatchField< Type > &) const
Check against given patch field.
virtual void operator*=(const faPatchField< scalar > &)
DimensionedField< Type, areaMesh > Internal
The internal field type associated with the patch field.
virtual void gradientInternalCoeffs(UList< Type > &) const
Retrieve the matrix diagonal coefficients corresponding to the evaluation of the gradient of this pat...
bool readValueEntry(const dictionary &dict, IOobjectOption::readOption readOpt=IOobjectOption::LAZY_READ)
Read the "value" entry into *this.
faPatchField(const faPatchField< Type > &, const faPatch &, const DimensionedField< Type, areaMesh > &, const faPatchFieldMapper &)
Construct by mapping the given faPatchField onto a new patch.
void extrapolateInternal()
Assign the patch field from the internal field.
static tmp< faPatchField< Type > > NewCalculatedType(const faPatchField< AnyType > &pf)
Return a pointer to a new calculatedFaPatchField created on freestore without setting patchField valu...
faPatchField(const faPatch &, const DimensionedField< Type, areaMesh > &, const dictionary &dict, IOobjectOption::readOption requireValue=IOobjectOption::LAZY_READ)
Construct from patch, internal field and dictionary.
static tmp< faPatchField< Type > > Clone(const DerivedPatchField &pf, const DimensionedField< Type, areaMesh > &iF)
Clone a patch field with an internal field reference.
virtual void operator*=(const scalar)
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::buffered)
Evaluate the patch field, sets updated() to false.
virtual void operator==(const Type &)
virtual tmp< Field< Type > > gradientBoundaryCoeffs() const
Return the matrix source coefficients corresponding to the evaluation of the gradient of this patchFi...
Finite area patch class. Used for 2-D non-Euclidian finite area method.
Definition faPatch.H:76
Registry of regIOobjects.
A traits class, which is primarily used for primitives and vector-space.
Definition pTraits.H:64
A class for managing temporary objects.
Definition tmp.H:75
A class for handling words, derived from Foam::string.
Definition word.H:66
Author Zeljko Tukovic, FMENA Hrvoje Jasak, Wikki Ltd.
volScalarField & p
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition error.H:688
OBJstream os(runTime.globalPath()/outputName)
Macros for creating faPatchField types.
const word zeroGradientType
A zeroGradient patch field type.
const word extrapolatedCalculatedType
A combined zero-gradient and calculated patch field type.
const word calculatedType
A calculated patch field type.
const word emptyType
An empty patch field type.
const word zeroValueType
A zeroValue patch field type.
Namespace for OpenFOAM.
List< label > labelList
A List of labels.
Definition List.H:62
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition POSIX.C:801
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces).
void rhs(fvMatrix< typename Expr::value_type > &m, const Expr &expression)
const direction noexcept
Definition scalarImpl.H:265
runTime write()
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes).
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68