Dear Lei Zhang,

By default the gmsh format read by getfem is the format 1.
By default the format used by gmsh is currently the format 2.
You have two solutions :
- you register your mesh as format 1 instead of 2 in gmsh.
- you use in getfem:
""getfem::import_mesh("t1.msh","gmshv2",m1);"" instead of:
""getfem::import_mesh("t1.msh","gmsh",m1);""

Best regards,
Ronan

Lei Zhang a écrit :
Dear developers,

Thanks for developing Getfem++. I am trying to use this package in my research.
Could you help with the following problem? Thanks a lot in advance!

When I tried to use import_mesh to import GMSH file into getfem like this:
    getfem::mesh m1;
    getfem::import_mesh("t1.msh","gmsh",m1);

I got the following error,
============================================
|      An error has been detected !!!      |
============================================
Error in getfem_import.cc, line 517 :
error while importing gmsh mesh file "t1.msh" : basic_ios::clear


The following is the gmsh file t1.msh.
$---------------------------------------------------------------------------------
$MeshFormat
2 0 8
$EndMeshFormat
$PhysicalNames
1
100 "My fancy surface label"
$EndPhysicalNames
$Nodes
9
1 0 0 0
2 1 0 0
3 1 2 0
4 0 2 0
5 0.4999999999986717 0 0
6 1 1.000000000002661 0
7 0.5000000000013305 2 0
8 0 1.000000000002661 0
9 0.5 1 0
$EndNodes
$Elements
16
1 15 3 1 1 0 1
2 15 3 1 2 0 2
3 1 3 99 1 0 1 5
4 1 3 99 1 0 5 2
5 1 3 99 2 0 3 6
6 1 3 99 2 0 6 2
7 1 3 99 4 0 4 8
8 1 3 99 4 0 8 1
9 2 3 100 6 0 2 6 9
10 2 3 100 6 0 6 7 9
11 2 3 100 6 0 6 3 7
12 2 3 100 6 0 9 7 4
13 2 3 100 6 0 2 9 5
14 2 3 100 6 0 9 8 5
15 2 3 100 6 0 9 4 8
16 2 3 100 6 0 5 8 1
$EndElements
$------------------------------------------------------------

Lei

_______________________________________________
Getfem-users mailing list
[email protected]
https://mail.gna.org/listinfo/getfem-users
begin:vcard
fn:Ronan Perrussel
n:Perrussel;Ronan
org;quoted-printable:Laboratoire Amp=C3=A8re
adr:;;36, avenue Guy de Collongue;Ecully;;69134;France
email;internet:[EMAIL PROTECTED]
title;quoted-printable:Charg=C3=A9 de recherche CNRS / Assistant scientist
tel;work:+33 4 72 18 61 09
x-mozilla-html:FALSE
url:http://perso.ec-lyon.fr/ronan.perrussel/
version:2.1
end:vcard

_______________________________________________
Getfem-users mailing list
[email protected]
https://mail.gna.org/listinfo/getfem-users

Reply via email to