2D Gmsh with named BC into MOOSE

351 views
Skip to first unread message

Edgar Rios

unread,
Oct 23, 2017, 5:10:44 PM10/23/17
to moose...@googlegroups.com
Dear MOOSE users,

*In short*: does anybody know how to set a 2D mesh from Gmsh with
boundary conditions as an input in MOOSE? An attempt of MWE is shown
below.

I am following the tutorial on tensor mechanics
([http://mooseframework.org/wiki/PhysicsModules/TensorMechanics/BasicTutorial/]).
In
there, an ExodusII mesh is provided
([https://github.com/idaholab/moose/blob/devel/modules/tensor_mechanics/tutorials/basics/necking_quad4.e]).
I
am trying to reproduce the problem using a mesh generated with Gmsh
(attached files)

tens_mech_tut.geo: Gmsh definition of the geometry and mesh with
specification of physical groups (for the boundaries)

tens_mech_tut.msh: exported mesh generated from the previous file, in
this way

┌────
│ dims=2
│ inFname="tens_mech_tut.geo"
│ outFname="tens_mech_tut.msh"
│ gmsh -optimize_ho -format msh -"$dims" -o
"$outFname" "$inFname" 1>/dev/null
└────

According to Gmsh, setting `-2' as an argument *requests a 2D mesh*.

When I run
┌────
│ moose_input='part_1.1.i'
│ moose_indir='/home/edgar/projects/moose/modules/tensor_mechanics/tutorials/basics'
│ exec_bin='tensor_mechanics-opt'
│ exec_dir='/home/edgar/projects/moose/modules/tensor_mechanics'
│ cd $moose_indir
│ "$exec_dir"/"$exec_bin" -i "$moose_indir"/"$moose_input"
└────

I get
┌────
│ *** ERROR ***
│ The number of variables supplied in 'displacements' must match the
mesh dimension.
└────

which makes me think that the mesh is not recognised as 2D. I can see
that the coordinates of the points are in 3D (all values of the third
dimension are 0).

Does anybody know how to do this (without creating a 3D mesh)?
tens_mech_tut.msh
tens_mech_tut.geo

Alexander Lindsay

unread,
Oct 23, 2017, 5:32:00 PM10/23/17
to moose...@googlegroups.com
Adding this line to the end of your .geo file made everything work for me:

Physical Surface("surface") = {6};

In my experience gmsh works best if you specify physical entities up to the desired dimension of the mesh you want to create. E.g. you had Physical Lines defined but no Physical Surface for your 2D mesh.

Alex


--
You received this message because you are subscribed to the Google Groups "moose-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to moose-users+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/moose-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/moose-users/CAGXJvsoQXLxL70SeEJWygKHPAzqvF8b-Vi9HZ%3D1o17uiCALcRg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Edgar Rios

unread,
Oct 23, 2017, 7:01:34 PM10/23/17
to moose-users
 Thanks Alex. That did the trick!
Reply all
Reply to author
Forward
0 new messages