Go to the documentation of this file.
37 namespace functionObjects
52 Foam::label Foam::functionObjects::ensightWrite::writeAllVolFields
54 const fvMeshSubset& proxy,
60 count += writeVolFields<scalar>(proxy, acceptField);
61 count += writeVolFields<vector>(proxy, acceptField);
62 count += writeVolFields<sphericalTensor>(proxy, acceptField);
63 count += writeVolFields<symmTensor>(proxy, acceptField);
64 count += writeVolFields<tensor>(proxy, acceptField);
72 Foam::functionObjects::ensightWrite::ensightWrite
119 consecutive_ =
dict.getOrDefault(
"consecutive",
false);
121 writeOpts_.useBoundaryMesh(
dict.getOrDefault(
"boundary",
true));
122 writeOpts_.useInternalMesh(
dict.getOrDefault(
"internal",
true));
129 dict.getOrDefault(
"noPatches",
false)
130 && writeOpts_.useBoundaryMesh()
134 <<
"Use 'boundary' instead of 'noPatches' to enable/disable "
135 <<
"conversion of the boundaries" <<
endl;
139 if (
dict.readIfPresent(
"patches", list))
142 writeOpts_.patchSelection(list);
145 if (
dict.readIfPresent(
"faceZones", list))
148 writeOpts_.faceZoneSelection(list);
154 caseOpts_.nodeValues(
dict.getOrDefault(
"nodeValues",
false));
155 caseOpts_.width(
dict.getOrDefault<label>(
"width", 8));
156 caseOpts_.overwrite(
dict.getOrDefault(
"overwrite",
false));
162 dict.readIfPresent(
"directory", outputDir_);
164 if (outputDir_.size())
168 if (!outputDir_.isAbsolute())
170 outputDir_ = time_.globalPath()/outputDir_;
196 new ensightCase(outputDir_, time_.globalCaseName(), caseOpts_)
202 ensCase().nextTime(time_.value());
206 ensCase().setTime(time_.value(), time_.timeIndex());
215 ensMesh_().write(
os);
218 wordHashSet acceptField(mesh_.names<
void>(selectFields_));
221 acceptField.filterKeys
223 [](
const word&
k){
return k.ends_with(
"_0"); },
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
A class for handling words, derived from Foam::string.
bool read(const char *buf, int32_t &val)
Same as readInt32.
virtual bool end()
Do nothing at the final time-loop.
virtual bool write()
Write fields, flush case file.
virtual bool read(const dictionary &dict)
Read the ensightWrite specification.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
label writeAllVolFields(ensightCase &ensCase, const ensightMesh &ensMesh, const IOobjectList &objects, const bool nearCellValue=false)
static word outputPrefix
Directory prefix.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
virtual bool read(const dictionary &dict)
Read optional controls.
OBJstream os(runTime.globalPath()/outputName)
Macros for easy insertion into run-time selection tables.
virtual bool execute()
Do nothing.
Supports writing of ensight cases as well as providing common factory methods to open new files.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
addToRunTimeSelectionTable(functionObject, ObukhovLength, dictionary)
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
static streamFormat formatEnum(const word &formatName, const streamFormat deflt=streamFormat::ASCII)
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
label k
Boltzmann constant.
A List of wordRe with additional matching capabilities.
void clear()
Clear the list, i.e. set size to zero.
defineTypeNameAndDebug(ObukhovLength, 0)
HashSet< word, Hash< word > > wordHashSet
A HashSet of words, uses string hasher.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
static wordRes uniq(const UList< wordRe > &input)
Return a wordRes with duplicate entries filtered out.
#define WarningInFunction
Report a warning using Foam::Warning.