Loading...
Searching...
No Matches
GeometricField.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-2017 OpenFOAM Foundation
9 Copyright (C) 2015-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::GeometricField
29
30Description
31 Generic GeometricField class.
32
33SourceFiles
34 GeometricFieldI.H
35 GeometricField.C
36 GeometricFieldFunctions.H
37 GeometricFieldFunctions.C
38
39\*---------------------------------------------------------------------------*/
40
41#ifndef Foam_GeometricField_H
42#define Foam_GeometricField_H
43
46
47// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48
49namespace Foam
50{
51
52// Forward Declarations
54template<class Type, template<class> class PatchField, class GeoMesh>
55class GeometricField;
56
57template<class Type, template<class> class PatchField, class GeoMesh>
58Ostream& operator<<
59(
62);
63
64template<class Type, template<class> class PatchField, class GeoMesh>
65Ostream& operator<<
66(
67 Ostream&,
69);
70
71
72/*---------------------------------------------------------------------------*\
73 Class GeometricField Declaration
74\*---------------------------------------------------------------------------*/
75
76template<class Type, template<class> class PatchField, class GeoMesh>
78:
79 public DimensionedField<Type, GeoMesh>
80{
81public:
82
83 // Public Typedefs
84
85 //- The template instance used for this GeometricField type
87
88 //- The mesh type for the GeometricField
89 typedef typename GeoMesh::Mesh Mesh;
90
91 //- The boundary mesh type for the boundary fields
92 typedef typename GeoMesh::BoundaryMesh BoundaryMesh;
94 //- The internal field type from which this GeometricField is derived
96
97 //- Type of boundary fields
99
100 //- The patch field type for the GeometricBoundaryField
101 typedef PatchField<Type> Patch;
102
103 //- Component type of the field elements
104 typedef typename Field<Type>::cmptType cmptType;
105
106
107private:
109 // Private Data
110
111 //- Current time index.
112 // Used to trigger the storing of the old-time value
113 mutable label timeIndex_;
114
115 //- Pointer to old time field
116 mutable std::unique_ptr<this_type> field0Ptr_;
117
118 //- Pointer to previous iteration (used for under-relaxation)
119 mutable std::unique_ptr<this_type> fieldPrevIterPtr_;
120
121 //- Boundary field containing boundary field values
122 Boundary boundaryField_;
123
124
125 // Private Member Functions
126
127 //- Read from file if it is present
128 bool readIfPresent();
129
130 //- Read old time field from file if it is present
131 bool readOldTimeIfPresent();
132
133 //- Read the field from the dictionary
134 void readFields(const dictionary& dict);
135
136 //- Read the field - create the field dictionary on-the-fly
137 void readFields();
138
139 //- Implementation for 'New' with specified registerObject preference.
140 // For LEGACY_REGISTER, registration is determined by
141 // objectRegistry::is_cacheTemporaryObject().
142 template<class... Args>
144 (
146 const word& name,
147 const Mesh& mesh,
148 Args&&... args
149 );
150
151public:
152
153 //- Runtime type information
154 TypeName("GeometricField");
155
156
157 // Static Member Functions
158
159 //- Return a null GeometricField (reference to a nullObject).
160 static const this_type& null() noexcept
161 {
163 }
164
165
166 // Constructors
167
168 //- Construct given IOobject, mesh, dimensions and patch type.
169 // This allocates storage for the field but does not set values.
170 // Used only within this class to create TEMPORARY variables
172 (
173 const IOobject& io,
174 const Mesh& mesh,
175 const dimensionSet& dims,
176 const word& patchFieldType = PatchField<Type>::calculatedType()
177 );
178
179 //- Construct given IOobject, mesh, dimensions and patch types.
180 // This allocates storage for the field but does not set values.
181 // Used only within this class to create TEMPORARY variables
183 (
184 const IOobject& io,
185 const Mesh& mesh,
186 const dimensionSet& dims,
187 const wordList& wantedPatchTypes,
188 const wordList& actualPatchTypes = wordList()
189 );
190
191 //- Construct given IOobject, mesh, dimensions, initial field value
192 //- and given patch type.
193 // This assigns both dimensions and values.
195 (
196 const IOobject& io,
197 const Mesh& mesh,
198 const Type& value,
199 const dimensionSet& dims,
200 const word& patchFieldType = PatchField<Type>::calculatedType()
201 );
202
203 //- Construct given IOobject, mesh, dimensions, initial field value
204 //- and given patch types.
205 // This assigns both dimensions and values.
208 const IOobject& io,
209 const Mesh& mesh,
210 const Type& value,
211 const dimensionSet& dims,
212 const wordList& wantedPatchTypes,
213 const wordList& actualPatchTypes = wordList()
214 );
215
216 //- Construct given IOobject, mesh, dimensioned<Type> and patch type.
217 // This assigns both dimensions and values.
218 // The name of the dimensioned<Type> has no influence.
220 (
221 const IOobject& io,
222 const Mesh& mesh,
223 const dimensioned<Type>& dt,
224 const word& patchFieldType = PatchField<Type>::calculatedType()
225 );
226
227 //- Construct given IOobject, mesh, dimensioned<Type> and patch types.
228 // This assigns both dimensions and values.
229 // The name of the dimensioned<Type> has no influence.
231 (
232 const IOobject& io,
233 const Mesh& mesh,
234 const dimensioned<Type>& dt,
235 const wordList& wantedPatchTypes,
236 const wordList& actualPatchTypes = wordList()
237 );
238
239 //- Copy construct from internal field and a patch list to clone
241 (
242 const IOobject& io,
243 const Internal& diField,
244 const PtrList<PatchField<Type>>& ptfl
245 );
246
247 //- Move construct from internal field and a patch list to clone
249 (
250 const IOobject& io,
251 Internal&& diField,
252 const PtrList<PatchField<Type>>& ptfl
253 );
254
255 //- Construct from internal field (tmp) and a patch list to clone
257 (
258 const IOobject& io,
259 const tmp<Internal>& tfield,
260 const PtrList<PatchField<Type>>& ptfl
261 );
262
263 //- Copy construct from internal field and a patch list to clone
265 (
266 const Internal& diField,
267 const PtrList<PatchField<Type>>& ptfl
268 );
269
270 //- Move construct from internal field and a patch list to clone
272 (
273 Internal&& diField,
274 const PtrList<PatchField<Type>>& ptfl
275 );
276
277 //- Copy construct from primitive field, with specified patch type
279 (
280 const IOobject& io,
281 const Mesh& mesh,
282 const dimensionSet& dims,
283 const Field<Type>& iField,
284 const word& patchFieldType = PatchField<Type>::calculatedType()
285 );
286
287 //- Move construct from primitive field, with specified patch type
289 (
290 const IOobject& io,
291 const Mesh& mesh,
292 const dimensionSet& dims,
293 Field<Type>&& iField,
294 const word& patchFieldType = PatchField<Type>::calculatedType()
295 );
296
297 //- Construct from primitive field (tmp), with specified patch type
299 (
300 const IOobject& io,
301 const Mesh& mesh,
302 const dimensionSet& dims,
303 const tmp<Field<Type>>& tfield,
304 const word& patchFieldType = PatchField<Type>::calculatedType()
305 );
306
307 //- Copy construct from primitive field and a patch list to clone
309 (
310 const IOobject& io,
311 const Mesh& mesh,
312 const dimensionSet& dims,
313 const Field<Type>& iField,
314 const PtrList<PatchField<Type>>& ptfl
315 );
316
317 //- Move construct from primitive field and a patch list to clone
319 (
320 const IOobject& io,
321 const Mesh& mesh,
322 const dimensionSet& dims,
323 Field<Type>&& iField,
324 const PtrList<PatchField<Type>>& ptfl
325 );
326
327 //- Copy construct from components
329 (
330 const IOobject& io,
331 const Mesh& mesh,
332 const dimensionSet& dims,
333 const tmp<Field<Type>>& tfield,
334 const PtrList<PatchField<Type>>& ptfl
335 );
336
337 //- Read construct using given IOobject. Always reads!
339 (
340 const IOobject& io,
341 const Mesh& mesh,
342 const bool readOldTime = true
343 );
344
345 //- Construct from dictionary
347 (
348 const IOobject& io,
349 const Mesh& mesh,
350 const dictionary& dict
351 );
352
353 //- Copy construct
355 (
357 );
358
359 //- Construct from tmp<GeometricField> deleting argument
361 (
363 );
364
365 //- Construct as copy resetting IO parameters
367 (
368 const IOobject& io,
370 );
371
372 //- Construct from tmp<GeometricField> resetting IO parameters
374 (
375 const IOobject& io,
377 );
378
379 //- Copy construct with a new name
381 (
382 const word& newName,
384 );
385
386 //- Construct with a new name from tmp<GeometricField>
388 (
389 const word& newName,
391 );
392
393 //- Construct as copy resetting IO parameters and patch type
395 (
396 const IOobject& io,
398 const word& patchFieldType
399 );
400
401 //- Construct as copy resetting IO parameters and boundary type
402 //- for selected patchIDs
404 (
405 const IOobject& io,
407 const labelList& patchIDs,
408 const word& patchFieldType
409 );
410
411 //- Construct as copy resetting IO parameters and boundary types
414 const IOobject& io,
416 const wordList& patchFieldTypes,
417 const wordList& actualPatchTypes = wordList()
418 );
419
420 //- Construct as copy resetting IO parameters and boundary types
422 (
423 const IOobject& io,
425 const wordList& patchFieldTypes,
426 const wordList& actualPatchTypes = wordList()
427 );
428
429 //- Clone
431
432
433 // Factory Methods
434
435 //- Return tmp field (NO_READ, NO_WRITE)
436 //- from name, mesh, dimensions and patch type.
437 //- [Takes current timeName from the mesh registry].
438 // For LEGACY_REGISTER, registration is determined by
439 // objectRegistry::is_cacheTemporaryObject().
442 const word& name,
444 const Mesh& mesh,
445 const dimensionSet& dims,
446 const word& patchFieldType = PatchField<Type>::calculatedType()
447 );
448
449 //- Return tmp field (NO_READ, NO_WRITE)
450 //- from name, mesh, dimensions and patch type.
451 //- [Takes current timeName from the mesh registry].
452 // Registration/persistence determined by
453 // objectRegistry::is_cacheTemporaryObject().
455 (
456 const word& name,
457 const Mesh& mesh,
458 const dimensionSet& dims,
459 const word& patchFieldType = PatchField<Type>::calculatedType()
460 );
461
462 //- Return tmp field (NO_READ, NO_WRITE)
463 //- from name, mesh, dimensions, copy of internal field and patch type.
464 //- [Takes current timeName from the mesh registry].
465 // For LEGACY_REGISTER, registration is determined by
466 // objectRegistry::is_cacheTemporaryObject().
468 (
469 const word& name,
471 const Mesh& mesh,
472 const dimensionSet& dims,
473 const Field<Type>& iField,
474 const word& patchFieldType = PatchField<Type>::calculatedType()
475 );
477 //- Return tmp field (NO_READ, NO_WRITE)
478 //- from name, mesh, dimensions, copy of internal field and patch type.
479 //- [Takes current timeName from the mesh registry].
480 // Registration/persistence determined by
481 // objectRegistry::is_cacheTemporaryObject().
483 (
484 const word& name,
485 const Mesh& mesh,
486 const dimensionSet& dims,
487 const Field<Type>& iField,
488 const word& patchFieldType = PatchField<Type>::calculatedType()
489 );
490
491 //- Return tmp field (NO_READ, NO_WRITE)
492 //- from name, mesh, dimensions, moved internal field contents
493 //- and patch type.
494 //- [Takes current timeName from the mesh registry].
495 // For LEGACY_REGISTER, registration is determined by
496 // objectRegistry::is_cacheTemporaryObject().
498 (
499 const word& name,
501 const Mesh& mesh,
502 const dimensionSet& dims,
503 Field<Type>&& iField,
504 const word& patchFieldType = PatchField<Type>::calculatedType()
505 );
506
507 //- Return tmp field (NO_READ, NO_WRITE)
508 //- from name, mesh, dimensions, moved internal field contents
509 //- and patch type.
510 //- [Takes current timeName from the mesh registry].
511 // Registration/persistence determined by
512 // objectRegistry::is_cacheTemporaryObject().
514 (
515 const word& name,
516 const Mesh& mesh,
517 const dimensionSet& dims,
518 Field<Type>&& iField,
519 const word& patchFieldType = PatchField<Type>::calculatedType()
520 );
521
522 //- Return tmp field (NO_READ, NO_WRITE)
523 //- from name, mesh, dimensions, tmp of primitive field
524 //- and patch type.
525 //- [Takes current timeName from the mesh registry].
526 // For LEGACY_REGISTER, registration is determined by
527 // objectRegistry::is_cacheTemporaryObject().
530 const word& name,
532 const Mesh& mesh,
533 const dimensionSet& dims,
534 const tmp<Field<Type>>& tfield,
535 const word& patchFieldType = PatchField<Type>::calculatedType()
536 );
537
538 //- Return tmp field (NO_READ, NO_WRITE)
539 //- from name, mesh, dimensions, tmp of primitive field
540 //- and patch type.
541 //- [Takes current timeName from the mesh registry].
542 // Registration/persistence determined by
543 // objectRegistry::is_cacheTemporaryObject().
545 (
546 const word& name,
547 const Mesh& mesh,
548 const dimensionSet& dims,
549 const tmp<Field<Type>>& tfield,
550 const word& patchFieldType = PatchField<Type>::calculatedType()
551 );
552
553 //- Return tmp field (NO_READ, NO_WRITE)
554 //- from name, mesh, dimensions, copy of internal field contents
555 //- and patch list to clone.
556 //- [Takes current timeName from the mesh registry].
557 // For LEGACY_REGISTER, registration is determined by
558 // objectRegistry::is_cacheTemporaryObject().
560 (
561 const word& name,
563 const Mesh& mesh,
564 const dimensionSet& dims,
565 const Field<Type>& iField,
566 const PtrList<PatchField<Type>>& pflds
567 );
568
569 //- Return tmp field (NO_READ, NO_WRITE)
570 //- from name, mesh, dimensions, copy of internal field contents
571 //- and patch list to clone.
572 //- [Takes current timeName from the mesh registry].
573 // Registration/persistence determined by
574 // objectRegistry::is_cacheTemporaryObject().
576 (
577 const word& name,
578 const Mesh& mesh,
579 const dimensionSet& dims,
580 const Field<Type>& iField,
581 const PtrList<PatchField<Type>>& pflds
582 );
583
584 //- Return tmp field (NO_READ, NO_WRITE)
585 //- from name, mesh, dimensions, moved internal field contents
586 //- and patch list to clone.
587 //- [Takes current timeName from the mesh registry].
588 // For LEGACY_REGISTER, registration is determined by
589 // objectRegistry::is_cacheTemporaryObject().
591 (
592 const word& name,
594 const Mesh& mesh,
595 const dimensionSet& dims,
596 Field<Type>&& iField,
597 const PtrList<PatchField<Type>>& pflds
598 );
599
600 //- Return tmp field (NO_READ, NO_WRITE)
601 //- from name, mesh, dimensions, moved internal field contents
602 //- and patch list to clone.
603 //- [Takes current timeName from the mesh registry].
604 // Registration/persistence determined by
605 // objectRegistry::is_cacheTemporaryObject().
607 (
608 const word& name,
609 const Mesh& mesh,
610 const dimensionSet& dims,
611 Field<Type>&& iField,
612 const PtrList<PatchField<Type>>& pflds
613 );
614
615 //- Return tmp field (NO_READ, NO_WRITE)
616 //- from name, mesh, field value, dimensions and patch type.
617 //- [Takes current timeName from the mesh registry].
618 // For LEGACY_REGISTER, registration is determined by
619 // objectRegistry::is_cacheTemporaryObject().
621 (
622 const word& name,
624 const Mesh& mesh,
625 const Type& value,
626 const dimensionSet& dims,
627 const word& patchFieldType = PatchField<Type>::calculatedType()
628 );
629
630 //- Return tmp field (NO_READ, NO_WRITE)
631 //- from name, mesh, field value, dimensions and patch type.
632 //- [Takes current timeName from the mesh registry].
633 // Registration/persistence determined by
634 // objectRegistry::is_cacheTemporaryObject().
636 (
637 const word& name,
638 const Mesh& mesh,
639 const Type& value,
640 const dimensionSet& dims,
641 const word& patchFieldType = PatchField<Type>::calculatedType()
642 );
643
644 //- Return tmp field (NO_READ, NO_WRITE)
645 //- from name, mesh, field value, dimensions and patch field types.
646 //- [Takes current timeName from the mesh registry].
647 // For LEGACY_REGISTER, registration is determined by
648 // objectRegistry::is_cacheTemporaryObject().
650 (
651 const word& name,
653 const Mesh& mesh,
654 const Type& value,
655 const dimensionSet& dims,
656 const wordList& patchFieldTypes,
657 const wordList& actualPatchTypes = wordList()
658 );
659
660 //- Return tmp field (NO_READ, NO_WRITE)
661 //- from name, mesh, field value, dimensions and patch field types.
662 //- [Takes current timeName from the mesh registry].
663 // Registration/persistence determined by
664 // objectRegistry::is_cacheTemporaryObject().
666 (
667 const word& name,
668 const Mesh& mesh,
669 const Type& value,
670 const dimensionSet& dims,
671 const wordList& patchFieldTypes,
672 const wordList& actualPatchTypes = wordList()
673 );
674
675 //- Return tmp field (NO_READ, NO_WRITE)
676 //- from name, mesh, dimensioned-type and patch type.
677 //- [Takes current timeName from the mesh registry].
678 // For LEGACY_REGISTER, registration is determined by
679 // objectRegistry::is_cacheTemporaryObject().
681 (
682 const word& name,
684 const Mesh& mesh,
686 const word& patchFieldType = PatchField<Type>::calculatedType()
687 );
688
689 //- Return tmp field (NO_READ, NO_WRITE)
690 //- from name, mesh, dimensioned-type and patch type.
691 //- [Takes current timeName from the mesh registry].
692 // Registration/persistence determined by
693 // objectRegistry::is_cacheTemporaryObject().
695 (
696 const word& name,
697 const Mesh& mesh,
698 const dimensioned<Type>& dt,
699 const word& patchFieldType = PatchField<Type>::calculatedType()
700 );
701
702 //- Return tmp field (NO_READ, NO_WRITE)
703 //- from name, mesh, dimensioned-type and patch field types.
704 //- [Takes current timeName from the mesh registry].
705 // For LEGACY_REGISTER, registration is determined by
706 // objectRegistry::is_cacheTemporaryObject().
708 (
709 const word& name,
711 const Mesh& mesh,
712 const dimensioned<Type>& dt,
713 const wordList& patchFieldTypes,
714 const wordList& actualPatchTypes = wordList()
715 );
716
717 //- Return tmp field (NO_READ, NO_WRITE)
718 //- from name, mesh, dimensioned-type and patch field types.
719 //- [Takes current timeName from the mesh registry].
720 // Registration/persistence determined by
721 // objectRegistry::is_cacheTemporaryObject().
723 (
724 const word& name,
725 const Mesh& mesh,
726 const dimensioned<Type>& dt,
727 const wordList& patchFieldTypes,
728 const wordList& actualPatchTypes = wordList()
729 );
730
731 //- Return renamed tmp field (NO_READ, NO_WRITE)
732 //- retaining its instance/local.
733 // For LEGACY_REGISTER, registration is determined by
734 // objectRegistry::is_cacheTemporaryObject().
736 (
737 const word& newName,
740 );
742 //- Return renamed tmp field (NO_READ, NO_WRITE)
743 //- retaining its instance/local.
744 // Registration/persistence determined by
745 // objectRegistry::is_cacheTemporaryObject().
747 (
748 const word& newName,
750 );
751
752 //- Return renamed tmp field (NO_READ, NO_WRITE)
753 //- with reset patch field type, retaining its instance/local.
754 // For LEGACY_REGISTER, registration is determined by
755 // objectRegistry::is_cacheTemporaryObject().
757 (
758 const word& newName,
761 const word& patchFieldType
762 );
763
764 //- Return renamed tmp field (NO_READ, NO_WRITE)
765 //- with reset patch field type, retaining its instance/local.
766 // Registration/persistence determined by
767 // objectRegistry::is_cacheTemporaryObject().
769 (
770 const word& newName,
772 const word& patchFieldType
773 );
774
775 //- Return renamed tmp field (NO_READ, NO_WRITE)
776 //- with reset patch field types, retaining its instance/local.
777 // For LEGACY_REGISTER, registration is determined by
778 // objectRegistry::is_cacheTemporaryObject().
780 (
781 const word& newName,
784 const wordList& patchFieldTypes,
785 const wordList& actualPatchTypes = wordList()
786 );
787
788 //- Return renamed tmp field (NO_READ, NO_WRITE)
789 //- with reset patch field types, retaining its instance/local.
790 // Registration/persistence determined by
791 // objectRegistry::is_cacheTemporaryObject().
794 const word& newName,
796 const wordList& patchFieldTypes,
797 const wordList& actualPatchTypes = wordList()
798 );
799
800 //- Construct tmp field (NO_READ, NO_WRITE)
801 //- based on mesh/registry information from an existing field.
802 //- [Takes instance from the field].
803 // Registration/persistence determined by
804 // objectRegistry::is_cacheTemporaryObject().
805 template<class AnyType>
807 (
809 const word& name,
810 const dimensionSet& dims,
811 const word& patchFieldType = PatchField<Type>::calculatedType()
812 );
813
814 //- Construct tmp field (NO_READ, NO_WRITE)
815 //- based on mesh/registry information from an existing field.
816 //- and initialise with value.
817 //- [Takes instance from the field].
818 // Registration/persistence determined by
819 // objectRegistry::is_cacheTemporaryObject().
820 template<class AnyType>
822 (
824 const word& name,
825 const dimensioned<Type>& dt,
826 const word& patchFieldType = PatchField<Type>::calculatedType()
827 );
828
829
830 //- Destructor
831 virtual ~GeometricField();
832
833
834 // Member Functions
835
836 //- Return non-const reference to this field
838 {
839 return const_cast<this_type&>(*this);
840 }
841
842 //- Return a const-reference to the dimensioned internal field.
843 inline const Internal& internalField() const noexcept;
844
845 //- Return a reference to the dimensioned internal field.
846 // \param updateAccessTime update event counter and check
847 // old-time fields
848 //
849 // \note Should avoid using updateAccessTime = true within loops.
850 Internal& internalFieldRef(const bool updateAccessTime = true);
851
852 //- Same as internalFieldRef()
853 Internal& ref(const bool updateAccessTime = true)
854 {
855 return this->internalFieldRef(updateAccessTime);
856 }
857
858 //- Return a const-reference to the dimensioned internal field
859 //- of a "vol" field.
860 // Useful in the formulation of source-terms for FV equations
861 //
862 // \note definition in finiteVolume/fields/volFields/volFieldsI.H
863 inline const Internal& v() const;
864
865 //- Return a const-reference to the internal field values.
866 inline const typename Internal::FieldType& primitiveField()
867 const noexcept;
868
869 //- Return a reference to the internal field values.
870 // \param updateAccessTime update event counter and check
871 // old-time fields
872 //
873 // \note Should avoid using updateAccessTime = true within loops.
875 (
876 const bool updateAccessTime = true
877 );
878
879 //- Return const-reference to the boundary field
880 inline const Boundary& boundaryField() const noexcept;
882 //- Return a reference to the boundary field
883 // \param updateAccessTime update event counter and check
884 // old-time fields
885 //
886 // \note Should avoid using updateAccessTime = true within loops.
887 Boundary& boundaryFieldRef(const bool updateAccessTime = true);
888
889 //- The time index of the field
890 label timeIndex() const noexcept { return timeIndex_; }
891
892 //- Write-access to the time index of the field
893 label& timeIndex() noexcept { return timeIndex_; }
894
895 //- The number of old time fields stored
896 label nOldTimes() const noexcept;
898 //- Store the old-time fields
899 void storeOldTimes() const;
900
901 //- Store the old-time field
902 void storeOldTime() const;
903
904 //- Return old time field
905 const GeometricField<Type, PatchField, GeoMesh>& oldTime() const;
906
907 //- Return non-const old time field
908 // (Not a good idea but it is used for sub-cycling)
909 GeometricField<Type, PatchField, GeoMesh>& oldTime();
910
911 //- Store the field as the previous iteration value
912 void storePrevIter() const;
913
914 //- Return previous iteration field
915 const GeometricField<Type, PatchField, GeoMesh>& prevIter() const;
916
917 //- Remove old-time and prev-iter fields
918 void clearOldTimes();
919
920 //- Correct boundary field
922
923 //- Correct boundary conditions after a purely local operation.
924 // Is dummy for processor boundary conditions etc
926
927 //- Evaluate boundary functions using the field storage:
928 // - extends the internal field storage
929 // - applies passed-in operator to fill in the slots
930 // .
931 // \returns The nominal geometric field size
932 template<class Cop>
933 label boundaryEvaluate(const Cop& cop);
934
935 //- Does the field need a reference level for solution
936 bool needReference() const;
937
938 //- Return a component of the field
940 (
941 const direction
942 ) const;
943
944 //- Return transpose (only if it is a tensor field)
945 tmp<GeometricField<Type, PatchField, GeoMesh>> T() const;
946
947 //- Relax field (for steady-state solution).
948 // alpha = 1 : no relaxation
949 // alpha < 1 : relaxation
950 // alpha = 0 : do nothing
951 void relax(const scalar alpha);
952
953 //- Relax field (for steady-state solution).
954 // alpha is read from controlDict
955 void relax();
956
957 //- Select the final iteration parameters if \c final is true
958 //- by returning the field name + "Final"
959 //- otherwise the standard parameters by returning the field name
960 word select(bool final) const;
961
962 //- Helper function to write the min and max to an Ostream.
963 // Uses the specified communicator for reductions
964 void writeMinMax(Ostream& os, label comm = UPstream::worldComm) const;
965
966
967 // Member Function *this Operators
968
969 //- Negate the field inplace. See notes in Field
970 void negate();
971
972 //- Normalise the field inplace. See notes in Field
973 void normalise();
974
975 //- Replace specified field component with content from another field
976 void replace
977 (
978 const direction d,
979 const GeometricField<cmptType, PatchField, GeoMesh>& gcf
980 );
981
982 //- Replace specified field component with specified value
983 void replace
984 (
985 const direction d,
987 );
988
989 //- Impose lower (floor) clamp on the field values (in-place)
990 void clamp_min(const Type& lower);
991
992 //- Impose lower (floor) clamp on the field values (in-place)
993 // No dimension checking
994 void clamp_min(const dimensioned<Type>& lower);
995
996 //- Impose lower (floor) clamp on the field values (in-place)
997 // No dimension checking
998 void clamp_min(const GeometricField<Type, PatchField, GeoMesh>& lower);
999
1000 //- Impose upper (ceiling) clamp on the field values (in-place)
1001 void clamp_max(const Type& upper);
1002
1003 //- Impose upper (ceiling) clamp on the field values (in-place)
1004 // No dimension checking
1005 void clamp_max(const dimensioned<Type>& upper);
1006
1007 //- Impose upper (ceiling) clamp on the field values (in-place)
1008 // No dimension checking
1009 void clamp_max(const GeometricField<Type, PatchField, GeoMesh>& upper);
1010
1011 //- Clamp field values (in-place) to the specified range.
1012 // Does not check if range is valid or not. No dimension checking.
1013 void clamp_range(const dimensioned<MinMax<Type>>& range);
1014
1015 //- Clamp field values (in-place) to the specified range.
1016 // Does not check if range is valid or not.
1017 void clamp_range(const Type& lower, const Type& upper);
1018
1019 //- Clamp field values (in-place) to the specified range.
1020 // Does not check if range is valid or not.
1021 void clamp_range(const MinMax<Type>& range);
1022
1023 //- Clamp field values (in-place) to the specified range.
1024 // Does not check if range is valid or not. No dimension checking.
1025 void clamp_range
1026 (
1027 const dimensioned<Type>& lower,
1028 const dimensioned<Type>& upper
1029 );
1030
1031
1032 // Member Operators
1033
1034 //- Same as internalField().
1035 // Useful in the formulation of source-terms for FV equations
1036 const Internal& operator()() const { return *this; }
1037
1040
1041 //- Assign value (with dimension check)
1043
1044 //- Assign value zero (no dimension checks)
1045 void operator=(Foam::zero);
1046
1048
1049 //- Assign value (with dimension check). Force assign for boundary.
1050 void operator==(const dimensioned<Type>&);
1051
1052 //- Assign value zero (no dimension checks). Force assign for boundary.
1053 void operator==(Foam::zero);
1054
1057
1063
1066
1067 void operator+=(const dimensioned<Type>&);
1068 void operator-=(const dimensioned<Type>&);
1069
1070 void operator*=(const dimensioned<scalar>&);
1071 void operator/=(const dimensioned<scalar>&);
1072
1073 // Prevent automatic comparison rewriting (c++20)
1074 bool operator!=
1075 (
1077 ) = delete;
1078 bool operator!=
1079 (
1081 ) = delete;
1082 bool operator!=(const dimensioned<Type>&) = delete;
1083 bool operator!=(Foam::zero) = delete;
1085
1086 // Write
1087
1088 //- The writeData function (required by regIOobject)
1089 bool writeData(Ostream& os) const;
1090
1091
1092 // Ostream Operators
1093
1094 //- Calls GeometricField::writeData()
1096 (
1097 Ostream&,
1100
1101 //- Calls GeometricField::writeData()
1103 (
1106 );
1107
1108
1109 // Housekeeping
1110
1111 //- Clamp field values (in-place) to the specified range.
1112 // \deprecated(2023-01) prefer clamp_range() naming
1113 FOAM_DEPRECATED_FOR(2023-01, "clamp_range() method")
1114 void clip(const dimensioned<MinMax<Type>>& range)
1115 {
1116 this->clamp_range(range);
1117 }
1118
1119 //- Clamp field values (in-place) to the specified range.
1120 // \deprecated(2023-01) prefer clamp_range() naming
1121 FOAM_DEPRECATED_FOR(2023-01, "clamp_range() method")
1122 void clip(const dimensioned<Type>& lo, const dimensioned<Type>& hi)
1123 {
1124 this->clamp_range(lo.value(), hi.value());
1125 }
1126
1127 //- Use minimum of the field and specified value. ie, clamp_max().
1128 // This sets the \em ceiling on the field values
1129 // \deprecated(2023-01) prefer clamp_max()
1130 FOAM_DEPRECATED_STRICT(2023-01, "clamp_max() method")
1131 void min(const dimensioned<Type>& upper) { this->clamp_max(upper); }
1132
1133 //- Use maximum of the field and specified value. ie, clamp_min().
1134 // This sets the \em floor on the field values
1135 // \deprecated(2023-01) prefer clamp_min()
1136 FOAM_DEPRECATED_STRICT(2023-01, "clamp_min() method")
1137 void max(const dimensioned<Type>& lower) { this->clamp_min(lower); }
1138
1139 //- Deprecated(2019-01) identical to clamp_range()
1140 // \deprecated(2019-01) identical to clamp_range()
1141 FOAM_DEPRECATED_FOR(2019-01, "clamp_range() method")
1142 void maxMin(const dimensioned<Type>& lo, const dimensioned<Type>& hi)
1143 {
1144 return this->clamp_range(lo.value(), hi.value());
1145 }
1147
1148 // Expression templates
1149
1150 //- Have unique tag
1151 using is_GeometricField = void;
1152
1153 //- Construct from IOobject and value expression. Supports
1154 // read_if_present
1155 template<typename E>
1157 (
1158 const IOobject& io,
1159 const Mesh& mesh,
1161 <
1162 E,
1163 typename E::IntExpr,
1164 typename E::UncoupledPatchExpr,
1165 typename E::CoupledPatchExpr,
1166 typename E::value_type
1167 >& expr
1168 );
1170 //- Construct from name, mesh and value expression.
1171 template<typename E>
1173 (
1174 const word& name,
1175 const Mesh& mesh,
1177 <
1178 E,
1179 typename E::IntExpr,
1180 typename E::UncoupledPatchExpr,
1181 typename E::CoupledPatchExpr,
1182 typename E::value_type
1183 >& expr
1184 );
1185
1186 //- Wrap value as expression
1188 <
1189 this_type
1190 > expr() const;
1191
1192 //- Assign values from expression
1193 template<typename E>
1194 void operator=
1195 (
1197 <
1198 E,
1199 typename E::IntExpr,
1200 typename E::UncoupledPatchExpr,
1201 typename E::CoupledPatchExpr,
1202 typename E::value_type
1204 );
1205
1206 //- Assign values from expression. Override asssignable.
1207 template<typename E>
1208 void operator==
1209 (
1211 <
1212 E,
1213 typename E::IntExpr,
1214 typename E::UncoupledPatchExpr,
1215 typename E::CoupledPatchExpr,
1216 typename E::value_type
1218 );
1219};
1220
1221
1222// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
1223
1224} // End namespace Foam
1226// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
1227
1228#include "GeometricFieldI.H"
1231#ifdef NoRepository
1232 #include "GeometricField.C"
1233#endif
1234
1235// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
1236
1237#endif
1238
1239// ************************************************************************* //
Expression templates for GeometricFields.
scalar range
Info<< nl;Info<< "Write faMesh in vtk format:"<< nl;{ vtk::uindirectPatchWriter writer(aMesh.patch(), fileName(aMesh.time().globalPath()/vtkBaseFileName));writer.writeGeometry();globalIndex procAddr(aMesh.nFaces());labelList cellIDs;if(UPstream::master()) { cellIDs.resize(procAddr.totalSize());for(const labelRange &range :procAddr.ranges()) { auto slice=cellIDs.slice(range);slice=identity(range);} } writer.beginCellData(4);writer.writeProcIDs();writer.write("cellID", cellIDs);writer.write("area", aMesh.S().field());writer.write("normal", aMesh.faceAreaNormals());writer.beginPointData(1);writer.write("normal", aMesh.pointAreaNormals());Info<< " "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.time().globalPath()/(vtkBaseFileName+"-edges")));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
labelList patchIDs
DimensionedField(const IOobject &io, const Mesh &mesh, const dimensionSet &dims, const Field< Type > &field)
Construct from components, copy initial field content.
Expression wrap of const reference to GeometricField.
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
Definition Field.H:172
pTraits< Type >::cmptType cmptType
Component type.
Definition Field.H:178
Generic mesh wrapper used by volMesh, surfaceMesh, pointMesh etc.
Definition GeoMesh.H:46
MESH::BoundaryMesh BoundaryMesh
Definition GeoMesh.H:62
Generic GeometricBoundaryField class.
Generic GeometricField class.
void operator+=(const dimensioned< Type > &)
void operator=(Foam::zero)
Assign value zero (no dimension checks).
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &name, const Mesh &mesh, const dimensionSet &dims, Field< Type > &&iField, const PtrList< PatchField< Type > > &pflds)
Return tmp field (NO_READ, NO_WRITE) from name, mesh, dimensions, moved internal field contents and p...
Expression::GeometricFieldConstRefWrap< this_type > expr() const
void operator-=(const tmp< GeometricField< Type, PatchField, GeoMesh > > &)
GeometricField(const IOobject &io, const Mesh &mesh, const dimensioned< Type > &dt, const wordList &wantedPatchTypes, const wordList &actualPatchTypes=wordList())
Construct given IOobject, mesh, dimensioned<Type> and patch types.
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &name, const Mesh &mesh, const dimensionSet &dims, const tmp< Field< Type > > &tfield, const word &patchFieldType=PatchField< Type >::calculatedType())
Return tmp field (NO_READ, NO_WRITE) from name, mesh, dimensions, tmp of primitive field and patch ty...
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &name, const Mesh &mesh, const dimensioned< Type > &dt, const wordList &patchFieldTypes, const wordList &actualPatchTypes=wordList())
Return tmp field (NO_READ, NO_WRITE) from name, mesh, dimensioned-type and patch field types....
friend Ostream & operator(Ostream &, const GeometricField< Type, faPatchField, areaMesh > &)
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &name, const Mesh &mesh, const dimensionSet &dims, Field< Type > &&iField, const word &patchFieldType=PatchField< Type >::calculatedType())
Return tmp field (NO_READ, NO_WRITE) from name, mesh, dimensions, moved internal field contents and p...
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &name, IOobjectOption::registerOption regOpt, const Mesh &mesh, const dimensionSet &dims, const word &patchFieldType=PatchField< Type >::calculatedType())
Return tmp field (NO_READ, NO_WRITE) from name, mesh, dimensions and patch type. [Takes current timeN...
static const this_type & null() noexcept
Return a null GeometricField (reference to a nullObject).
void operator*=(const dimensioned< scalar > &)
void operator=(const dimensioned< Type > &dt)
Assign value (with dimension check).
DimensionedField< Type, areaMesh > Internal
bool operator!=(const GeometricField< Type, PatchField, GeoMesh > &)=delete
void clamp_range(const dimensioned< MinMax< Type > > &range)
void maxMin(const dimensioned< Type > &lo, const dimensioned< Type > &hi)
GeometricField(const IOobject &io, const Mesh &mesh, const Type &value, const dimensionSet &dims, const word &patchFieldType=PatchField< Type >::calculatedType())
Construct given IOobject, mesh, dimensions, initial field value and given patch type.
GeometricField(const IOobject &io, const Mesh &mesh, const dimensionSet &dims, const Field< Type > &iField, const PtrList< PatchField< Type > > &ptfl)
Copy construct from primitive field and a patch list to clone.
const GeometricField< Type, faPatchField, areaMesh > & oldTime() const
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &name, IOobjectOption::registerOption regOpt, const Mesh &mesh, const dimensioned< Type > &dt, const word &patchFieldType=PatchField< Type >::calculatedType())
Return tmp field (NO_READ, NO_WRITE) from name, mesh, dimensioned-type and patch type....
TypeName("GeometricField")
Runtime type information.
void operator/=(const GeometricField< scalar, PatchField, GeoMesh > &)
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &name, IOobjectOption::registerOption regOpt, const Mesh &mesh, const dimensionSet &dims, const tmp< Field< Type > > &tfield, const word &patchFieldType=PatchField< Type >::calculatedType())
Return tmp field (NO_READ, NO_WRITE) from name, mesh, dimensions, tmp of primitive field and patch ty...
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &newName, const tmp< GeometricField< Type, PatchField, GeoMesh > > &tfld, const word &patchFieldType)
Return renamed tmp field (NO_READ, NO_WRITE) with reset patch field type, retaining its instance/loca...
label & timeIndex() noexcept
Write-access to the time index of the field.
GeometricField(Internal &&diField, const PtrList< PatchField< Type > > &ptfl)
Move construct from internal field and a patch list to clone.
GeometricField(const GeometricField< Type, PatchField, GeoMesh > &gf)
Copy construct.
tmp< GeometricField< Type, faPatchField, areaMesh > > T() const
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &name, IOobjectOption::registerOption regOpt, const Mesh &mesh, const dimensionSet &dims, const Field< Type > &iField, const word &patchFieldType=PatchField< Type >::calculatedType())
Return tmp field (NO_READ, NO_WRITE) from name, mesh, dimensions, copy of internal field and patch ty...
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &name, const Mesh &mesh, const dimensionSet &dims, const Field< Type > &iField, const PtrList< PatchField< Type > > &pflds)
Return tmp field (NO_READ, NO_WRITE) from name, mesh, dimensions, copy of internal field contents and...
GeometricField(const IOobject &io, const GeometricField< Type, PatchField, GeoMesh > &gf, const word &patchFieldType)
Construct as copy resetting IO parameters and patch type.
void replace(const direction d, const GeometricField< cmptType, faPatchField, areaMesh > &gcf)
GeometricField(const IOobject &io, const tmp< Internal > &tfield, const PtrList< PatchField< Type > > &ptfl)
Construct from internal field (tmp) and a patch list to clone.
GeometricField(const Internal &diField, const PtrList< PatchField< Type > > &ptfl)
Copy construct from internal field and a patch list to clone.
bool writeData(Ostream &os) const
The writeData function (required by regIOobject).
this_type & constCast() const noexcept
Return non-const reference to this field.
void operator==(const dimensioned< Type > &)
Assign value (with dimension check). Force assign for boundary.
GeometricField(const IOobject &io, const Mesh &mesh, const dimensionSet &dims, const word &patchFieldType=PatchField< Type >::calculatedType())
Construct given IOobject, mesh, dimensions and patch type.
void operator-=(const GeometricField< Type, PatchField, GeoMesh > &)
Internal & ref(const bool updateAccessTime=true)
Internal::FieldType & primitiveFieldRef(const bool updateAccessTime=true)
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &newName, IOobjectOption::registerOption regOpt, const tmp< GeometricField< Type, PatchField, GeoMesh > > &tfld, const word &patchFieldType)
Return renamed tmp field (NO_READ, NO_WRITE) with reset patch field type, retaining its instance/loca...
void operator==(const tmp< GeometricField< Type, PatchField, GeoMesh > > &)
void operator=(const tmp< GeometricField< Type, PatchField, GeoMesh > > &)
GeometricField(const IOobject &io, const Mesh &mesh, const dimensioned< Type > &dt, const word &patchFieldType=PatchField< Type >::calculatedType())
Construct given IOobject, mesh, dimensioned<Type> and patch type.
GeometricField(const IOobject &io, const Mesh &mesh, const Type &value, const dimensionSet &dims, const wordList &wantedPatchTypes, const wordList &actualPatchTypes=wordList())
Construct given IOobject, mesh, dimensions, initial field value and given patch types.
Boundary & boundaryFieldRef(const bool updateAccessTime=true)
GeometricField(const word &newName, const GeometricField< Type, PatchField, GeoMesh > &gf)
Copy construct with a new name.
GeometricField(const IOobject &io, const GeometricField< Type, PatchField, GeoMesh > &gf, const wordList &patchFieldTypes, const wordList &actualPatchTypes=wordList())
Construct as copy resetting IO parameters and boundary types.
const Internal & internalField() const noexcept
Return a const-reference to the dimensioned internal field.
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &name, IOobjectOption::registerOption regOpt, const Mesh &mesh, const Type &value, const dimensionSet &dims, const word &patchFieldType=PatchField< Type >::calculatedType())
Return tmp field (NO_READ, NO_WRITE) from name, mesh, field value, dimensions and patch type....
void operator*=(const GeometricField< scalar, PatchField, GeoMesh > &)
void operator+=(const GeometricField< Type, PatchField, GeoMesh > &)
GeometricBoundaryField< Type, faPatchField, areaMesh > Boundary
GeometricField(const IOobject &io, const Mesh &mesh, const dimensionSet &dims, const tmp< Field< Type > > &tfield, const PtrList< PatchField< Type > > &ptfl)
Copy construct from components.
void clip(const dimensioned< MinMax< Type > > &range)
label nOldTimes() const noexcept
The number of old time fields stored.
const Internal::FieldType & primitiveField() const noexcept
Return a const-reference to the internal field values.
const Internal & v() const
Return a const-reference to the dimensioned internal field of a "vol" field.
Definition volFieldsI.H:26
bool operator!=(const dimensioned< Type > &)=delete
GeometricField(const IOobject &io, const GeometricField< Type, PatchField, GeoMesh > &gf)
Construct as copy resetting IO parameters.
GeometricField(const IOobject &io, const Mesh &mesh, const dimensionSet &dims, const wordList &wantedPatchTypes, const wordList &actualPatchTypes=wordList())
Construct given IOobject, mesh, dimensions and patch types.
Internal & internalFieldRef(const bool updateAccessTime=true)
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &name, const Mesh &mesh, const Type &value, const dimensionSet &dims, const word &patchFieldType=PatchField< Type >::calculatedType())
Return tmp field (NO_READ, NO_WRITE) from name, mesh, field value, dimensions and patch type....
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &name, IOobjectOption::registerOption regOpt, const Mesh &mesh, const dimensionSet &dims, const Field< Type > &iField, const PtrList< PatchField< Type > > &pflds)
Return tmp field (NO_READ, NO_WRITE) from name, mesh, dimensions, copy of internal field contents and...
const GeometricField< Type, faPatchField, areaMesh > & prevIter() const
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &newName, IOobjectOption::registerOption regOpt, const tmp< GeometricField< Type, PatchField, GeoMesh > > &tfld)
Return renamed tmp field (NO_READ, NO_WRITE) retaining its instance/local.
void operator-=(const dimensioned< Type > &)
GeometricField(const IOobject &io, Internal &&diField, const PtrList< PatchField< Type > > &ptfl)
Move construct from internal field and a patch list to clone.
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &name, const Mesh &mesh, const dimensionSet &dims, const Field< Type > &iField, const word &patchFieldType=PatchField< Type >::calculatedType())
Return tmp field (NO_READ, NO_WRITE) from name, mesh, dimensions, copy of internal field and patch ty...
GeometricField(const IOobject &io, const Mesh &mesh, const dimensionSet &dims, const tmp< Field< Type > > &tfield, const word &patchFieldType=PatchField< Type >::calculatedType())
Construct from primitive field (tmp), with specified patch type.
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &name, IOobjectOption::registerOption regOpt, const Mesh &mesh, const dimensionSet &dims, Field< Type > &&iField, const word &patchFieldType=PatchField< Type >::calculatedType())
Return tmp field (NO_READ, NO_WRITE) from name, mesh, dimensions, moved internal field contents and p...
bool operator!=(Foam::zero)=delete
GeometricField(const IOobject &io, const tmp< GeometricField< Type, PatchField, GeoMesh > > &tgf, const wordList &patchFieldTypes, const wordList &actualPatchTypes=wordList())
Construct as copy resetting IO parameters and boundary types.
GeometricField(const IOobject &io, const GeometricField< Type, PatchField, GeoMesh > &gf, const labelList &patchIDs, const word &patchFieldType)
Construct as copy resetting IO parameters and boundary type for selected patchIDs.
void operator==(Foam::zero)
Assign value zero (no dimension checks). Force assign for boundary.
void max(const dimensioned< Type > &lower)
GeometricField(const IOobject &io, const Mesh &mesh, const dictionary &dict)
Construct from dictionary.
virtual ~GeometricField()
Destructor.
GeometricField(const IOobject &io, const Mesh &mesh, const dimensionSet &dims, Field< Type > &&iField, const word &patchFieldType=PatchField< Type >::calculatedType())
Move construct from primitive field, with specified patch type.
void operator+=(const tmp< GeometricField< Type, PatchField, GeoMesh > > &)
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &name, IOobjectOption::registerOption regOpt, const Mesh &mesh, const Type &value, const dimensionSet &dims, const wordList &patchFieldTypes, const wordList &actualPatchTypes=wordList())
Return tmp field (NO_READ, NO_WRITE) from name, mesh, field value, dimensions and patch field types....
GeometricField(const IOobject &io, const Mesh &mesh, const dimensionSet &dims, const Field< Type > &iField, const word &patchFieldType=PatchField< Type >::calculatedType())
Copy construct from primitive field, with specified patch type.
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &newName, IOobjectOption::registerOption regOpt, const tmp< GeometricField< Type, PatchField, GeoMesh > > &tfld, const wordList &patchFieldTypes, const wordList &actualPatchTypes=wordList())
Return renamed tmp field (NO_READ, NO_WRITE) with reset patch field types, retaining its instance/loc...
GeometricField(const tmp< GeometricField< Type, PatchField, GeoMesh > > &tgf)
Construct from tmp<GeometricField> deleting argument.
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &name, const Mesh &mesh, const Type &value, const dimensionSet &dims, const wordList &patchFieldTypes, const wordList &actualPatchTypes=wordList())
Return tmp field (NO_READ, NO_WRITE) from name, mesh, field value, dimensions and patch field types....
const Boundary & boundaryField() const noexcept
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &name, const Mesh &mesh, const dimensioned< Type > &dt, const word &patchFieldType=PatchField< Type >::calculatedType())
Return tmp field (NO_READ, NO_WRITE) from name, mesh, dimensioned-type and patch type....
GeometricField(const IOobject &io, const Mesh &mesh, const Expression::GeometricFieldExpression< E, typename E::IntExpr, typename E::UncoupledPatchExpr, typename E::CoupledPatchExpr, typename E::value_type > &expr)
Construct from IOobject and value expression. Supports.
GeometricField(const IOobject &io, const Mesh &mesh, const dimensionSet &dims, Field< Type > &&iField, const PtrList< PatchField< Type > > &ptfl)
Move construct from primitive field and a patch list to clone.
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &newName, const tmp< GeometricField< Type, PatchField, GeoMesh > > &tfld, const wordList &patchFieldTypes, const wordList &actualPatchTypes=wordList())
Return renamed tmp field (NO_READ, NO_WRITE) with reset patch field types, retaining its instance/loc...
GeometricField(const IOobject &io, const Internal &diField, const PtrList< PatchField< Type > > &ptfl)
Copy construct from internal field and a patch list to clone.
GeometricField(const IOobject &io, const tmp< GeometricField< Type, PatchField, GeoMesh > > &tgf)
Construct from tmp<GeometricField> resetting IO parameters.
void operator/=(const tmp< GeometricField< scalar, PatchField, GeoMesh > > &)
void operator*=(const tmp< GeometricField< scalar, PatchField, GeoMesh > > &)
void min(const dimensioned< Type > &upper)
void operator=(const GeometricField< Type, PatchField, GeoMesh > &)
tmp< GeometricField< Type, PatchField, GeoMesh > > clone() const
Clone.
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const GeometricField< AnyType, PatchField, GeoMesh > &fld, const word &name, const dimensioned< Type > &dt, const word &patchFieldType=PatchField< Type >::calculatedType())
Construct tmp field (NO_READ, NO_WRITE) based on mesh/registry information from an existing field....
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &name, IOobjectOption::registerOption regOpt, const Mesh &mesh, const dimensioned< Type > &dt, const wordList &patchFieldTypes, const wordList &actualPatchTypes=wordList())
Return tmp field (NO_READ, NO_WRITE) from name, mesh, dimensioned-type and patch field types....
void writeMinMax(Ostream &os, label comm=UPstream::worldComm) const
GeometricField(const word &newName, const tmp< GeometricField< Type, PatchField, GeoMesh > > &tgf)
Construct with a new name from tmp<GeometricField>.
GeometricField< Type, faPatchField, areaMesh > this_type
GeometricField(const IOobject &io, const Mesh &mesh, const bool readOldTime=true)
Read construct using given IOobject. Always reads!
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &name, const Mesh &mesh, const dimensionSet &dims, const word &patchFieldType=PatchField< Type >::calculatedType())
Return tmp field (NO_READ, NO_WRITE) from name, mesh, dimensions and patch type. [Takes current timeN...
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &newName, const tmp< GeometricField< Type, PatchField, GeoMesh > > &tfld)
Return renamed tmp field (NO_READ, NO_WRITE) retaining its instance/local.
void operator/=(const dimensioned< scalar > &)
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &name, IOobjectOption::registerOption regOpt, const Mesh &mesh, const dimensionSet &dims, Field< Type > &&iField, const PtrList< PatchField< Type > > &pflds)
Return tmp field (NO_READ, NO_WRITE) from name, mesh, dimensions, moved internal field contents and p...
GeometricField(const word &name, const Mesh &mesh, const Expression::GeometricFieldExpression< E, typename E::IntExpr, typename E::UncoupledPatchExpr, typename E::CoupledPatchExpr, typename E::value_type > &expr)
Construct from name, mesh and value expression.
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const GeometricField< AnyType, PatchField, GeoMesh > &fld, const word &name, const dimensionSet &dims, const word &patchFieldType=PatchField< Type >::calculatedType())
Construct tmp field (NO_READ, NO_WRITE) based on mesh/registry information from an existing field....
tmp< GeometricField< cmptType, faPatchField, areaMesh > > component(const direction) const
registerOption
Enumeration for use with registerObject(). Values map to bool (false/true).
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition IOobject.H:191
A min/max value pair with additional methods. In addition to conveniently storing values,...
Definition MinMax.H:106
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition PtrList.H:67
Inter-processor communications stream.
Definition UPstream.H:69
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
Dimension set for the base types, which can be used to implement rigorous dimension checking for alge...
Generic dimensioned Type class.
A class for managing temporary objects.
Definition tmp.H:75
A class for handling words, derived from Foam::string.
Definition word.H:66
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
Definition zero.H:58
dynamicFvMesh & mesh
OBJstream os(runTime.globalPath()/outputName)
const auto & io
Namespace for OpenFOAM.
List< word > wordList
List of word.
Definition fileName.H:60
const T & NullObjectRef() noexcept
Const reference (of type T) to the nullObject.
Definition nullObject.H:228
List< label > labelList
A List of labels.
Definition List.H:62
uint8_t direction
Definition direction.H:49
const direction noexcept
Definition scalarImpl.H:265
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition exprTraits.C:127
volScalarField & alpha
dictionary dict
Foam::argList args(argc, argv)
#define FOAM_DEPRECATED_FOR(since, replacement)
Definition stdFoam.H:43
#define FOAM_DEPRECATED_STRICT(since, replacement)
Definition stdFoam.H:53
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68