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
90 caseOpts_(writeOpts_.format()),
125 consecutive_ =
dict.lookupOrDefault(
"consecutive",
false);
127 writeOpts_.useBoundaryMesh(
dict.lookupOrDefault(
"boundary",
true));
128 writeOpts_.useInternalMesh(
dict.lookupOrDefault(
"internal",
true));
135 dict.lookupOrDefault(
"noPatches",
false)
136 && writeOpts_.useBoundaryMesh()
140 <<
"Use 'boundary' instead of 'noPatches' to enable/disable "
141 <<
"conversion of the boundaries" <<
endl;
145 if (
dict.readIfPresent(
"patches", list))
148 writeOpts_.patchSelection(list);
151 if (
dict.readIfPresent(
"faceZones", list))
154 writeOpts_.faceZoneSelection(list);
160 caseOpts_.nodeValues(
dict.lookupOrDefault(
"nodeValues",
false));
161 caseOpts_.width(
dict.lookupOrDefault<
label>(
"width", 8));
162 caseOpts_.overwrite(
dict.lookupOrDefault(
"overwrite",
false));
168 dict.readIfPresent(
"directory", outputDir_);
170 if (outputDir_.size())
174 if (!outputDir_.isAbsolute())
176 outputDir_ = time_.globalPath()/outputDir_;
198 if (!ensCase_.valid())
202 new ensightCase(outputDir_, time_.globalCaseName(), caseOpts_)
208 ensCase().nextTime(time_.value());
212 ensCase().setTime(time_.value(), time_.timeIndex());
221 ensMesh_().write(os);
224 wordHashSet acceptField(mesh_.names<
void>(selectFields_));
229 [](
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...
addToRunTimeSelectionTable(functionObject, add, dictionary)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
word name(const complex &c)
Return string representation of complex.
label writeAllVolFields(ensightCase &ensCase, const ensightMesh &ensMesh, const fvMeshSubsetProxy &proxy, const IOobjectList &objects, const bool nodeValues)
static word outputPrefix
Directory prefix.
label filterKeys(const UnaryPredicate &pred, const bool pruning=false)
Generalized means to filter table entries based on their keys.
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.
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.
defineTypeNameAndDebug(fvMeshFunctionObject, 0)
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
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.
HashSet< word > wordHashSet
A HashSet with word keys.
static wordRes uniq(const UList< wordRe > &input)
Return a wordRes with duplicate entries filtered out.
#define WarningInFunction
Report a warning using Foam::Warning.
static const Enum< streamFormat > formatNames
Stream format names (ascii, binary)
#define Log
Report write to Foam::Info if the local log switch is true.