[Paraview] How to insert annotate time info into catalyst?

SeongMo seongmo.yeon at gmail.com
Sun Jan 28 07:57:55 EST 2018


Hi, Andy Bauer,


My script should show streamline with time of cavity tutorial of 
OpenFOAM as attached.

However, my script makes a error which does not the case without 
annotate time filter.

I checked my script with your script and found the following difference.


My script:

annotateTime1Display = Show(annotateTime1, renderView1)

SetActiveSource(parallelMultiBlockDataSetWriter1)

return PipeLine()


Andy Bauer's script:

annotateTime1Display = Show(annotateTime1, renderView1)

annotateTime1Display.FontFile = ''

SetActiveSource(annotateTime1)

return PipeLine()


I guess this difference is related to my error but my question is how 
can I get my field with time plotted without setting annotateTime1 as 
active source.


Below is the error message, FYI.


Starting time loop

     Original cells:400 points:882   Additional cells:0  additional points:0

Building InternalMesh
Building BoundaryMesh
Start Catalyst
Time = 0.005

Courant Number mean: 0 max: 0
smoothSolver:  Solving for Ux, Initial residual = 1, Final residual = 
8.90511e-06, No Iterations 19
smoothSolver:  Solving for Uy, Initial residual = 0, Final residual = 0, 
No Iterations 0
DICPCG:  Solving for p, Initial residual = 1, Final residual = 
0.0492854, No Iterations 12
time step continuity errors : sum local = 0.000466513, global = 
-1.79995e-19, cumulative = -1.79995e-19
DICPCG:  Solving for p, Initial residual = 0.590864, Final residual = 
2.65225e-07, No Iterations 35
time step continuity errors : sum local = 2.74685e-09, global = 
-2.6445e-19, cumulative = -4.44444e-19
#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::sigFpe::sigHandler(int) at ??:?
#2  ? in "/usr/lib/libc.so.6"
#3  vtkSMBoundsDomain::SetDomainValues(double*) in 
"/home/user1/OpenFOAM/ThirdParty-5.x/platforms/linux64Gcc/ParaView-5.4.1/lib/paraview-5.4/libvtkPVServerManagerCore-pv5.4.so.1"
#4  vtkSMBoundsDomain::Update(vtkSMProperty*) in 
"/home/user1/OpenFOAM/ThirdParty-5.x/platforms/linux64Gcc/ParaView-5.4.1/lib/paraview-5.4/libvtkPVServerManagerCore-pv5.4.so.1"
#5  vtkSMProperty::UpdateDomains() in 
"/home/user1/OpenFOAM/ThirdParty-5.x/platforms/linux64Gcc/ParaView-5.4.1/lib/paraview-5.4/libvtkPVServerManagerCore-pv5.4.so.1"
#6 
vtkObject::vtkClassMemberCallback<vtkSMProperty>::operator()(vtkObject*, 
unsigned long, void*) in 
"/home/user1/OpenFOAM/ThirdParty-5.x/platforms/linux64Gcc/ParaView-5.4.1/lib/paraview-5.4/libvtkPVServerManagerCore-pv5.4.so.1"
#7  ? in 
"/home/user1/OpenFOAM/ThirdParty-5.x/platforms/linux64Gcc/ParaView-5.4.1/lib/paraview-5.4/libvtkCommonCore-pv5.4.so.1"
#8  vtkSMProxyProperty::Copy(vtkSMProperty*) in 
"/home/user1/OpenFOAM/ThirdParty-5.x/platforms/linux64Gcc/ParaView-5.4.1/lib/paraview-5.4/libvtkPVServerManagerCore-pv5.4.so.1"
#9  ? in 
"/home/user1/OpenFOAM/ThirdParty-5.x/platforms/linux64Gcc/ParaView-5.4.1/lib/paraview-5.4/libvtkCommonCore-pv5.4.so.1"
#10  vtkSMPropertyHelper::Set(unsigned int, vtkSMProxy*, unsigned int) 
in 
"/home/user1/OpenFOAM/ThirdParty-5.x/platforms/linux64Gcc/ParaView-5.4.1/lib/paraview-5.4/libvtkPVServerManagerCore-pv5.4.so.1"
#11 vtkSMRenderViewProxy::GetRepresentationType(vtkSMSourceProxy*, int) 
in 
"/home/user1/OpenFOAM/ThirdParty-5.x/platforms/linux64Gcc/ParaView-5.4.1/lib/paraview-5.4/libvtkPVServerManagerRendering-pv5.4.so.1"
#12  vtkSMViewProxy::CreateDefaultRepresentation(vtkSMProxy*, int) in 
"/home/user1/OpenFOAM/ThirdParty-5.x/platforms/linux64Gcc/ParaView-5.4.1/lib/paraview-5.4/libvtkPVServerManagerRendering-pv5.4.so.1"
#13 
vtkSMParaViewPipelineControllerWithRendering::Show(vtkSMSourceProxy*, 
int, vtkSMViewProxy*) in 
"/home/user1/OpenFOAM/ThirdParty-5.x/platforms/linux64Gcc/ParaView-5.4.1/lib/paraview-5.4/libvtkPVServerManagerRendering-pv5.4.so.1"
#14  ? in 
"/home/user1/OpenFOAM/ThirdParty-5.x/build/linux64Gcc/ParaView-5.4.1/lib/libvtkPVServerManagerRenderingPython27D-pv5.4.so.1"
#15  PyEval_EvalFrameEx in "/usr/lib/libpython2.7.so.1.0"
#16  PyEval_EvalCodeEx in "/usr/lib/libpython2.7.so.1.0"
#17  PyEval_EvalFrameEx in "/usr/lib/libpython2.7.so.1.0"
#18  PyEval_EvalCodeEx in "/usr/lib/libpython2.7.so.1.0"
#19  PyEval_EvalFrameEx in "/usr/lib/libpython2.7.so.1.0"
#20  PyEval_EvalCodeEx in "/usr/lib/libpython2.7.so.1.0"
#21  PyEval_EvalFrameEx in "/usr/lib/libpython2.7.so.1.0"
#22  PyEval_EvalCodeEx in "/usr/lib/libpython2.7.so.1.0"
#23  PyEval_EvalFrameEx in "/usr/lib/libpython2.7.so.1.0"
#24  PyEval_EvalCodeEx in "/usr/lib/libpython2.7.so.1.0"
#25  PyEval_EvalFrameEx in "/usr/lib/libpython2.7.so.1.0"
#26  PyEval_EvalCodeEx in "/usr/lib/libpython2.7.so.1.0"
#27  PyEval_EvalFrameEx in "/usr/lib/libpython2.7.so.1.0"
#28  PyEval_EvalFrameEx in "/usr/lib/libpython2.7.so.1.0"
#29  PyEval_EvalCodeEx in "/usr/lib/libpython2.7.so.1.0"
#30  PyEval_EvalCode in "/usr/lib/libpython2.7.so.1.0"
#31  ? in "/usr/lib/libpython2.7.so.1.0"
#32  PyRun_StringFlags in "/usr/lib/libpython2.7.so.1.0"
#33  PyRun_SimpleStringFlags in "/usr/lib/libpython2.7.so.1.0"
#34  vtkPythonInterpreter::RunSimpleString(char const*) in 
"/home/user1/OpenFOAM/ThirdParty-5.x/platforms/linux64Gcc/ParaView-5.4.1/lib/paraview-5.4/libvtkPythonInterpreter-pv5.4.so.1"
#35  vtkCPPythonScriptPipeline::CoProcess(vtkCPDataDescription*) in 
"/home/user1/OpenFOAM/ThirdParty-5.x/platforms/linux64Gcc/ParaView-5.4.1/lib/paraview-5.4/libvtkPVPythonCatalyst-pv5.4.so.1"
#36  vtkCPProcessor::CoProcess(vtkCPDataDescription*) in 
"/home/user1/OpenFOAM/ThirdParty-5.x/platforms/linux64Gcc/ParaView-5.4.1/lib/paraview-5.4/libvtkPVCatalyst-pv5.4.so.1"
#37  ? at ~/Desktop/Catalyst/icoFoam/OFAdaptor.C:1337
#38  ? at ~/Desktop/Catalyst/icoFoam/icoFoam.C:128
#39  __libc_start_main in "/usr/lib/libc.so.6"
#40  ? at ??:?
Floating point exception (core dumped)


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

On 01/27/2018 02:06 AM, Andy Bauer wrote:
> Hi SeongMo,
>
> The AnnotateTime source should work with Catalyst. See the attached 
> images and the annotatetime.py script which I used to create it.
>
> With your script, what do your images look like?
>
> You could also try what Ufuk mentioned. I think his work is based on 
> weather/climate time scales so he has to handle months, leap years, 
> etc. which ParaView itself doesn't handle naturally. You can see some 
> of the things he's done with Catalyst at 
> https://blog.kitware.com/integration-of-paraview-catalyst-with-regional-earth-system-model/.
>
> Best,
> Andy
>
> On Thu, Jan 25, 2018 at 10:47 AM, SeongMo <seongmo.yeon at gmail.com 
> <mailto:seongmo.yeon at gmail.com>> wrote:
>
>     Dear Andy Bauer,
>
>     For the color map issue, I think ParaView 5.4.1 resolved it. But,
>     I could not figure out annotate time filter issue. may be it is
>     just simple problem but I am not sure. Coprocess routine is as
>     follows and python script is attached.
>
>     It would be appreciated if you make some advice.
>
>
>     void CoProcess(Foam::fvMesh& mesh, Foam::Time& runTime)
>     {
>            vtkNew<vtkCPDataDescription> dataDescription;
>            dataDescription->AddInput("input");
>            const double time = runTime.value();
>            const unsigned int timeStep = runTime.timeIndex();
>            dataDescription->SetTimeData(time, timeStep);
>
>            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)
>                {
>                    // mesh moved? or mesh topology changed?
>                    BuildVTKGrid(mesh, true);
>                }
>                UpdateVTKAttributes(mesh);
>                dataDescription->GetInputDescriptionByName("input")->
>                    SetGrid(multiBlockDataSet);
>                Processor->CoProcess(dataDescription.GetPointer());
>            }
>     }
>
>     Regards.
>
>     SeongMo
>
>     SeongMo Yeon, Ph.D, Senior Engineer
>     Offshore Hydrodynamics Research
>     SAMSUNG HEAVY INDUSTRIES CO., LTD.
>     Central Research Institute
>     E-mail :seongmo.yeon at gmail.com <mailto:seongmo.yeon at gmail.com>
>     Tel :
>     --------------------------------------------------------
>     Fluctuat nec mergitur
>
>     On 01/25/2018 06:56 AM, Andy Bauer wrote:
>>     Hi Seongmo,
>>
>>     Please keep the conversations on the mailing list so that anyone
>>     can follow along or participate. Also, these types of things
>>     often get lost in my inbox when they don't make it back to the
>>     ParaView mailing list.
>>
>>     What version of ParaView Catalyst are you using? I think the
>>     annotate time filter should work with Catalyst but I haven't
>>     verified that. I vaguely remember others using that filter with
>>     Catalyst though. Also, I think the colormap bug was fixed. If you
>>     have a way of sharing a sample that demonstrates either of those
>>     bugs I can try taking a look at the issue.
>>
>>     Best,
>>     Andy
>>
>>     On Thu, Jan 18, 2018 at 6:40 PM, Seong Mo Yeon
>>     <seongmo.yeon at gmail.com <mailto:seongmo.yeon at gmail.com>> wrote:
>>
>>         Dear Andy Bauer
>>
>>         I have a quick question.
>>         Is it possible to have annotate time filter processed in
>>         catalyst adaptor? Current my code cannot that filter.
>>
>>         BTW, image extracted from catalyst looks different from
>>         render view of paraview at the time of writing a script.
>>         e.g., pressure colormap legend is missing.
>>
>>         Regards
>>         Seongmo
>>
>>         On 2018년 1월 18일 AM 1:17 +0900, Andy Bauer
>>         <andy.bauer at kitware.com <mailto:andy.bauer at kitware.com>>, wrote:
>>>         Hi,
>>>
>>>         My guess is that the TimeStep isn't getting set properly in
>>>         the adaptor (though it looks like it should be in
>>>         "dataDescription->SetTimeData(runTime.value(),
>>>         runTime.deltaTValue());"). My suggestion would be to add in
>>>         the following to either the RequestDataDescription() or
>>>         DoCoProcessing() methods in the python script to see what
>>>         Catalyst thinks the time step is:
>>>             print("In script2.py, the data time step is ",
>>>         datadescription.GetTimeStep())
>>>
>>>
>>>         On Wed, Jan 17, 2018 at 9:57 AM, SeongMo
>>>         <seongmo.yeon at gmail.com <mailto:seongmo.yeon at gmail.com>> wrote:
>>>
>>>             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.
>>>
>>>
>>>             FYI, python script is attached and 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
>>>             <mailto:seongmo.yeon at gmail.com>
>>>             Tel :
>>>             --------------------------------------------------------
>>>             Fluctuat nec mergitur
>>>
>>>
>>>             _______________________________________________
>>>             Powered by www.kitware.com <http://www.kitware.com>
>>>
>>>             Visit other Kitware open-source projects at
>>>             http://www.kitware.com/opensource/opensource.html
>>>             <http://www.kitware.com/opensource/opensource.html>
>>>
>>>             Please keep messages on-topic and check the ParaView
>>>             Wiki at: http://paraview.org/Wiki/ParaView
>>>             <http://paraview.org/Wiki/ParaView>
>>>
>>>             Search the list archives at:
>>>             http://markmail.org/search/?q=ParaView
>>>             <http://markmail.org/search/?q=ParaView>
>>>
>>>             Follow this link to subscribe/unsubscribe:
>>>             https://paraview.org/mailman/listinfo/paraview
>>>             <https://paraview.org/mailman/listinfo/paraview>
>>>
>>>
>>
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://paraview.org/pipermail/paraview/attachments/20180128/8a1104d9/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 197414 bytes
Desc: not available
URL: <https://paraview.org/pipermail/paraview/attachments/20180128/8a1104d9/attachment-0001.png>


More information about the ParaView mailing list