38 namespace functionObjects
56 Foam::label Foam::functionObjects::ensightWrite::writeAllVolFields
58 const fvMeshSubset& proxy,
68 #define doLocalCode(PrimitiveType) \ 69 count += writeVolFieldsImpl<PrimitiveType> \ 91 Foam::functionObjects::ensightWrite::ensightWrite
139 consecutive_ =
dict.getOrDefault(
"consecutive",
false);
141 writeOpts_.useBoundaryMesh(
dict.getOrDefault(
"boundary",
true));
142 writeOpts_.useInternalMesh(
dict.getOrDefault(
"internal",
true));
149 dict.getOrDefault(
"noPatches",
false)
150 && writeOpts_.useBoundaryMesh()
154 <<
"Use 'boundary' instead of 'noPatches' to enable/disable " 155 <<
"conversion of the boundaries" <<
endl;
159 if (
dict.readIfPresent(
"patches", list))
162 writeOpts_.patchSelection(list);
164 if (
dict.readIfPresent(
"excludePatches", list))
167 writeOpts_.patchExclude(list);
170 if (
dict.readIfPresent(
"faceZones", list))
173 writeOpts_.faceZoneSelection(list);
179 caseOpts_.nodeValues(
dict.getOrDefault(
"nodeValues",
false));
180 caseOpts_.width(
dict.getOrDefault<label>(
"width", 8));
181 caseOpts_.overwrite(
dict.getOrDefault(
"overwrite",
false));
187 dict.readIfPresent(
"directory", outputDir_);
189 if (outputDir_.size())
193 if (!outputDir_.isAbsolute())
195 outputDir_ = time_.globalPath()/outputDir_;
221 new ensightCase(outputDir_, time_.globalCaseName(), caseOpts_)
227 ensCase().nextTime(time_.value());
231 ensCase().setTime(time_.value(), time_.timeIndex());
239 autoPtr<ensightGeoFile>
os = ensCase_().newGeometry(
true);
240 ensMesh_().write(
os);
249 if (!selectFields_.empty())
251 if (!blockFields_.empty())
254 wordRes::filter filter(selectFields_, blockFields_);
256 candidateNames = mesh_.names<
void>(filter);
261 candidateNames = mesh_.names<
void>(selectFields_);
266 candidateNames.filterKeys
268 [](
const word&
k){
return k.ends_with(
"_0"); },
defineTypeNameAndDebug(ObukhovLength, 0)
Supports writing of ensight cases as well as providing common factory methods to open new files...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
label writeAllVolFields(ensightCase &ensCase, const ensightMesh &ensMesh, const IOobjectList &objects, const bool nearCellValue=false)
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual bool execute()
Do nothing.
A simple container for options an IOstream can normally have.
label k
Boltzmann constant.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Macros for easy insertion into run-time selection tables.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
void clear()
Clear the list, i.e. set size to zero.
SymmTensor< scalar > symmTensor
SymmTensor of scalars, i.e. SymmTensor<scalar>.
A class for handling words, derived from Foam::string.
A List of wordRe with additional matching capabilities.
HashSet< word, Hash< word > > wordHashSet
A HashSet of words, uses string hasher.
virtual bool end()
Do nothing at the final time-loop.
DynamicList< float > floatBufferType
The list type used for component-wise buffering.
OBJstream os(runTime.globalPath()/outputName)
addToRunTimeSelectionTable(functionObject, ObukhovLength, dictionary)
virtual bool read(const dictionary &dict)
Read the ensightWrite specification.
static wordRes uniq(const UList< wordRe > &input)
Return a wordRes with duplicate entries filtered out.
#define WarningInFunction
Report a warning using Foam::Warning.
virtual bool write()
Write fields, flush case file.
static word outputPrefix
Directory prefix.
virtual bool read(const dictionary &dict)
Read optional controls.
Mesh consisting of general polyhedral cells.
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
SphericalTensor< scalar > sphericalTensor
SphericalTensor of scalars, i.e. SphericalTensor<scalar>.
#define doLocalCode(PrimitiveType)