GeometricBoundaryField.C
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,2022 OpenFOAM Foundation
9  Copyright (C) 2016-2023 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 \*---------------------------------------------------------------------------*/
28 
29 #include "GeometricBoundaryField.H"
30 #include "globalMeshData.H"
31 #include "cyclicPolyPatch.H"
32 #include "emptyPolyPatch.H"
33 
34 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
35 
36 template<class Type, template<class> class PatchField, class GeoMesh>
37 template<class CheckPatchFieldType>
39 (
40  const scalar tol,
41  const bool doExit
42 ) const
43 {
44  if (!this->size())
45  {
46  return true;
47  }
48 
49  if (debug&2)
50  {
51  const auto& pfld0 = this->operator[](0);
53  << " Checking boundary consistency for field "
54  << pfld0.internalField().name()
55  << endl;
56  }
57 
58  auto& bfld = const_cast<GeometricBoundaryField<Type, PatchField, GeoMesh>&>
59  (
60  *this
61  );
62 
63 
64  // Store old value
65  List<Field<Type>> oldBfld(this->size());
66  boolList oldUpdated(this->size());
67  //Note: areaFields (finiteArea) do not have manipulatedMatrix() flag. TBD.
68  //boolList oldManipulated(this->size());
69 
70  for (auto& pfld : bfld)
71  {
72  if (isA<CheckPatchFieldType>(pfld))
73  {
74  const label patchi = pfld.patch().index();
75  oldUpdated[patchi] = pfld.updated();
76  oldBfld[patchi] = pfld;
77  //oldManipulated[patchi] = pfld.manipulatedMatrix();
78  }
79  }
80 
81 
82  // Re-evaluate
83  {
84  const label startOfRequests = UPstream::nRequests();
85 
86  for (auto& pfld : bfld)
87  {
88  if (isA<CheckPatchFieldType>(pfld))
89  {
90  pfld.initEvaluate(UPstream::commsTypes::nonBlocking);
91  }
92  }
93 
94  // Wait for outstanding requests
95  UPstream::waitRequests(startOfRequests);
96 
97  for (auto& pfld : bfld)
98  {
99  if (isA<CheckPatchFieldType>(pfld))
100  {
101  pfld.evaluate(UPstream::commsTypes::nonBlocking);
102  }
103  }
104  }
105 
106 
107  // Check
108  bool ok = true;
109  for (auto& pfld : bfld)
110  {
111  if (isA<CheckPatchFieldType>(pfld))
112  {
113  const label patchi = pfld.patch().index();
114  const auto& oldPfld = oldBfld[patchi];
115 
116  forAll(pfld, facei)
117  {
118  if (mag(pfld[facei]-oldPfld[facei]) > tol)
119  {
120  ok = false;
121  break;
122  }
123  }
124 
125  if (!ok)
126  {
127  if (doExit)
128  {
129  FatalErrorInFunction << "Field "
130  << pfld.internalField().name()
131  << " is not evaluated?"
132  << " On patch " << pfld.patch().name()
133  << " type " << pfld.type()
134  << " : average of field = "
135  << average(oldPfld)
136  << ". Average of evaluated field = "
137  << average(pfld)
138  << ". Difference:" << average(pfld-oldPfld)
139  << ". Tolerance:" << tol
140  << exit(FatalError);
141  }
142  else
143  {
144  WarningInFunction << "Field "
145  << pfld.internalField().name()
146  << " is not evaluated?"
147  << " On patch " << pfld.patch().name()
148  << " type " << pfld.type()
149  << " : average of field = "
150  << average(oldPfld)
151  << ". Average of evaluated field = "
152  << average(pfld)
153  << ". Difference:" << average(pfld-oldPfld)
154  << ". Tolerance:" << tol
155  << endl;
156 
157  // Skip other patches
158  break;
159  }
160  }
161  }
162  }
163 
164  // Restore bfld, updated
165  for (auto& pfld : bfld)
166  {
167  if (isA<CheckPatchFieldType>(pfld))
168  {
169  const label patchi = pfld.patch().index();
170  pfld.setUpdated(oldUpdated[patchi]);
171  Field<Type>& vals = pfld;
172  vals = std::move(oldBfld[patchi]);
173  //pfld.setManipulated(oldManipulated[patchi]);
174  }
175  }
176 
177  if (debug&2)
178  {
179  const auto& pfld0 = this->operator[](0);
181  << " Result of checking for field "
182  << pfld0.internalField().name() << " : " << ok << endl;
183  }
185  return ok;
186 }
187 
188 
189 template<class Type, template<class> class PatchField, class GeoMesh>
191 (
193  const dictionary& dict
194 )
195 {
200 
201  // Clear the boundary field if already initialised
202  this->clear();
203 
204  this->resize(bmesh_.size());
205 
206  label nUnset = this->size();
207 
208  // 1. Handle explicit patch names. Note that there can be only one explicit
209  // patch name since is key of dictionary.
210 
211  for (const entry& dEntry : dict)
212  {
213  if (dEntry.isDict() && dEntry.keyword().isLiteral())
214  {
215  const label patchi = bmesh_.findPatchID(dEntry.keyword());
216 
217  if (patchi != -1)
218  {
219  this->set
220  (
221  patchi,
223  (
224  bmesh_[patchi],
225  field,
226  dEntry.dict()
227  )
228  );
229  nUnset--;
230  }
231  }
232  }
233 
234  if (nUnset == 0)
235  {
236  return;
237  }
238 
239 
240  // 2. Patch-groups. (using non-wild card entries of dictionaries)
241  // (patchnames already matched above)
242  // Note: in reverse order of entries in the dictionary (last
243  // patchGroups wins). This is so it is consistent with dictionary wildcard
244  // behaviour
245  for (auto iter = dict.crbegin(); iter != dict.crend(); ++iter)
246  {
247  const entry& dEntry = *iter;
248 
249  if (dEntry.isDict() && dEntry.keyword().isLiteral())
250  {
251  const labelList patchIds =
252  bmesh_.indices(dEntry.keyword(), true); // use patchGroups
253 
254  for (const label patchi : patchIds)
255  {
256  if (!this->set(patchi))
257  {
258  this->set
259  (
260  patchi,
262  (
263  bmesh_[patchi],
264  field,
265  dEntry.dict()
266  )
267  );
268  }
269  }
270  }
271  }
272 
273 
274  // 3. Wildcard patch overrides
275  forAll(bmesh_, patchi)
276  {
277  if (!this->set(patchi))
278  {
279  if (bmesh_[patchi].type() == emptyPolyPatch::typeName)
280  {
281  this->set
282  (
283  patchi,
285  (
286  emptyPolyPatch::typeName,
287  bmesh_[patchi],
288  field
289  )
290  );
291  }
292  else
293  {
294  bool found = dict.found(bmesh_[patchi].name());
295 
296  if (found)
297  {
298  this->set
299  (
300  patchi,
302  (
303  bmesh_[patchi],
304  field,
305  dict.subDict(bmesh_[patchi].name())
306  )
307  );
308  }
309  }
310  }
311  }
312 
313 
314  // Check for any unset patches
315  forAll(bmesh_, patchi)
316  {
317  if (!this->set(patchi))
318  {
319  if (bmesh_[patchi].type() == cyclicPolyPatch::typeName)
320  {
322  << "Cannot find patchField entry for cyclic "
323  << bmesh_[patchi].name() << endl
324  << "Is your field uptodate with split cyclics?" << endl
325  << "Run foamUpgradeCyclics to convert mesh and fields"
326  << " to split cyclics." << exit(FatalIOError);
327  }
328  else
329  {
331  << "Cannot find patchField entry for "
332  << bmesh_[patchi].name() << exit(FatalIOError);
333  }
334  }
335  }
336 }
337 
338 
339 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
340 
341 template<class Type, template<class> class PatchField, class GeoMesh>
343 (
344  const BoundaryMesh& bmesh
345 )
346 :
347  FieldField<PatchField, Type>(bmesh.size()),
348  bmesh_(bmesh)
349 {}
350 
351 
352 template<class Type, template<class> class PatchField, class GeoMesh>
354 (
355  const BoundaryMesh& bmesh,
357  const word& patchFieldType
358 )
359 :
360  FieldField<PatchField, Type>(bmesh.size()),
361  bmesh_(bmesh)
362 {
367 
368  forAll(bmesh_, patchi)
369  {
370  this->set
371  (
372  patchi,
374  (
375  patchFieldType,
376  bmesh_[patchi],
377  field
378  )
379  );
380  }
381 }
382 
383 
384 template<class Type, template<class> class PatchField, class GeoMesh>
386 (
387  const BoundaryMesh& bmesh,
388  const DimensionedField<Type, GeoMesh>& field,
389  const wordList& patchFieldTypes,
390  const wordList& constraintTypes
391 )
392 :
393  FieldField<PatchField, Type>(bmesh.size()),
394  bmesh_(bmesh)
395 {
400 
401  if
402  (
403  patchFieldTypes.size() != this->size()
404  || (constraintTypes.size() && (constraintTypes.size() != this->size()))
405  )
406  {
408  << "Incorrect number of patch type specifications given" << nl
409  << " Number of patches in mesh = " << bmesh.size()
410  << " number of patch type specifications = "
411  << patchFieldTypes.size()
412  << abort(FatalError);
413  }
414 
415  if (constraintTypes.size())
416  {
417  forAll(bmesh_, patchi)
418  {
419  this->set
420  (
421  patchi,
423  (
424  patchFieldTypes[patchi],
425  constraintTypes[patchi],
426  bmesh_[patchi],
427  field
428  )
429  );
430  }
431  }
432  else
433  {
434  forAll(bmesh_, patchi)
435  {
436  this->set
437  (
438  patchi,
440  (
441  patchFieldTypes[patchi],
442  bmesh_[patchi],
443  field
444  )
445  );
446  }
447  }
448 }
449 
450 
451 template<class Type, template<class> class PatchField, class GeoMesh>
453 (
454  const BoundaryMesh& bmesh,
455  const DimensionedField<Type, GeoMesh>& field,
456  const PtrList<PatchField<Type>>& ptfl
457 )
458 :
459  FieldField<PatchField, Type>(bmesh.size()),
460  bmesh_(bmesh)
461 {
466 
467  forAll(bmesh_, patchi)
468  {
469  this->set(patchi, ptfl[patchi].clone(field));
470  }
471 }
472 
473 
474 template<class Type, template<class> class PatchField, class GeoMesh>
476 (
477  const DimensionedField<Type, GeoMesh>& field,
478  const GeometricBoundaryField<Type, PatchField, GeoMesh>& btf
479 )
480 :
481  FieldField<PatchField, Type>(btf.size()),
482  bmesh_(btf.bmesh_)
483 {
488 
489  forAll(bmesh_, patchi)
490  {
491  this->set(patchi, btf[patchi].clone(field));
492  }
493 }
494 
495 
496 template<class Type, template<class> class PatchField, class GeoMesh>
498 (
499  const DimensionedField<Type, GeoMesh>& field,
500  const GeometricBoundaryField<Type, PatchField, GeoMesh>& btf,
501  const labelList& patchIDs,
502  const word& patchFieldType
503 )
504 :
505  FieldField<PatchField, Type>(btf.size()),
506  bmesh_(btf.bmesh_)
507 {
512 
513  for (const label patchi : patchIDs)
514  {
515  this->set
516  (
517  patchi,
519  (
520  patchFieldType,
521  bmesh_[patchi],
522  field
523  )
524  );
525  }
526 
527  forAll(bmesh_, patchi)
528  {
529  if (!this->set(patchi))
530  {
531  this->set(patchi, btf[patchi].clone(field));
532  }
533  }
534 }
535 
536 
537 template<class Type, template<class> class PatchField, class GeoMesh>
539 (
540  const GeometricBoundaryField<Type, PatchField, GeoMesh>& btf
541 )
542 :
543  FieldField<PatchField, Type>(btf),
544  bmesh_(btf.bmesh_)
545 {
550 }
551 
552 
553 template<class Type, template<class> class PatchField, class GeoMesh>
555 (
556  const BoundaryMesh& bmesh,
557  const DimensionedField<Type, GeoMesh>& field,
558  const dictionary& dict
559 )
560 :
561  FieldField<PatchField, Type>(bmesh.size()),
562  bmesh_(bmesh)
563 {
564  readField(field, dict);
565 }
566 
567 
568 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
569 
570 template<class Type, template<class> class PatchField, class GeoMesh>
572 {
577 
578  for (auto& pfld : *this)
579  {
580  pfld.updateCoeffs();
581  }
582 }
583 
584 
585 template<class Type, template<class> class PatchField, class GeoMesh>
587 {
592 
593  const UPstream::commsTypes commsType = UPstream::defaultCommsType;
594  const label startOfRequests = UPstream::nRequests();
595 
596  if
597  (
598  commsType == UPstream::commsTypes::blocking
599  || commsType == UPstream::commsTypes::nonBlocking
600  )
601  {
602  for (auto& pfld : *this)
603  {
604  pfld.initEvaluate(commsType);
605  }
606 
607  // Wait for outstanding requests
608  if (commsType == Pstream::commsTypes::nonBlocking)
609  {
610  UPstream::waitRequests(startOfRequests);
611  }
612 
613  for (auto& pfld : *this)
614  {
615  pfld.evaluate(commsType);
616  }
617  }
618  else if (commsType == UPstream::commsTypes::scheduled)
619  {
620  const lduSchedule& patchSchedule =
621  bmesh_.mesh().globalData().patchSchedule();
622 
623  for (const auto& schedEval : patchSchedule)
624  {
625  const label patchi = schedEval.patch;
626  auto& pfld = (*this)[patchi];
627 
628  if (schedEval.init)
629  {
630  pfld.initEvaluate(commsType);
631  }
632  else
633  {
634  pfld.evaluate(commsType);
635  }
636  }
637  }
638  else
639  {
641  << "Unsupported communications type "
642  << UPstream::commsTypeNames[commsType]
644  }
645 }
646 
647 
648 template<class Type, template<class> class PatchField, class GeoMesh>
650 (
651  const UList<label>& patchIDs
652 )
653 {
654  for (const label patchi : patchIDs)
655  {
656  auto& pf = (*this)[patchi];
657 
658  DebugInfo<< "Updating " << pf.patch().name() << endl;
659 
660  const label startOfRequests = UPstream::nRequests();
661 
662  pf.initEvaluate(UPstream::commsTypes::nonBlocking);
663 
664  UPstream::waitRequests(startOfRequests);
666  pf.evaluate(UPstream::commsTypes::nonBlocking);
667  }
668 }
669 
670 
671 template<class Type, template<class> class PatchField, class GeoMesh>
673 {
678 
679  if (!localConsistency)
680  {
681  return;
682  }
683 
684  const UPstream::commsTypes commsType = UPstream::defaultCommsType;
685  const label startOfRequests = UPstream::nRequests();
686 
687  if
688  (
689  commsType == UPstream::commsTypes::blocking
690  || commsType == UPstream::commsTypes::nonBlocking
691  )
692  {
693  for (auto& pfld : *this)
694  {
695  pfld.initEvaluateLocal(commsType);
696  }
697 
698  // Wait for outstanding requests
699  if (commsType == Pstream::commsTypes::nonBlocking)
700  {
701  UPstream::waitRequests(startOfRequests);
702  }
703 
704  for (auto& pfld : *this)
705  {
706  pfld.evaluateLocal(commsType);
707  }
708  }
709  else if (commsType == UPstream::commsTypes::scheduled)
710  {
711  const lduSchedule& patchSchedule =
712  bmesh_.mesh().globalData().patchSchedule();
713 
714  for (const auto& schedEval : patchSchedule)
715  {
716  const label patchi = schedEval.patch;
717  auto& pfld = (*this)[patchi];
718 
719  if (schedEval.init)
720  {
721  pfld.initEvaluateLocal(commsType);
722  }
723  else
724  {
725  pfld.evaluateLocal(commsType);
726  }
727  }
728  }
729  else
730  {
732  << "Unsupported communications type "
733  << UPstream::commsTypeNames[commsType]
734  << exit(FatalError);
735  }
736 }
737 
738 
739 template<class Type, template<class> class PatchField, class GeoMesh>
740 template<class CoupledPatchType>
741 void
744 {
749 
750  const UPstream::commsTypes commsType = UPstream::defaultCommsType;
751  const label startOfRequests = UPstream::nRequests();
752 
753  if
754  (
755  commsType == UPstream::commsTypes::blocking
756  || commsType == UPstream::commsTypes::nonBlocking
757  )
758  {
759  for (auto& pfld : *this)
760  {
761  const auto* cpp = isA<CoupledPatchType>(pfld.patch());
762 
763  if (cpp && cpp->coupled())
764  {
765  pfld.initEvaluate(commsType);
766  }
767  }
768 
769  // Wait for outstanding requests
770  if (commsType == UPstream::commsTypes::nonBlocking)
771  {
772  UPstream::waitRequests(startOfRequests);
773  }
774 
775  for (auto& pfld : *this)
776  {
777  const auto* cpp = isA<CoupledPatchType>(pfld.patch());
778 
779  if (cpp && cpp->coupled())
780  {
781  pfld.evaluate(commsType);
782  }
783  }
784  }
785  else if (commsType == UPstream::commsTypes::scheduled)
786  {
787  const lduSchedule& patchSchedule =
788  bmesh_.mesh().globalData().patchSchedule();
789 
790  for (const auto& schedEval : patchSchedule)
791  {
792  const label patchi = schedEval.patch;
793  auto& pfld = (*this)[patchi];
794 
795  const auto* cpp = isA<CoupledPatchType>(pfld.patch());
796 
797  if (cpp && cpp->coupled())
798  {
799  if (schedEval.init)
800  {
801  pfld.initEvaluate(commsType);
802  }
803  else
804  {
805  pfld.evaluate(commsType);
806  }
807  }
808  }
809  }
810  else
811  {
813  << "Unsupported communications type "
814  << UPstream::commsTypeNames[commsType]
816  }
817 }
818 
819 
820 template<class Type, template<class> class PatchField, class GeoMesh>
823 {
824  const FieldField<PatchField, Type>& pff = *this;
825 
826  wordList list(pff.size());
827 
828  forAll(pff, patchi)
829  {
830  list[patchi] = pff[patchi].type();
831  }
832 
833  return list;
834 }
835 
836 
837 template<class Type, template<class> class PatchField, class GeoMesh>
840 boundaryInternalField() const
841 {
843 
844  forAll(result, patchi)
845  {
846  result[patchi] == this->operator[](patchi).patchInternalField();
847  }
849  return result;
850 }
851 
852 
853 template<class Type, template<class> class PatchField, class GeoMesh>
856 {
857  LduInterfaceFieldPtrsList<Type> list(this->size());
858 
859  forAll(list, patchi)
860  {
861  const auto* lduPtr =
862  isA<LduInterfaceField<Type>>(this->operator[](patchi));
863 
864  if (lduPtr)
865  {
866  list.set(patchi, lduPtr);
867  }
868  }
869 
870  return list;
871 }
872 
873 
874 template<class Type, template<class> class PatchField, class GeoMesh>
877 scalarInterfaces() const
878 {
879  lduInterfaceFieldPtrsList list(this->size());
880 
881  forAll(list, patchi)
882  {
883  const auto* lduPtr =
884  isA<lduInterfaceField>(this->operator[](patchi));
885 
886  if (lduPtr)
887  {
888  list.set(patchi, lduPtr);
889  }
890  }
892  return list;
893 }
894 
895 
896 template<class Type, template<class> class PatchField, class GeoMesh>
898 (
899  const word& keyword,
900  Ostream& os
901 ) const
902 {
903  os.beginBlock(keyword);
904  this->writeEntries(os);
905  os.endBlock();
907  os.check(FUNCTION_NAME);
908 }
909 
910 
911 template<class Type, template<class> class PatchField, class GeoMesh>
913 (
914  Ostream& os
915 ) const
916 {
917  for (const auto& pfld : *this)
918  {
919  os.beginBlock(pfld.patch().name());
920  os << pfld;
921  os.endBlock();
922  }
923 }
924 
925 
926 template<class Type, template<class> class PatchField, class GeoMesh>
928 (
929 ) const
930 {
931  // Dummy op - template specialisations provide logic (usually call
932  // to checkConsistency)
933  return true;
934 }
935 
936 
937 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
938 
939 template<class Type, template<class> class PatchField, class GeoMesh>
941 (
942  const GeometricBoundaryField<Type, PatchField, GeoMesh>& bf
943 )
944 {
946 }
947 
948 
949 template<class Type, template<class> class PatchField, class GeoMesh>
951 (
953 )
954 {
956 }
957 
958 
959 template<class Type, template<class> class PatchField, class GeoMesh>
961 (
962  const Type& val
963 )
964 {
966 }
967 
968 
969 template<class Type, template<class> class PatchField, class GeoMesh>
971 (
972  const GeometricBoundaryField<Type, PatchField, GeoMesh>& bf
973 )
974 {
975  forAll(*this, patchi)
976  {
977  this->operator[](patchi) == bf[patchi];
978  }
979 }
980 
981 
982 template<class Type, template<class> class PatchField, class GeoMesh>
984 (
985  const FieldField<PatchField, Type>& bf
986 )
987 {
988  forAll(*this, patchi)
989  {
990  this->operator[](patchi) == bf[patchi];
991  }
992 }
993 
994 
995 template<class Type, template<class> class PatchField, class GeoMesh>
997 (
998  const Type& val
999 )
1000 {
1001  forAll(*this, patchi)
1002  {
1003  this->operator[](patchi) == val;
1004  }
1005 }
1006 
1007 
1008 // * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
1009 
1010 template<class Type, template<class> class PatchField, class GeoMesh>
1011 Foam::Ostream& Foam::operator<<
1012 (
1013  Ostream& os,
1014  const GeometricBoundaryField<Type, PatchField, GeoMesh>& bf
1015 )
1016 {
1017  os << static_cast<const FieldField<PatchField, Type>&>(bf);
1018  return os;
1019 }
1020 
1021 
1022 // ************************************************************************* //
const labelList patchIDs(pbm.indices(polyPatchNames, true))
labelList patchIds
dictionary dict
type
Types of root.
Definition: Roots.H:52
rDeltaTY field()
GeometricBoundaryField(const BoundaryMesh &bmesh)
Construct from a BoundaryMesh, setting patches later.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:125
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
patchWriters resize(patchIds.size())
commsTypes
Communications types.
Definition: UPstream.H:72
error FatalError
Error stream (stdout output on all processes), with additional &#39;FOAM FATAL ERROR&#39; header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:598
constexpr char nl
The newline &#39;\n&#39; character (0x0a)
Definition: Ostream.H:50
lduInterfaceFieldPtrsList scalarInterfaces() const
Return a list of pointers for each patch field with only those pointing to interfaces being set...
wordList types() const
Return a list of the patch types.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:531
tmp< GeometricField< Type, faPatchField, areaMesh > > average(const GeometricField< Type, faePatchField, edgeMesh > &ssf)
Area-weighted average a edgeField creating a areaField.
Definition: facAverage.C:40
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
List< lduScheduleEntry > lduSchedule
A List of lduSchedule entries.
Definition: lduSchedule.H:46
A field of fields is a PtrList of fields with reference counting.
Definition: FieldField.H:51
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:421
void evaluate()
Evaluate boundary conditions.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition: exprTraits.C:127
void evaluateLocal()
Evaluate boundary conditions after change in local values.
A class for handling words, derived from Foam::string.
Definition: word.H:63
void evaluateSelected(const UList< label > &patchIDs)
Evaluate boundary conditions for selected patches.
void evaluateCoupled()
Evaluate boundary conditions on a subset of coupled patches.
patchWriters clear()
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
Definition: HashTable.H:106
errorManip< error > abort(error &err)
Definition: errorManip.H:139
bool check() const
Helper: check if field has been evaluated. See instantiations.
void updateCoeffs()
Update the boundary condition coefficients.
#define DebugInfo
Report an information message using Foam::Info.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
int debug
Static debugging option.
OBJstream os(runTime.globalPath()/outputName)
#define FUNCTION_NAME
Generic GeometricBoundaryField class.
Definition: areaFieldsFwd.H:46
List< word > wordList
List of word.
Definition: fileName.H:59
#define WarningInFunction
Report a warning using Foam::Warning.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Definition: error.H:627
void writeEntry(const word &keyword, Ostream &os) const
Write boundary field as dictionary entry.
#define PoutInFunction
Report using Foam::Pout with FUNCTION_NAME prefix.
void readField(const DimensionedField< Type, GeoMesh > &field, const dictionary &dict)
Read the boundary field.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: areaFieldsFwd.H:42
LduInterfaceFieldPtrsList< Type > interfaces() const
Return a list of pointers for each patch field with only those pointing to interfaces being set...
GeometricBoundaryField boundaryInternalField() const
Return boundary field of values neighbouring the boundary.
void writeEntries(Ostream &os) const
Write dictionary entries of the individual boundary fields.
Generic mesh wrapper used by volMesh, surfaceMesh, pointMesh etc.
Definition: GeoMesh.H:42
List< label > labelList
A List of labels.
Definition: List.H:62
List< bool > boolList
A List of bools.
Definition: List.H:60
bool found
A keyword and a list of tokens is an &#39;entry&#39;.
Definition: entry.H:63
const T * set(const label i) const
Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie...
Definition: UPtrList.H:366
IOerror FatalIOError
Error stream (stdout output on all processes), with additional &#39;FOAM FATAL IO ERROR&#39; header text and ...