[Gmsh] How do I specify a physical group of dimension 1 for the Crack plugin?

Geoff Oxberry goxberry at gmail.com
Wed May 14 12:28:11 CEST 2014


Figured out the cause of the problems. Here's a corrected version, split
into two files (more on why below):

/*********************************************************************
 *
 * Minimal crack example: crack2.geo
 *
 *********************************************************************/

// Characteristic length made large so the number of elements is small
lc = 1;

// Point: X, Y, Z coordinates, & characteristic length setting elt size
Point(1) = {0, 0, 0, lc} ;
Point(2) = {1, 0, 0, lc} ;
Point(3) = {1, 1, 0, lc} ;
Point(4) = {0, 1, 0, lc} ;

// Lines defined by lists of numbers:
Line(1) = {1, 2} ;
Line(2) = {2, 3} ;
Line(3) = {3, 4} ;
Line(4) = {4, 1} ;
Line(5) = {1, 3} ;

// Line loops to construct surfaces
Line Loop(1) = {1, 2, -5} ;
Line Loop(2) = {5, 3, 4} ;

// Surfaces for meshing
Plane Surface(1) = {1} ;
Plane Surface(2) = {2} ;

Physical Point(13) = {1, 3};
Physical Line(105) = {5} ;
Physical Surface(201) = {1} ;
Physical Surface(202) = {2} ;

// End of file: crack2.geo

// File: crack2a.geo, for post-processing crack2.msh

// Duplicate nodes around Line 5; a mock crack
Plugin(Crack).Dimension = 1 ;
Plugin(Crack).PhysicalGroup = 105 ;
Plugin(Crack).OpenBoundaryPhysicalGroup = 13 ;
Plugin(Crack).Run ;

// End of file: crack2a.geo

Having split the file into two parts, to process the mesh correctly and
noninteractively:

Geoffs-MacBook-Pro:~ goxberry$ gmsh crack2.geo -2
Info    : Running 'gmsh crack2.geo -2' [Gmsh 2.8.4, 1 node, max. 1 thread]
Info    : Started on Wed May 14 03:16:00 2014
Info    : Reading 'crack2.geo'...
Info    : Done reading 'crack2.geo'
Info    : Meshing 1D...
Info    : Meshing curve 1 (Line)
Info    : Meshing curve 2 (Line)
Info    : Meshing curve 3 (Line)
Info    : Meshing curve 4 (Line)
Info    : Meshing curve 5 (Line)
Info    : Done meshing 1D (0.000626 s)
Info    : Meshing 2D...
Info    : Meshing surface 1 (Plane, Delaunay)
Info    : Meshing surface 2 (Plane, Delaunay)
Info    : Done meshing 2D (0.000716925 s)
Info    : 5 vertices 14 elements
Info    : Writing 'crack2.msh'...
Info    : Done writing 'crack2.msh'
Info    : Stopped on Wed May 14 03:16:00 2014

Geoffs-MacBook-Pro:~ goxberry$ gmsh crack2.msh crack2a.geo -2
Info    : Running 'gmsh crack2.msh crack2a.geo -2' [Gmsh 2.8.4, 1 node,
max. 1 thread]
Info    : Started on Wed May 14 03:16:13 2014
Info    : Reading 'crack2.msh'...
Info    : 5 vertices
Info    : Vertex numbering is dense
Info    : 8 elements
Info    : Done reading 'crack2.msh'
Info    : Reading 'crack2a.geo'...
Info    : Running Plugin(Crack)...
Info    : Done running Plugin(Crack)
Info    : Done reading 'crack2a.geo'
Info    : Meshing 1D...
Info    : Done meshing 1D (7e-06 s)
Info    : Meshing 2D...
Info    : Done meshing 2D (2.09808e-05 s)
Info    : 8 vertices 10 elements
Info    : Writing 'crack2.msh'...
Info    : Done writing 'crack2.msh'
Info    : Stopped on Wed May 14 03:16:13 2014

Basically, what happened was:

- post-processing plugins seem to be run first in an input file; since
these directives appear to be processed first, if there are no other input
files, no physical groups have been defined, hence the errors I was seeing
- if nonzero, OpenBoundaryPhysicalGroup must contain the points (when
Dimension = 1; probably lines when Dimension = 2) on the boundary of the
physical group being duplicated with the Crack plugin
- to post-process a mesh non-interactively, run an input file without
post-processing commands to obtain a mesh, then merge the output .msh file
with an input file containing the post-processing directives (see above)

Hope this helps anyone Googling for help; I couldn't find any examples for
the Crack plugin when I searched around. Running the commands interactively
was also a big help in debugging.

Cheers,

Geoff


On Tue, May 13, 2014 at 10:59 AM, Geoff Oxberry <goxberry at gmail.com> wrote:

> The following .geo file describes what I am trying to do:
>
>
> /*********************************************************************
>  *
>  * Minimal crack example
>  *
>  *********************************************************************/
>
> // Characteristic length made large so the number of elements is small
> lc = 1;
>
> // Point: X, Y, Z coordinates, & characteristic length setting elt size
> Point(1) = {0, 0, 0, lc} ;
> Point(2) = {1, 0, 0, lc} ;
> Point(3) = {1, 1, 0, lc} ;
> Point(4) = {0, 1, 0, lc} ;
>
> // Lines defined by lists of numbers:
> Line(1) = {1, 2} ;
> Line(2) = {2, 3} ;
> Line(3) = {3, 4} ;
> Line(4) = {4, 1} ;
> Line(5) = {1, 3} ;
>
> // Line loops to construct surfaces
> Line Loop(1) = {1, 2, -5} ;
> Line Loop(2) = {5, 3, 4} ;
>
> // Surfaces for meshing
> Plane Surface(1) = {1} ;
> Plane Surface(2) = {2} ;
>
> Physical Line(105) = {5} ;
> Physical Surface(201) = {1} ;
> Physical Surface(202) = {2} ;
>
> // Duplicate nodes around Line 5; a mock crack
> Plugin(Crack).Dimension = 1 ;
> Plugin(Crack).PhysicalGroup = 1 ;
> Plugin(Crack).OpenBoundaryPhysicalGroup = 1 ;
> Plugin(Crack).Run ;
>
> // End of file
>
> However, when I try to mesh this geometry, I get an error during the
> processing:
> Physical group 105 (dimension 1) is empty
>
> Geoffs-MacBook-Pro:~ goxberry$ gmsh crack.geo -2
> Info    : Running 'gmsh crack.geo -2' [Gmsh 2.8.4, 1 node, max. 1 thread]
> Info    : Started on Tue May 13 10:52:25 2014
> Info    : Reading 'crack.geo'...
> Info    : Running Plugin(Crack)...
> Error   : Physical group 105 (dimension 1) is empty
> Info    : Done running Plugin(Crack)
> Info    : Done reading 'crack.geo'
> Info    : Meshing 1D...
> Info    : Meshing curve 1 (Line)
> Info    : Meshing curve 2 (Line)
> Info    : Meshing curve 3 (Line)
> Info    : Meshing curve 4 (Line)
> Info    : Meshing curve 5 (Line)
> Info    : Done meshing 1D (0.000602 s)
> Info    : Meshing 2D...
> Info    : Meshing surface 1 (Plane, Delaunay)
> Info    : Meshing surface 2 (Plane, Delaunay)
> Info    : Done meshing 2D (0.000666142 s)
> Info    : 5 vertices 14 elements
> Info    : Writing 'crack.msh'...
> Info    : Done writing 'crack.msh'
> Info    : Stopped on Tue May 13 10:52:25 2014
>
> How should I correct my input file so it duplicates the nodes along
> Physical Line 105 (equivalently, Line 5)?
>
> Thanks,
>
> Geoff
>
> --
> Geoffrey Oxberry, Ph.D., E.I.T.
> goxberry at gmail.com
>



-- 
Geoffrey Oxberry, Ph.D., E.I.T.
goxberry at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20140514/eaadf629/attachment.html>