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