Can GridIn read 3D quad mesh?

111 views
Skip to first unread message

Yuxiang Wang

unread,
Sep 16, 2018, 11:32:21 PM9/16/18
to deal.II User Group
Dear all,

Sorry for the beginner question.

I am trying to load a 3D quad mesh (i.e. not all nodes are co-planar for one element) to implement a Mindlin–Reissner plate. I wonder, can GridIn class read such meshes? Upon reading the document, it seems like if the input element is quad then it is a 2D mesh; but for shell elements the spatial information is 3D.

Thank you!
Shawn

Daniel Arndt

unread,
Sep 17, 2018, 3:07:43 PM9/17/18
to deal.II User Group
Shawn,

If I understand correctly you want to read a 2D mesh embedded in a three-dimensional space.
Which mesh format are you interested in?
At least, GridIn::read_ucd and GridIn::read_msh should be able to do that.

If you experience problems, we like to here about that as well.

Best,
Daniel

Yuxiang Wang

unread,
Sep 18, 2018, 4:41:03 PM9/18/18
to dea...@googlegroups.com
Hi Daniel,

Thank you for your help! I just tried a code snippet (modified step-49) below and it does not work, either when I set the dim=2 or dim=3.

```
int main ()
{
  Triangulation<2> triangulation;

  GridIn<2> gridin;
  gridin.attach_triangulation(triangulation);
  std::ifstream f("mesh.inp");
  gridin.read_abaqus(f);

  GridOut gridout;
  std::ofstream fout("mesh.vtu");
  gridout.write_vtu(triangulation, fout);
}
```

The complete code is attached at the end of this email. If you don't mind, could you help provide any guesses in what potentially went wrong?

Shawn

--
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/Erk7pxwTEj4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dealii+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Yuxiang "Shawn" Wang, PhD
CMakeLists.txt
step-49.cc
mesh.inp

Yuxiang Wang

unread,
Sep 18, 2018, 4:49:14 PM9/18/18
to deal.II User Group
Oh and another detail - the mesh is not really 2D mesh because the four nodes of a quad element may not be co-planar. Therefore, there does not exist a transform that can reduce the mesh to 2D.

Shawn

Wolfgang Bangerth

unread,
Sep 18, 2018, 4:56:19 PM9/18/18
to dea...@googlegroups.com
On 09/18/2018 02:40 PM, Yuxiang Wang wrote:
>
> Thank you for your help! I just tried a code snippet (modified step-49) below
> and it does not work, either when I set the dim=2 or dim=3.

If you want to use quadrilateral (2d) meshes embedded in 3d, then you need to use
Triangulation<2,3>
GridIn<2,3>
etc.

The 2 is the dimension of cells, the 3 the dimension of the space in which
they live.

Best
W.

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

Yuxiang Wang

unread,
Sep 18, 2018, 5:18:58 PM9/18/18
to deal.II User Group
Hi Professor Bangerth,

Thank you for the pointer! I changed my code as you suggested and it finished running.

However, when I opened the output file (mesh.vtu), the 3D mesh was projected to a 2D plane of z=0, and lost its 3D features. Was that expected behavior?

Shawn

Wolfgang Bangerth

unread,
Sep 18, 2018, 7:28:34 PM9/18/18
to dea...@googlegroups.com
On 09/18/2018 03:18 PM, Yuxiang Wang wrote:
>
> Thank you for the pointer! I changed my code as you suggested and it finished
> running.

Great!


> However, when I opened the output file (mesh.vtu), the 3D mesh was projected
> to a 2D plane of z=0, and lost its 3D features. Was that expected behavior?

No. Are you saying that if you read a mesh, then immediately output it again,
that the z-coordinate is lost? If that's correct, then that's a bug and it
would be nice to have a small program and input file that demonstrates this.

Yuxiang Wang

unread,
Sep 18, 2018, 7:38:36 PM9/18/18
to dea...@googlegroups.com
Prof. Bangerth,

Thank you for the prompt response! Yes please find attached the minimal program. The main body is pretty short (see below), modified from step-49. Please let me know if you cannot reproduce it!

```
int main ()
{
  Triangulation<2, 3> triangulation;

  GridIn<2, 3> gridin;
  gridin.attach_triangulation(triangulation);
  std::ifstream f("mesh.inp");
  gridin.read_abaqus(f);

  GridOut gridout;
  std::ofstream fout("mesh.vtu");
  gridout.write_vtu(triangulation, fout);
}

```


Shawn

--
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/Erk7pxwTEj4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dealii+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
step-49.cc
mesh.inp
CMakeLists.txt
mesh.vtu

Jean-Paul Pelteret

unread,
Sep 19, 2018, 1:57:30 AM9/19/18
to dea...@googlegroups.com
Dear Shawn,

The GridIn::read_abaqus() function is currently not equipped to deal with the codimension 1 case. I might be able to find some time to look at this in the next few days though. In addition to the mesh file that you’ve already given us, may you please construct and give us a fully structured grid in codimension 1 (so something like a rectangle warped in the third dimension) that also has some boundary colouring? That would help a great deal with implementing this feature, and would also ensure that the assignment of boundary ID’s is possible.

Best,
Jean-Paul

You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dealii+un...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
<step-49.cc><mesh.inp><CMakeLists.txt><mesh.vtu>

Yuxiang Wang

unread,
Sep 19, 2018, 4:48:31 PM9/19/18
to dea...@googlegroups.com
Hi Jean-Paul,

Thank you for your help! I'd love to provide the mesh. Please let me know whether the attached one would work.

For the boundary coloring - could you please elaborate on what that means? I wasn't aware that ABAQUS has such a coloring feature but it could be me not knowing this though.

image.png

Best,
Shawn
Job-1.inp

Jean-Paul Pelteret

unread,
Sep 20, 2018, 1:00:07 AM9/20/18
to dea...@googlegroups.com
Hi Shawn,

Thank you for your help! I'd love to provide the mesh. Please let me know whether the attached one would work.

You’re welcome. This second mesh is perfect. I’ll let you know when I’ve submitted a patch that allows this grid to be read in.

For the boundary coloring - could you please elaborate on what that means? I wasn't aware that ABAQUS has such a coloring feature but it could be me not knowing this though.

This means assigning some boundary ID’s (in all of the documentation we call it “colouring”). Cubit allows one to do this, but I don’t know about ABAQUS itself (I would have thought it would be possible). I’ll try to modify the input file you supplied, which should be possible since the geometry is simple enough.

Best,
Jean-Paul

<Job-1.inp>

Yuxiang Wang

unread,
Sep 20, 2018, 2:12:01 AM9/20/18
to dea...@googlegroups.com
Oh I see! Thank you for explaining. My guess would be that the ABAQUS equivalent is "node set". Please let me know if you'd like me to try that!

Best,
Shawn

Jean-Paul Pelteret

unread,
Sep 20, 2018, 4:20:46 AM9/20/18
to dea...@googlegroups.com
Dear Shawn,

No, its fine. I see that the changes weren’t as drastic as I thought they’d be, so I think that the boundary ID assignment will work out of the box (I’d forgotten that someone else had already done much of the work necessary to support codim-1). 

I’ve made a patch to add this functionality. See here: https://github.com/dealii/dealii/pull/7217
Thank a lot for the grids and the minimal test case!

Best,
J-P

Yuxiang Wang

unread,
Sep 20, 2018, 8:29:06 PM9/20/18
to deal.II User Group
That's so fast! Thank you Jean-Paul :)

Shawn

Jean-Paul Pelteret

unread,
Sep 21, 2018, 3:09:47 AM9/21/18
to dea...@googlegroups.com
That's so fast!

Well, it was an easy fix so we got lucky there. But the test case you provided was really useful, so we appreciate you providing that.

Thank you Jean-Paul :)

You’re quite welcome.

Best,
Jean-Paul

Yuxiang Wang

unread,
Oct 4, 2018, 2:54:41 AM10/4/18
to deal.II User Group
Hi Jean-Paul,

Thank you again for the fix and sorry to bother again. I wonder that, would you think it'd be easy to have spacedim = 3 and dim = 1 implemented? This would be very useful for beam elements (e.g. Timoshenko beams). I saw here that:


This scenario would currently raise an error. Would you think that would be easy? I would be happy to provide sample files if that would be helpful.

Best,
Shawn

Jean-Paul Pelteret

unread,
Oct 4, 2018, 4:45:27 AM10/4/18
to dea...@googlegroups.com
Dear Yuxiang,

Yes, indeed the co-dimension 2 case is not supported as of yet. However, I think that there is sufficient robustness in the current implementation of the Abaqus grid reader that it would be possible to implement this without too much difficulty. The three places that one would probably have to focus one's attention on are the definition of the “element” here, the boundaries here, and then face indices in this function (this last part should be completely trivial). If you want to try to add this functionality then you could open up an issue in the GitHub repository and we could discuss this further over there. We would appreciate this contribution!

Best,
Jean-Paul

Yuxiang Wang

unread,
Oct 5, 2018, 12:57:58 AM10/5/18
to deal.II User Group
Thank you Jean-Paul! Let me open an issue at GitHub.

Best,
Shawn
Reply all
Reply to author
Forward
0 new messages