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$
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
Could you check whether the uploaded patch fixes the problem?
I have the functionObject defined in the controlDict.
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
One stupid question remains: how do i apply the patch?
In the right directory do
patch -p0 <ClearCaseDictionary.patch
for further details see "man patch"
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
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