CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   ParaView (https://www.cfd-online.com/Forums/paraview/)
-   -   [OpenFOAM] Annoying issue of automatic "Rescale to Data Range " with paraFoam/paraview 3.12 (https://www.cfd-online.com/Forums/paraview/118294-annoying-issue-automatic-rescale-data-range-parafoam-paraview-3-12-a.html)

immortality August 18, 2013 17:42

Bravo Bruno!
it works fine now.but I have trouble with saving it.when I save state and exit from paraView and then start it and use load state another file with the same name appear in biltin part in paraView and filds became disappear! and doesn't work correctly.

wyldckat August 18, 2013 17:52

Before opening ParaView, run:
Code:

paraFoam -touch

immortality August 19, 2013 08:33

Hi Bruno
this type of error occurs again when save and load state:
Code:

ERROR: In /home/opencfd/OpenFOAM/ThirdParty-dev/ParaView-3.12.0/VTK/IO/vtkOpenFOAMReader.cxx, line 6481
vtkOpenFOAMReaderPrivate (0x2cff1b0): Error reading line 19 of /home/ehsan/Desktop/WR_3/0/T: Expected number, string or (, found Temperature


ERROR: In /home/opencfd/OpenFOAM/ThirdParty-dev/ParaView-3.12.0/VTK/IO/vtkOpenFOAMReader.cxx, line 6481
vtkOpenFOAMReaderPrivate (0x2cff1b0): Error reading line 19 of /home/ehsan/Desktop/WR_3/0/U: Expected number, string or (, found Velocity


ERROR: In /home/opencfd/OpenFOAM/ThirdParty-dev/ParaView-3.12.0/VTK/IO/vtkOpenFOAMReader.cxx, line 6481
vtkOpenFOAMReaderPrivate (0x2cff1b0): Error reading line 20 of /home/ehsan/Desktop/WR_3/0/k: Expected number, string or (, found turbulentK


ERROR: In /home/opencfd/OpenFOAM/ThirdParty-dev/ParaView-3.12.0/VTK/IO/vtkOpenFOAMReader.cxx, line 6481
vtkOpenFOAMReaderPrivate (0x2cff1b0): Error reading line 20 of /home/ehsan/Desktop/WR_3/0/omega: Expected number, string or (, found turbulentOmega


ERROR: In /home/opencfd/OpenFOAM/ThirdParty-dev/ParaView-3.12.0/VTK/IO/vtkOpenFOAMReader.cxx, line 6481
vtkOpenFOAMReaderPrivate (0x2cff1b0): Error reading line 19 of /home/ehsan/Desktop/WR_3/0/p: Expected number, string or (, found Pressure


Traceback (most recent call last):
  File "<string>", line 42, in <module>
  File "<string>", line 7, in tick
AttributeError: 'NoneType' object has no attribute 'UpdatePipeline'

Traceback (most recent call last):
  File "<string>", line 42, in <module>
  File "<string>", line 7, in tick
AttributeError: 'NoneType' object has no attribute 'UpdatePipeline'

Traceback (most recent call last):
  File "<string>", line 42, in <module>
  File "<string>", line 7, in tick
AttributeError: 'NoneType' object has no attribute 'UpdatePipeline'

ERROR: In /home/opencfd/OpenFOAM/ThirdParty-dev/ParaView-3.12.0/VTK/IO/vtkOpenFOAMReader.cxx, line 6481
vtkOpenFOAMReaderPrivate (0x245ee40): Error reading line 33568 of /home/ehsan/Desktop/WR_3/5e-06/ddt0(rhoU).gz: Inflation failed:


Traceback (most recent call last):
  File "<string>", line 42, in <module>
  File "<string>", line 7, in tick
AttributeError: 'NoneType' object has no attribute 'UpdatePipeline'

Traceback (most recent call last):
  File "<string>", line 42, in <module>
  File "<string>", line 7, in tick
AttributeError: 'NoneType' object has no attribute 'UpdatePipeline'


wyldckat August 19, 2013 10:10

Hi Ehsan,

Sorry, apparently last night I was a bit tired already and I didn't notice that I wrote "-builtin" instead of "-touch". I've corrected the previous post.

OK, to avoid future problems with the state files, I suggest that you follow this procedure:
  1. On each one of your cases, create 2 dummy files, one for each type of plug-in:
    Code:

    touch case.foam
    touch case.OpenFOAM

    The name itself doesn't matter much, what matters is the extension (".foam" or ".OpenFOAM") and that the name is the same for all of your cases.
  2. Instead of running paraFoam, run paraview:
    Code:

    paraview
  3. Now, open the file you want to use in ParaView, either "case.foam" or "case.OpenFOAM".
  4. Then configure things to your needs, such as: which fields to load, scales, legends, colours and so on.
  5. Now, before saving the state file, make sure that you are at the time instance "0".
  6. Save the state file inside the case folder.
  7. You can now repeat the same for the other file, namely "case.foam" or "case.OpenFOAM".
  8. Once you have the desired state files well saved, you should always use the paraview command to start ParaView and to have the "case.*" and state files inside each case.
    • Keep in mind that when a state file is opened, it's hard-coded to open the case file located at the full path, not the relative path. The reason why I say that you should save the state file inside the respective case, is to make it a bit easier to locate the "case.*" files.
    • With this methodology, you should be able to re-use the same state file and "case.*" files on any case.
Best regards,
Bruno

immortality September 14, 2013 05:33

why when paraview is making images for animation,it abruptly closes itself and making animations discontinues?

immortality September 14, 2013 06:18

what does this error(warning) means? :mad::(
Code:

Traceback (most recent call last):
  File "<string>", line 42, in <module>
  File "<string>", line 7, in tick
AttributeError: 'NoneType' object has no attribute 'UpdatePipeline'

Traceback (most recent call last):
  File "<string>", line 42, in <module>
  File "<string>", line 7, in tick
AttributeError: 'NoneType' object has no attribute 'UpdatePipeline'

Traceback (most recent call last):
  File "<string>", line 42, in <module>
  File "<string>", line 7, in tick
AttributeError: 'NoneType' object has no attribute 'UpdatePipeline'

Traceback (most recent call last):
  File "<string>", line 42, in <module>
  File "<string>", line 7, in tick
AttributeError: 'NoneType' object has no attribute 'UpdatePipeline'

Traceback (most recent call last):
  File "<string>", line 42, in <module>
  File "<string>", line 7, in tick
AttributeError: 'NoneType' object has no attribute 'UpdatePipeline'

Traceback (most recent call last):
  File "<string>", line 42, in <module>
  File "<string>", line 7, in tick
AttributeError: 'NoneType' object has no attribute 'UpdatePipeline'

Traceback (most recent call last):
  File "<string>", line 42, in <module>
  File "<string>", line 7, in tick
AttributeError: 'NoneType' object has no attribute 'UpdatePipeline'

Traceback (most recent call last):
  File "<string>", line 42, in <module>
  File "<string>", line 7, in tick
AttributeError: 'NoneType' object has no attribute 'UpdatePipeline'

Traceback (most recent call last):
  File "<string>", line 42, in <module>
  File "<string>", line 7, in tick
AttributeError: 'NoneType' object has no attribute 'UpdatePipeline'

Traceback (most recent call last):
  File "<string>", line 42, in <module>
  File "<string>", line 7, in tick
AttributeError: 'NoneType' object has no attribute 'UpdatePipeline'

Traceback (most recent call last):
  File "<string>", line 42, in <module>
  File "<string>", line 7, in tick
AttributeError: 'NoneType' object has no attribute 'UpdatePipeline'

Traceback (most recent call last):
  File "<string>", line 42, in <module>
  File "<string>", line 7, in tick
AttributeError: 'NoneType' object has no attribute 'UpdatePipeline'

Traceback (most recent call last):
  File "<string>", line 42, in <module>
  File "<string>", line 7, in tick
AttributeError: 'NoneType' object has no attribute 'UpdatePipeline'

Traceback (most recent call last):
  File "<string>", line 42, in <module>
  File "<string>", line 7, in tick
AttributeError: 'NoneType' object has no attribute 'UpdatePipeline'

Traceback (most recent call last):
  File "<string>", line 42, in <module>
  File "<string>", line 7, in tick
AttributeError: 'NoneType' object has no attribute 'UpdatePipeline'

Traceback (most recent call last):
  File "<string>", line 42, in <module>
  File "<string>", line 7, in tick
AttributeError: 'NoneType' object has no attribute 'UpdatePipeline'

Traceback (most recent call last):
  File "<string>", line 42, in <module>
  File "<string>", line 7, in tick
AttributeError: 'NoneType' object has no attribute 'UpdatePipeline'

Traceback (most recent call last):
  File "<string>", line 42, in <module>
  File "<string>", line 7, in tick
AttributeError: 'NoneType' object has no attribute 'UpdatePipeline'

Traceback (most recent call last):
  File "<string>", line 42, in <module>
  File "<string>", line 7, in tick
AttributeError: 'NoneType' object has no attribute 'UpdatePipeline'

Traceback (most recent call last):
  File "<string>", line 42, in <module>
  File "<string>", line 7, in tick
AttributeError: 'NoneType' object has no attribute 'UpdatePipeline'

Traceback (most recent call last):
  File "<string>", line 42, in <module>
  File "<string>", line 7, in tick
AttributeError: 'NoneType' object has no attribute 'UpdatePipeline'

Traceback (most recent call last):
  File "<string>", line 42, in <module>
  File "<string>", line 7, in tick
AttributeError: 'NoneType' object has no attribute 'UpdatePipeline'

Traceback (most recent call last):
  File "<string>", line 42, in <module>
  File "<string>", line 7, in tick
AttributeError: 'NoneType' object has no attribute 'UpdatePipeline'

Traceback (most recent call last):
  File "<string>", line 42, in <module>
  File "<string>", line 7, in tick
AttributeError: 'NoneType' object has no attribute 'UpdatePipeline'

Traceback (most recent call last):
  File "<string>", line 42, in <module>
  File "<string>", line 7, in tick
AttributeError: 'NoneType' object has no attribute 'UpdatePipeline'

Traceback (most recent call last):
  File "<string>", line 42, in <module>
  File "<string>", line 7, in tick
AttributeError: 'NoneType' object has no attribute 'UpdatePipeline'

Traceback (most recent call last):
  File "<string>", line 42, in <module>
  File "<string>", line 7, in tick
AttributeError: 'NoneType' object has no attribute 'UpdatePipeline'

Traceback (most recent call last):
  File "<string>", line 42, in <module>
  File "<string>", line 7, in tick
AttributeError: 'NoneType' object has no attribute 'UpdatePipeline'

Traceback (most recent call last):
  File "<string>", line 42, in <module>
  File "<string>", line 7, in tick
AttributeError: 'NoneType' object has no attribute 'UpdatePipeline'


immortality September 14, 2013 06:35

2 Attachment(s)
when above error is shown,the maximums in images are saved wrong,
in attachments KE.0116.jpg is saved by the python script and 116 is screenshot.
----------------------------------
then troubles are these:
1) paraFoam doesn't act good with extremes of variables,means legends are in 0,1 region
2)because of 1,I open cases by paraview -dr as dear Bruno mentioned somewhere,
3)in one case,when it reaches to a middle time,paraview suddenly closes (during saving animation),
4)in other case,paraview doesn't save correct values in ranges for maximum in saving animation

wyldckat September 14, 2013 07:54

Hi Ehsan,

Quote:

Originally Posted by immortality (Post 451634)
why when paraview is making images for animation,it abruptly closes itself and making animations discontinues?

That seems to be related to this: http://www.cfd-online.com/Forums/ope...animation.html
Use the command top in a new terminal, to confirm if the memory occupied by ParaView keeps rising. Or use "System Tools -> System Monitor" instead of top.

Quote:

Originally Posted by immortality (Post 451639)
what does this error(warning) means? :mad::(
Code:

Traceback (most recent call last):
  File "<string>", line 42, in <module>
  File "<string>", line 7, in tick
AttributeError: 'NoneType' object has no attribute 'UpdatePipeline'


I guess it's because you didn't configure properly the script used for updating the ranges. But since you didn't give a proper description of what you've done to get that error, I can only guess.

Quote:

Originally Posted by immortality (Post 451642)
when above error is shown,the maximums in images are saved wrong,
in attachments KE.0116.jpg is saved by the python script and 116 is screenshot.
----------------------------------
then troubles are these:
1) paraFoam doesn't act good with extremes of variables,means legends are in 0,1 region
2)because of 1,I open cases by paraview -dr as dear Bruno mentioned somewhere,
3)in one case,when it reaches to a middle time,paraview suddenly closes (during saving animation),
4)in other case,paraview doesn't save correct values in ranges for maximum in saving animation

2) You probably saw it here: http://www.cfd-online.com/Forums/ope...esnt-work.html

3) Explained in the first paragraph of this post I'm writing.

4) Uh... the answer after the 2nd quote?

Best regards,
Bruno

immortality September 14, 2013 11:46

Quote:

That seems to be related to this: Paraview 3.12 memory allocation problem while saving animation
Use the command top in a new terminal, to confirm if the memory occupied by ParaView keeps rising. Or use "System Tools -> System Monitor" instead of top.
it only occupies 50% of memory but closes abruptly.
Quote:

I guess it's because you didn't configure properly the script used for updating the ranges. But since you didn't give a proper description of what you've done to get that error, I can only guess.
I did what you had told :(

--------------

forgot to attach system Monitor.

wyldckat September 14, 2013 12:09

But how exactly did the memory occupancy by ParaView evolve along the animation?

And no, you didn't attach the image of the System Monitor :(

immortality September 14, 2013 12:39

1 Attachment(s)
forgot to attach system Monitor.

immortality September 14, 2013 12:46

Bruno something occupies the memory when paraview's are closed!
how can find out what it is?
it hardly attaches.

wyldckat September 14, 2013 12:54

Have you looked in the "Processes" tab on the "System Monitor"?

immortality September 14, 2013 16:24

a corrupted pidgin run had occupied the memory.

immortality September 15, 2013 04:18

dear Bruno Hi,
I added this code according to what you said and I had done before also,
Code:

from paraview.simple import *

def start_cue(self): pass

def tick(self):
    source = FindSource("WR_4.OpenFOAM")
    #This works on ParaView 4.0.1
    source.UpdatePipeline(self.GetAnimationTime())

    #This works on ParaView 3.12.0
    #source.UpdatePipeline(GetAnimationScene().TimeKeeper.Time)
   

    #The array and number of components
    #arrayName = "p"
    #arrayComponents = 1
    #component = -1
    #options for component: -1, 0, 1 and 2 => Mag, X, Y, Z

    # If it's a scalar field
    arrayName = "p"
    arrayComponents = 1
    component = 0

    #Get the look-up table for this array
    lookupTable = GetLookupTableForArray(arrayName, arrayComponents)

    #get the access to the cellData or pointData
    #data = source.GetCellDataInformation()
    data = source.GetPointDataInformation()

    #get the array and the respective min-max
    array = data.GetArray(arrayName)
    dataRange = array.GetRange(component)

    lookupTable.LockScalarRange = 1

    #Now let's hack in the range values
    lookupTable.RGBPoints[0] = dataRange[0] #min
    lookupTable.RGBPoints[4] = dataRange[1] #max


def end_cue(self): pass

but this is the error:
Code:

Traceback (most recent call last):
  File "<string>", line 47, in <module>
  File "<string>", line 9, in tick
AttributeError: 'NoneType' object has no attribute 'UpdatePipeline'
Traceback (most recent call last):
  File "<string>", line 47, in <module>
  File "<string>", line 9, in tick
AttributeError: 'NoneType' object has no attribute 'UpdatePipeline'
Traceback (most recent call last):
  File "<string>", line 47, in <module>
  File "<string>", line 9, in tick
AttributeError: 'NoneType' object has no attribute 'UpdatePipeline'
Traceback (most recent call last):
  File "<string>", line 47, in <module>
  File "<string>", line 9, in tick
AttributeError: 'NoneType' object has no attribute 'UpdatePipeline'
Traceback (most recent call last):
  File "<string>", line 47, in <module>
  File "<string>", line 9, in tick
AttributeError: 'NoneType' object has no attribute 'UpdatePipeline'
Traceback (most recent call last):
  File "<string>", line 47, in <module>
  File "<string>", line 9, in tick
AttributeError: 'NoneType' object has no attribute 'UpdatePipeline'
Traceback (most recent call last):
  File "<string>", line 47, in <module>
  File "<string>", line 9, in tick
AttributeError: 'NoneType' object has no attribute 'UpdatePipeline'
Traceback (most recent call last):
  File "<string>", line 47, in <module>
  File "<string>", line 9, in tick
AttributeError: 'NoneType' object has no attribute 'UpdatePipeline'
Traceback (most recent call last):
  File "<string>", line 47, in <module>
  File "<string>", line 9, in tick
AttributeError: 'NoneType' object has no attribute 'UpdatePipeline'
Traceback (most recent call last):
  File "<string>", line 47, in <module>
  File "<string>", line 9, in tick
AttributeError: 'NoneType' object has no attribute 'UpdatePipeline'
Traceback (most recent call last):
  File "<string>", line 47, in <module>
  File "<string>", line 9, in tick
AttributeError: 'NoneType' object has no attribute 'UpdatePipeline'
Traceback (most recent call last):
  File "<string>", line 47, in <module>
  File "<string>", line 9, in tick
AttributeError: 'NoneType' object has no attribute 'UpdatePipeline'
Traceback (most recent call last):
  File "<string>", line 47, in <module>
  File "<string>", line 9, in tick
AttributeError: 'NoneType' object has no attribute 'UpdatePipeline'
Traceback (most recent call last):
  File "<string>", line 47, in <module>
  File "<string>", line 9, in tick
AttributeError: 'NoneType' object has no attribute 'UpdatePipeline'
Traceback (most recent call last):
  File "<string>", line 47, in <module>
  File "<string>", line 9, in tick
AttributeError: 'NoneType' object has no attribute 'UpdatePipeline'
Traceback (most recent call last):
  File "<string>", line 47, in <module>
  File "<string>", line 9, in tick
AttributeError: 'NoneType' object has no attribute 'UpdatePipeline'
Traceback (most recent call last):
  File "<string>", line 47, in <module>
  File "<string>", line 9, in tick
AttributeError: 'NoneType' object has no attribute 'UpdatePipeline'

you know that I now use 4.0.1 version,is there any other changes other than what you mentioned in post #6 I have to do to solve the issue?

wyldckat September 15, 2013 05:02

Hi Ehsan,

Is the case file actually named "WR_4.OpenFOAM"? Because that error message implies that it is not.

Best regards,
Bruno

immortality September 15, 2013 06:03

no its name is case.foam,I'm mixed up with names!
is the folder name important too?
I have to make a file with name: case.foam and open it after running "paraFoam4"?

wyldckat September 15, 2013 06:10

The name and folder are not relevant to this filter. All that matters is the name you gave to it in the "Pipeline Browser" (yes, you can rename the entries there as well!).

This is because this instruction:
Code:

FindSource("WR_4.OpenFOAM")
searches the items on said "Pipeline Browser" for the name indicated.

immortality September 15, 2013 06:32

1 Attachment(s)
Bruno I made a file named case.foam in the case folder and used paraFoam4 command as you said me,copy the python code and take animations but the maximums are not correct,they don't match to real local maximum values and another issue is that again " Automatic Color scaling" doesn't work and scale bar doesn't change :( :mad:

immortality September 15, 2013 06:54

Bruno I closed that and open a new paraview and rescaling problem is resolved,I worry if I add the python code it occurs again! it was working fine before,why it has became so?


All times are GMT -4. The time now is 07:32.