Can't run the newton method demos

Asked by Daniel Bare

Hello,

 I want to run the newton method examples in 'tar xvzf fenics_tutorial_examples.tar.gz'. But with all demos I run I obtain an error as

Traceback (most recent call last):
  File "pde_newton_np.py", line 19, in <module>
    degree = int(sys.argv[1])
IndexError: list index out of range

This hasn't happened in other demos, what may be the problem here?

Thanks,

regards,

Zoufine

Question information

Language:
English Edit question
Status:
Solved
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Solved by:
Anders Logg
Solved:
Last query:
Last reply:
Revision history for this message
Best Anders Logg (logg) said :
#1

On Mon, Jul 02, 2012 at 10:01:09PM -0000, Daniel Bare wrote:
> New question #202076 on DOLFIN:
> https://answers.launchpad.net/dolfin/+question/202076
>
>
> Hello,
>
>
> I want to run the newton method examples in 'tar xvzf fenics_tutorial_examples.tar.gz'. But with all demos I run I obtain an error as
>
>
> Traceback (most recent call last):
> File "pde_newton_np.py", line 19, in <module>
> degree = int(sys.argv[1])
> IndexError: list index out of range
>
> This hasn't happened in other demos, what may be the problem here?
>
> Thanks,
>
> regards,
>
> Zoufine

You need to supply an argument to that demo. It tries to read your
input from sys.argv. So try something like

python demo.py 1

--
Anders

Revision history for this message
Daniel Bare (raszoufine) said :
#2

Thanks Anders Logg, that solved my question.