57 return this->
getBaseName(points, valueSetNames) +
".vtk";
70 os <<
"# vtk DataFile Version 2.0" <<
nl 73 <<
"DATASET POLYDATA" <<
nl 74 <<
"POINTS " << points.
size() <<
" float" <<
nl;
78 const vector& pt = points[i];
79 os << pt.
x() <<
' ' << pt.
y() <<
' ' << pt.
z() <<
nl;
82 os <<
"VERTICES " << points.
size() <<
' ' << 2*points.
size() <<
nl;
86 os << 1 <<
' ' << i <<
endl;
89 os <<
"POINT_DATA " << points.
size() <<
nl 90 <<
" FIELD attributes " << valueSetNames.
size() <<
nl;
92 forAll(valueSetNames, setI)
94 os << valueSetNames[setI] << ' ' << pTraits<Type>::nComponents <<
' ' 95 << points.
size() <<
" float" <<
nl;
115 const bool writeTracks,
122 if (valueSets.size() != valueSetNames.
size())
125 <<
"Number of variables:" << valueSetNames.
size() <<
endl 126 <<
"Number of valueSets:" << valueSets.size()
134 nPoints += tracks[i].
size();
137 os <<
"# vtk DataFile Version 2.0" <<
nl 138 << tracks[0].name() <<
nl 140 <<
"DATASET POLYDATA" <<
nl 141 <<
"POINTS " << nPoints <<
" float" <<
nl;
145 const coordSet& points = tracks[trackI];
148 const vector& pt = points[i];
149 os << pt.
x() <<
' ' << pt.
y() <<
' ' << pt.
z() <<
nl;
155 os <<
"LINES " << nTracks <<
' ' << nPoints+nTracks <<
nl;
161 const coordSet& points = tracks[trackI];
166 os <<
' ' << globalPtI;
173 os <<
"POINT_DATA " << nPoints << nl
174 <<
" FIELD attributes " << valueSetNames.
size() <<
nl;
176 forAll(valueSetNames, setI)
178 os << valueSetNames[setI] << ' ' << pTraits<Type>::nComponents <<
' ' 179 << nPoints <<
" float" <<
nl;
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
A class for handling file names.
virtual ~vtkSetWriter()
Destructor.
virtual void write(const coordSet &, const wordList &, const List< const Field< Type > *> &, Ostream &) const =0
General entry point for writing.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Base class for graphics format writing. Entry points are.
virtual fileName getFileName(const coordSet &, const wordList &) const
Generate file name with correct extension.
void size(const label)
Override size to be inconsistent with allocated storage.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Macros for easy insertion into run-time selection tables.
vtkSetWriter()
Construct null.
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){ const word &name=lagrangianScalarNames[i];IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Holds list of sampling positions.
Pre-declare SubField and related Field type.
virtual void write(const coordSet &, const wordList &, const List< const Field< Type > *> &, Ostream &) const
General entry point for writing.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
const word & name() const
label size() const
Return the number of elements in the UPtrList.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
fileName getBaseName(const coordSet &, const wordList &) const
Generates filename from coordSet and sampled fields.