externalCoupledMixedFvPatchField.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 | Copyright (C) 2013-2017 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
27 #include "fvPatchFieldMapper.H"
28 #include "volFields.H"
29 #include "IFstream.H"
30 #include "globalIndex.H"
31 
32 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
33 
34 template<class Type>
35 Foam::word Foam::externalCoupledMixedFvPatchField<Type>::lockName = "OpenFOAM";
36 
37 template<class Type>
39 Foam::externalCoupledMixedFvPatchField<Type>::patchKey = "# Patch: ";
40 
41 
42 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
43 
44 template<class Type>
46 {
47  word regionName(this->internalField().mesh().name());
48  if (regionName == polyMesh::defaultRegion)
49  {
50  regionName = ".";
51  }
52 
53  fileName result(commsDir_/regionName);
54  result.clean();
55 
56  return result;
57 }
58 
59 
60 template<class Type>
62 (
63  const labelList& patchIDs
64 )
65 {
66  const volFieldType& cvf =
67  static_cast<const volFieldType&>(this->internalField());
68 
69  volFieldType& vf = const_cast<volFieldType&>(cvf);
70 
71  typename volFieldType::Boundary& bf = vf.boundaryFieldRef();
72 
73  // number of patches can be different in parallel...
74  label nPatch = bf.size();
75  reduce(nPatch, maxOp<label>());
76 
77  offsets_.setSize(nPatch);
78  forAll(offsets_, i)
79  {
80  offsets_[i].setSize(Pstream::nProcs());
81  offsets_[i] = 0;
82  }
83 
84  // set the master patch
85  forAll(patchIDs, i)
86  {
87  label patchi = patchIDs[i];
88 
89  patchType& pf = refCast<patchType>(bf[patchi]);
90 
91  offsets_[patchi][Pstream::myProcNo()] = pf.size();
92 
93  if (i == 0)
94  {
95  pf.master() = true;
96  }
97  else
98  {
99  pf.master() = false;
100  }
101  }
102 
103  // set the patch offsets
104  int tag = Pstream::msgType() + 1;
105  forAll(offsets_, i)
106  {
107  Pstream::gatherList(offsets_[i], tag);
108  Pstream::scatterList(offsets_[i], tag);
109  }
110 
111  label patchOffset = 0;
112  forAll(offsets_, patchi)
113  {
114  label sumOffset = 0;
115  List<label>& procOffsets = offsets_[patchi];
116 
117  forAll(procOffsets, proci)
118  {
119  label o = procOffsets[proci];
120  if (o > 0)
121  {
122  procOffsets[proci] = patchOffset + sumOffset;
123  sumOffset += o;
124  }
125  }
126  patchOffset += sumOffset;
127  }
128 }
129 
130 
131 template<class Type>
133 (
134  OFstream& osPoints,
135  OFstream& osFaces
136 ) const
137 {
138  int tag = Pstream::msgType() + 1;
139 
140  const label proci = Pstream::myProcNo();
141  const polyPatch& p = this->patch().patch();
142  const polyMesh& mesh = p.boundaryMesh().mesh();
143 
144  labelList pointToGlobal;
145  labelList uniquePointIDs;
146  (void)mesh.globalData().mergePoints
147  (
148  p.meshPoints(),
149  p.meshPointMap(),
150  pointToGlobal,
151  uniquePointIDs
152  );
153 
154  List<pointField> allPoints(Pstream::nProcs());
155  allPoints[proci] = pointField(mesh.points(), uniquePointIDs);
156  Pstream::gatherList(allPoints, tag);
157 
158  List<faceList> allFaces(Pstream::nProcs());
159  faceList& patchFaces = allFaces[proci];
160  patchFaces = p.localFaces();
161  forAll(patchFaces, facei)
162  {
163  inplaceRenumber(pointToGlobal, patchFaces[facei]);
164  }
165 
166  Pstream::gatherList(allFaces, tag);
167 
168  if (Pstream::master())
169  {
170  pointField pts
171  (
172  ListListOps::combine<pointField>(allPoints, accessOp<pointField>())
173  );
174 
175  // write points
176  osPoints << patchKey.c_str() << this->patch().name() << pts << endl;
177 
178  faceList fcs
179  (
180  ListListOps::combine<faceList>(allFaces, accessOp<faceList>())
181  );
182 
183  // write faces
184  osFaces<< patchKey.c_str() << this->patch().name() << fcs << endl;
185  }
186 }
187 
188 
189 template<class Type>
191 {
192  return fileName(baseDir()/(lockName + ".lock"));
193 }
194 
195 
196 template<class Type>
198 {
199  if (!master_ || !Pstream::master())
200  {
201  return;
202  }
203 
204  const fileName fName(lockFile());
205  IFstream is(fName);
206 
207  // only create lock file if it doesn't already exist
208  if (!is.good())
209  {
210  if (log_)
211  {
212  Info<< type() << ": creating lock file" << endl;
213  }
214 
215  OFstream os(fName);
216  os << "lock file";
217  os.flush();
218  }
219 }
220 
221 
222 template<class Type>
224 {
225  if (!master_ || !Pstream::master())
226  {
227  return;
228  }
229 
230  if (log_)
231  {
232  Info<< type() << ": removing lock file" << endl;
233  }
234 
235  rm(lockFile());
236 }
237 
238 
239 template<class Type>
241 {
242  // only wait on master patch
243 
244  const volFieldType& cvf =
245  static_cast<const volFieldType&>(this->internalField());
246 
247  const typename volFieldType::Boundary& bf =
248  cvf.boundaryField();
249 
250  forAll(coupledPatchIDs_, i)
251  {
252  label patchi = coupledPatchIDs_[i];
253 
254  const patchType& pf = refCast<const patchType>(bf[patchi]);
255 
256  if (pf.master())
257  {
258  pf.wait();
259  break;
260  }
261  }
262 }
263 
264 
265 template<class Type>
267 {
268  const fileName fName(lockFile());
269  label found = 0;
270  label totalTime = 0;
271 
272  if (log_)
273  {
274  Info<< type() << ": beginning wait for lock file " << fName << endl;
275  }
276 
277  while (found == 0)
278  {
279  if (Pstream::master())
280  {
281  if (totalTime > timeOut_)
282  {
284  << "Wait time exceeded time out time of " << timeOut_
285  << " s" << abort(FatalError);
286  }
287 
288  IFstream is(fName);
289 
290  if (is.good())
291  {
292  found++;
293 
294  if (log_)
295  {
296  Info<< type() << ": found lock file " << fName << endl;
297  }
298  }
299  else
300  {
301  sleep(waitInterval_);
302  totalTime += waitInterval_;
303 
304  if (log_)
305  {
306  Info<< type() << ": wait time = " << totalTime << endl;
307  }
308  }
309  }
310 
311  // prevent other procs from racing ahead
312  reduce(found, sumOp<label>());
313  }
314 }
315 
316 
317 template<class Type>
319 (
320  IFstream& is
321 ) const
322 {
323  if (!is.good())
324  {
326  << "Unable to open data transfer file " << is.name()
327  << " for patch " << this->patch().name()
328  << exit(FatalError);
329  }
330 
331  label offset = offsets_[this->patch().index()][Pstream::myProcNo()];
332 
333  // scan forward to start reading at relevant line/position
334  string line;
335  for (label i = 0; i < offset; i++)
336  {
337  if (is.good())
338  {
339  is.getLine(line);
340  }
341  else
342  {
344  << "Unable to scan forward to appropriate read position for "
345  << "data transfer file " << is.name()
346  << " for patch " << this->patch().name()
347  << exit(FatalError);
348  }
349  }
350 }
351 
352 
353 // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
354 
355 template<class Type>
357 (
358  const fileName& transferFile
359 )
360 {
361  // read data passed back from external source
362  IFstream is(transferFile + ".in");
363 
364  // pre-process the input transfer file
365  initialiseRead(is);
366 
367  // read data from file
368  forAll(this->patch(), facei)
369  {
370  if (is.good())
371  {
372  is >> this->refValue()[facei]
373  >> this->refGrad()[facei]
374  >> this->valueFraction()[facei];
375  }
376  else
377  {
379  << "Insufficient data for patch "
380  << this->patch().name()
381  << " in file " << is.name()
382  << exit(FatalError);
383  }
384  }
385 
386  initialised_ = true;
387 
388  // update the value from the mixed condition
390 }
391 
392 
393 template<class Type>
395 (
396  const fileName& transferFile
397 ) const
398 {
399  if (!master_)
400  {
401  return;
402  }
403 
404  OFstream os(transferFile);
405 
406  writeHeader(os);
407 
408  const volFieldType& cvf =
409  static_cast<const volFieldType&>(this->internalField());
410 
411  const typename volFieldType::Boundary& bf =
412  cvf.boundaryField();
413 
414  forAll(coupledPatchIDs_, i)
415  {
416  label patchi = coupledPatchIDs_[i];
417 
418  const patchType& pf = refCast<const patchType>(bf[patchi]);
419 
420  pf.transferData(os);
421  }
422 }
423 
424 
425 template<class Type>
427 (
428  OFstream& os
429 ) const
430 {
431  os << "# Values: magSf value snGrad" << endl;
432 }
433 
434 
435 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
436 
437 template<class Type>
440 (
441  const fvPatch& p,
443 )
444 :
446  commsDir_("unknown-commsDir"),
447  fName_("unknown-fName"),
448  waitInterval_(0),
449  timeOut_(0),
450  calcFrequency_(0),
451  initByExternal_(false),
452  log_(false),
453  master_(false),
454  offsets_(),
455  initialised_(false),
456  coupledPatchIDs_()
457 {
458  this->refValue() = Zero;
459  this->refGrad() = Zero;
460  this->valueFraction() = 0.0;
461 }
462 
463 
464 template<class Type>
467 (
469  const fvPatch& p,
471  const fvPatchFieldMapper& mapper
472 )
473 :
474  mixedFvPatchField<Type>(ptf, p, iF, mapper),
475  commsDir_(ptf.commsDir_),
476  fName_(ptf.fName_),
477  waitInterval_(ptf.waitInterval_),
478  timeOut_(ptf.timeOut_),
479  calcFrequency_(ptf.calcFrequency_),
480  initByExternal_(ptf.initByExternal_),
481  log_(ptf.log_),
482  master_(ptf.master_),
483  offsets_(ptf.offsets_),
484  initialised_(ptf.initialised_),
485  coupledPatchIDs_(ptf.coupledPatchIDs_)
486 {}
487 
488 
489 template<class Type>
492 (
493  const fvPatch& p,
495  const dictionary& dict
496 )
497 :
499  commsDir_(dict.lookup("commsDir")),
500  fName_(dict.lookup("file")),
501  waitInterval_(dict.lookupOrDefault("waitInterval", 1)),
502  timeOut_(dict.lookupOrDefault("timeOut", 100*waitInterval_)),
503  calcFrequency_(dict.lookupOrDefault("calcFrequency", 1)),
504  initByExternal_(readBool(dict.lookup("initByExternal"))),
505  log_(dict.lookupOrDefault("log", false)),
506  master_(true),
507  offsets_(),
508  initialised_(false),
509  coupledPatchIDs_()
510 {
511  if (dict.found("value"))
512  {
514  (
515  Field<Type>("value", dict, p.size())
516  );
517  }
518  else
519  {
520  fvPatchField<Type>::operator=(this->patchInternalField());
521  }
522 
523  commsDir_.expand();
524 
525  if (Pstream::master())
526  {
527  mkDir(baseDir());
528  }
529 
530  if (!initByExternal_)
531  {
532  createLockFile();
533  }
534 
535  // initialise as a fixed value
536  this->refValue() = *this;
537  this->refGrad() = Zero;
538  this->valueFraction() = 1.0;
539 }
540 
541 
542 template<class Type>
545 (
547 )
548 :
550  commsDir_(ecmpf.commsDir_),
551  fName_(ecmpf.fName_),
552  waitInterval_(ecmpf.waitInterval_),
553  timeOut_(ecmpf.timeOut_),
554  calcFrequency_(ecmpf.calcFrequency_),
555  initByExternal_(ecmpf.initByExternal_),
556  log_(ecmpf.log_),
557  master_(ecmpf.master_),
558  offsets_(ecmpf.offsets_),
559  initialised_(ecmpf.initialised_),
560  coupledPatchIDs_(ecmpf.coupledPatchIDs_)
561 {}
562 
563 
564 template<class Type>
567 (
570 )
571 :
572  mixedFvPatchField<Type>(ecmpf, iF),
573  commsDir_(ecmpf.commsDir_),
574  fName_(ecmpf.fName_),
575  waitInterval_(ecmpf.waitInterval_),
576  timeOut_(ecmpf.timeOut_),
577  calcFrequency_(ecmpf.calcFrequency_),
578  initByExternal_(ecmpf.initByExternal_),
579  log_(ecmpf.log_),
580  master_(ecmpf.master_),
581  offsets_(ecmpf.offsets_),
582  initialised_(ecmpf.initialised_),
583  coupledPatchIDs_(ecmpf.coupledPatchIDs_)
584 {}
585 
586 
587 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
588 
589 template<class Type>
592 {
593  removeLockFile();
594 }
595 
596 
597 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
598 
599 template<class Type>
601 (
602  const fileName& transferFile
603 )
604 {
605  if (initialised_)
606  {
607  return;
608  }
609 
610  const volFieldType& cvf =
611  static_cast<const volFieldType&>(this->internalField());
612 
613  volFieldType& vf = const_cast<volFieldType&>(cvf);
614 
615  typename volFieldType::Boundary& bf = vf.boundaryFieldRef();
616 
617  // identify all coupled patches
618  DynamicList<label> coupledPatchIDs(bf.size());
619 
620  forAll(bf, patchi)
621  {
622  if (isA<patchType>(bf[patchi]))
623  {
624  coupledPatchIDs.append(patchi);
625  }
626  }
627 
628  coupledPatchIDs_.transfer(coupledPatchIDs);
629 
630 
631  // initialise by external solver, or just set the master patch
632  if (initByExternal_)
633  {
634  // remove lock file, signalling external source to execute
635 // removeLockFile();
636 
637  forAll(coupledPatchIDs_, i)
638  {
639  label patchi = coupledPatchIDs_[i];
640 
641  patchType& pf = refCast<patchType>(bf[patchi]);
642 
643  pf.setMaster(coupledPatchIDs_);
644  }
645 
646 
647  // wait for initial data to be made available
648  startWait();
649 
650  // read the initial data
651  if (master_)
652  {
653  forAll(coupledPatchIDs_, i)
654  {
655  label patchi = coupledPatchIDs_[i];
656 
657  patchType& pf = refCast<patchType>(bf[patchi]);
658 
659  pf.readData(transferFile);
660  }
661  }
662  }
663  else
664  {
665  setMaster(coupledPatchIDs_);
666  }
667 
668  initialised_ = true;
669 }
670 
671 
672 template<class Type>
674 (
675  const Pstream::commsTypes comms
676 )
677 {
678  if (!initialised_ || this->db().time().timeIndex() % calcFrequency_ == 0)
679  {
680  const fileName transferFile(baseDir()/fName_);
681 
682  // initialise the coupling
683  initialise(transferFile);
684 
685  // write data for external source
686  writeData(transferFile + ".out");
687 
688  // remove lock file, signalling external source to execute
689  removeLockFile();
690 
691  // wait for response
692  startWait();
693 
694  if (master_ && Pstream::master())
695  {
696  // remove old data file from OpenFOAM
697  rm(transferFile + ".out");
698  }
699 
700  // read data passed back from external source
701  readData(transferFile);
702 
703  // create lock file for external source
704  createLockFile();
705  }
706 }
707 
708 
709 template<class Type>
711 (
712  OFstream& os
713 ) const
714 {
715  if (log_)
716  {
717  Info<< type() << ": writing data to " << os.name() << endl;
718  }
719 
720  if (Pstream::parRun())
721  {
722  int tag = Pstream::msgType() + 1;
723 
724  List<Field<scalar>> magSfs(Pstream::nProcs());
725  magSfs[Pstream::myProcNo()].setSize(this->patch().size());
726  magSfs[Pstream::myProcNo()] = this->patch().magSf();
727  Pstream::gatherList(magSfs, tag);
728 
729  List<Field<Type>> values(Pstream::nProcs());
730  values[Pstream::myProcNo()].setSize(this->patch().size());
731  values[Pstream::myProcNo()] = this->refValue();
732  Pstream::gatherList(values, tag);
733 
734  List<Field<Type>> snGrads(Pstream::nProcs());
735  snGrads[Pstream::myProcNo()].setSize(this->patch().size());
736  snGrads[Pstream::myProcNo()] = this->snGrad();
737  Pstream::gatherList(snGrads, tag);
738 
739  if (Pstream::master())
740  {
741  forAll(values, proci)
742  {
743  const Field<scalar>& magSf = magSfs[proci];
744  const Field<Type>& value = values[proci];
745  const Field<Type>& snGrad = snGrads[proci];
746 
747  forAll(magSf, facei)
748  {
749  os << magSf[facei] << token::SPACE
750  << value[facei] << token::SPACE
751  << snGrad[facei] << nl;
752  }
753  }
754 
755  os.flush();
756  }
757  }
758  else
759  {
760  const Field<scalar>& magSf(this->patch().magSf());
761  const Field<Type>& value(this->refValue());
762  const Field<Type> snGrad(this->snGrad());
763 
764  forAll(magSf, facei)
765  {
766  os << magSf[facei] << token::SPACE
767  << value[facei] << token::SPACE
768  << snGrad[facei] << nl;
769  }
770 
771  os.flush();
772  }
773 }
774 
775 
776 template<class Type>
778 {
779  const volFieldType& cvf =
780  static_cast<const volFieldType&>(this->internalField());
781 
782  const typename volFieldType::Boundary& bf =
783  cvf.boundaryField();
784 
785  OFstream osPoints(baseDir()/"patchPoints");
786  OFstream osFaces(baseDir()/"patchFaces");
787 
788  if (log_)
789  {
790  Info<< "writing collated patch points to: " << osPoints.name() << nl
791  << "writing collated patch faces to: " << osFaces.name() << endl;
792  }
793 
794  forAll(bf, patchi)
795  {
796  if (isA<patchType>(bf[patchi]))
797  {
798  const patchType& pf = refCast<const patchType>(bf[patchi]);
799 
800  pf.writeGeometry(osPoints, osFaces);
801  }
802  }
803 }
804 
805 
806 template<class Type>
808 {
810 
811  os.writeKeyword("commsDir") << commsDir_ << token::END_STATEMENT << nl;
812  os.writeKeyword("file") << fName_ << token::END_STATEMENT << nl;
813  os.writeKeyword("waitInterval") << waitInterval_ << token::END_STATEMENT
814  << nl;
815  os.writeKeyword("timeOut") << timeOut_ << token::END_STATEMENT << nl;
816  os.writeKeyword("calcFrequency") << calcFrequency_ << token::END_STATEMENT
817  << nl;
818  os.writeKeyword("initByExternal") << initByExternal_ << token::END_STATEMENT
819  << nl;
820  os.writeKeyword("log") << log_ << token::END_STATEMENT << nl;
821 
822  this->writeEntry("value", os);
823 }
824 
825 
826 // ************************************************************************* //
dictionary dict
This boundary condition provides an interface to an external application. Values are transferred as p...
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
Definition: dictionary.C:431
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:428
type
Types of root.
Definition: Roots.H:52
virtual void transferData(OFstream &os) const
Transfer data for external source.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
A class for handling file names.
Definition: fileName.H:69
void inplaceRenumber(const labelUList &oldToNew, ListType &)
Inplace renumber the values of a list.
void writeGeometry() const
Write the geometry to the comms dir.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
error FatalError
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:319
const Boundary & boundaryField() const
Return const-reference to the boundary field.
commsTypes
Types of communications.
Definition: UPstream.H:64
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:60
Foam::word regionName
Output to file stream.
Definition: OFstream.H:82
void size(const label)
Override size to be inconsistent with allocated storage.
Definition: ListI.H:163
List< face > faceList
Definition: faceListFwd.H:43
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:253
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
This boundary condition provides a base class for &#39;mixed&#39; type boundary conditions, i.e. conditions that mix fixed value and patch-normal gradient conditions.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:66
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::blocking)
Evaluate the patch field.
bool readBool(Istream &)
Definition: boolIO.C:60
const fileName & name() const
Return the name of the stream.
Definition: OFstream.H:120
bool good() const
Return true if next operation might succeed.
Definition: IOstream.H:333
void write(Ostream &, const label, const dictionary &)
Write with dictionary lookup.
vectorField pointField
pointField is a vectorField.
Definition: pointFieldFwd.H:42
virtual void writeHeader(OFstream &os) const
Write header to transfer file.
dynamicFvMesh & mesh
Pre-declare SubField and related Field type.
Definition: Field.H:57
A class for handling words, derived from string.
Definition: word.H:59
Foam::fvPatchFieldMapper.
const fileName & name() const
Return the name of the stream.
Definition: IFstream.H:116
virtual void flush()
Flush stream.
Definition: OSstream.C:246
List< label > labelList
A List of labels.
Definition: labelList.H:56
static const zero Zero
Definition: zero.H:91
errorManip< error > abort(error &err)
Definition: errorManip.H:131
const fvPatch & patch() const
Return patch.
Definition: fvPatchField.H:340
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
static const char nl
Definition: Ostream.H:262
Input from file stream.
Definition: IFstream.H:81
const bool writeData(readBool(pdfDictionary.lookup("writeData")))
Ostream & writeKeyword(const keyType &)
Write the keyword followed by an appropriate indentation.
Definition: Ostream.C:54
bool mkDir(const fileName &, mode_t=0777)
Make a directory and return an error if it could not be created.
Definition: POSIX.C:297
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
virtual void readData(const fileName &transferFile)
Read data from external source.
virtual void writeData(const fileName &transferFile) const
Write data for external source - calls transferData.
void setSize(const label)
Reset size of List.
Definition: List.C:281
label patchi
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
Boundary & boundaryFieldRef()
Return a reference to the boundary field.
externalCoupledMixedFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
label timeIndex
Definition: getTimeIndex.H:4
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
messageStream Info
tmp< pointField > allPoints(const Triangulation &t)
Extract all points in vertex-index order.
volScalarField & p
bool rm(const fileName &)
Remove a file, returning true if successful otherwise false.
Definition: POSIX.C:984
A class for handling character strings derived from std::string.
Definition: string.H:74
unsigned int sleep(const unsigned int)
Sleep for the specified number of seconds.
Definition: POSIX.C:1092
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcSnGrad.C:45
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
Definition: dictionary.C:576