setExprFields.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) 2019-2021 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Application
27 setExprFields
28
29Group
30 grpPreProcessingUtilities
31
32Description
33 Set values on a selected set of cells/patch-faces via a dictionary.
34
35Note
36 Based on funkySetFields from
37 Bernhard Gschaider <bgschaid@hfd-research.com>
38
39\*---------------------------------------------------------------------------*/
40
41#include "argList.H"
42#include "Time.H"
43#include "fvMesh.H"
44#include "pointMesh.H"
45#include "volFields.H"
46#include "surfaceFields.H"
47#include "pointFields.H"
48#include "exprOps.H"
49#include "volumeExprDriver.H"
50#include "timeSelector.H"
51#include "readFields.H"
52
53
54using namespace Foam;
55
57
59{
60 switch (geoType)
61 {
62 case FieldAssociation::POINT_DATA : return "points"; break;
63 case FieldAssociation::FACE_DATA : return "faces"; break;
64 case FieldAssociation::VOLUME_DATA : return "cells"; break;
65 default: break;
66 }
67 return "unknown";
68}
69
70
71//- Simple control structure to with collected switches to simplify passing
72struct setExprFieldsControl
73{
74 bool dryRun;
75 bool debugParsing;
76 bool cacheVariables;
77 bool hasDimensions;
78 bool createNew;
79 bool keepPatches;
80 bool correctPatches;
81 bool correctBCs;
82 IOstreamOption streamOpt;
83};
84
85
86template<class Type>
88(
89 bool correctBCs,
91)
92{
93 if (correctBCs)
94 {
95 Info<< "Correcting boundary conditions: " << field.name() << nl;
96 field.correctBoundaryConditions();
97 }
98}
99
100
101template<class Type>
103(
104 bool correctBCs,
106)
107{
108 if (correctBCs)
109 {
110 Info<< "Correcting boundary conditions: " << field.name() << nl;
111 field.correctBoundaryConditions();
112 }
113}
114
115
116template<class Type>
118(
119 bool correctBCs,
121)
122{}
123
124
125template<class GeoField>
126bool setField
127(
128 const word& fieldName,
129 const GeoField& evaluated,
130 const boolField& fieldMask,
131 const dimensionSet& dims,
132 const wordList& valuePatches,
133
134 const setExprFieldsControl& ctrl
135)
136{
137 Info<< "setField(" << fieldName << "): "
139
140 const auto& mesh = evaluated.mesh();
141
142 tmp<GeoField> toutput;
143
144 if (ctrl.createNew)
145 {
146 // Create with zero
147 toutput = GeoField::New
148 (
149 fieldName,
150 mesh,
152 );
153 }
154 else
155 {
156 // Read
157 toutput = tmp<GeoField>::New
158 (
160 (
161 fieldName,
162 mesh.thisDb().time().timeName(),
163 mesh.thisDb(),
164 IOobject::MUST_READ,
165 IOobject::NO_WRITE,
166 false // No register
167 ),
168 mesh
169 );
170 }
171
172 auto& output = toutput.ref();
173
174 label numValuesChanged = 0;
175
176 // Internal field
177 if (fieldMask.empty())
178 {
179 // No field-mask - set entire internal field
180 numValuesChanged = output.size();
181
182 output.primitiveFieldRef() = evaluated;
183 }
184 else
185 {
186 auto& internal = output.primitiveFieldRef();
187
188 forAll(internal, idx)
189 {
190 if (fieldMask[idx])
191 {
192 internal[idx] = evaluated[idx];
193 ++numValuesChanged;
194 }
195 }
196 }
197
198 // Boundary fields
199 forAll(evaluated.boundaryField(), patchi)
200 {
201 auto& pf = output.boundaryFieldRef()[patchi];
202
203 if (pf.patch().coupled())
204 {
205 pf == evaluated.boundaryField()[patchi];
206 }
207 }
208
209 doCorrectBoundaryConditions(ctrl.correctBCs, output);
210
211 const label numTotal = returnReduce(output.size(), sumOp<label>());
212 reduce(numValuesChanged, sumOp<label>());
213
214 if (numValuesChanged == numTotal)
215 {
216 Info<< "Set all ";
217 }
218 else
219 {
220 Info<< "Set " << numValuesChanged << " of ";
221 }
222 Info<< numTotal << " values" << endl;
223
224 if (ctrl.hasDimensions)
225 {
226 Info<< "Setting dimensions to " << dims << endl;
227 output.dimensions().reset(dims);
228 }
229
230 if (ctrl.dryRun)
231 {
232 Info<< "(dry-run): Writing to " << output.name() << nl;
233 }
234 else
235 {
236 Info<< "Writing to " << output.name() << nl;
237 output.writeObject(ctrl.streamOpt, true);
238 }
239
240 return true;
241}
242
243
244void evaluate
245(
246 const fvMesh& mesh,
247 const word& fieldName,
248 const expressions::exprString& valueExpr_,
249 const expressions::exprString& maskExpr_,
250 const dictionary& dict,
251 const dimensionSet& dims,
252 const wordList& valuePatches,
253
254 const setExprFieldsControl& ctrl
255)
256{
257 word oldFieldType;
258
259 if (ctrl.createNew)
260 {
261 Info<< "Set new field: " << fieldName;
262 }
263 else
264 {
266 (
267 fieldName,
268 mesh.thisDb().time().timeName(),
269 mesh.thisDb(),
270 IOobject::MUST_READ,
271 IOobject::NO_WRITE
272 );
273 io.typeHeaderOk<IOobject>(false);
274
275 oldFieldType = io.headerClassName();
276
277 if (oldFieldType == IOobject::typeName)
278 {
280 << "Field " << fieldName << "(type: " << oldFieldType
281 << ") seems to be missing. Use 'create'" << nl
282 << exit(FatalError);
283 }
284
285 Info<< "Modify field: " << fieldName
286 << " (type " << oldFieldType << ')';
287 }
288
289
290 Info<< " time=" << mesh.thisDb().time().timeName() << nl
291 << "Expression:" << nl
292 << ">>>>" << nl
293 << valueExpr_.c_str() << nl
294 << "<<<<" << nl;
295
296 bool evalFieldMask =
297 (maskExpr_.size() && maskExpr_ != "true" && maskExpr_ != "1");
298
299 if (evalFieldMask)
300 {
301 Info<< "field-mask:" << nl
302 << ">>>>" << nl
303 << maskExpr_.c_str() << nl
304 << "<<<<" << nl;
305 }
306
307 if (ctrl.keepPatches)
308 {
309 Info<< "Keeping patches unaltered" << endl;
310 }
311 else if (!valuePatches.empty())
312 {
313 Info<< "Setting patches " << flatOutput(valuePatches)
314 << " to fixed value" << endl;
315 }
316
317 Info<< endl;
318
320
321 driver.setCaching(ctrl.cacheVariables);
322
323 driver.readDict(dict);
324
325 if (ctrl.debugParsing)
326 {
327 Info<< "Parsing expression: " << valueExpr_ << "\nand field-mask "
328 << maskExpr_ << nl << endl;
329 driver.setDebugging(true, true);
330 }
331
332
333 driver.clearVariables();
334
335
336 // Handle "field-mask" evaluation
337
338 boolField fieldMask;
340
341 if (evalFieldMask)
342 {
343 if (ctrl.debugParsing)
344 {
345 Info<< "Parsing field-mask:" << maskExpr_ << endl;
346 }
347
348 driver.parse(maskExpr_);
349 if (ctrl.debugParsing)
350 {
351 Info<< "Parsed field-mask" << endl;
352 }
353
354 if (driver.isLogical())
355 {
356 auto& result = driver.result();
357 if (result.is_bool())
358 {
359 fieldMask = result.getResult<bool>();
360 maskFieldAssoc = driver.fieldAssociation();
361 }
362 }
363
364 // Slightly pedantic...
365 driver.clearField();
366 driver.clearResult();
367
368 evalFieldMask = (maskFieldAssoc != FieldAssociation::NO_DATA);
369
370 if (!evalFieldMask)
371 {
373 << " mask: " << maskExpr_
374 << " does not evaluate to a logical expression: "
375 << driver.resultType() << nl
376 #ifdef FULLDEBUG
377 << "contents: " << fieldMask
378 #endif
379 << exit(FatalError);
380 }
381
382 if (ctrl.debugParsing)
383 {
384 Info<< "Field-mask evaluates to "
385 << fieldMask << nl;
386 }
387 }
388
389 if (ctrl.debugParsing)
390 {
391 Info<< "Parsing expression:" << valueExpr_ << endl;
392 }
393
394 driver.parse(valueExpr_);
395
396 if (ctrl.debugParsing)
397 {
398 Info<< "Parsed expression" << endl;
399 }
400
401 if (evalFieldMask && maskFieldAssoc != driver.fieldAssociation())
402 {
404 << "Mismatch between field-mask geometric type ("
405 << fieldGeoType(maskFieldAssoc) << ") and" << nl
406 << "expression geometric type ("
407 << fieldGeoType(driver.fieldAssociation()) << ')' << nl
408 << nl
409 << "expression: " << valueExpr_ << nl
410 << "field-mask: " << maskExpr_ << nl
411 << nl
412 << exit(FatalError);
413 }
414
415 if (!oldFieldType.empty() && driver.resultType() != oldFieldType)
416 {
418 << "Inconsistent types: " << fieldName << " is "
419 << oldFieldType
420 << " but the expression evaluates to "
421 << driver.resultType()
422 << exit(FatalError);
423 }
424
425 Info<< "Dispatch ... " << driver.resultType() << nl;
426
427
428 bool applied = false;
429 switch (driver.fieldAssociation())
430 {
431 #undef doLocalCode
432 #define doLocalCode(GeoField) \
433 { \
434 const auto* ptr = driver.isResultType<GeoField>(); \
435 if (ptr) \
436 { \
437 applied = setField \
438 ( \
439 fieldName, \
440 *ptr, \
441 fieldMask, \
442 dims, \
443 valuePatches, \
444 ctrl \
445 ); \
446 break; \
447 } \
448 }
449
451 {
457 break;
458 }
460 {
466 break;
467 }
469 {
475 break;
476 }
477
478 default: break;
479 #undef doLocalCode
480 }
481
482 if (!applied)
483 {
485 << "Expression evaluates to an unsupported type: "
486 << driver.resultType() << nl << nl
487 << "Expression " << valueExpr_ << nl << endl
488 << exit(FatalError);
489 }
490}
491
492
493// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
494
495int main(int argc, char *argv[])
496{
497 argList::noFunctionObjects(true);
498
499 // No -constant, no special treatment for 0/
500 timeSelector::addOptions(false);
501
502 argList::addBoolOption
503 (
504 "ascii",
505 "Write in ASCII format instead of the controlDict setting"
506 );
507 argList::addOption
508 (
509 "dict",
510 "file",
511 "Alternative dictionary for setExprFieldsDict"
512 );
513 argList::addDryRunOption
514 (
515 "Evaluate but do not write"
516 );
517 argList::addVerboseOption
518 (
519 "Additional verbosity",
520 true // Advanced option
521 );
522 argList::addOption
523 (
524 "load-fields",
525 "wordList",
526 "Specify field or fields to preload. Eg, 'T' or '(p T U)'",
527 true // Advanced option
528 );
529 argList::addOption
530 (
531 "field",
532 "name",
533 "The field to create/overwrite"
534 " (command-line operation)",
535 true // Advanced option
536 );
537 argList::addOption
538 (
539 "expression",
540 "expr",
541 "The expression to evaluate"
542 " (command-line operation)",
543 true // Advanced option
544 );
545 argList::addOption
546 (
547 "field-mask",
548 "logic",
549 "The field mask (logical condition) when to apply the expression"
550 " (command-line operation)",
551 true // Advanced option
552 );
553 argList::addOptionCompat("field-mask", {"condition", 2106});
554 argList::addOption
555 (
556 "dimensions",
557 "dims",
558 "The dimensions for created fields"
559 " (command-line operation)",
560 true // Advanced option
561 );
562 argList::addOptionCompat("dimensions", {"dimension", 2012});
563
564 argList::addBoolOption
565 (
566 "debug-parser",
567 "Additional debugging information",
568 true // Advanced option
569 );
570 argList::addBoolOption
571 (
572 "no-variable-cache",
573 "Disable caching of expression variables",
574 true // Advanced option
575 );
576 argList::addBoolOption
577 (
578 "create",
579 "Create a new field"
580 " (command-line operation)",
581 true // Advanced option
582 );
583 argList::addBoolOption
584 (
585 "keepPatches",
586 "Leave patches unaltered"
587 " (command-line operation)",
588 true // Advanced option
589 );
590 argList::addOption
591 (
592 "value-patches",
593 "(patches)",
594 "A list of patches that receive a fixed value"
595 " (command-line operation)",
596 true // Advanced option
597 );
598 argList::addBoolOption
599 (
600 "dummy-phi",
601 "Provide a zero phi field"
602 " (command-line operation)",
603 true // Advanced option
604 );
605
606 // Future?
607 #if 0
608 argList::addBoolOption
609 (
610 "noCorrectPatches",
611 ""
612 );
613 argList::addBoolOption
614 (
615 "correctResultBoundaryFields",
616 "",
617 true
618 );
619 #endif
620
621 #include "addRegionOption.H"
622 #include "setRootCase.H"
623
624 #include "createTime.H"
625
626 const word dictName("setExprFieldsDict");
627
628 instantList times = timeSelector::select0(runTime, args);
629
630 if (times.empty())
631 {
633 << "No times selected." << nl
634 << exit(FatalError);
635 }
636
637 // Disable dimension checking during operations
638 dimensionSet::checking(false);
639
640 #include "createNamedMesh.H"
641
643
644 autoPtr<IOdictionary> exprDictPtr;
645
646 // Sort out conflicts
647
648 const bool useCommandArgs = args.found("field");
649
650 if (useCommandArgs)
651 {
652 bool fatalCombination = false;
653
654 if (args.found("dict"))
655 {
656 fatalCombination = true;
658 << "Cannot specify both dictionary and command-line arguments"
659 << nl << endl;
660 }
661
662 if (args.found("create") && args.found("keepPatches"))
663 {
664 fatalCombination = true;
666 << "Cannot specify both 'create' and 'keepPatches'" << nl
667 << endl;
668 }
669
670 if (!args.found("expression"))
671 {
672 fatalCombination = true;
674 << "Missing mandatory 'expression' option'" << nl
675 << endl;
676 }
677 if (fatalCombination)
678 {
680 << exit(FatalError);
681 }
682 }
683 else
684 {
685 // Carp about inapplicable options (non-fatal)
686
687 wordHashSet badOptions
688 ({
689 "create", "keepPatches", "value-patches",
690 "field-mask", "expression", "dimensions"
691 });
692 badOptions.retain(args.options());
693
694 if (!badOptions.empty())
695 {
696 // Non-fatal (warning)
698 << "Using a dictionary. Cannot specify these options:" << nl
699 << flatOutput(badOptions.sortedToc()) << nl
700 << endl;
701 }
702
704 exprDictPtr.reset(new IOdictionary(dictIO));
705 }
706
707 forAll(times, timei)
708 {
709 runTime.setTime(times[timei], timei);
710
711 Info<< "\nTime = " << runTime.timeName() << endl;
712
713 mesh.readUpdate();
714
715 // preload fields specified on command-line
716 if (timei == 0)
717 {
718 wordList preloadFields;
719 args.readListIfPresent("load-fields", preloadFields);
720 readFieldsHandler(mesh).execute(preloadFields);
721 }
722
723 if (args.found("dummy-phi") && !dummyPhi)
724 {
725 Info<< "Adding a dummy phi" << endl;
726 dummyPhi.reset
727 (
729 (
731 (
732 "phi",
733 mesh.thisDb().time().constant(),
734 mesh.thisDb(),
735 IOobject::NO_READ,
736 IOobject::NO_WRITE
737 ),
738 mesh,
740 )
741 );
742 }
743
744 if (args.found("withFunctionObjects"))
745 {
746 runTime.functionObjects().start();
747 }
748
749 if (useCommandArgs)
750 {
751 const word fieldName(args.get<word>("field"));
752
753 Info<< "Using command-line options for "
754 << fieldName << nl << endl;
755
756 setExprFieldsControl ctrl;
757
758 ctrl.dryRun = args.dryRun();
759 ctrl.debugParsing = args.found("debug-parser");
760 ctrl.cacheVariables = !args.found("no-variable-caching");
761
762 ctrl.createNew = args.found("create");
763 ctrl.keepPatches = args.found("keepPatches");
764 ctrl.correctPatches = !args.found("noCorrectPatches");
765 ctrl.correctBCs = args.found("correctResultBoundaryFields");
766 ctrl.hasDimensions = args.found("dimensions");
767 ctrl.streamOpt.format(runTime.writeFormat());
768 if (args.found("ascii"))
769 {
770 ctrl.streamOpt.format(IOstream::ASCII);
771 }
772
773 expressions::exprString valueExpr_
774 (
775 args["expression"],
777 );
778
779 expressions::exprString maskExpr_;
780 args.readIfPresent("field-mask", maskExpr_);
781
782 dimensionSet dims;
783 if (ctrl.hasDimensions)
784 {
785 ITstream is(args.lookup("dimensions"));
786 is >> dims;
787 }
788
790 (
791 mesh,
792 fieldName,
793 valueExpr_,
794 maskExpr_,
796 dims,
797 args.getList<word>("value-patches", false),
798
799 ctrl
800 );
801 }
802 else if (exprDictPtr)
803 {
804 const dictionary& exprDict = *exprDictPtr;
805
806 // preload fields specified in dictionary
807 {
808 wordList preloadFields;
809 exprDict.readIfPresent("readFields", preloadFields);
810 readFieldsHandler(mesh).execute(preloadFields);
811 }
812
813 // Read set construct info from dictionary
814 PtrList<entry> actions(exprDict.lookup("expressions"));
815
816 for (const entry& dEntry : actions)
817 {
818 if (!dEntry.isDict())
819 {
820 Info<< "Ignore non-dictionary entry: "
821 << dEntry.keyword() << nl;
822 continue;
823 }
824
825 const dictionary& dict = dEntry.dict();
826
827 setExprFieldsControl ctrl;
828
829 ctrl.dryRun = args.dryRun();
830 ctrl.debugParsing = args.found("debug-parser");
831 ctrl.cacheVariables = !args.found("no-variable-caching");
832
833 ctrl.createNew = dict.getOrDefault("create", false);
834 ctrl.keepPatches = dict.getOrDefault("keepPatches", false);
835
836 ctrl.correctPatches = !args.found("noCorrectPatches");
837 ctrl.correctBCs = args.found("correctResultBoundaryFields");
838 ctrl.streamOpt.format(runTime.writeFormat());
839 if (args.found("ascii"))
840 {
841 ctrl.streamOpt.format(IOstream::ASCII);
842 }
843
844 if (ctrl.createNew && ctrl.keepPatches)
845 {
847 << "Cannot specify both 'create' and 'keepPatches'"
848 << nl << endl
849 << exit(FatalIOError);
850 }
851
852 // Local override
853 dict.readIfPresent
854 (
855 "correctResultBoundaryFields",
856 ctrl.correctBCs
857 );
858
859
860 const word fieldName(dict.get<word>("field"));
861
862 auto valueExpr_
863 (
864 expressions::exprString::getEntry
865 (
866 "expression",
867 dict
868 )
869 );
870
871 expressions::exprString maskExpr_;
872 {
873 const entry* eptr = dict.findCompat
874 (
875 "fieldMask", {{"condition", 2106}},
876 keyType::LITERAL
877 );
878
879 if (eptr)
880 {
881 maskExpr_.readEntry(eptr->keyword(), dict);
882 maskExpr_.trim();
883 }
884 }
885
886 dimensionSet dims;
887 {
888 const entry* dimPtr = dict.findCompat
889 (
890 "dimensions", {{"dimension", 2012}},
891 keyType::LITERAL
892 );
893 if (dimPtr)
894 {
895 dimPtr->stream() >> dims;
896 }
897 ctrl.hasDimensions = bool(dimPtr);
898 }
899
900 if (args.verbose() && !timei)
901 {
902 // Report once
903 Info<< "Processing" << dict << nl;
904 }
905
907 (
908 mesh,
909 fieldName,
910 valueExpr_,
911 maskExpr_,
912 dict,
913 dims,
914 dict.getOrDefault<wordList>("valuePatches", wordList()),
915
916 ctrl
917 );
918 }
919 }
920 else
921 {
923 << "No command-line or dictionary??" << nl << endl
924 << exit(FatalError);
925 }
926 }
927
928 Info<< "\nEnd\n" << endl;
929
930 return 0;
931}
932
933
934// ************************************************************************* //
reduce(hasMovingMesh, orOp< bool >())
Generic GeometricField class.
label retain(const HashTable< AnyType, Key, AnyHash > &other)
Retain table entries given by keys of the other hash-table.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:57
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:170
The IOstreamOption is a simple container for options an IOstream can normally have.
An input stream of tokens.
Definition: ITstream.H:56
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: PtrList.H:73
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
Definition: Time.C:717
bool empty() const noexcept
True if the UList is empty (ie, size() is zero)
Definition: UListI.H:427
T get(const label index) const
Get a value from the argument at index.
Definition: argListI.H:278
int dryRun() const noexcept
Return the dry-run flag.
Definition: argListI.H:116
const HashTable< string > & options() const noexcept
Return options.
Definition: argListI.H:165
int verbose() const noexcept
Return the verbose flag.
Definition: argListI.H:128
bool readListIfPresent(const word &optName, List< T > &list) const
Definition: argListI.H:394
bool found(const word &optName) const
Return true if the named option is found.
Definition: argListI.H:178
bool readIfPresent(const word &optName, T &val) const
Read a value from the named option if present.
Definition: argListI.H:323
ITstream lookup(const word &optName) const
Return an input stream from the named option.
Definition: argListI.H:184
List< T > getList(const label index) const
Get a List of values from the argument at index.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
void reset(autoPtr< T > &&other) noexcept
Delete managed object and set to new given pointer.
Definition: autoPtrI.H:117
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
ITstream & lookup(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Definition: dictionary.C:386
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
Dimension set for the base types, which can be used to implement rigorous dimension checking for alge...
Definition: dimensionSet.H:109
Generic dimensioned Type class.
A keyword and a list of tokens is an 'entry'.
Definition: entry.H:70
virtual ITstream & stream() const =0
Return token stream, if entry is a primitive entry.
const keyType & keyword() const noexcept
Return keyword.
Definition: entry.H:195
The field association for mesh (patch/volume) values.
void trim()
Inplace trim leading and trailing whitespace.
Definition: exprString.C:96
bool readEntry(const word &keyword, const dictionary &dict, bool mandatory=true, const bool stripComments=true)
Definition: exprString.C:103
Driver for volume, surface, point field expressions.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
A traits class, which is primarily used for primitives.
Definition: pTraits.H:59
A simple field-loader, as per the readFields function object.
Definition: readFields.H:51
bool execute(const UList< word > &fieldNames)
Definition: readFields.H:175
A class for managing temporary objects.
Definition: tmp.H:65
T & ref() const
Definition: tmpI.H:227
@ POINT_DATA
Inside PointData.
A class for handling words, derived from Foam::string.
Definition: word.H:68
rDeltaTY field()
bool
Definition: EEqn.H:20
dynamicFvMesh & mesh
engineTime & runTime
Required Variables.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Definition: error.H:473
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:453
Operations involving expressions.
const word dictName("faMeshDefinition")
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
@ VOLUME_DATA
Volume data.
const wordList internal
Standard dimensioned field types (scalar, vector, tensor, etc)
string evaluate(label fieldWidth, const std::string &s, size_t pos=0, size_t len=std::string::npos)
String evaluation with specified (positive, non-zero) field width.
Namespace for OpenFOAM.
messageStream Info
Information stream (stdout output on master, null elsewhere)
void doCorrectBoundaryConditions(bool correctBCs, PointField< Type > &field)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:372
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.
Definition: FlatOutput.H:215
word fieldGeoType(const expressions::FieldAssociation geoType)
error FatalError
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce (copy) and return value.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130
constexpr char nl
The newline '\n' character (0x0a)
Definition: Ostream.H:53
dictionary dict
surfacesMesh setField(triSurfaceToAgglom)
IOobject dictIO
Foam::argList args(argc, argv)
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:333
Foam::surfaceFields.
#define doLocalCode(GeoField)