Help with import of mesh-files from the format .unv

Mesh generators, CAD programs, and other tools
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Help with import of mesh-files from the format .unv

Post by raback »

Hi
elgrip wrote:Quadratic mesh import trouble ... I also have been having trouble importing .unv files into Elmer, from Salome. The regular tetrahedral and hexahedral meshes import into Elmer correctly. However no quadratic mesh will import; Elmer GUI crashes every time. I am using Windows 7 for all of this. Has anyone a workaround for this?
Unfortunately all elementtypes need to be checked manually since the ordering may differ. We don't much use Salome. If you would like to help in debugging, make minimalistic meshes of just a few elements, both in linear and quadratic and sent them for testing.

-Peter
elgrip
Posts: 9
Joined: 30 Nov 2011, 07:06
Antispam: Yes

Re: Help with import of mesh-files from the format .unv

Post by elgrip »

Hello Peter. Here is a cylinder, meshed with tets in Salome and with one Quad mesh which had the middle points unattached to the geometry. Importing this small mesh into Elmer GUI did not crash it; but resulted in no import and a blank screen.

Another user has replied on the Salome site that ...

"Re: Bug; Export of Salome .unv quadratic meshes to Elmer GUI
Posted by salad at Tuesday 21:58

As a quick feedback, I have been using Elmer with SALOME, but didn't encounter this problem. By the way, I used Elmer command line tools instead of the GUI on Linux / Ubuntu.

Wayne"

... so maybe there is just a problem with the Windows .exe?
Attachments
LinearQuadMeshes.zip
Zip file of linear and quad Tet meshes of a cylinder
(7.06 KiB) Downloaded 470 times
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Help with import of mesh-files from the format .unv

Post by mzenker »

Hi,

I have trouble opening a mesh created by CosmosWorks with Elmer (Rev 5270, WIN XP).
I have tried unv, inp (NASTRAN) and dat (ABAQUS).
When I try to open it with the GUI, the log window says
for unv format:
---------------------------------------------------
ElmerGrid loading data from file: H:/FEM/Test/plate_with_hole/plate_with hole-Study 1.unv
Reading mesh from universal mesh file H:/FEM/Test/plate_with_hole/plate_with hole-Study 1.unv.
done reading
Reordering 50164 elements with indexes up to 50280
Allocating for 50283 knots and 50164 50277-node elements.
run-time error...
allocation failure 2 in imatrix()
...now exiting to system...
---------------------------------------------------

for ABAQUS (inp) format:
----------------------------------------------------
ElmerGrid checking filename suffix for file: H:/FEM/Test/plate_with_hole/plate_with hole-Study 1.inp
Filetype determined by suffix: 5
Initialized the filetype

ElmerGrid loading data from file: H:/FEM/Test/plate_with_hole/plate_with hole-Study 1.inp
Reading input from ABAQUS input file H:/FEM/Test/plate_with_hole/plate_with hole-Study 1.inp.
comment: ** OUTPUT FROM COS2ABQ TRANSLATOR VERSION 2011
Loading Abacus input file:

comment: ** PARTS
comment: **
unknown command: *PART,NAME=PART1
Unknown element code: *ELEMENT,TYPE=C3D10,ELSET=PART1_EG1

Loading elements of type 0 starting from element 0.
unknown command: *ORIENTATION,NAME=RECT1,DEFINITION=COORDINATES,SYSTEM=RECTANGULAR
unknown command: *END PART
comment: ** ASSEMBLY
unknown command: *ASSEMBLY, NAME=ASSEMBLY
unknown command: *INSTANCE, NAME=PART1-1, PART=PART1
unknown command: *END INSTANCE
unknown command: *END ASSEMBLY
unknown command: *MATERIAL,NAME=MAT1unknown command: *ELASTIC
unknown command: *PLASTIC
unknown command: *EXPANSION
unknown command: *DENSITY
unknown command: *CONDUCTIVITY
unknown command: *SPECIFIC HEAT
unknown command: *STEP,SOLVER=DDM
unknown command: *STATIC
unknown command: *TEMPERATURE,OP=NEW
unknown command: *END STEP
Allocating for 50283 knots and 33443 0-node elements.
There are 32116 boundary nodes, thus allocating 64232 elements
Loading Abacus input file:

Unknown element code: *ELEMENT,TYPE=C3D10,ELSET=PART1_EG1

Loading elements of type 0 starting from element 0.
The mesh was loaded from file H:/FEM/Test/plate_with_hole/plate_with hole-Study 1.inp.
Boundary types are in interval [1, 5]
Boundary nodes are in interval [0, 50282]
Found 0 side elements formed by 32116 points.

ElmerGrid manipulating and importing data
GetElementDimension: unknown elementtype 0
Setting elements of 0dim
Implemented only for element dimensions 2 and 3 (not 0)
Done converting mesh
Found 0 edges on boundary
Creating edge indexes
0 boundary edges were numbered up to index 0
Bcs/materials on surface elements: 0
Bcs/materials on edge elements: 0
Bcs/materials on point elements: 0
Generating lists to display
Generated 2 lists
Apply 0 operations
----------------------------------------------------------------

for NASTAN (dat):
-----------------------------------------------------------------
Unable to open file: file type unknown
Unable to (re)mesh: no input data or mesh generator (please make sure that your input file suffix is in lower case)
-----------------------------------------------------------------

The files are several MB large so I cannot easily post them here.
Note that I can open the unv and dat files with gmsh, so they seem not to be obviously corrupt.

What can I do to approach a solution?

Matthias
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Help with import of mesh-files from the format .unv

Post by mzenker »

I have just tried to open the Wuerfel.unv from the beginning of this tread. My ElmerGUI says in the log window:

--------------------------------------------------------
ElmerGrid checking filename suffix for file: H:/FEM/Test/Wuerfel/Wuerfel.unv
Filetype determined by suffix: 8
Initialized the filetype

ElmerGrid loading data from file: H:/FEM/Test/Wuerfel/Wuerfel.unv
Reading mesh from universal mesh file H:/FEM/Test/Wuerfel/Wuerfel.unv.
done reading
Invalid mesh consits of 0 knots and 0 0-node elements.
Found 0 edges on boundary
Creating edge indexes
0 boundary edges were numbered up to index 0
Apply 0 operations
--------------------------------------------------------

When I load it in gmsh, nothing is shown either.

Another unv file, also generated by COSMOSWorks, does open OK in Elmer.

Strange...

EDIT: Actually, that one was generated by GID, not by COSMOS.
Last edited by mzenker on 11 Jan 2012, 12:55, edited 1 time in total.
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Help with import of mesh-files from the format .unv

Post by mzenker »

Hi,

I am still interested in the unv import...
My Elmer (Rev.5270, Windoze XP) opens the file LinearTetMesh.unv posted by elgrip.
For my file generated by COSMOS, I have found a workaround: since gmsh can read it, I open it with gmsh and save it in msh format, which Elmer can read. However, this does not solve the unv parser problem in Elmer...
I have noticed that Elmer does not seem to read an unv file produced by gmsh. I have tried it with two different geometries, both resulted in an ElmerGUI crash. The second geometry is smaller, I have attached the file. I think it would be helpful for quite some Elmer users to have an improved unv parser. Peter, could you perhaps have a look into this...?
Just a thought: The gmsh unv parser seems more robust - perhaps it could be used for Elmer?

Matthias
Attachments
Baugruppe1_overlap_3D.zip
(458.82 KiB) Downloaded 428 times
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Help with import of mesh-files from the format .unv

Post by raback »

Hi
elgrip wrote:Hello Peter. Here is a cylinder, meshed with tets in Salome and with one Quad mesh which had the middle points unattached to the geometry. Importing this small mesh into Elmer GUI did not crash it; but resulted in no import and a blank screen.
I had a look at the files. As said the "LinearTetMesh.unv" imports without problems while the "QuadTetMesh.unv" does not. However, the latter is just 48 bytes (the former 54 kb) and if you open it you see that there is just the start and end of fields, not any mesh information. So it seems the Salome output is broken for quadratic elements.

-Peter
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Help with import of mesh-files from the format .unv

Post by raback »

Hi
mzenker wrote: I have noticed that Elmer does not seem to read an unv file produced by gmsh. I have tried it with two different geometries, both resulted in an ElmerGUI crash. The second geometry is smaller, I have attached the file. I think it would be helpful for quite some Elmer users to have an improved unv parser. Peter, could you perhaps have a look into this...?
There were two problems which I tried to fix now. The first one was related to how line elements of type 21 are read and the other one was the treatment of "D" when reading floating numbers. By default strtod in C does not recognize "D" as a sign for exponent, only "E" and "e". I made a tailored reading that first changes Ds to Es. Not perhaps pretty but seems to work. The changes are in the svn. For now only in the command-line ElmerGrid.

-Peter
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Help with import of mesh-files from the format .unv

Post by mzenker »

Thank you for fixing, Peter. I will try it as soon as the fix is in the Windows binary.
elgrip, is your problem already solved? Or do you feel like compiling Elmer in order to try the latest fix?

Matthias
elgrip
Posts: 9
Joined: 30 Nov 2011, 07:06
Antispam: Yes

Re: Help with import of mesh-files from the format .unv

Post by elgrip »

Thank you all for looking into the problem I had with importing Quad meshes from Salome. So it seems that Salome does not export quadratic meshes correctly, rather than Elmer not importing correctly. That's good to know.

I have been looking into varieties of meshing while running the Elmer beam elasticity tutorial, in order to check the accuracy of Elmer and get my methods correct. So I have assumed an Al metal beam of the tutorial's dimensions, and have solved it in Elmer as well as in SolidWorks' Simulation, as well as theoretically. SolidWorks and theory agree.

However Elmer, importing STP geometry file and meshing the metal beam, does not. Crazy answers result, which apparently meant that the mesh was 'locking' and had to be quadratic.

So I tried gmsh on my STP, then importing its meshes into Elmer, and nothing I could do would yield good answers from that program either.

However when putting my STP through Salome, and getting its linear mesh exported into Elmer, theory and Elmer finally agreed! I felt that was a rather magical result since I thought that linear meshes would not have worked.

So you can see that my problems with Salome and quad meshes are a mystery to me; would it be that Salome exports a quad mesh even though I have requested a linear mesh from it?
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Help with import of mesh-files from the format .unv

Post by raback »

Hi

Attaching a minimalistic example would help. Then I could have a look sometimes when time permits.

-Peter
Post Reply