Base class for writing coordinate sets with data. More...
Public Member Functions | |
TypeName ("setWriter") | |
Runtime type information. More... | |
declareRunTimeSelectionTable (autoPtr, setWriter, word,(const IOstream::streamFormat writeFormat, const IOstream::compressionType writeCompression),(writeFormat, writeCompression)) | |
declareRunTimeSelectionTable (autoPtr, setWriter, dict,(const dictionary &dict),(dict)) | |
setWriter (const IOstream::streamFormat writeFormat, const IOstream::compressionType writeCompression) | |
Construct given write options. More... | |
setWriter (const dictionary &dict) | |
Construct from dictionary. More... | |
setWriter (const setWriter &writer) | |
Construct copy. More... | |
virtual autoPtr< setWriter > | clone () const =0 |
Construct and return a clone. More... | |
virtual | ~setWriter ()=0 |
Destructor. More... | |
virtual void | write (const fileName &outputDir, const fileName &setName, const coordSet &set, const wordList &valueSetNames #define TypeValueSetsConstArg(Type, nullArg)) const =0 |
Write a coordSet and associated data. More... | |
virtual void | write (const fileName &outputDir, const fileName &setName, const coordSet &set, const wordList &valueSetNames #define TypeValueSetsConstArg(Type, nullArg)) const |
Write a coordSet and associated data. More... | |
template<class ... Args> | |
void | write (const fileName &outputDir, const fileName &setName, const coordSet &set, const Args &... args) const |
Write fields for a single surface to file. For use in code where. More... | |
template<class Type > | |
Foam::Ostream & | writeValue (const Type &value, Ostream &os, const bool align) const |
Static Public Member Functions | |
template<class Types , class Type > | |
static void | appendTypeValueSet (UPtrList< const Field< Types >> &valueSets, const Field< Type > &valueSet) |
Helper for variadic write. More... | |
template<class Type > | |
static void | appendTypeValueSet (UPtrList< const Field< Type >> &valueSets, const Field< Type > &valueSet) |
Helper for variadic write. More... | |
static void | unpackTypeValueSets (wordList &valueSetNames #define TypeValueSetsNonConstArg(Type, nullArg)) |
Helper for variadic write. More... | |
template<class Type , class ... Args> | |
static void | unpackTypeValueSets (wordList &valueSetNames #define TypeValueSetsNonConstArg(Type, nullArg) FOR_ALL_FIELD_TYPES(TypeValueSetsNonConstArg), const word &valueSetName, const Field< Type > &valueSet, Args &... args) |
Helper for variadic write. More... | |
template<class Type , class ... Args> | |
static void | unpackTypeValueSets (wordList &valueSetNames #define TypeValueSetsNonConstArg(Type, nullArg) FOR_ALL_FIELD_TYPES(TypeValueSetsNonConstArg), const wordList &valueSetNamesPart, const UPtrList< const Field< Type >> &valueSetsPart, Args &... args) |
Helper for variadic write. More... | |
template<class Type , class ... Args> | |
static void | unpackTypeValueSets (wordList &valueSetNames #define TypeValueSetsNonConstArg(Type, nullArg) FOR_ALL_FIELD_TYPES(TypeValueSetsNonConstArg), const wordList &valueSetNamesPart, const PtrList< Field< Type >> &valueSetsPart, Args &... args) |
Helper for variadic write. More... | |
static autoPtr< setWriter > | New (const word &writeType, const IOstream::streamFormat writeFormat=IOstream::ASCII, const IOstream::compressionType writeCompression=IOstream::UNCOMPRESSED) |
Select given write options. More... | |
static autoPtr< setWriter > | New (const word &writeType, const dictionary &dict) |
Select given a dictionary. More... | |
Protected Member Functions | |
virtual void | writeValueSeparator (Ostream &os) const |
Write a value separator. More... | |
virtual void | writeCoordSeparator (Ostream &os) const |
Write a coordinate separator. More... | |
virtual void | writeSegmentSeparator (Ostream &os) const |
Write a segment separator. More... | |
const List< string > & | delimiters () const |
Possible delimiters that need quoting. More... | |
Ostream & | writeWord (const word &w, Ostream &os, const bool align=false, const unsigned long alignPad=0) const |
Write a word. More... | |
template<class Type > | |
Ostream & | writeValue (const Type &value, Ostream &os, const bool align=false) const |
Write a value. More... | |
void | writeTableHeader (const coordSet &set, const wordList &valueSetNames, #define TypeValueSetsConstArg(Type, nullArg) Ostream &os, const bool align=false, const unsigned long alignPad=0) const |
Write multi-column table header. More... | |
void | writeTable (const coordSet &set, #define TypeValueSetsConstArg(Type, nullArg) Ostream &os, const bool align=false) const |
Write multi-column table of data. More... | |
Static Protected Member Functions | |
static unsigned long | columnWidth (Ostream &os) |
Width of columns in tabulated output. More... | |
Protected Attributes | |
IOstream::streamFormat | writeFormat_ |
Write format. More... | |
IOstream::compressionType | writeCompression_ |
Write compression. More... | |
autoPtr< List< string > > | delimiters_ |
Possible delimiters that need quoting. Constructed on demand from. More... | |
Base class for writing coordinate sets with data.
Example:
setWriter::New("vtk")->write ( "myDirectory", "mySet", coordSet(true, "position", points), "p", p, "U", U );
Definition at line 63 of file setWriter.H.
setWriter | ( | const IOstream::streamFormat | writeFormat, |
const IOstream::compressionType | writeCompression | ||
) |
Construct given write options.
Definition at line 248 of file setWriter.C.
setWriter | ( | const dictionary & | dict | ) |
Construct from dictionary.
Definition at line 259 of file setWriter.C.
Construct copy.
Definition at line 276 of file setWriter.C.
|
pure virtual |
Destructor.
Definition at line 347 of file setWriter.C.
|
inlinestatic |
Helper for variadic write.
Definition at line 71 of file setWriter.H.
|
inlinestatic |
Helper for variadic write.
Definition at line 83 of file setWriter.H.
|
inlinestatic |
Helper for variadic write.
Definition at line 94 of file setWriter.H.
Referenced by setWriter::unpackTypeValueSets(), setWriter::write(), and surfaceWriter::write().
|
inlinestatic |
Helper for variadic write.
Definition at line 106 of file setWriter.H.
References AppendTypeValueSet, args, Foam::FOR_ALL_FIELD_TYPES(), TypeValueSetsParameter, and setWriter::unpackTypeValueSets().
|
inlinestatic |
Helper for variadic write.
Definition at line 137 of file setWriter.H.
References AppendTypeValueSet, args, Foam::FOR_ALL_FIELD_TYPES(), forAll, TypeValueSetsParameter, and setWriter::unpackTypeValueSets().
|
inlinestatic |
Helper for variadic write.
Definition at line 171 of file setWriter.H.
References args, Foam::FOR_ALL_FIELD_TYPES(), TypeValueSetsParameter, and setWriter::unpackTypeValueSets().
|
protectedvirtual |
Write a value separator.
Reimplemented in csvSetWriter.
Definition at line 43 of file setWriter.C.
References token::SPACE.
Referenced by setWriter::writeValue().
|
protectedvirtual |
|
protectedvirtual |
Write a segment separator.
Reimplemented in rawSetWriter, and csvSetWriter.
Definition at line 55 of file setWriter.C.
References Foam::nl.
|
protected |
Possible delimiters that need quoting.
Definition at line 61 of file setWriter.C.
References OStringStream::rewind(), and OStringStream::str().
|
inlinestaticprotected |
Width of columns in tabulated output.
Definition at line 228 of file setWriter.H.
References Ostream::precision().
Referenced by setWriter::writeValue().
|
inlineprotected |
Write a value.
|
protected |
Write multi-column table header.
Definition at line 118 of file setWriter.C.
References Foam::first(), Foam::FOR_ALL_FIELD_TYPES(), forAll, coordSet::hasPointAxis(), coordSet::hasScalarAxis(), coordSet::pointName(), coordSet::scalarName(), and WriteTypeValueSetNames.
|
protected |
Write multi-column table of data.
Definition at line 192 of file setWriter.C.
References Foam::first(), Foam::FOR_ALL_FIELD_TYPES(), forAll, coordSet::hasPointAxis(), coordSet::hasScalarAxis(), coordSet::pointCoord(), coordSet::scalarCoord(), coordSet::segments(), and WriteTypeValueSets.
TypeName | ( | "setWriter" | ) |
Runtime type information.
declareRunTimeSelectionTable | ( | autoPtr | , |
setWriter | , | ||
word | , | ||
(const IOstream::streamFormat writeFormat, const IOstream::compressionType writeCompression) | , | ||
(writeFormat, writeCompression) | |||
) |
|
static |
Select given write options.
Definition at line 285 of file setWriter.C.
References Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, and Foam::nl.
Referenced by main(), populationBalanceSizeDistribution::read(), histogram::read(), layerAverage::read(), patchCutLayerAverage::read(), regionSizeDistribution::read(), streamlines::read(), sampledSets::read(), and Foam::writeEk().
|
static |
Select given a dictionary.
Definition at line 309 of file setWriter.C.
References IOstream::ASCII, IOstream::compressionEnum(), dict, IOstream::formatEnum(), dictionary::found(), dictionary::lookup(), and IOstream::UNCOMPRESSED.
Construct and return a clone.
Implemented in vtkSetWriter, rawSetWriter, noSetWriter, gnuplotSetWriter, ensightSetWriter, and csvSetWriter.
|
pure virtual |
Write a coordSet and associated data.
Implemented in vtkSetWriter, rawSetWriter, noSetWriter, gnuplotSetWriter, ensightSetWriter, and csvSetWriter.
Referenced by setWriter::write().
|
inlinevirtual |
Write a coordSet and associated data.
Reimplemented in vtkSetWriter, rawSetWriter, noSetWriter, gnuplotSetWriter, ensightSetWriter, and csvSetWriter.
Definition at line 369 of file setWriter.H.
References Foam::FOR_ALL_FIELD_TYPES(), TypeValueSetsParameter, and setWriter::write().
|
inline |
Write fields for a single surface to file. For use in code where.
the fields that are to be written are known. Takes any number of name, values arguments at the end. E.g.:
write ( Output options "myDirectory", "mySet",
Geometry coordSet(true, "position", points),
Fields "p", Field<scalar>(points.size(), ...), "U", Field<vector>(points.size(), ...) );
Definition at line 413 of file setWriter.H.
References args, DeclareTypeValueSets, Foam::FOR_ALL_FIELD_TYPES(), TypeValueSetsParameter, setWriter::unpackTypeValueSets(), and setWriter::write().
Foam::Ostream& writeValue | ( | const Type & | value, |
Ostream & | os, | ||
const bool | align | ||
) | const |
Definition at line 32 of file setWriterTemplates.C.
References setWriter::columnWidth(), Foam::component(), Foam::setw(), and setWriter::writeValueSeparator().
|
protected |
Write format.
Definition at line 203 of file setWriter.H.
|
protected |
Write compression.
Definition at line 206 of file setWriter.H.
Possible delimiters that need quoting. Constructed on demand from.
the write.*Separator functions.
Definition at line 210 of file setWriter.H.