Ondrej Certik wrote:
I put my code at:
Great, I will look at it.
Let's discuss how to best integrate it in sfepy. The main code is in:
which converts to/from a lot of formats. It's quite long though and all in one class. My plan was to create a new class for each output/input format.
To have transparent read support of various formats, I have created the meshio.py file (sfe.fem.meshio) - there are curently two classes, for medit (.mesh) and for legacy VTK files. I suggest you split your class and put a class for each format in there. Or I may do it, but not today, I fear. I will atleast document the expected return value of the read() method of those classes.
So let's create some basic mesh classes, for example based on the code in sfe/fem/mesh.py. Then I'll just subclass it, implement some output/input and that's it.
See above. What is needed is only a class with read() and write() (this one is not used anywhere yet) methods. The Mesh class in sfe/fem/mesh.py automatically selects the 'io' class then.
Another problem: how can I select some part of the geometry and assign a special boundary condition to it? In sfepy, as I understand it, it's handled by assigning a special number to each element (tetrahedron), but how can I generate such a mesh? It's not a business of sfepy. But generally I need to create a geometry (for example in gmsh), tell gmsh to mark some surface with a number. Then it is passed to tetgen, that is clever enough to assign this number to each element in the output. So all I need is to parse the output of tetgen and print the element numbers to a file for example.
Sometimes, I not only need the element IDs, but I also need the set of nodes sitting at a surface. All these features are implemented in the patch attached to the issue 17.
In my older FEM code, I simply read this file and assigned a correct BC to the elements in this file. How is this handled by sfepy?
Short answer: regions :-)
True, you can select elements by their id (the special number you mention), but there are many other ways
I think sfepy can do some things that is in the patch, but probably cannot do all of them. So let's merge it. I am waiting for your suggestions and ideas. ;)
I have not seen your patch yet, but the ideas above apply anyway :)
thanks for contributing to SfePy! r.