sampledSurfaces.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 OpenFOAM Foundation
9  Copyright (C) 2016-2021 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 "sampledSurfaces.H"
30 #include "polySurface.H"
31 
32 #include "mapPolyMesh.H"
33 #include "volFields.H"
34 #include "HashOps.H"
35 #include "ListOps.H"
36 #include "Time.H"
37 #include "UIndirectList.H"
39 
40 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44  defineTypeNameAndDebug(sampledSurfaces, 0);
45 
47  (
48  functionObject,
49  sampledSurfaces,
50  dictionary
51  );
52 }
53 
54 Foam::scalar Foam::sampledSurfaces::mergeTol_ = 1e-10;
55 
56 
57 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
58 
59 Foam::polySurface* Foam::sampledSurfaces::getRegistrySurface
60 (
61  const sampledSurface& s
62 ) const
63 {
64  return s.getRegistrySurface
65  (
66  storedObjects(),
67  IOobject::groupName(name(), s.name())
68  );
69 }
70 
71 
72 Foam::polySurface* Foam::sampledSurfaces::storeRegistrySurface
73 (
74  const sampledSurface& s
75 )
76 {
77  return s.storeRegistrySurface
78  (
79  storedObjects(),
80  IOobject::groupName(name(), s.name())
81  );
82 }
83 
84 
85 bool Foam::sampledSurfaces::removeRegistrySurface
86 (
87  const sampledSurface& s
88 )
89 {
90  return s.removeRegistrySurface
91  (
92  storedObjects(),
93  IOobject::groupName(name(), s.name())
94  );
95 }
96 
97 
98 void Foam::sampledSurfaces::countFields()
99 {
100  wordList allFields; // Just needed for warnings
101  HashTable<wordHashSet> selected;
102 
103  if (loadFromFiles_)
104  {
105  // Check files for a particular time
106  IOobjectList objects(obr_, obr_.time().timeName());
107 
108  allFields = objects.names();
109  selected = objects.classes(fieldSelection_);
110  }
111  else
112  {
113  // Check currently available fields
114  allFields = obr_.names();
115  selected = obr_.classes(fieldSelection_);
116  }
117 
118  if (Pstream::parRun())
119  {
120  Pstream::mapCombineGather(selected, HashSetOps::plusEqOp<word>());
121  Pstream::mapCombineScatter(selected);
122  }
123 
124 
125  DynamicList<label> missed(fieldSelection_.size());
126 
127  // Detect missing fields
128  forAll(fieldSelection_, i)
129  {
130  if (findStrings(fieldSelection_[i], allFields).empty())
131  {
132  missed.append(i);
133  }
134  }
135 
136  if (missed.size())
137  {
139  << nl
140  << "Cannot find "
141  << (loadFromFiles_ ? "field file" : "registered field")
142  << " matching "
143  << UIndirectList<wordRe>(fieldSelection_, missed) << endl;
144  }
145 
146 
147  // Currently only support volume and surface field types
148  label nVolumeFields = 0;
149  label nSurfaceFields = 0;
150 
151  forAllConstIters(selected, iter)
152  {
153  const word& clsName = iter.key();
154  const label n = iter.val().size();
155 
156  if (fieldTypes::volume.found(clsName))
157  {
158  nVolumeFields += n;
159  }
160  else if (sampledSurface::surfaceFieldTypes.found(clsName))
161  {
162  nSurfaceFields += n;
163  }
164  }
165 
166  // Now propagate field counts (per surface)
167  // - can update writer even when not writing without problem
168 
169  forAll(*this, surfi)
170  {
171  const sampledSurface& s = (*this)[surfi];
172  surfaceWriter& outWriter = writers_[surfi];
173 
174  outWriter.nFields
175  (
176  nVolumeFields
177  + (s.withSurfaceFields() ? nSurfaceFields : 0)
178  +
179  (
180  // Face-id field, but not if the writer manages that itself
181  !s.isPointData() && s.hasFaceIds() && !outWriter.usesFaceIds()
182  ? 1 : 0
183  )
184  );
185  }
186 }
187 
188 
189 Foam::autoPtr<Foam::surfaceWriter> Foam::sampledSurfaces::newWriter
190 (
191  word writeType,
192  const dictionary& formatOptions,
193  const dictionary& surfDict
194 )
195 {
196  // Per-surface adjustment
197  surfDict.readIfPresent<word>("surfaceFormat", writeType);
198 
199  dictionary options = formatOptions.subOrEmptyDict(writeType);
200 
201  options.merge
202  (
203  surfDict.subOrEmptyDict("formatOptions").subOrEmptyDict(writeType)
204  );
205 
206  return surfaceWriter::New(writeType, options);
207 }
208 
209 
210 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
211 
212 Foam::sampledSurfaces::sampledSurfaces
213 (
214  const word& name,
215  const Time& runTime,
216  const dictionary& dict
217 )
218 :
221  loadFromFiles_(false),
222  verbose_(false),
223  onExecute_(false),
224  outputPath_
225  (
226  time_.globalPath()/functionObject::outputPrefix/name
227  ),
228  fieldSelection_(),
229  sampleFaceScheme_(),
230  sampleNodeScheme_(),
231  writers_(),
232  actions_(),
233  nFaces_()
234 {
235  outputPath_.clean(); // Remove unneeded ".."
236 
237  read(dict);
238 }
239 
240 
241 Foam::sampledSurfaces::sampledSurfaces
242 (
243  const word& name,
244  const objectRegistry& obr,
245  const dictionary& dict,
246  const bool loadFromFiles
247 )
248 :
251  loadFromFiles_(loadFromFiles),
252  verbose_(false),
253  onExecute_(false),
254  outputPath_
255  (
256  time_.globalPath()/functionObject::outputPrefix/name
257  ),
258  fieldSelection_(),
259  sampleFaceScheme_(),
260  sampleNodeScheme_(),
261  writers_(),
262  actions_(),
263  nFaces_()
264 {
265  outputPath_.clean(); // Remove unneeded ".."
266 
267  read(dict);
268 }
269 
270 
271 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
272 
274 {
275  bool old(verbose_);
276  verbose_ = on;
277  return old;
278 }
279 
280 
282 {
284 
286  writers_.clear();
287  actions_.clear();
288  nFaces_.clear();
289  fieldSelection_.clear();
290 
291  verbose_ = dict.getOrDefault("verbose", false);
292  onExecute_ = dict.getOrDefault("sampleOnExecute", false);
293 
294  sampleFaceScheme_ =
295  dict.getOrDefault<word>("sampleScheme", "cell");
296 
297  sampleNodeScheme_ =
298  dict.getOrDefault<word>("interpolationScheme", "cellPoint");
299 
300  const entry* eptr = dict.findEntry("surfaces");
301 
302  // Surface writer type and format options
303  const word writerType =
304  (eptr ? dict.get<word>("surfaceFormat") : word::null);
305 
306  const dictionary formatOptions(dict.subOrEmptyDict("formatOptions"));
307 
308  // Store on registry?
309  const bool dfltStore = dict.getOrDefault("store", false);
310 
311  if (eptr && eptr->isDict())
312  {
313  PtrList<sampledSurface> surfs(eptr->dict().size());
314 
315  actions_.resize(surfs.size(), ACTION_WRITE); // Default action
316  writers_.resize(surfs.size());
317  nFaces_.resize(surfs.size(), Zero);
318 
319  label surfi = 0;
320 
321  for (const entry& dEntry : eptr->dict())
322  {
323  if (!dEntry.isDict())
324  {
325  continue;
326  }
327 
328  const dictionary& surfDict = dEntry.dict();
329 
332  (
333  dEntry.keyword(),
334  mesh_,
335  surfDict
336  );
337 
338  if (!surf || !surf->enabled())
339  {
340  continue;
341  }
342 
343  // Define the surface
344  surfs.set(surfi, surf);
345 
346  // Define additional action(s)
347  if (surfDict.getOrDefault("store", dfltStore))
348  {
349  actions_[surfi] |= ACTION_STORE;
350  }
351  if (surfDict.getOrDefault("surfMeshStore", false))
352  {
353  actions_[surfi] |= ACTION_SURF_MESH;
354  }
355 
356  // Define surface writer, but do NOT yet attach a surface
357  writers_.set
358  (
359  surfi,
360  newWriter(writerType, formatOptions, surfDict)
361  );
362 
363  writers_[surfi].isPointData(surfs[surfi].isPointData());
364 
365  // Use outputDir/TIME/surface-name
366  writers_[surfi].useTimeDir(true);
367  writers_[surfi].verbose(verbose_);
368 
369  ++surfi;
370  }
371 
372  surfs.resize(surfi);
373  actions_.resize(surfi);
374  writers_.resize(surfi);
375  surfaces().transfer(surfs);
376  }
377  else if (eptr)
378  {
379  // This is slightly trickier.
380  // We want access to the individual dictionaries used for construction
381 
382  DynamicList<dictionary> capture;
383 
385  (
386  eptr->stream(),
387  sampledSurface::iNewCapture(mesh_, capture)
388  );
389 
390  PtrList<sampledSurface> surfs(input.size());
391 
392  actions_.resize(surfs.size(), ACTION_WRITE); // Default action
393  writers_.resize(surfs.size());
394  nFaces_.resize(surfs.size(), Zero);
395 
396  label surfi = 0;
397 
398  forAll(input, inputi)
399  {
400  const dictionary& surfDict = capture[inputi];
401 
402  autoPtr<sampledSurface> surf = input.release(inputi);
403 
404  if (!surf || !surf->enabled())
405  {
406  continue;
407  }
408 
409  // Define the surface
410  surfs.set(surfi, surf);
411 
412  // Define additional action(s)
413  if (surfDict.getOrDefault("store", dfltStore))
414  {
415  actions_[surfi] |= ACTION_STORE;
416  }
417  if (surfDict.getOrDefault("surfMeshStore", false))
418  {
419  actions_[surfi] |= ACTION_SURF_MESH;
420  }
421 
422  // Define surface writer, but do NOT yet attach a surface
423  writers_.set
424  (
425  surfi,
426  newWriter(writerType, formatOptions, surfDict)
427  );
428 
429  writers_[surfi].isPointData(surfs[surfi].isPointData());
430 
431  // Use outputDir/TIME/surface-name
432  writers_[surfi].useTimeDir(true);
433  writers_[surfi].verbose(verbose_);
434 
435  ++surfi;
436  }
437 
438  surfs.resize(surfi);
439  actions_.resize(surfi);
440  writers_.resize(surfi);
441  surfaces().transfer(surfs);
442  }
443 
444 
445  const auto& surfs = surfaces();
446 
447  // Have some surfaces, so sort out which fields are needed and report
448 
449  if (surfs.size())
450  {
451  nFaces_.resize(surfs.size(), Zero);
452 
453  dict.readEntry("fields", fieldSelection_);
454  fieldSelection_.uniq();
455 
456  forAll(*this, surfi)
457  {
458  const sampledSurface& s = (*this)[surfi];
459 
460  if (!surfi)
461  {
462  Info<< "Sampled surface:" << nl;
463  }
464 
465  Info<< " " << s.name() << " -> " << writers_[surfi].type();
466  if (actions_[surfi] & ACTION_STORE)
467  {
468  Info<< ", store on registry ("
469  << IOobject::groupName(name(), s.name()) << ')';
470  }
471  if (actions_[surfi] & ACTION_SURF_MESH)
472  {
473  Info<< ", store as surfMesh (DEPRECATED)";
474  }
475  Info<< nl;
476  Info<< " ";
477  s.print(Info, 0);
478  Info<< nl;
479  }
480  Info<< nl;
481  }
482 
483  if (debug && Pstream::master())
484  {
485  Pout<< "sample fields:" << fieldSelection_ << nl
486  << "sample surfaces:" << nl << '(' << nl;
487 
488  for (const sampledSurface& s : surfaces())
489  {
490  Pout<< " " << s << nl;
491  }
492  Pout<< ')' << endl;
493  }
494 
495  // Ensure all surfaces and merge information are expired
496  expire(true);
497 
498  return true;
499 }
500 
501 
502 bool Foam::sampledSurfaces::performAction(unsigned request)
503 {
504  // Update surfaces and store
505  bool ok = false;
506 
507  forAll(*this, surfi)
508  {
509  sampledSurface& s = (*this)[surfi];
510 
511  if (request & actions_[surfi])
512  {
513  if (s.update())
514  {
515  writers_[surfi].expire();
516  }
517 
518  nFaces_[surfi] = returnReduce(s.faces().size(), sumOp<label>());
519 
520  ok = ok || nFaces_[surfi];
521 
522 
523  // Store surfaces (even empty ones) otherwise we miss geometry
524  // updates.
525  // Any associated fields will be removed if the size changes
526 
527  if ((request & actions_[surfi]) & ACTION_STORE)
528  {
529  storeRegistrySurface(s);
530  }
531 
532  if ((request & actions_[surfi]) & ACTION_SURF_MESH)
533  {
534  s.storeSurfMesh();
535  }
536  }
537  }
538 
539  if (!ok)
540  {
541  // No surface with an applicable action or with faces to sample
542  return true;
543  }
544 
545 
546  // Determine the per-surface number of fields, including Ids etc.
547  // Only seems to be needed for VTK legacy
548  countFields();
549 
550 
551  // Update writers
552 
553  forAll(*this, surfi)
554  {
555  const sampledSurface& s = (*this)[surfi];
556 
557  if (((request & actions_[surfi]) & ACTION_WRITE) && nFaces_[surfi])
558  {
559  surfaceWriter& outWriter = writers_[surfi];
560 
561  if (outWriter.needsUpdate())
562  {
563  outWriter.setSurface(s);
564  }
565 
566  outWriter.open(outputPath_/s.name());
567 
568  outWriter.beginTime(obr_.time());
569 
570  // Face-id field, but not if the writer manages that itself
571  if (!s.isPointData() && s.hasFaceIds() && !outWriter.usesFaceIds())
572  {
573  // This is still quite horrible.
574 
575  Field<label> ids(s.faceIds());
576 
577  if
578  (
580  (
581  !ListOps::found(ids, lessOp1<label>(0)),
582  andOp<bool>()
583  )
584  )
585  {
586  // From 0-based to 1-based, provided there are no
587  // negative ids (eg, encoded solid/side)
588 
589  ids += label(1);
590  }
591 
592  writeSurface(outWriter, ids, "Ids");
593  }
594  }
595  }
596 
597  // Sample fields
598 
599  const IOobjectList objects(obr_, obr_.time().timeName());
600 
601  performAction<volScalarField>(objects, request);
602  performAction<volVectorField>(objects, request);
603  performAction<volSphericalTensorField>(objects, request);
604  performAction<volSymmTensorField>(objects, request);
605  performAction<volTensorField>(objects, request);
606 
607  // Only bother with surface fields if a sampler supports them
608  if
609  (
610  testAny
611  (
612  surfaces(),
613  [] (const sampledSurface& s) { return s.withSurfaceFields(); }
614  )
615  )
616  {
617  performAction<surfaceScalarField>(objects, request);
618  performAction<surfaceVectorField>(objects, request);
619  performAction<surfaceSphericalTensorField>(objects, request);
620  performAction<surfaceSymmTensorField>(objects, request);
621  performAction<surfaceTensorField>(objects, request);
622  }
623 
624 
625  // Finish this time step
626  forAll(writers_, surfi)
627  {
628  if (((request & actions_[surfi]) & ACTION_WRITE) && nFaces_[surfi])
629  {
630  // Write geometry if no fields were written so that we still
631  // can have something to look at
632 
633  if (!writers_[surfi].wroteData())
634  {
635  writers_[surfi].write();
636  }
637 
638  writers_[surfi].endTime();
639  }
640  }
641 
642  return true;
643 }
644 
645 
647 {
648  if (onExecute_)
649  {
650  return performAction(ACTION_ALL & ~ACTION_WRITE);
651  }
652 
653  return true;
654 }
655 
656 
658 {
659  return performAction(ACTION_ALL);
660 }
661 
662 
664 {
665  if (&mpm.mesh() == &mesh_)
666  {
667  expire();
668  }
669 
670  // pointMesh and interpolation will have been reset in mesh.update
671 }
672 
673 
675 {
676  if (&mesh == &mesh_)
677  {
678  expire();
679  }
680 }
681 
682 
684 {
685  if (state != polyMesh::UNCHANGED)
686  {
687  // May want to use force expiration here
688  expire();
689  }
690 }
691 
692 
693 bool Foam::sampledSurfaces::needsUpdate() const
694 {
695  for (const sampledSurface& s : surfaces())
696  {
697  if (s.needsUpdate())
698  {
699  return true;
700  }
701  }
702 
703  return false;
704 }
705 
706 
707 bool Foam::sampledSurfaces::expire(const bool force)
708 {
709  // Dimension as fraction of mesh bounding box
710  const scalar mergeDim = mergeTol_ * mesh_.bounds().mag();
711 
712  label nChanged = 0;
713 
714  forAll(*this, surfi)
715  {
716  sampledSurface& s = (*this)[surfi];
717 
718  if (s.invariant() && !force)
719  {
720  // 'Invariant' - does not change when geometry does
721  continue;
722  }
723  if (s.expire())
724  {
725  ++nChanged;
726  }
727 
728  writers_[surfi].expire();
729  writers_[surfi].mergeDim(mergeDim);
730  nFaces_[surfi] = 0;
731  }
732 
733  // True if any surfaces just expired
734  return nChanged;
735 }
736 
737 
738 bool Foam::sampledSurfaces::update()
739 {
740  if (!needsUpdate())
741  {
742  return false;
743  }
744 
745  label nUpdated = 0;
746 
747  forAll(*this, surfi)
748  {
749  sampledSurface& s = (*this)[surfi];
750 
751  if (s.update())
752  {
753  ++nUpdated;
754  writers_[surfi].expire();
755  }
756 
757  nFaces_[surfi] = returnReduce(s.faces().size(), sumOp<label>());
758  }
759 
760  return nUpdated;
761 }
762 
763 
765 {
766  return mergeTol_;
767 }
768 
769 
770 Foam::scalar Foam::sampledSurfaces::mergeTol(const scalar tol)
771 {
772  const scalar prev(mergeTol_);
773  mergeTol_ = tol;
774  return prev;
775 }
776 
777 
778 // ************************************************************************* //
Foam::expressions::patchExpr::debug
int debug
Static debugging option.
Foam::Pstream::mapCombineGather
static void mapCombineGather(const List< commsStruct > &comms, Container &Values, const CombineOp &cop, const int tag, const label comm)
Definition: combineGatherScatter.C:551
Foam::addToRunTimeSelectionTable
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
Foam::entry
A keyword and a list of tokens is an 'entry'.
Definition: entry.H:67
volFields.H
runTime
engineTime & runTime
Definition: createEngineTime.H:13
Foam::sampledSurface::New
static autoPtr< sampledSurface > New(const word &name, const polyMesh &mesh, const dictionary &dict)
Return a reference to the selected surface.
Definition: sampledSurface.C:62
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:73
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
UIndirectList.H
Foam::returnReduce
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
Definition: PstreamReduceOps.H:94
s
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Definition: gmvOutputSpray.H:25
polySurface.H
Foam::sampledSurfaces::readUpdate
virtual void readUpdate(const polyMesh::readUpdateState state)
Update for changes of mesh due to readUpdate - expires the surfaces.
Definition: sampledSurfaces.C:683
Foam::Zero
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:131
Foam::DynamicList
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Definition: DynamicList.H:55
Foam::functionObjects::timeFunctionObject::storedObjects
objectRegistry & storedObjects()
Definition: timeFunctionObject.C:63
mapPolyMesh.H
Foam::read
bool read(const char *buf, int32_t &val)
Same as readInt32.
Definition: int32.H:108
Foam::sampledSurfaces::read
virtual bool read(const dictionary &dict)
Read the sampledSurfaces dictionary.
Definition: sampledSurfaces.C:281
Foam::UPstream::master
static bool master(const label communicator=worldComm)
Am I the master process.
Definition: UPstream.H:457
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:369
Foam::sampledSurfaces::updateMesh
virtual void updateMesh(const mapPolyMesh &mpm)
Update for changes of mesh - expires the surfaces.
Definition: sampledSurfaces.C:663
Foam::fieldTypes::volume
const wordList volume
Standard volume field types (scalar, vector, tensor, etc)
Foam::sampledSurface::surfaceFieldTypes
static const wordList surfaceFieldTypes
Class names for surface field types.
Definition: sampledSurface.H:130
Foam::dictionary::get
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Definition: dictionaryTemplates.C:107
Foam::Pout
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
Foam::sampledSurfaces::mergeTol
static scalar mergeTol()
Get merge tolerance.
Definition: sampledSurfaces.C:764
Foam::functionObjects::fvMeshFunctionObject
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
Definition: fvMeshFunctionObject.H:64
formatOptions
const dictionary formatOptions
Definition: createFields.H:26
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:296
Foam::sampledSurfaces::verbose
bool verbose(const bool on)
Enable/disable verbose output.
Definition: sampledSurfaces.C:273
sampledSurfaces.H
Foam::wordList
List< word > wordList
A List of words.
Definition: fileName.H:62
Foam::objectRegistry
Registry of regIOobjects.
Definition: objectRegistry.H:60
Foam::blockMeshTools::read
void read(Istream &, label &val, const dictionary &)
In-place read with dictionary lookup.
Definition: blockMeshTools.C:57
n
label n
Definition: TABSMDCalcMethod2.H:31
Foam::dictionary::merge
bool merge(const dictionary &dict)
Merge entries from the given dictionary.
Definition: dictionary.C:812
Foam::polySurface
A surface mesh consisting of general polygon faces and capable of holding fields.
Definition: polySurface.H:67
Foam::sampledSurfaces::execute
virtual bool execute()
Sample and store if the sampleOnExecute is enabled.
Definition: sampledSurfaces.C:646
Foam::Info
messageStream Info
Information stream (stdout output on master, null elsewhere)
Foam::sampledSurface::iNewCapture
Definition: sampledSurface.H:244
Foam::polyMesh::UNCHANGED
Definition: polyMesh.H:92
Foam::dictionary::readEntry
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, bool mandatory=true) const
Definition: dictionaryTemplates.C:302
Foam::sampledSurface
An abstract class for surfaces with sampling.
Definition: sampledSurface.H:121
Foam::PtrList< sampledSurface >
Foam::functionObject::outputPrefix
static word outputPrefix
Directory prefix.
Definition: functionObject.H:376
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
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam::PtrList::clear
void clear()
Clear the PtrList. Delete allocated entries and set size to zero.
Definition: PtrListI.H:97
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::findStrings
labelList findStrings(const regExp &matcher, const UList< StringType > &input, const bool invert=false)
Return list indices for strings matching the regular expression.
Definition: stringListOps.H:86
Foam::entry::dict
virtual const dictionary & dict() const =0
Return dictionary, if entry is a dictionary.
Foam::dictionary::subOrEmptyDict
dictionary subOrEmptyDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX, const bool mandatory=false) const
Definition: dictionary.C:540
Foam::sampledSurface::enabled
bool enabled() const noexcept
Surface is enabled.
Definition: sampledSurface.H:328
Foam::PtrList::resize
void resize(const label newLen)
Adjust size of PtrList.
Definition: PtrList.C:103
Foam::polyMesh::readUpdateState
readUpdateState
Enumeration defining the state of the mesh after a read update.
Definition: polyMesh.H:90
found
bool found
Definition: TABSMDCalcMethod2.H:32
Time.H
Foam::autoPtr< Foam::surfaceWriter >
Foam::functionObject::name
const word & name() const noexcept
Return the name of this functionObject.
Definition: functionObject.C:143
Foam::nl
constexpr char nl
Definition: Ostream.H:404
forAllConstIters
forAllConstIters(mixture.phases(), phase)
Definition: pEqn.H:28
Foam::Pstream::mapCombineScatter
static void mapCombineScatter(const List< commsStruct > &comms, Container &Values, const int tag, const label comm)
Scatter data. Reverse of combineGather.
Definition: combineGatherScatter.C:666
Foam::surfaceWriter::New
static autoPtr< surfaceWriter > New(const word &writeType)
Return a reference to the selected surfaceWriter.
Definition: surfaceWriter.C:64
Foam::UPstream::parRun
static bool & parRun() noexcept
Test if this a parallel run.
Definition: UPstream.H:433
Foam::dictionary::findEntry
entry * findEntry(const word &keyword, enum keyType::option matchOpt=keyType::REGEX)
Find for an entry (non-const access) with the given keyword.
Definition: dictionaryI.H:97
Foam::constant::electromagnetic::e
const dimensionedScalar e
Elementary charge.
Definition: createFields.H:11
Foam::word::null
static const word null
An empty word.
Definition: word.H:80
Foam::input
static Istream & input(Istream &is, IntRange< T > &range)
Definition: IntRanges.C:55
Foam::ListOps::found
bool found(const ListType &input, const UnaryPredicate &pred, const label start=0)
True if there is a value in the list that satisfies the predicate.
Definition: ListOpsTemplates.C:1156
Foam::mapPolyMesh
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:161
Foam::name
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
ListOps.H
Various functions to operate on Lists.
Foam::sampledSurfaces::write
virtual bool write()
Sample and write.
Definition: sampledSurfaces.C:657
Foam::IOobject::groupName
static word groupName(StringType base, const word &group)
Create dot-delimited name.group string.
Foam::dictionary::getOrDefault
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
Definition: dictionaryTemplates.C:148
Foam::mapPolyMesh::mesh
const polyMesh & mesh() const
Return polyMesh.
Definition: mapPolyMesh.H:363
Foam::defineTypeNameAndDebug
defineTypeNameAndDebug(combustionModel, 0)
WarningInFunction
#define WarningInFunction
Report a warning using Foam::Warning.
Definition: messageStream.H:328
HashOps.H
Foam::sampledSurfaces::movePoints
virtual void movePoints(const polyMesh &mesh)
Update for mesh point-motion - expires the surfaces.
Definition: sampledSurfaces.C:674