On 25 Nov, 22:51, "Ondrej Certik" <[EMAIL PROTECTED]> wrote:
> Hi Kent,
>
> > Hi, I just implemented a small toolbox for finite element calculations
> > based on Lagrangian elements
> > and compared it to similar code using GiNaC. The difference in
> > efficiency is remarkable. My sympy
> > code takes about 20 seconds where corresponding GiNaC code is below
> > one second.
>
> Thanks a lot for writing this. I am aware of SyFi [1] and I wanted to
> to write something like you just wrote in sympy. For those who want to
> know more about it, I suggest to read the tutorial [2], which explains
> everything. I myself am using the libmesh [3] library for finite
> elements, which is very good. But the SyFi's approach is very nice.
> Did you try it on some real example? How does it compare to the
> traditional approach, that libmesh is using? BTW, I am glad that SyFi
> is using swiginac[4], that we wrote with Ola Skavhaug. I thought that
> when I wrap ginac to python, I'll get an easy to use symbolic library,
> but I realized this is not the way.
>
I have tried SyFi on several real examples like the Bidomain
equations, Navier-Stokes etc.
But I only use SyFi for generating the C++ code for the finite
elements, element matrices etc.
The generated code is usually very fast, orders of magnitude faster
than traditional quadrature.
Its code and efficiency is similar to FFC. Assembly is typically done
in Dolfin/PyCC and solving
the linear systems is done in Hypre/Trilinos.
> Can I add your example to the examples directory in SymPy? We use a BSD
> license.
>
Yes.
> > Any comments on this ?
>
> As Fredrik has said, we need to improve the integration of
> polynomials. See recently discussed issues for that:
>
> http://code.google.com/p/sympy/issues/detail?id=461http://code.google.com/p/sympy/issues/detail?id=463
>
> But generally, Python is like 200 slower than C++ in my experience, so
> this is what has to be expected.
>
> Could you tell us what are the future plans with SyFi and also
> Fenics[5] etc? Last time I tried that, it took quite a long time to
> compile and it wasn't as versatile as libmesh (particularly I need to
> assign boundary conditions and changing conductivity in the body,
> which wasn't implemented at that time, but libmesh can do that
> easily). Generally I like the fenics ideas, but it wasn't yet ready
> for a production use. So I am curious what your own plans are, as I
> would like to help if I like it, because good finite elements in
> Python is exactly what I need.
> d it wasn't as versatile as libmesh (particularly I need to
> assign boundary conditions and changing conductivity in the body,
> which wasn't implemented at that time, but libmesh can do that
> easily). Generally I like the fenics ideas, but it wasn't yet ready
> for a production use. So I am curious what your own plans are, as I
> would like to help if I like it, because good finite elements in
> Python is exactly what I need.
Many of the Fenics projects have been in a state of flux for the last
year. But this
is improving. The future plan of SyFi is to come up with a nice user
interface/language such
that SyFi will work as a compiler translating high-level finite
element python code
to efficient low-level C++ code.
The reason why I am looking at Sympy is that although I am fairly
happy with GiNaC, it has its issues.
Still, I think I'd prefer Sympy (except the efficiency).
Can sympy generate C++ code ?
Kent
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sympy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sympy?hl=en
-~----------~----~----~----~------~----~------~--~---