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-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 \*---------------------------------------------------------------------------*/
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.interpolate() && 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].interpolate();
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].interpolate();
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  }
477  Info<< nl;
478  }
479 
480  if (debug && Pstream::master())
481  {
482  Pout<< "sample fields:" << fieldSelection_ << nl
483  << "sample surfaces:" << nl << '(' << nl;
484 
485  for (const sampledSurface& s : surfaces())
486  {
487  Pout<< " " << s << nl;
488  }
489  Pout<< ')' << endl;
490  }
491 
492  // Ensure all surfaces and merge information are expired
493  expire(true);
494 
495  return true;
496 }
497 
498 
499 bool Foam::sampledSurfaces::performAction(unsigned request)
500 {
501  // Update surfaces and store
502  bool ok = false;
503 
504  forAll(*this, surfi)
505  {
506  sampledSurface& s = (*this)[surfi];
507 
508  if (request & actions_[surfi])
509  {
510  if (s.update())
511  {
512  writers_[surfi].expire();
513  }
514 
515  nFaces_[surfi] = returnReduce(s.faces().size(), sumOp<label>());
516 
517  ok = ok || nFaces_[surfi];
518 
519 
520  // Store surfaces (even empty ones) otherwise we miss geometry
521  // updates.
522  // Any associated fields will be removed if the size changes
523 
524  if ((request & actions_[surfi]) & ACTION_STORE)
525  {
526  storeRegistrySurface(s);
527  }
528 
529  if ((request & actions_[surfi]) & ACTION_SURF_MESH)
530  {
531  s.storeSurfMesh();
532  }
533  }
534  }
535 
536  if (!ok)
537  {
538  // No surface with an applicable action or with faces to sample
539  return true;
540  }
541 
542 
543  // Determine the per-surface number of fields, including Ids etc.
544  // Only seems to be needed for VTK legacy
545  countFields();
546 
547 
548  // Update writers
549 
550  forAll(*this, surfi)
551  {
552  const sampledSurface& s = (*this)[surfi];
553 
554  if (((request & actions_[surfi]) & ACTION_WRITE) && nFaces_[surfi])
555  {
556  surfaceWriter& outWriter = writers_[surfi];
557 
558  if (outWriter.needsUpdate())
559  {
560  outWriter.setSurface(s);
561  }
562 
563  outWriter.open(outputPath_/s.name());
564 
565  outWriter.beginTime(obr_.time());
566 
567  // Face-id field, but not if the writer manages that itself
568  if (!s.interpolate() && s.hasFaceIds() && !outWriter.usesFaceIds())
569  {
570  // This is still quite horrible.
571 
572  Field<label> ids(s.faceIds());
573 
574  if
575  (
577  (
578  !ListOps::found(ids, lessOp1<label>(0)),
579  andOp<bool>()
580  )
581  )
582  {
583  // From 0-based to 1-based, provided there are no
584  // negative ids (eg, encoded solid/side)
585 
586  ids += label(1);
587  }
588 
589  writeSurface(outWriter, ids, "Ids");
590  }
591  }
592  }
593 
594  // Sample fields
595 
596  const IOobjectList objects(obr_, obr_.time().timeName());
597 
598  performAction<volScalarField>(objects, request);
599  performAction<volVectorField>(objects, request);
600  performAction<volSphericalTensorField>(objects, request);
601  performAction<volSymmTensorField>(objects, request);
602  performAction<volTensorField>(objects, request);
603 
604  // Only bother with surface fields if a sampler supports them
605  if
606  (
607  testAny
608  (
609  surfaces(),
610  [] (const sampledSurface& s) { return s.withSurfaceFields(); }
611  )
612  )
613  {
614  performAction<surfaceScalarField>(objects, request);
615  performAction<surfaceVectorField>(objects, request);
616  performAction<surfaceSphericalTensorField>(objects, request);
617  performAction<surfaceSymmTensorField>(objects, request);
618  performAction<surfaceTensorField>(objects, request);
619  }
620 
621 
622  // Finish this time step
623  forAll(writers_, surfi)
624  {
625  if (((request & actions_[surfi]) & ACTION_WRITE) && nFaces_[surfi])
626  {
627  // Write geometry if no fields were written so that we still
628  // can have something to look at
629 
630  if (!writers_[surfi].wroteData())
631  {
632  writers_[surfi].write();
633  }
634 
635  writers_[surfi].endTime();
636  }
637  }
638 
639  return true;
640 }
641 
642 
644 {
645  if (onExecute_)
646  {
647  return performAction(ACTION_ALL & ~ACTION_WRITE);
648  }
649 
650  return true;
651 }
652 
653 
655 {
656  return performAction(ACTION_ALL);
657 }
658 
659 
661 {
662  if (&mpm.mesh() == &mesh_)
663  {
664  expire();
665  }
666 
667  // pointMesh and interpolation will have been reset in mesh.update
668 }
669 
670 
672 {
673  if (&mesh == &mesh_)
674  {
675  expire();
676  }
677 }
678 
679 
681 {
682  if (state != polyMesh::UNCHANGED)
683  {
684  // May want to use force expiration here
685  expire();
686  }
687 }
688 
689 
690 bool Foam::sampledSurfaces::needsUpdate() const
691 {
692  for (const sampledSurface& s : surfaces())
693  {
694  if (s.needsUpdate())
695  {
696  return true;
697  }
698  }
699 
700  return false;
701 }
702 
703 
704 bool Foam::sampledSurfaces::expire(const bool force)
705 {
706  // Dimension as fraction of mesh bounding box
707  const scalar mergeDim = mergeTol_ * mesh_.bounds().mag();
708 
709  label nChanged = 0;
710 
711  forAll(*this, surfi)
712  {
713  sampledSurface& s = (*this)[surfi];
714 
715  if (s.invariant() && !force)
716  {
717  // 'Invariant' - does not change when geometry does
718  continue;
719  }
720  if (s.expire())
721  {
722  ++nChanged;
723  }
724 
725  writers_[surfi].expire();
726  writers_[surfi].mergeDim() = mergeDim;
727  nFaces_[surfi] = 0;
728  }
729 
730  // True if any surfaces just expired
731  return nChanged;
732 }
733 
734 
735 bool Foam::sampledSurfaces::update()
736 {
737  if (!needsUpdate())
738  {
739  return false;
740  }
741 
742  label nUpdated = 0;
743 
744  forAll(*this, surfi)
745  {
746  sampledSurface& s = (*this)[surfi];
747 
748  if (s.update())
749  {
750  ++nUpdated;
751  writers_[surfi].expire();
752  }
753 
754  nFaces_[surfi] = returnReduce(s.faces().size(), sumOp<label>());
755  }
756 
757  return nUpdated;
758 }
759 
760 
762 {
763  return mergeTol_;
764 }
765 
766 
767 Foam::scalar Foam::sampledSurfaces::mergeTol(const scalar tol)
768 {
769  const scalar prev(mergeTol_);
770  mergeTol_ = tol;
771  return prev;
772 }
773 
774 
775 // ************************************************************************* //
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:64
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:62
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:680
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::parRun
static bool & parRun()
Test if this a parallel run, or allow modify access.
Definition: UPstream.H:434
Foam::UPstream::master
static bool master(const label communicator=worldComm)
Am I the master process.
Definition: UPstream.H:458
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:350
Foam::sampledSurfaces::updateMesh
virtual void updateMesh(const mapPolyMesh &mpm)
Update for changes of mesh - expires the surfaces.
Definition: sampledSurfaces.C:660
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:129
Foam::dictionary::get
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Definition: dictionaryTemplates.C:81
Foam::sampledSurface::enabled
bool enabled() const
Surface is enabled.
Definition: sampledSurface.H:327
Foam::Pout
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
Foam::sampledSurfaces::mergeTol
static scalar mergeTol()
Get merge tolerance.
Definition: sampledSurfaces.C:761
Foam::functionObjects::fvMeshFunctionObject
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
Definition: fvMeshFunctionObject.H:64
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:59
Foam::objectRegistry
Registry of regIOobjects.
Definition: objectRegistry.H:60
n
label n
Definition: TABSMDCalcMethod2.H:31
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:643
Foam::Info
messageStream Info
Information stream (uses stdout - output is on the master only)
Foam::name
word name(const complex &c)
Return string representation of complex.
Definition: complex.C:76
Foam::sampledSurface::iNewCapture
Definition: sampledSurface.H:243
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:314
Foam::sampledSurface
An abstract class for surfaces with sampling.
Definition: sampledSurface.H:120
Foam::PtrList< sampledSurface >
Foam::functionObject::outputPrefix
static word outputPrefix
Directory prefix.
Definition: functionObject.H:352
Foam::blockMeshTools::read
void read(Istream &, label &, const dictionary &)
In-place read with dictionary lookup.
Definition: blockMeshTools.C:33
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:121
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:76
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:608
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::nl
constexpr char nl
Definition: Ostream.H:385
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::functionObject::name
const word & name() const
Return the name of this functionObject.
Definition: functionObject.C:131
Foam::surfaceWriter::New
static autoPtr< surfaceWriter > New(const word &writeType)
Return a reference to the selected surfaceWriter.
Definition: surfaceWriter.C:64
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: dictionary.C:374
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:77
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:1163
Foam::mapPolyMesh
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:161
ListOps.H
Various functions to operate on Lists.
Foam::sampledSurfaces::write
virtual bool write()
Sample and write.
Definition: sampledSurfaces.C:654
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:122
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:303
HashOps.H
Foam::sampledSurfaces::movePoints
virtual void movePoints(const polyMesh &mesh)
Update for mesh point-motion - expires the surfaces.
Definition: sampledSurfaces.C:671