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;
83 os <<
"POINT_DATA " << points.
size() <<
nl 84 <<
" FIELD attributes " << valueSetNames.
size() <<
nl;
86 forAll(valueSetNames, setI)
88 os << valueSetNames[setI] << ' ' << pTraits<Type>::nComponents <<
' ' 89 << points.
size() <<
" float" <<
nl;
109 const bool writeTracks,
116 if (valueSets.size() != valueSetNames.
size())
119 <<
"Number of variables:" << valueSetNames.
size() <<
endl 120 <<
"Number of valueSets:" << valueSets.size()
128 nPoints += tracks[i].
size();
131 os <<
"# vtk DataFile Version 2.0" <<
nl 132 << tracks[0].name() <<
nl 134 <<
"DATASET POLYDATA" <<
nl 135 <<
"POINTS " << nPoints <<
" float" <<
nl;
139 const coordSet& points = tracks[trackI];
142 const vector& pt = points[i];
143 os << pt.
x() <<
' ' << pt.
y() <<
' ' << pt.
z() <<
nl;
149 os <<
"LINES " << nTracks <<
' ' << nPoints+nTracks <<
nl;
155 const coordSet& points = tracks[trackI];
160 os <<
' ' << globalPtI;
167 os <<
"POINT_DATA " << nPoints << nl
168 <<
" FIELD attributes " << valueSetNames.
size() <<
nl;
170 forAll(valueSetNames, setI)
172 os << valueSetNames[setI] << ' ' << pTraits<Type>::nComponents <<
' ' 173 << nPoints <<
" float" <<
nl;
#define forAll(list, i)
Loop across all elements in list.
fileName getBaseName(const coordSet &, const wordList &) const
Generates filename from coordSet and sampled fields.
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.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
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.
virtual void write(const coordSet &, const wordList &, const List< const Field< Type > *> &, Ostream &) const =0
General entry point for writing.
Base class for graphics format writing. Entry points are.
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...