# Gmsh/Example

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

As an example for using gmsh, we are going to create a simple two-dimensional mesh.

```[leonhard@euler09 ~]\$ cat t1.geo
lc = 1e-2;
Point(1) = {0, 0, 0, lc};
Point(2) = {.1, 0,  0, lc} ;
Point(3) = {.1, .3, 0, lc} ;
Point(4) = {0,  .3, 0, lc} ;
Line(1) = {1,2} ;
Line(2) = {3,2} ;
Line(3) = {3,4} ;
Line(4) = {4,1} ;
Line Loop(1) = {4,1,-2,3} ;
Plane Surface(1) = {1} ;
Physical Point(1) = {1,2} ;
MY_LINE = 2;
Physical Line(MY_LINE) = {1,2} ;
Physical Line("My second line (automatic physical id)") = {3} ;
Physical Line("My third line (physical id 5)", 5) = {4} ;
Physical Surface("My surface") = {1} ;
[leonhard@euler09 ~]\$ module load gcc/4.8.2 python/2.7.6 gmsh/2.12
Autoloading openblas/0.2.13_seq
[leonhard@euler09 ~]\$ bsub -n 1 -W 0:10 -R "rusage[mem=100]" "gmsh t1.geo -2"
Generic job.
Job <36396680> is submitted to queue <normal.4h>.
[leonhard@euler09 ~]\$ bjobs
JOBID      USER       STAT  QUEUE      FROM_HOST   EXEC_HOST   JOB_NAME   SUBMIT_TIME
36396680   leonhard   PEND  normal.4h  euler09
[leonhard@euler09 ~]\$ bjobs
JOBID      USER       STAT  QUEUE      FROM_HOST   EXEC_HOST   JOB_NAME   SUBMIT_TIME
36396680   leonhard   RUN   normal.4h  euler09     e1047       *gmesh.pos Jan 27 15:33
[leonhard@euler09 ~]\$ bjobs
No unfinished job found
[leonhard@euler09 ~]\$ grep Done lsf.o36396680
Info    : Done reading 't1.geo'
Info    : Done meshing 1D (0.001 s)
Info    : Done meshing 2D (0.0190279 s)
Info    : Done writing 't1.msh'
[leonhard@euler09 ~]\$
```

The resource usage summary for the job can be found in the LSF log file.