[Paraview] filename_%t is not expanded to current time in Catalyst
SeongMo
seongmo.yeon at gmail.com
Wed Jan 17 09:56:44 EST 2018
Hi,
I wrote a OpenFOAM adaptor for Catalyst.
In the ParaView, the connection is made good and shows filtered flow
field as written in the python script.
However, filename_%t and image_%t is not expanded as time marching but
just write filename_0 and image_0.png.
As far as I know, %t should be replaced with current time as given in
dataDescription->SetTimeData.
Any help would be appreciated.
snippet of my OpenFOAM Adaptor code for Catalyst is as follows:
// icoFoam.C
#ifdef USE_CATALYST
Foam::HashTable<string> options = args.options();
IStringStream is(options["scriptList"]);
wordList scriptList = readList<word>(is);
OFAdaptor::Initialize(scriptList, mesh);
#endif
while (runTime.loop())
{
runTime.write();
#ifdef USE_CATALYST
OFAdaptor::CoProcess(mesh, runTime);
#endif
}
#ifdef USE_CATALYST
OFAdaptor::Finalize();
#endif
// OFAdaptor.C
void CoProcess(Foam::fvMesh& mesh, Foam::Time& runTime)
{
vtkNew<vtkCPDataDescription> dataDescription;
dataDescription->AddInput("input");
dataDescription->SetTimeData(runTime.value(),
runTime.deltaTValue());
if (runTime.end())
{
// assume that we want to all the pipelines to execute
// if it is the last time step
dataDescription->ForceOutputOn();
}
if
(Processor->RequestDataDescription(dataDescription.GetPointer()) != 0)
{
Foam::polyMesh::readUpdateState meshState = mesh.readUpdate();
if(meshState != Foam::polyMesh::UNCHANGED)
{
BuildVTKGrid(mesh);
}
UpdateVTKAttributes(mesh);
dataDescription->GetInputDescriptionByName("input")->SetGrid(multiBlockDataSet);
Processor->CoProcess(dataDescription.GetPointer());
}
}
--
SeongMo Yeon, Ph.D, Senior Engineer
Offshore Hydrodynamics Research
SAMSUNG HEAVY INDUSTRIES CO., LTD.
Central Research Institute
E-mail : seongmo.yeon at gmail.com
Tel :
--------------------------------------------------------
Fluctuat nec mergitur
-------------- next part --------------
A non-text attachment was scrubbed...
Name: script2.py
Type: text/x-python
Size: 13055 bytes
Desc: not available
URL: <https://paraview.org/pipermail/paraview/attachments/20180117/9562b46c/attachment.py>
More information about the ParaView
mailing list