PDE and Finite Element methods

209 views
Skip to first unread message

Hector Villafuerte

unread,
Apr 2, 2008, 7:19:58 PM4/2/08
to sage-s...@googlegroups.com
Hi,
I wonder what the current situation in SAGE is for dealing with PDE
and methods to solve them numerically, such as say Finite Elements.

A quick search threw this thread (which I'm afraid is not very conclusive):
http://groups.google.com/group/sage-devel/browse_thread/thread/15c7e426fc571e26

Thanks in advance for any pointers!
--
Hector

William Stein

unread,
Apr 2, 2008, 8:18:04 PM4/2/08
to sage-s...@googlegroups.com

I don't know, since that's not my area. However, it would be a
really good idea
to ask this same question on the scipy list (maybe this one)?:
http://projects.scipy.org/mailman/listinfo/scipy-dev

Also do a google search for
pde finite element scipy
This paper that pops up might be relevant:
http://ieeexplore.ieee.org/iel5/5992/4160244/04160257.pdf

Definitely report back. We could put the best of what you find into
Sage, if it isn't
there already...

-- William

Ondrej Certik

unread,
Apr 3, 2008, 12:53:14 PM4/3/08
to sage-s...@googlegroups.com
On Thu, Apr 3, 2008 at 2:18 AM, William Stein <wst...@gmail.com> wrote:
>
> On Wed, Apr 2, 2008 at 4:19 PM, Hector Villafuerte <hect...@gmail.com> wrote:
> >
> > Hi,
> > I wonder what the current situation in SAGE is for dealing with PDE
> > and methods to solve them numerically, such as say Finite Elements.
> >
> > A quick search threw this thread (which I'm afraid is not very conclusive):
> > http://groups.google.com/group/sage-devel/browse_thread/thread/15c7e426fc571e26
> >
> > Thanks in advance for any pointers!
>
> I don't know, since that's not my area. However, it would be a
> really good idea
> to ask this same question on the scipy list (maybe this one)?:
> http://projects.scipy.org/mailman/listinfo/scipy-dev
>
> Also do a google search for
> pde finite element scipy
> This paper that pops up might be relevant:
> http://ieeexplore.ieee.org/iel5/5992/4160244/04160257.pdf

I don't have access to this article, but from the author names, those
are people from the Simula laboratory doing SyFi.

> Definitely report back. We could put the best of what you find into
> Sage, if it isn't
> there already...

Yep, let us know what you like the best.

Writing a good FEM library is very hard. After trying fenics, syfi,
libmesh (I used that one for quite a long time), I ended up with
sfepy:

http://code.google.com/p/sfepy/

that is Python + C, maybe not so nice documented for newcomers, but
very simple, fast, doing all I need and having the author 100km from
Prague, where I live. :)

Ondrej

William Stein

unread,
Apr 4, 2008, 12:27:50 PM4/4/08
to sage-s...@googlegroups.com

Just out of curiosity, do you think it would make sense to include
sfepy in Sage? If so, would you (=Ondrej) be interested in being
spkg maintainer for it?

-- William

Ondrej Certik

unread,
Apr 4, 2008, 4:36:45 PM4/4/08
to sage-s...@googlegroups.com, Robert Cimrman

I think it's too early for that, but just to be sure, CCing Robert,
the main maintainer of sfepy. I think a good measure is when there are
enough
people using it (i.e. on the mailinglist, currently 11).

Ondrej

Ondrej Certik

unread,
Apr 7, 2008, 9:07:05 AM4/7/08
to sage-s...@googlegroups.com, Robert Cimrman
Forwarding Robert's answer, he had some problems with sending the email.


---------- Forwarded message ----------
From: Robert Cimrman <>
Date: Mon, Apr 7, 2008 at 1:51 PM
Subject: Re: [sage-support] Re: PDE and Finite Element methods
To: Ondrej Certik <>
Cc: sage-s...@googlegroups.com

Ondrej Certik wrote:

I would be very glad if sfepy would get into sage, but agree that it
is probably too soon now. I am available at IRC channel #sfepy at
Freenode (usually from 10 to 18 CE(S)T), so we can discuss there what
requirements there are for a code to be included.

11 people on the list might look not so small, but me (and now
Ondrej) are the only people actually writing the code, with one of my
colleagues now starting too (even applying for a post-doc grant
project).

I see two principal areas that need to be addressed first: the
documentation and the behaviour on failures/exceptions (the code works
very well, but behaves as garbage-in/garbage-out and it is not easy
for a casual user to recognize what in her/his input was wrong). No
matter what the results of this discussion is, these must be done
anyway, but every feedback is welcome!

best regards,
Robert

David Joyner

unread,
Apr 7, 2008, 9:12:38 AM4/7/08
to sage-s...@googlegroups.com, sage-...@googlegroups.com
Hector told me (in a separate email) about DOLFIN
http://www.fenics.org/wiki/FEniCS_Project
which is built on numpy. Although I had trouble installing it,
I'm wondering if anyone else on this list has been able to try it out?

Cross-posting to sage-devel.

Ondrej Certik

unread,
Apr 7, 2008, 9:25:56 AM4/7/08
to sage-...@googlegroups.com, sage-s...@googlegroups.com
On Mon, Apr 7, 2008 at 3:12 PM, David Joyner <wdjo...@gmail.com> wrote:
>
> Hector told me (in a separate email) about DOLFIN
> http://www.fenics.org/wiki/FEniCS_Project
> which is built on numpy. Although I had trouble installing it,
> I'm wondering if anyone else on this list has been able to try it out?

Yes, I did. This is the code developed by people at Simula. It works
nice, but it's quite difficult to install. I generally prefer smaller
tools, if I can get the job done.

Ondrej

Mike Hansen

unread,
Apr 7, 2008, 9:41:11 AM4/7/08
to sage-s...@googlegroups.com
On Mon, Apr 7, 2008 at 6:25 AM, Ondrej Certik <ond...@certik.cz> wrote:
> Yes, I did. This is the code developed by people at Simula. It works
> nice, but it's quite difficult to install. I generally prefer smaller
> tools, if I can get the job done.
>
> Ondrej

Other than size and build issues, are the two projects equivalent
feature / speed-wise?

--Mike

Ondrej Certik

unread,
Apr 7, 2008, 10:08:11 AM4/7/08
to sage-s...@googlegroups.com, Robert Cimrman

To my purposes, sfepy is better than fenics, because sfepy is in
python (and can do all I need). As to speed, that's about the same,
because the mainloop of sfepy for the assembly is in pure C, without
any python callbacks. Also because it's smaller, I find it simpler to
use. But Fenics definitely is also good and have it's users.

Ondrej

David Joyner

unread,
Apr 7, 2008, 10:15:09 AM4/7/08
to sage-s...@googlegroups.com


Feature-wise, is Fenics better than sfepy? You did seem to indicate sfepy
is smaller. Is it because Fenics does more? Also, isn't Fenics also in
C+Python?


>
> Ondrej
>
>
>
> >
>

Ondrej Certik

unread,
Apr 7, 2008, 10:47:39 AM4/7/08
to sage-s...@googlegroups.com, Robert Cimrman
On Mon, Apr 7, 2008 at 4:15 PM, David Joyner <wdjo...@gmail.com> wrote:
>
>
> On Mon, Apr 7, 2008 at 10:08 AM, Ondrej Certik <ond...@certik.cz> wrote:
> >
> > On Mon, Apr 7, 2008 at 3:41 PM, Mike Hansen <mha...@gmail.com> wrote:
> > >
> > > On Mon, Apr 7, 2008 at 6:25 AM, Ondrej Certik <ond...@certik.cz> wrote:
> > > > Yes, I did. This is the code developed by people at Simula. It works
> > > > nice, but it's quite difficult to install. I generally prefer smaller
> > > > tools, if I can get the job done.
> > > >
> > > > Ondrej
> > >
> > > Other than size and build issues, are the two projects equivalent
> > > feature / speed-wise?
> >
> > To my purposes, sfepy is better than fenics, because sfepy is in
> > python (and can do all I need). As to speed, that's about the same,
> > because the mainloop of sfepy for the assembly is in pure C, without
> > any python callbacks. Also because it's smaller, I find it simpler to
> > use. But Fenics definitely is also good and have it's users.
>
>
> Feature-wise, is Fenics better than sfepy?

I tried Fenics about a year ago, so they may have improved. For my own
purposes, i.e. solving a PDE, with Neumann or Dirichlet boundary
conditions,
assigning different material properties to different regions in the
body, etc., sfepy is better in a sense, that I was able to do what I
want in it (with the help of Robert) easier than in Fenics.

> You did seem to indicate sfepy
> is smaller. Is it because Fenics does more?

Because they are doing almost everything in C++, while sfepy uses a
very clever approach of only doing the main assembly loop in pure C,
otherwise doing everything in Python (so it's the same fast as the
libmesh (also C++ library) for my own purposes). Also, at the time I
tried Fenics, I had to code in C++ to do what I want. I don't like
that, I prefer
to work in Python (in sfepy, you don't have to touch the C code,
unless you want to do something very unusual). But they may have
improved since then.


> Also, isn't Fenics also in
> C+Python?

It's Python + C++. I don't like C++, I really prefer Python + C, it's
easier to understand, cleaner, more portable, easier to wrap in
Python, etc.

Well, download the sources of Dolfin and sfepy and see for yourself.
It takes less than 30s to compile sfepy on my computer. I haven't
tried dolphin, because it requires some dependencies I don't have, but
I am sure it will take at least 20x more time. Sfepy only requires
numpy+scipy.

Ondrej

Anders Logg

unread,
Apr 7, 2008, 2:35:05 PM4/7/08
to sage-support
On 7 Apr, 16:47, "Ondrej Certik" <ond...@certik.cz> wrote:
> On Mon, Apr 7, 2008 at 4:15 PM, David Joyner <wdjoy...@gmail.com> wrote:
>
> >  On Mon, Apr 7, 2008 at 10:08 AM, Ondrej Certik <ond...@certik.cz> wrote:
>
Just a few comments.

1. Yes, we have improved (as always... :-) but it's still far from
finished.

There's a simple example demonstrating the solution of Poisson's
equation
on this page: http://www.fenics.org/wiki/Tutorial

More demos can be found here:

http://www.fenics.org/hg/dolfin?cmd=manifest;manifest=e91acc1d9b392762c6cc1310abad399aef240993;path=/demo/

2. Yes, FEniCS is fairly complex: http://www.fenics.org/wiki/Projects

However, this shouldn't be a problem for users, and there are (Ubuntu)
packages
that let you install everything by just doing apt-get install fenics.

--
Anders

David Joyner

unread,
Apr 7, 2008, 2:48:09 PM4/7/08
to sage-s...@googlegroups.com

wdj@wooster:~/wdj/computer_algebra/dolfin$ sudo apt-get install fenics
[sudo] password for wdj:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Couldn't find package fenics

Maybe a site has to be added to /etc/sources?

>
> --
> Anders
>
>
>
> >
>

Anders Logg

unread,
Apr 7, 2008, 4:24:01 PM4/7/08
to sage-support
Yes, see here:

http://www.fenics.org/wiki/Download

--
Anders

On 7 Apr, 20:48, "David Joyner" <wdjoy...@gmail.com> wrote:
> >  http://www.fenics.org/hg/dolfin?cmd=manifest;manifest=e91acc1d9b39276...

Ondrej Certik

unread,
Apr 8, 2008, 4:09:20 AM4/8/08
to sage-s...@googlegroups.com

Yes, I tried that on Debian some time ago and it worked too. But as
David Joyner has noticed, you should try to get them to the official
Debian. :)

Ondrej

William Stein

unread,
Feb 6, 2014, 8:09:34 PM2/6/14
to sage-support, ander...@gmail.com
On Mon, Apr 7, 2008 at 11:35 AM, Anders Logg <ander...@gmail.com> wrote:
>
> On 7 Apr, 16:47, "Ondrej Certik" <ond...@certik.cz> wrote:
>> On Mon, Apr 7, 2008 at 4:15 PM, David Joyner <wdjoy...@gmail.com> wrote:
>>
>> > On Mon, Apr 7, 2008 at 10:08 AM, Ondrej Certik <ond...@certik.cz> wrote:
>>
>> > > On Mon, Apr 7, 2008 at 3:41 PM, Mike Hansen <mhan...@gmail.com> wrote:
>>
>> > > > On Mon, Apr 7, 2008 at 6:25 AM, Ondrej Certik <ond...@certik.cz> wrote:
>> > > > > Yes, I did. This is the code developed by people at Simula. It works
>> > > > > nice, but it's quite difficult to install. I generally prefer smaller
>> > > > > tools, if I can get the job done.
>>
>> > > > > Ondrej
>>
>> > > > Other than size and build issues, are the two projects equivalent
>> > > > feature / speed-wise?
>>
>> > > To my purposes, sfepy is better than fenics, because sfepy is in
>> > > python (and can do all I need). As to speed, that's about the same,
>> > > because the mainloop of sfepy for the assembly is in pure C, without
>> > > any python callbacks. Also because it's smaller, I find it simpler to
>> > > use. But Fenics definitely is also good and have it's users.
>>
>> > Feature-wise, is Fenics better than sfepy?
>>
>> I tried Fenics about a year ago, so they may have improved. For my own
>> purposes, i.e. solving a PDE, with Neumann or Dirichlet boundary


I've added FEnics to SageMathCloud (https://cloud.sagemath.com):

http://ask.sagemath.org/question/3506/can-fenics-be-setup-on-sagemath-cloud?answer=4644#4644

-- William
> --~--~---------~--~----~------------~-------~--~----~
> To post to this group, send email to sage-s...@googlegroups.com
> To unsubscribe from this group, send email to sage-support...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/sage-support
> URLs: http://www.sagemath.org
> -~----------~----~----~----~------~----~------~--~---
>



--
William Stein
Professor of Mathematics
University of Washington
http://wstein.org
Reply all
Reply to author
Forward
0 new messages