Menu

#145 (version 0.5.6) pyFoamClearCase crashes with --function-object-data option

confirmed
None
normal
crash
always
none
A Utility
0.5.4
general
2012-08-01
2012-07-31
code-red
No

pyFoamClearCase crashes when invoked with the --function-object-data option. Altough, other operations are exeecuted, see additional information.
---- additional_information ----
user@host:~/OpenFOAM/user-2.1.x/run/icoFoam/cavity$ ls
0Œ 0.1Œ 0.2Œ 0.3Œ 0.4Œ 0.5Œ constantŒ PlyParser_FoamFileParser_parsetab.pyŒ probes1Œ PyFoamHistoryŒ system
user@host:~/OpenFOAM/user-2.1.x/run/icoFoam/cavity$ pyFoamClearCase.py . --function-object-data --keep-last
Traceback (most recent call last):
Œ File "/usr/local/bin/pyFoamClearCase.py", line 5, in <module>
ŒŒŒ ClearCase()
Œ File "/usr/local/lib/python2.6/dist-packages/PyFoam/Applications/ClearCase.py", line 23, in __init__
ŒŒŒ exactNr=False)
Œ File "/usr/local/lib/python2.6/dist-packages/PyFoam/Applications/PyFoamApplication.py", line 155, in __init__
ŒŒŒ result=self.run()
Œ File "/usr/local/lib/python2.6/dist-packages/PyFoam/Applications/ClearCase.py", line 107, in run
ŒŒŒ functionObjectData=self.parser.getOptions().functionObjectData)
Œ File "/usr/local/lib/python2.6/dist-packages/PyFoam/RunDictionary/SolutionDirectory.py", line 511, in clear
ŒŒŒ functionObjectData=functionObjectData)
Œ File "/usr/local/lib/python2.6/dist-packages/PyFoam/RunDictionary/SolutionDirectory.py", line 469, in clearResults
ŒŒŒ for f in cd["functions"][0::2]:
Œ File "/usr/local/lib/python2.6/dist-packages/PyFoam/Basics/DataStructures.py", line 219, in __getitem__
ŒŒŒ return dict.__getitem__(self,key)
TypeError: unhashable type
user@host:~/OpenFOAM/user-2.1.x/run/icoFoam/cavity$ ls
0Œ 0.5Œ constantŒ PlyParser_FoamFileParser_parsetab.pyŒ probes1Œ PyFoamHistoryŒ system
user@host:~/OpenFOAM/user-2.1.x/run/icoFoam/cavity$

Discussion

  • Bernhard Gschaider

    Your case has the function objects in a dictionary, right? Old way (and still working) was that functions was a list and PyFoam still assumes that in this case.

    I'll have a look

     
  • Bernhard Gschaider

     
  • Bernhard Gschaider

    Could you check whether the uploaded patch fixes the problem?

     
  • code-red

    code-red - 2012-08-01

    I have the functionObject defined in the controlDict.

     
  • Bernhard Gschaider

    That was clear to me from the error message. But in your case it is a dictionary (starting with { and ending with }) instead of a list (starting and ending with () ).

    Anyway. Try to apply the patch and see if that fixes it

     
  • code-red

    code-red - 2012-08-01

    One stupid question remains: how do i apply the patch?

     
  • Bernhard Gschaider

    In the right directory do

    patch -p0 <ClearCaseDictionary.patch

    for further details see "man patch"

     
  • code-red

    code-red - 2012-08-01

    I am still getting this error. This is how the functionObject is defined

    functions
    {
    ŒŒŒ probes1
    ŒŒŒŒŒŒŒ {
    ŒŒŒŒŒŒŒŒŒŒŒŒŒŒŒ type probes;

    ŒŒŒŒŒŒŒŒŒŒŒŒŒŒŒ functionObjectLibs ("libsampling.so");

    ŒŒŒŒŒŒŒŒŒŒŒŒŒŒŒ dictionary probesDict;
    ŒŒŒŒŒŒŒ }
    }

    In the help text there is a copy&paste error:

    --clear-historyŒŒŒŒŒŒŒŒ Clear the PyFoamHistory-file
    --function-object-dataŒ Clear the PyFoamHistory-file

     
  • Bernhard Gschaider

    If you still see the copy/paste error then the patch was not correctly applied (check the output) because I already fixed that in the patch

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.