Importing .msh file from CUBIT

53 views
Skip to first unread message

HIMAL MAGAR

unread,
Dec 6, 2022, 10:36:30 AM12/6/22
to deal.II User Group
Warm Greetings!,
I am trying to import .msh file that I have created in CUBIT in step-17. However, the code doesn't read the file and produces following error:
Screenshot from 2022-12-06 21-15-16.png
Do i need to manually modify the contents in file before importing into the code? If so, how can i do that?
Thanks
Himal.

Bruno Turcksin

unread,
Dec 6, 2022, 10:56:35 AM12/6/22
to deal.II User Group
Himal,

It looks like there is a problem opening the file. How did you export the mesh? Are you using read_ucd or read_abaqus?

Best,

Bruno

HIMAL MAGAR

unread,
Dec 6, 2022, 11:08:32 AM12/6/22
to dea...@googlegroups.com
Hi Bruno,
I have used the .inp format file and used read_ucd here. I was actually trying to import a .msh file. However, the same error occurs for the read_msh function as well.

Himal.


--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to a topic in the Google Groups "deal.II User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dealii/qd-n-iiMx-k/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dealii+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/bc9262ab-4258-4032-b839-bb9e78d75a41n%40googlegroups.com.

Bruno Turcksin

unread,
Dec 6, 2022, 11:15:03 AM12/6/22
to dea...@googlegroups.com

Wolfgang Bangerth

unread,
Dec 6, 2022, 11:30:51 AM12/6/22
to dea...@googlegroups.com
On 12/6/22 08:36, HIMAL MAGAR wrote:
> I am trying to import .msh file that I have created in CUBIT in step-17.
> However, the code doesn't read the file and produces following error:

The error happens in read_ucd(), but that is clearly the wrong function for
reading .msh files: You need to use read_msh().

That said, the error happens at the very top of the function. I believe that
you are trying to read from a file that doesn't exist or can't be opened. Did
you spell the file name and directory name correctly in your program? Does the
file you are trying to read from actually exist?

Best
W.

--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/


yy.wayne

unread,
Dec 7, 2022, 5:20:48 AM12/7/22
to deal.II User Group
Sorry but I want to add a question here. What's the recommanded  way to import a mesh from cubit to deal.ii?
I tried read_abaqus and read_ucd with following error:
Snipaste_2022-12-07_18-14-08.png
I‘m using Cubit 2022.4. In deal.II documentation it supports Cubit 11.x to 15.x, does it mean Trelis 15.x? [Cubit download]
At least in Trelis 16.5 there's no "Export using Cubit ID's" to uncheck.
Cubit mesh.png

Bruno Turcksin

unread,
Dec 7, 2022, 9:18:10 AM12/7/22
to dea...@googlegroups.com
I don't know what's the relationship between Trelis and Cubit. I got Cubit directly from Sandia https://cubit.sandia.gov/ but it's not available to everybody. It looks like Coreform has its own versioning that doesn't match the one from Sandia :-( Try something that's from 2021 or older.

Best,

Bruno

--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to a topic in the Google Groups "deal.II User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dealii/qd-n-iiMx-k/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dealii+un...@googlegroups.com.

yy.wayne

unread,
Dec 7, 2022, 9:32:09 AM12/7/22
to deal.II User Group
I see ... I forgot that Cubit and Coreform Cubit are different, the former one is for gov. and latter one is for commercial & academic use.
I can import an .inp mesh exported from Coreform Cubit when no SideSet are asigned. With SideSet it gives following error: 
Snipaste_2022-12-07_22-27-05.png
Cubit is easier to use than GMSH when generating hex meshes and saves a lot time. Any recommended open source software to generate
hex mesh that deal.II can read?

Bruno Turcksin

unread,
Dec 7, 2022, 9:54:57 AM12/7/22
to dea...@googlegroups.com
That error is independent of the mesh format that you are using. deal.II does not support boundary id on internal faces. I agree that Cubit is better for hex meshes but I think most people use GMSH because it's easier to get. With Cubit, you can also export the file as an ExodusII file and we use Trilinos to read that format so that may give you better support across Cubit versions. This doesn't change the fact that deal.II does not support boundary id on internal faces.

Bruno

yy.wayne

unread,
Dec 7, 2022, 9:10:32 PM12/7/22
to deal.II User Group
I never notice that limitation before. Thank you.
Reply all
Reply to author
Forward
0 new messages