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-2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::GeometricField
29 
30 Description
31  Generic GeometricField class.
32 
33 SourceFiles
34  GeometricFieldI.H
35  GeometricField.C
36  GeometricBoundaryField.C
37  GeometricFieldFunctions.H
38  GeometricFieldFunctions.C
39 
40 \*---------------------------------------------------------------------------*/
41 
42 #ifndef GeometricField_H
43 #define GeometricField_H
44 
45 #include "regIOobject.H"
46 #include "dimensionedTypes.H"
47 #include "DimensionedField.H"
48 #include "FieldField.H"
51 
52 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 
54 namespace Foam
55 {
56 
57 // Forward Declarations
58 class dictionary;
59 
60 template<class Type, template<class> class PatchField, class GeoMesh>
61 class GeometricField;
62 
63 template<class Type, template<class> class PatchField, class GeoMesh>
64 Ostream& operator<<
65 (
66  Ostream&,
67  const GeometricField<Type, PatchField, GeoMesh>&
68 );
69 
70 template<class Type, template<class> class PatchField, class GeoMesh>
71 Ostream& operator<<
72 (
73  Ostream&,
74  const tmp<GeometricField<Type, PatchField, GeoMesh>>&
75 );
76 
77 
78 /*---------------------------------------------------------------------------*\
79  Class GeometricField Declaration
80 \*---------------------------------------------------------------------------*/
81 
82 template<class Type, template<class> class PatchField, class GeoMesh>
83 class GeometricField
84 :
85  public DimensionedField<Type, GeoMesh>
86 {
87  // Private Member Functions
88 
89  //- Read from file if it is present
90  bool readIfPresent();
91 
92  //- Read old time field from file if it is present
93  bool readOldTimeIfPresent();
94 
95 
96 public:
97 
98  // Public Typedefs
99 
100  //- Type of mesh on which this GeometricField is instantiated
101  typedef typename GeoMesh::Mesh Mesh;
102 
103  //- Type of boundary mesh on which this GeometricField::Boundary is
104  //- instantiated
105  typedef typename GeoMesh::BoundaryMesh BoundaryMesh;
106 
107  //- Type of the internal field from which this GeometricField is derived
109 
110  //- Type of the patch field of which the GeometricField::Boundary is
111  //- composed
112  typedef PatchField<Type> Patch;
113 
114 
115  //- The boundary fields
116  class Boundary
117  :
118  public FieldField<PatchField, Type>
119  {
120  // Private Data
121 
122  //- Reference to BoundaryMesh for which this field is defined
123  const BoundaryMesh& bmesh_;
124 
125 
126  public:
127 
128  // Constructors
129 
130  //- Construct from a BoundaryMesh, setting patches later
131  explicit Boundary(const BoundaryMesh& bmesh);
132 
133  //- Construct from a BoundaryMesh, reference to the internal field
134  //- and a patch type
135  Boundary
136  (
137  const BoundaryMesh& bmesh,
138  const Internal& field,
139  const word& patchFieldType = PatchField<Type>::calculatedType()
140  );
141 
142  //- Construct from a BoundaryMesh, reference to the internal field
143  //- and a wordList of patch types and optional the actual patch
144  //- types (to override constraint patches)
145  Boundary
146  (
147  const BoundaryMesh& bmesh,
148  const Internal& field,
149  const wordList& wantedPatchTypes,
150  const wordList& actualPatchTypes = wordList()
151  );
152 
153  //- Construct from a BoundaryMesh, reference to the internal field
154  //- and a PtrList<PatchField<Type>>
155  Boundary
156  (
157  const BoundaryMesh& bmesh,
158  const Internal& field,
159  const PtrList<PatchField<Type>>&
160  );
161 
162  //- Construct as copy setting the reference to the internal field
163  Boundary
164  (
165  const Internal& field,
166  const Boundary& btf
167  );
168 
169  //- Construct as copy setting the reference to the internal field
170  //- and resetting type of field for given patch IDs
171  Boundary
172  (
173  const Internal& field,
174  const Boundary& btf,
175  const labelList& patchIDs,
176  const word& patchFieldName
177  );
178 
179  //- Copy construct
180  // Dangerous because Field may be set to a field which gets deleted
181  // Need new type of BoundaryField, one which is part of a geometric
182  // field for which snGrad etc. may be called and a free standing
183  // BoundaryField for which such operations are unavailable.
184  Boundary(const Boundary& btf);
185 
186  //- Construct from dictionary
187  Boundary
188  (
189  const BoundaryMesh& bmesh,
190  const Internal& field,
191  const dictionary& dict
192  );
193 
194 
195  // Member Functions
196 
197  //- Read the boundary field
198  void readField
199  (
200  const Internal& field,
201  const dictionary& dict
202  );
203 
204  //- Update the boundary condition coefficients
205  void updateCoeffs();
206 
207  //- Evaluate boundary conditions
208  void evaluate();
209 
210  //- Return a list of the patch types
211  wordList types() const;
212 
213  //- Return BoundaryField of the cell values neighbouring
214  //- the boundary
216 
217  //- Return a list of pointers for each patch field with only those
218  //- pointing to interfaces being set
220 
221  //- Return a list of pointers for each patch field with only those
222  //- pointing to interfaces being set
224 
225  //- Write boundary field as dictionary entry
226  void writeEntry(const word& keyword, Ostream& os) const;
227 
228  //- Write dictionary entries of the individual boundary fields.
229  void writeEntries(Ostream& os) const;
230 
231 
232  // Member Operators
233 
234  //- Assignment to BoundaryField<Type, PatchField, BoundaryMesh>
235  void operator=(const Boundary&);
236 
237  //- Assignment to FieldField<PatchField, Type>
239 
240  //- Assignment to Type
241  void operator=(const Type&);
242 
243 
244  //- Forced assignment to
245  // BoundaryField<Type, PatchField, BoundaryMesh>
246  void operator==(const Boundary&);
247 
248  //- Forced assignment to FieldField<PatchField, Type>
250 
251  //- Forced assignment to Type
252  void operator==(const Type&);
253  };
254 
255 
256 private:
257 
258  // Private data
259 
260  //- Current time index.
261  // Used to trigger the storing of the old-time value
262  mutable label timeIndex_;
263 
264  //- Pointer to old time field
265  mutable GeometricField<Type, PatchField, GeoMesh>* field0Ptr_;
266 
267  //- Pointer to previous iteration (used for under-relaxation)
268  mutable GeometricField<Type, PatchField, GeoMesh>* fieldPrevIterPtr_;
269 
270  //- Boundary Type field containing boundary field values
271  Boundary boundaryField_;
272 
273 
274  // Private Member Functions
275 
276  //- Read the field from the dictionary
277  void readFields(const dictionary& dict);
278 
279  //- Read the field - create the field dictionary on-the-fly
280  void readFields();
281 
282 
283 public:
284 
285  //- Runtime type information
286  TypeName("GeometricField");
287 
288 
289  // Public typedefs
290 
291  typedef typename Field<Type>::cmptType cmptType;
292 
293  // Static Member Functions
294 
295  //- Return a null geometric field
296  inline static const GeometricField<Type, PatchField, GeoMesh>& null();
297 
298 
299  // Constructors
300 
301  //- Construct given IOobject, mesh, dimensions and patch type.
302  // This allocates storage for the field but does not set values.
303  // Used only within this class to create TEMPORARY variables
305  (
306  const IOobject& io,
307  const Mesh& mesh,
308  const dimensionSet& ds,
309  const word& patchFieldType = PatchField<Type>::calculatedType()
310  );
311 
312  //- Construct given IOobject, mesh, dimensions and patch types.
313  // This allocates storage for the field but does not set values.
314  // Used only within this class to create TEMPORARY variables
316  (
317  const IOobject& io,
318  const Mesh& mesh,
319  const dimensionSet& ds,
320  const wordList& wantedPatchTypes,
321  const wordList& actualPatchTypes = wordList()
322  );
323 
324  //- Construct given IOobject, mesh, dimensioned<Type> and patch type.
325  // This assigns both dimensions and values.
326  // The internal name for the dimensioned<Type> has no influence.
328  (
329  const IOobject& io,
330  const Mesh& mesh,
331  const dimensioned<Type>& dt,
332  const word& patchFieldType = PatchField<Type>::calculatedType()
333  );
334 
335  //- Construct given IOobject, mesh, dimensioned<Type> and patch types.
336  // This assigns both dimensions and values.
337  // The internal name for the dimensioned<Type> has no influence.
339  (
340  const IOobject& io,
341  const Mesh& mesh,
342  const dimensioned<Type>& dt,
343  const wordList& wantedPatchTypes,
344  const wordList& actualPatchTypes = wordList()
345  );
346 
347  //- Copy construct from components
349  (
350  const IOobject& io,
351  const Internal& diField,
352  const PtrList<PatchField<Type>>& ptfl
353  );
354 
355  //- Copy construct from internal field, with specified patch type
357  (
358  const IOobject& io,
359  const Mesh& mesh,
360  const dimensionSet& ds,
361  const Field<Type>& iField,
362  const word& patchFieldType = PatchField<Type>::calculatedType()
363  );
364 
365  //- Move construct from internal field, with specified patch type
367  (
368  const IOobject& io,
369  const Mesh& mesh,
370  const dimensionSet& ds,
371  Field<Type>&& iField,
372  const word& patchFieldType = PatchField<Type>::calculatedType()
373  );
374 
375  //- Copy construct from components
377  (
378  const IOobject& io,
379  const Mesh& mesh,
380  const dimensionSet& ds,
381  const Field<Type>& iField,
382  const PtrList<PatchField<Type>>& ptfl
383  );
384 
385  //- Construct and read given IOobject
387  (
388  const IOobject& io,
389  const Mesh& mesh,
390  const bool readOldTime = true
391  );
392 
393  //- Construct from dictionary
395  (
396  const IOobject& io,
397  const Mesh& mesh,
398  const dictionary& dict
399  );
400 
401  //- Copy construct
403  (
405  );
406 
407  //- Construct from tmp<GeometricField> deleting argument
409  (
411  );
412 
413  //- Construct as copy resetting IO parameters
415  (
416  const IOobject& io,
418  );
419 
420  //- Construct as copy of tmp<GeometricField> resetting IO parameters
422  (
423  const IOobject& io,
425  );
426 
427  //- Copy construct with a new name
429  (
430  const word& newName,
432  );
433 
434  //- Construct with a new name from tmp<GeometricField>
436  (
437  const word& newName,
439  );
440 
441  //- Construct as copy resetting IO parameters and patch type
443  (
444  const IOobject& io,
446  const word& patchFieldType
447  );
448 
449  //- Construct as copy resetting IO parameters and boundary type
450  //- for selected patchIDs
452  (
453  const IOobject& io,
455  const labelList& patchIDs,
456  const word& patchFieldType
457  );
458 
459  //- Construct as copy resetting IO parameters and boundary types
461  (
462  const IOobject& io,
464  const wordList& patchFieldTypes,
465  const wordList& actualPatchTypes = wordList()
466  );
467 
468  //- Construct as copy resetting IO parameters and boundary types
470  (
471  const IOobject& io,
473  const wordList& patchFieldTypes,
474  const wordList& actualPatchTypes = wordList()
475  );
476 
477  //- Clone
479 
480 
481  // Static Constructors
482 
483  //- Return tmp field from name, mesh, dimensions and patch type.
484  // The field is NO_READ, NO_WRITE, unregistered and uses the
485  // current timeName from the mesh registry
487  (
488  const word& name,
489  const Mesh& mesh,
490  const dimensionSet& ds,
491  const word& patchFieldType = PatchField<Type>::calculatedType()
492  );
493 
494  //- Return tmp field from name, mesh, dimensions,
495  //- copy of internal field, with specified patch type.
496  // The field is NO_READ, NO_WRITE, unregistered and uses the
497  // current timeName from the mesh registry
499  (
500  const word& name,
501  const Mesh& mesh,
502  const dimensionSet& ds,
503  const Field<Type>& iField,
504  const word& patchFieldType = PatchField<Type>::calculatedType()
505  );
506 
507  //- Return tmp field from name, mesh, dimensions,
508  //- moved internal field contents, with specified patch type.
509  // The field is NO_READ, NO_WRITE, unregistered and uses the
510  // current timeName from the mesh registry
512  (
513  const word& name,
514  const Mesh& mesh,
515  const dimensionSet& ds,
516  Field<Type>&& iField,
517  const word& patchFieldType = PatchField<Type>::calculatedType()
518  );
519 
520  //- Return tmp field from name, mesh, dimensioned<Type>
521  //- and patch type.
522  // The field is NO_READ, NO_WRITE, unregistered and uses the
523  // current timeName from the mesh registry
525  (
526  const word& name,
527  const Mesh& mesh,
528  const dimensioned<Type>& dt,
529  const word& patchFieldType = PatchField<Type>::calculatedType()
530  );
531 
532  //- Return tmp field from name, mesh, dimensioned<Type>
533  //- and patch types.
534  // The field is NO_READ, NO_WRITE, unregistered and uses the
535  // current timeName from the mesh registry
537  (
538  const word& name,
539  const Mesh& mesh,
540  const dimensioned<Type>& dt,
541  const wordList& patchFieldTypes,
542  const wordList& actualPatchTypes = wordList()
543  );
544 
545  //- Return renamed tmp field
546  // The field is NO_READ, NO_WRITE, unregistered and uses the
547  // current timeName from the mesh registry
549  (
550  const word& newName,
552  );
553 
554  //- Rename tmp field and reset patch field types and return
555  // The field is NO_READ, NO_WRITE, unregistered and uses the
556  // current timeName from the mesh registry
558  (
559  const word& newName,
561  const wordList& patchFieldTypes,
562  const wordList& actualPatchTypes = wordList()
563  );
564 
565 
566  //- Destructor
567  virtual ~GeometricField();
568 
569 
570  // Member Functions
571 
572  //- Return a reference to the dimensioned internal field
573  // \param updateAccessTime update event counter and check
574  // old-time fields
575  //
576  // \note Should avoid using updateAccessTime = true within loops.
577  Internal& ref(const bool updateAccessTime = true);
578 
579  //- Return a const-reference to the dimensioned internal field
580  inline const Internal& internalField() const;
581 
582  //- Return a const-reference to the dimensioned internal field
583  //- of a "vol" field.
584  // Useful in the formulation of source-terms for FV equations
585  //
586  // \note definition in finiteVolume/fields/volFields/volFieldsI.H
587  inline const Internal& v() const;
588 
589  //- Return a reference to the internal field
590  // \param updateAccessTime update event counter and check
591  // old-time fields
592  //
593  // \note Should avoid using updateAccessTime = true within loops.
595  (
596  const bool updateAccessTime = true
597  );
598 
599  //- Return a const-reference to the internal field
600  inline const typename Internal::FieldType& primitiveField() const;
601 
602  //- Return a reference to the boundary field
603  // \param updateAccessTime update event counter and check
604  // old-time fields
605  //
606  // \note Should avoid using updateAccessTime = true within loops.
607  Boundary& boundaryFieldRef(const bool updateAccessTime = true);
608 
609  //- Return const-reference to the boundary field
610  inline const Boundary& boundaryField() const;
611 
612  //- Return the time index of the field
613  inline label timeIndex() const;
614 
615  //- Return the time index of the field
616  inline label& timeIndex();
617 
618  //- Store the old-time fields
619  void storeOldTimes() const;
620 
621  //- Store the old-time field
622  void storeOldTime() const;
623 
624  //- Return the number of old time fields stored
625  label nOldTimes() const;
626 
627  //- Return old time field
629 
630  //- Return non-const old time field
631  // (Not a good idea but it is used for sub-cycling)
633 
634  //- Store the field as the previous iteration value
635  void storePrevIter() const;
636 
637  //- Return previous iteration field
639 
640  //- Correct boundary field
642 
643  //- Does the field need a reference level for solution
644  bool needReference() const;
645 
646  //- Return a component of the field
648  (
649  const direction
650  ) const;
651 
652  //- WriteData member function required by regIOobject
653  bool writeData(Ostream&) const;
654 
655  //- Return transpose (only if it is a tensor field)
657 
658  //- Relax field (for steady-state solution).
659  // alpha = 1 : no relaxation
660  // alpha < 1 : relaxation
661  // alpha = 0 : do nothing
662  void relax(const scalar alpha);
663 
664  //- Relax field (for steady-state solution).
665  // alpha is read from controlDict
666  void relax();
667 
668  //- Select the final iteration parameters if `final' is true
669  // by returning the field name + "Final"
670  // otherwise the standard parameters by returning the field name
671  word select(bool final) const;
672 
673  //- Helper function to write the min and max to an Ostream
674  void writeMinMax(Ostream& os) const;
675 
676 
677  // Member Function *this Operators
678 
679  //- Negate the field inplace
680  void negate();
681 
682  //- Replace specified field component with content from another field
683  void replace
684  (
685  const direction d,
687  );
688 
689  //- Replace specified field component with specified value
690  void replace
691  (
692  const direction d,
693  const dimensioned<cmptType>& ds
694  );
695 
696  //- Use the minimum of the field and specified value
697  // This sets the \em ceiling on the field values
698  void min(const dimensioned<Type>& dt);
699 
700  //- Use the maximum of the field and specified value
701  // This sets the \em floor on the field values
702  void max(const dimensioned<Type>& dt);
703 
704  //- Clip the field to be bounded within the specified range
705  void clip(const dimensioned<MinMax<Type>>& range);
706 
707  //- Clip the field to be bounded within the specified range
708  void clip
709  (
710  const dimensioned<Type>& minVal,
711  const dimensioned<Type>& maxVal
712  );
713 
714  //- Deprecated(2019-01) identical to clip()
715  // \deprecated(2019-01) identical to clip()
716  FOAM_DEPRECATED_FOR(2019-01, "clip() method")
717  void maxMin
718  (
719  const dimensioned<Type>& minVal,
720  const dimensioned<Type>& maxVal
721  );
722 
723 
724  // Member Operators
725 
726  //- Return a const-reference to the dimensioned internal field
727  // Useful in the formulation of source-terms for FV equations
728  inline const Internal& operator()() const;
729 
730  void operator=(const GeometricField<Type, PatchField, GeoMesh>&);
731  void operator=(const tmp<GeometricField<Type, PatchField, GeoMesh>>&);
732  void operator=(const dimensioned<Type>&);
733 
734  void operator==(const tmp<GeometricField<Type, PatchField, GeoMesh>>&);
735  void operator==(const dimensioned<Type>&);
736 
737  void operator+=(const GeometricField<Type, PatchField, GeoMesh>&);
738  void operator+=(const tmp<GeometricField<Type, PatchField, GeoMesh>>&);
739 
740  void operator-=(const GeometricField<Type, PatchField, GeoMesh>&);
741  void operator-=(const tmp<GeometricField<Type, PatchField, GeoMesh>>&);
742 
743  void operator*=(const GeometricField<scalar, PatchField, GeoMesh>&);
744  void operator*=(const tmp<GeometricField<scalar,PatchField,GeoMesh>>&);
745 
746  void operator/=(const GeometricField<scalar, PatchField, GeoMesh>&);
747  void operator/=(const tmp<GeometricField<scalar,PatchField,GeoMesh>>&);
748 
749  void operator+=(const dimensioned<Type>&);
750  void operator-=(const dimensioned<Type>&);
751 
752  void operator*=(const dimensioned<scalar>&);
753  void operator/=(const dimensioned<scalar>&);
754 
755 
756  // Ostream operators
757 
758  friend Ostream& operator<< <Type, PatchField, GeoMesh>
759  (
760  Ostream&,
761  const GeometricField<Type, PatchField, GeoMesh>&
762  );
763 
764  friend Ostream& operator<< <Type, PatchField, GeoMesh>
765  (
766  Ostream&,
767  const tmp<GeometricField<Type, PatchField, GeoMesh>>&
768  );
769 };
770 
771 
772 template<class Type, template<class> class PatchField, class GeoMesh>
773 Ostream& operator<<
774 (
775  Ostream&,
776  const typename GeometricField<Type, PatchField, GeoMesh>::
777  Boundary&
778 );
779 
780 
781 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
782 
783 } // End namespace Foam
784 
785 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
786 
787 #include "GeometricFieldI.H"
788 
789 #ifdef NoRepository
790  #include "GeometricField.C"
791 #endif
792 
793 #include "GeometricFieldFunctions.H"
794 
795 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
796 
797 #endif
798 
799 // ************************************************************************* //
regIOobject.H
GeometricFieldFunctions.H
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:169
Foam::GeometricField::component
tmp< GeometricField< cmptType, PatchField, GeoMesh > > component(const direction) const
Return a component of the field.
Foam::GeometricField::replace
void replace(const direction d, const GeometricField< cmptType, PatchField, GeoMesh > &gcf)
Replace specified field component with content from another field.
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::FieldField
A field of fields is a PtrList of fields with reference counting.
Definition: FieldField.H:53
Foam::GeometricField::writeData
bool writeData(Ostream &) const
WriteData member function required by regIOobject.
Definition: GeometricField.C:1035
FieldField.H
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
DimensionedField.H
Foam::GeometricField::Boundary::Boundary
Boundary(const BoundaryMesh &bmesh)
Construct from a BoundaryMesh, setting patches later.
Definition: GeometricBoundaryField.C:185
Foam::constant::atomic::alpha
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
Definition: readThermalProperties.H:212
Foam::GeometricField::primitiveField
const Internal::FieldType & primitiveField() const
Return a const-reference to the internal field.
Definition: GeometricFieldI.H:53
Foam::GeometricField::Boundary::writeEntries
void writeEntries(Ostream &os) const
Write dictionary entries of the individual boundary fields.
Definition: GeometricBoundaryField.C:563
Foam::GeometricField::TypeName
TypeName("GeometricField")
Runtime type information.
Foam::GeometricField::Boundary::operator=
void operator=(const Boundary &)
Assignment to BoundaryField<Type, PatchField, BoundaryMesh>
Foam::GeometricField::oldTime
const GeometricField< Type, PatchField, GeoMesh > & oldTime() const
Return old time field.
Definition: GeometricField.C:850
Foam::GeometricField::GeometricField
GeometricField(const IOobject &io, const Mesh &mesh, const dimensionSet &ds, const word &patchFieldType=PatchField< Type >::calculatedType())
Construct given IOobject, mesh, dimensions and patch type.
Definition: GeometricField.C:197
Foam::GeometricField::v
const Internal & v() const
Definition: volFieldsI.H:33
Foam::GeometricField::BoundaryMesh
GeoMesh::BoundaryMesh BoundaryMesh
Definition: GeometricField.H:104
Foam::dimensionSet
Dimension set for the base types, which can be used to implement rigorous dimension checking for alge...
Definition: dimensionSet.H:108
Foam::GeometricField::select
word select(bool final) const
Select the final iteration parameters if `final' is true.
Definition: GeometricField.C:1007
Foam::GeometricField::internalField
const Internal & internalField() const
Return a const-reference to the dimensioned internal field.
Definition: GeometricFieldI.H:43
Foam::GeometricField::clip
void clip(const dimensioned< MinMax< Type >> &range)
Clip the field to be bounded within the specified range.
Definition: GeometricField.C:1154
lduInterfaceFieldPtrsList.H
Foam::GeometricField::Boundary::evaluate
void evaluate()
Evaluate boundary conditions.
Definition: GeometricBoundaryField.C:407
Foam::GeometricField::cmptType
Field< Type >::cmptType cmptType
Definition: GeometricField.H:290
Foam::GeometricField::min
void min(const dimensioned< Type > &dt)
Use the minimum of the field and specified value.
Definition: GeometricField.C:1132
Foam::GeometricField::Boundary::updateCoeffs
void updateCoeffs()
Update the boundary condition coefficients.
Definition: GeometricBoundaryField.C:395
Foam::GeometricField::needReference
bool needReference() const
Does the field need a reference level for solution.
Definition: GeometricField.C:949
Foam::GeometricField::maxMin
void maxMin(const dimensioned< Type > &minVal, const dimensioned< Type > &maxVal)
Deprecated(2019-01) identical to clip()
Definition: GeometricField.C:1179
Foam::GeometricField::nOldTimes
label nOldTimes() const
Return the number of old time fields stored.
Definition: GeometricField.C:837
Foam::GeometricField::New
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &name, const Mesh &mesh, const dimensionSet &ds, const word &patchFieldType=PatchField< Type >::calculatedType())
Return tmp field from name, mesh, dimensions and patch type.
Definition: GeometricFieldNew.C:34
Foam::wordList
List< word > wordList
A List of words.
Definition: fileName.H:62
Foam::GeometricField::Boundary::interfaces
LduInterfaceFieldPtrsList< Type > interfaces() const
Definition: GeometricBoundaryField.C:505
Foam::GeometricField::storeOldTimes
void storeOldTimes() const
Store the old-time fields.
Definition: GeometricField.C:797
Foam::GeometricField::Mesh
GeoMesh::Mesh Mesh
Type of mesh on which this GeometricField is instantiated.
Definition: GeometricField.H:100
Foam::Field::cmptType
pTraits< Type >::cmptType cmptType
Component type.
Definition: Field.H:86
Foam::GeometricField::negate
void negate()
Negate the field inplace.
Definition: GeometricField.C:1189
Foam::Field
Generic templated field type.
Definition: Field.H:63
Foam::GeometricField::Boundary::readField
void readField(const Internal &field, const dictionary &dict)
Read the boundary field.
Definition: GeometricBoundaryField.C:36
Foam::GeometricField::Boundary::operator==
void operator==(const Boundary &)
Forced assignment to.
Foam::GeometricField::writeMinMax
void writeMinMax(Ostream &os) const
Helper function to write the min and max to an Ostream.
Definition: GeometricField.C:1022
Foam::GeometricField::Internal
DimensionedField< Type, GeoMesh > Internal
Type of the internal field from which this GeometricField is derived.
Definition: GeometricField.H:107
LduInterfaceFieldPtrsList.H
List of coupled interface fields to be used in coupling.
Foam::GeometricField::prevIter
const GeometricField< Type, PatchField, GeoMesh > & prevIter() const
Return previous iteration field.
Definition: GeometricField.C:923
Foam::UPtrList< const lduInterfaceField >
Foam::GeometricField::Boundary::types
wordList types() const
Return a list of the patch types.
Definition: GeometricBoundaryField.C:470
field
rDeltaTY field()
Foam::PtrList
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: List.H:59
Foam::GeoMesh::BoundaryMesh
MESH::BoundaryMesh BoundaryMesh
Definition: GeoMesh.H:63
Foam::GeometricField::storeOldTime
void storeOldTime() const
Store the old-time field.
Definition: GeometricField.C:816
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
os
OBJstream os(runTime.globalPath()/outputName)
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
GeometricField.C
Foam::dimensioned
Generic dimensioned Type class.
Definition: dimensionedScalarFwd.H:42
Foam::GeoMesh
Generic mesh wrapper used by volMesh, surfaceMesh, pointMesh etc.
Definition: GeoMesh.H:48
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::GeometricField::timeIndex
label timeIndex() const
Return the time index of the field.
Definition: GeometricFieldI.H:70
Foam::GeometricField::primitiveFieldRef
Internal::FieldType & primitiveFieldRef(const bool updateAccessTime=true)
Return a reference to the internal field.
Definition: GeometricField.C:766
Foam::GeometricField::clone
tmp< GeometricField< Type, PatchField, GeoMesh > > clone() const
Clone.
Definition: GeometricField.C:727
Foam::GeometricField::correctBoundaryConditions
void correctBoundaryConditions()
Correct boundary field.
Definition: GeometricField.C:940
Foam::GeometricField::T
tmp< GeometricField< Type, PatchField, GeoMesh > > T() const
Return transpose (only if it is a tensor field)
Definition: GeometricField.C:1046
Foam::GeometricField::storePrevIter
void storePrevIter() const
Store the field as the previous iteration value.
Definition: GeometricField.C:900
Foam::GeometricField::Boundary
The boundary fields.
Definition: GeometricField.H:115
range
scalar range
Definition: LISASMDCalcMethod1.H:12
Foam::GeometricField::ref
Internal & ref(const bool updateAccessTime=true)
Return a reference to the dimensioned internal field.
Definition: GeometricField.C:749
Foam::GeometricField::boundaryFieldRef
Boundary & boundaryFieldRef(const bool updateAccessTime=true)
Return a reference to the boundary field.
Definition: GeometricField.C:783
Foam::List< word >
Foam::GeometricField::relax
void relax()
Relax field (for steady-state solution).
Definition: GeometricField.C:982
Foam::direction
uint8_t direction
Definition: direction.H:52
dimensionedTypes.H
Foam::FOAM_DEPRECATED_FOR
class FOAM_DEPRECATED_FOR(2017-05, "Foam::Enum") NamedEnum
Definition: NamedEnum.H:69
Foam::GeometricField::~GeometricField
virtual ~GeometricField()
Destructor.
Definition: GeometricField.C:736
Foam::name
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
Foam::GeometricField::max
void max(const dimensioned< Type > &dt)
Use the maximum of the field and specified value.
Definition: GeometricField.C:1143
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::LduInterfaceFieldPtrsList
Definition: LduInterfaceFieldPtrsList.H:50
Foam::GeometricField::operator
friend Ostream & operator(Ostream &, const GeometricField< Type, PatchField, GeoMesh > &)
Foam::GeometricField
Generic GeometricField class.
Definition: areaFieldsFwd.H:53
Foam::GeoMesh::Mesh
MESH Mesh
Definition: GeoMesh.H:62
Foam::GeometricField::Patch
PatchField< Type > Patch
Definition: GeometricField.H:111
Foam::MinMax
A min/max value pair with additional methods. In addition to conveniently storing values,...
Definition: HashSet.H:76
Foam::GeometricField::Boundary::writeEntry
void writeEntry(const word &keyword, Ostream &os) const
Write boundary field as dictionary entry.
Definition: GeometricBoundaryField.C:548
Foam::GeometricField::boundaryField
const Boundary & boundaryField() const
Return const-reference to the boundary field.
Definition: GeometricFieldI.H:62
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54
Foam::GeometricField::Boundary::scalarInterfaces
lduInterfaceFieldPtrsList scalarInterfaces() const
Definition: GeometricBoundaryField.C:527
Foam::GeometricField::Boundary::boundaryInternalField
Boundary boundaryInternalField() const
Definition: GeometricBoundaryField.C:488