Hi Pablo!

On Wed, Mar 24, 2010 at 7:32 AM, Pablo Angulo <[email protected]> wrote:
> Hello,
>
> This weekend I wrote a triangulation editor, based on the previous code
> for the graph editor.
>
> You can get the relevant files from:
>
> http://www.uam.es/personal_pdi/ciencias/pangulo/etc/te.zip
>
> I'm learning mercurial, and the sage packaging conventions, and I need
> to decide where to place the code before I can produce a patch
> (suggestions are welcome). Anyway, this is prototype quality (no tests,
> scarce docstrings, a bunch of NotImplementedErrors...).
>
> I placed the python file at sage.graphs, but you can copy and paste into
> a worksheet if you remove the import statements. The folder
> triangulation_editor contains the html and js files, and should be
> decompressed in the folder:
> $SAGE_ROOT/local/lib/python2.6/site-packages/sagenb-0.7.5.1-py2.6.egg/sagenb/data/
>
> The editor understands only about vertices and triangles, not edges. It
> shows a grid to which you can snap the vertices, and it can replace the
> triangles with the Delaunay triangulation for the given set of vertices.
> It does not produce meshes.

This is very cool and close to what we want. Thanks for writing about it!

>
> I wrote it to complement a sage worksheet I wrote about the FEM. I was
> quite satisfied as to how the symbolic and numerical abilities of SAGE
> combined to simplify the definition of the problem and the computation
> of the solution, but I didn't like having to introduce the triangulation
> by hand. The workflow would be the following:
>  * use the editor to introduce a first triangulation.
>  * refine the triangulation if needed, without the editor.
>  * setup the problem using symbolic integrals over a general triangle
>  * evaluate the result on the vertices of the triangles
>  * solve the linear system of PDEs
>  * plot it

Do you have some example worksheet doing this? That's the exact same
workflow that we want to use in FEMhub --- only we want to use our C++
PDE solvers (http://hpfem.org/), that we wrapped in Python.

>
> By the way, Ondrej Certik just mentioned he's using Flex to work in a
> mesh editor:
> http://groups.google.com/group/sage-devel/browse_thread/thread/c262901cfafd3f45

Yes, Aayush in our group in Reno knows flex, so he started to develop
the mesh editor in that. Just yesterday I have discovered the graph
editor and realized that it does exactly what we need.

 I have one more question --- does your code produce elements?

I was thinking yesterday, that if I take the graph (generated using
the graph editor), I have vertices (and their coordinates), and then I
have a set of edges (pairs of vertices, connected by a line). How can
I convert this to a FE mesh? FE mesh is a set of triangles and quads.
So here is a crude algorithm, that we have in mind:

1) find some boundary edge
2) get neighboring vertices (follow edges) and try to construct a
triangle, that contains the edge. If success, cut the triangle out
(add it to the list of triangles) and go to 1)
3) try to construct a quad, make sure it is not composed of two
triangles. If success (e.g. either a quad, or two triangles), cut it
out (add it to the list of quads or triangles) and go to 1)

Isn't this already implemented in Sage somewhere?

In any case, your code (which just produces triangles) would also be
fine, at the beginning.

Thanks,
Ondrej

-- 
To post to this group, send an email to [email protected]
To unsubscribe from this group, send an email to 
[email protected]
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

To unsubscribe from this group, send email to 
sage-devel+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.

Reply via email to