On 05/26/10 16:39, Logan Sorenson wrote:
On Wed, May 26, 2010 at 6:52 AM, Robert Cimrman<cimr...@ntc.zcu.cz> wrote:
On 05/25/10 23:33, Logan Sorenson wrote:
Hey Robert,
On Mon, May 24, 2010 at 4:34 AM, Robert Cimrman<cimr...@ntc.zcu.cz> wrote:
Hi Logan,
On 05/22/10 18:59, Logan Sorenson wrote:
Hi all,
I added to the existing Comsol meshio faciliites to implement full read/write for SfePy suported types. Hope someone can find it useful. At the very least, it should make comparisons between Comsol and SfePy easier. The code is on the comsol_mesh branch at [1].
I have tried several meshes with different kinds of elements, e.g.
./script/convert_mesh.py meshes/3d/cylinder.mesh cyli.txt ./postproc.py cyli.txt
and it worked perfectly!
I tried to run the mesh generated by Salome and converted using convert_mesh.py to Comsol format. It looks like Comsol can read the mesh okay, but when I run the Comsol solution it gives some errors about inverted elements and the solution looks strange compared to a mesh generated directly in Comsol. Therefore, I think that something is not quite right in the implementation of the Comsol write code. I know from reading and writing a Comsol generated mesh file that some of the elements get reordered by SfePy, so maybe this is causing the error. I will look more into it, but just wanted to post a warning if anyone is planning to use this to create Comsol meshes.
FYI: The orientation of elements (= ordering of vertices in connectivity) is depicted in [2].
Ah, yes, I used these to figure out the difference in node ordering b/w Comsol and SfePy. It looks like the 2_4 and 3_8 elements have different nodal ordering.
What I should have said is that when I read the mesh into SfePy, the rows of the conn array are interchanged. Then when I write back out the same mesh, the rows of elements will obviously be different since I'm just following the order of the conn array. I guess there is an internal sorting algorithm in SfePy for the conn array? I still don't understand why this would lead to problems in Comsol though...
I was thinking more about that nodal ordering (when wrong, it causes negative volume elements and other weird errors).
Here's an example to clarify the problem:
./script/convert_mesh.py meshes/various_formats/comsol_tri.txt comsol_tri2.txt diff meshes/various_formats/comsol_tri.txt comsol_tri2.txt
I can see only whitespace differences in the order of elements (trinagles). Do you see something different?
Ideally, I suppose the two meshes should match exactly. I'll try some more simple examples to see what the problem is in Comsol.
OK, but remember that sfepy does not use lower level entities in the mesh like edges, faces etc.
cheers, r.