63 if (!delimiters_.valid())
67 writeValueSeparator(oss);
68 delimiters_()[0] = oss.
str();
70 writeCoordSeparator(oss);
71 delimiters_()[1] = oss.
str();
73 writeSegmentSeparator(oss);
74 delimiters_()[2] = oss.
str();
87 const unsigned long alignPad
93 if (w.find(delimiters()[i]) != string::npos)
104 else if (
s.size() < columnWidth(os) - alignPad)
106 os <<
string(columnWidth(os) - alignPad -
s.size(),
' ').c_str()
111 os <<
s(columnWidth(os) - alignPad - 3).c_str() <<
"...";
128 const unsigned long alignPad
136 if (!
first) writeValueSeparator(os);
143 for (
direction cmpt = 0; cmpt < pTraits<point>::nComponents; ++ cmpt)
145 if (!
first) writeValueSeparator(os);
147 const bool separator =
153 + (separator ?
"_" :
"")
156 writeWord(w, os, align,
first*alignPad);
162 forAll(scalarValueSets, fieldi)
164 #define WriteTypeValueSetNames(Type, nullArg) \
165 if (Type##ValueSets.set(fieldi)) \
167 const label nCmpt = pTraits<Type>::nComponents; \
169 for (direction cmpt = 0; cmpt < nCmpt; ++ cmpt) \
171 if (!first) writeValueSeparator(os); \
173 const bool separator = \
174 !valueSetNames[fieldi].empty() \
175 && strlen(pTraits<Type>::componentNames[cmpt]) > 0; \
178 valueSetNames[fieldi] \
179 + (separator ? "_" : "") \
180 + pTraits<Type>::componentNames[cmpt]; \
182 writeWord(w, os, align, first*alignPad); \
187 #undef WriteTypeValueSetNames
207 writeCoordSeparator(os);
211 writeSegmentSeparator(os);
219 if (!
first) writeValueSeparator(os);
225 if (!
first) writeValueSeparator(os);
226 writeValue(set.
pointCoord(pointi), os, align);
230 forAll(scalarValueSets, fieldi)
232 #define WriteTypeValueSets(Type, nullArg) \
233 if (Type##ValueSets.set(fieldi)) \
235 if (!first) writeValueSeparator(os); \
236 writeValue(Type##ValueSets[fieldi][pointi], os, align); \
240 #undef WriteTypeValueSets
254 writeFormat_(writeFormat),
255 writeCompression_(writeCompression)
270 ?
IOstream::compressionEnum(
dict.lookup(
"writeCompression"))
278 writeFormat_(writer.writeFormat_),
279 writeCompression_(writer.writeCompression_)
287 const word& writeType,
292 typename wordConstructorTable::iterator cstrIter =
293 wordConstructorTablePtr_->find(writeType);
295 if (cstrIter == wordConstructorTablePtr_->end())
298 <<
"Unknown write type "
299 << writeType <<
nl <<
nl
300 <<
"Valid write types : " <<
endl
301 << wordConstructorTablePtr_->sortedToc()
311 const word& writeType,
316 dictConstructorTable::iterator cstrIter =
317 dictConstructorTablePtr_->find(writeType);
319 if (cstrIter == dictConstructorTablePtr_->end())
#define forAll(list, i)
Loop across all elements in list.
Macros for easy insertion into run-time selection tables.
Pre-declare SubField and related Field type.
An IOstream is an abstract base class for all input/output systems; be they streams,...
streamFormat
Enumeration for the format of data in the stream.
static streamFormat formatEnum(const word &)
Return stream format of given format name.
compressionType
Enumeration for the format of data in the stream.
static compressionType compressionEnum(const word &)
Return compression of given compression name.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Output to memory buffer stream.
void rewind()
Rewind the OStringStream.
string str() const
Return the string.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Holds list of sampling positions.
bool hasPointAxis() const
Is the coordinate axis a point?
point pointCoord(const label index) const
Get vector coordinate (axis is xyz)
word scalarName() const
Return the name of the scalar coordinates.
const labelList & segments() const
Return the segments.
word pointName() const
Return the name of the point coordinates.
bool hasScalarAxis() const
Is the coordinate axis a scalar?
scalar scalarCoord(const label index) const
Get scalar coordinate (axis is x, y, z or distance)
A list of keyword definitions, which are a keyword followed by any number of values (e....
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
Traits class for primitives.
Base class for writing coordinate sets with data.
void writeTable(const coordSet &set, #define TypeValueSetsConstArg(Type, nullArg) Ostream &os, const bool align=false) const
Write multi-column table of data.
virtual ~setWriter()=0
Destructor.
const List< string > & delimiters() const
Possible delimiters that need quoting.
virtual void writeSegmentSeparator(Ostream &os) const
Write a segment separator.
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.
static autoPtr< setWriter > New(const word &writeType, const IOstream::streamFormat writeFormat=IOstream::ASCII, const IOstream::compressionType writeCompression=IOstream::UNCOMPRESSED)
Select given write options.
virtual void writeCoordSeparator(Ostream &os) const
Write a coordinate separator.
Ostream & writeWord(const word &w, Ostream &os, const bool align=false, const unsigned long alignPad=0) const
Write a word.
virtual void writeValueSeparator(Ostream &os) const
Write a value separator.
setWriter(const IOstream::streamFormat writeFormat, const IOstream::compressionType writeCompression)
Construct given write options.
A class for handling character strings derived from std::string.
A class for handling words, derived from string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.name(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
errorManipArg< error, int > exit(error &err, const int errNo=1)
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
Ostream & endl(Ostream &os)
Add newline and flush stream.
labelList first(const UList< labelPair > &p)
defineTypeNameAndDebug(combustionModel, 0)
FOR_ALL_FIELD_TYPES(makeFieldSourceTypedef)
#define WriteTypeValueSets(Type, nullArg)
#define WriteTypeValueSetNames(Type, nullArg)
#define TypeValueSetsConstArg(Type, nullArg)