204
views
0
5 months ago by
Hi!

I am trying to solve an optimization problem using IPOPT. When the definition of BC is made using classes, optimiztion runs well. When the definition is made using functions, I get the following error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/dist-packages/spyderlib/widgets/externalshell/sitecustomize.py", line 699, in runfile
execfile(filename, namespace)
File "/usr/lib/python2.7/dist-packages/spyderlib/widgets/externalshell/sitecustomize.py", line 81, in execfile
builtins.execfile(filename, *where)
File "/home/okubo/Desktop/Source_sink_tests/Elbow_2_Source_sink_opt.py", line 121, in <module>
tape.evaluate()
File "/home/okubo/.local/lib/python2.7/site-packages/pyadjoint/tape.py", line 106, in evaluate
File "/home/okubo/.local/lib/python2.7/site-packages/pyadjoint/tape.py", line 41, in wrapper
return function(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/dolfin/functions/function.py", line 355, in sub
% num_sub_spaces)
RuntimeError: Can only extract subfunctions with i = 0..2​

The problem is that with the function use, I can reach convergence and, with classes, I can not make the problem converge (note that they are the same problem).

Any ideas?

Thanks?

Okubo
Community: FEniCS Project