cahn-hilliard demo does not work

Asked by Stig Larsson

I tried the Cahn-Hilliard demo. It works fine on my macbook but when running it on a fresh installation of fenics on Ubuntu 10.04.1 I get the following error:

stig@math-pc65:~/cahn-hilliard$ python demo2.py
Calling FFC just-in-time (JIT) compiler, this may take some time.
Calling FFC just-in-time (JIT) compiler, this may take some time.
Got expression dimension = 0
Traceback (most recent call last):
  File "demo2.py", line 66, in <module>
    u.interpolate(u_init)
  File "demo2.py", line 20, in eval
    values[1] = 0.0
IndexError: index out of bounds
stig@math-pc65:~/cahn-hilliard$

The poisson demo works fine on this machine.

Question information

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

Are you using the Ubuntu packages from the PPA? If so, try to replace the 'value_shape' method starting at line 21 with this:

  def dim(self):
          return 2

This is needed because the PPA contains the latest stable release of DOLFIN (version 0.9.9), while the documentation on the web page (where I assume you got demo2.py) is following the development version.

You also probably need to select quadrature representation in the form compiler options:

  parameters["form_compiler"]["representation"] = "quadrature"

Revision history for this message
Anders Logg (logg) said :
#2

On Fri, Jan 28, 2011 at 09:45:04AM -0000, Johannes Ring wrote:
> Question #143060 on DOLFIN changed:
> https://answers.launchpad.net/dolfin/+question/143060
>
> Status: Open => Answered
>
> Johannes Ring proposed the following answer:
> Are you using the Ubuntu packages from the PPA? If so, try to replace
> the 'value_shape' method starting at line 21 with this:
>
> def dim(self):
> return 2
>
> This is needed because the PPA contains the latest stable release of
> DOLFIN (version 0.9.9), while the documentation on the web page (where I
> assume you got demo2.py) is following the development version.
>
> You also probably need to select quadrature representation in the form
> compiler options:
>
> parameters["form_compiler"]["representation"] = "quadrature"

This should be resolved next week or so when we release 0.9.10.

--
Anders

Revision history for this message
Stig Larsson (stig-chalmers) said :
#3

Yes, it is from PPA.

I conclude that the mac binaries are also following the 'development
version', since demo2.py runs on my macbook.

Thanks. /stig

On 28 jan 2011 v 04, at 10.45, Johannes Ring wrote:

> Your question #143060 on DOLFIN changed:
> https://answers.launchpad.net/dolfin/+question/143060
>
> Status: Open => Answered
>
> Johannes Ring proposed the following answer:
> Are you using the Ubuntu packages from the PPA? If so, try to replace
> the 'value_shape' method starting at line 21 with this:
>
> def dim(self):
> return 2
>
> This is needed because the PPA contains the latest stable release of
> DOLFIN (version 0.9.9), while the documentation on the web page
> (where I
> assume you got demo2.py) is following the development version.
>
> You also probably need to select quadrature representation in the form
> compiler options:
>
> parameters["form_compiler"]["representation"] = "quadrature"
>
> --
> If this answers your question, please go to the following page to
> let us
> know that it is solved:
> https://answers.launchpad.net/dolfin/+question/143060/+confirm?answer_id=0
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/dolfin/+question/143060
>
> You received this question notification because you are a direct
> subscriber of the question.

Revision history for this message
Stig Larsson (stig-chalmers) said :
#4

Thanks. /stig