43namespace coordSetWriters
89 elemOutputType elemOutput
100 const auto& coords =
coords_[tracki];
101 const label
nPoints = coords.size();
104 if (
coords_.size() == 1 && elemOutputType::WRITE_LINES != elemOutput)
106 partName =
"sampled";
119 if (elemOutputType::WRITE_POINTS == elemOutput)
126 for (label pointi = 0; pointi <
nPoints; ++pointi)
133 if (elemOutputType::WRITE_LINES == elemOutput)
135 const label nLines = (
nPoints-1);
141 for (label pointi = 0; pointi <
nPoints; ++pointi)
152 for (label pointi = 0; pointi < nLines; ++pointi)
171 caching_(
"fieldsDict")
182 collateTimes_(options.getOrDefault(
"collateTimes", true)),
183 caching_(
"fieldsDict")
196 open(coords, outputPath);
209 open(tracks, outputPath);
233 if (!outputPath_.empty())
258 const word& fieldName,
267 if (coords_.size() != 1)
270 <<
"Attempted to write field: " << fieldName
271 <<
" (" << 1 <<
" entries) for "
272 << coords_.size() <<
" sets" <<
nl
278 elemOutputType elemOutput =
281 ? elemOutputType::WRITE_LINES
282 : elemOutputType::NO_ELEMENTS
287 return writeCollated(fieldName, fieldPtrs, elemOutput);
291 return writeUncollated(fieldName, fieldPtrs, elemOutput);
299 const word& fieldName,
308 if (coords_.size() != fieldValues.size())
311 <<
"Attempted to write field: " << fieldName
312 <<
" (" << fieldValues.size() <<
" entries) for "
313 << coords_.size() <<
" sets" <<
nl
325 elemOutputType::WRITE_LINES
330 return writeUncollated
334 elemOutputType::WRITE_LINES
Istream and Ostream manipulators taking arguments.
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
Generic templated field type.
The IOstreamOption is a simple container for options an IOstream can normally have.
An IOstream is an abstract base class for all input/output systems; be they streams,...
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
virtual Ostream & write(const char c)
Write character.
virtual Ostream & writeKeyword(const keyType &kw)
Write the keyword followed by an appropriate indentation.
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
void writeGeometry()
Write the mesh.
Base class for writing coordSet(s) and tracks with fields.
virtual void open(const fileName &outputPath)
Write separate geometry to file.
UPtrList< const coordSet > coords_
Reference to coordinate set(s)
virtual ~ensightWriter()
Destructor. Calls close()
ensightWriter()
Default construct.
virtual fileName path() const
Expected (characteristic) output file name - information only.
Holds list of sampling positions.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Ensight output with specialized write() for strings, integers and floats. Correctly handles binary wr...
static const char *const coordinates
The keyword "coordinates".
Specification of a valid Ensight file-name.
A class for handling file names.
static const fileName null
An empty fileName.
A class for handling words, derived from Foam::string.
#define defineTypeName(Type)
Define the typeName.
Convenience macros for instantiating coordSetWriter methods.
#define defineCoordSetWriterWriteFields(ThisClass)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
bool writeCoordinates(ensightGeoFile &os, const label partId, const word &partName, const label nPoints, const FieldContainer< Foam::point > &fld, bool parallel)
Write coordinates (component-wise) for the given part.
bool writeFieldComponents(ensightFile &os, const char *key, const FieldContainer< Type > &fld, bool parallel)
Write field content (component-wise) for the given ensight element type.
static void writeTrackField(ensightFile &os, const UPtrList< const Field< Type > > &fieldPtrs)
vectorField pointField
pointField is a vectorField.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.
static constexpr char close
Ensight names and component order for base types.