Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ad450bc

Browse files
committed
Add a good .msh file (swiped from MOOSE) to tests
1 parent 52d29fd commit ad450bc

File tree

3 files changed

+146
-2
lines changed

3 files changed

+146
-2
lines changed

tests/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ data = matrices/geom_1_extraction_op.m \
155155
meshes/bad_64bit_elem_integers.e \
156156
meshes/block.msh \
157157
meshes/BlockWithHole_Patch9.bxt.gz \
158+
meshes/circle.msh \
158159
meshes/constrain10to4.m \
159160
meshes/Cube_With_Sidesets.e \
160161
meshes/exodus_elements/read_exodus_EDGE2.e \

tests/mesh/mesh_input.C

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,8 @@ public:
194194
#endif // LIBMESH_DIM > 1
195195
//
196196
#if LIBMESH_DIM > 1
197-
CPPUNIT_TEST( testGmsh );
197+
CPPUNIT_TEST( testBadGmsh );
198+
CPPUNIT_TEST( testGoodGmsh );
198199
#endif
199200

200201
#ifdef LIBMESH_HAVE_TETGEN
@@ -1514,7 +1515,7 @@ public:
15141515
helperTestingDynaQuad(mesh);
15151516
}
15161517

1517-
void testGmsh ()
1518+
void testBadGmsh ()
15181519
{
15191520
LOG_UNIT_TEST;
15201521

@@ -1540,6 +1541,20 @@ public:
15401541
#endif
15411542
}
15421543

1544+
void testGoodGmsh ()
1545+
{
1546+
LOG_UNIT_TEST;
1547+
1548+
Mesh mesh(*TestCommWorld);
1549+
1550+
GmshIO gmsh_io(mesh);
1551+
1552+
if (mesh.processor_id() == 0)
1553+
gmsh_io.read("meshes/circle.msh");
1554+
1555+
CPPUNIT_ASSERT_EQUAL(mesh.n_elem(), dof_id_type(16));
1556+
}
1557+
15431558
void testTetgenIO ()
15441559
{
15451560
#ifdef LIBMESH_HAVE_TETGEN

tests/meshes/circle.msh

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
$MeshFormat
2+
4.1 0 8
3+
$EndMeshFormat
4+
$PhysicalNames
5+
2
6+
1 2 "outer"
7+
2 1 "domain"
8+
$EndPhysicalNames
9+
$Entities
10+
5 4 1 0
11+
1 1 0 0 0
12+
2 0 1 0 0
13+
3 0 0 0 0
14+
4 -1 0 0 0
15+
5 0 -1 0 0
16+
1 5.551115123125783e-17 0 0 1 1 0 1 2 2 1 -2
17+
2 -1 5.551115123125783e-17 0 0 1 0 0 2 2 -4
18+
3 -1 -1 0 -5.551115123125783e-17 0 0 0 2 4 -5
19+
4 0 -1 0 1 -5.551115123125783e-17 0 0 2 5 -1
20+
1 -1 -1 0 1 1 0 1 1 4 1 2 3 4
21+
$EndEntities
22+
$Nodes
23+
9 37 1 37
24+
0 1 0 1
25+
1
26+
1 0 0
27+
0 2 0 1
28+
2
29+
0 1 0
30+
0 4 0 1
31+
3
32+
-1 0 0
33+
0 5 0 1
34+
4
35+
0 -1 0
36+
1 1 0 3
37+
5
38+
6
39+
7
40+
0.7071067795767627 0.7071067827963323 0
41+
0.9238795321515167 0.3826834332336513 0
42+
0.3826834311765871 0.9238795330035807 0
43+
1 2 0 3
44+
8
45+
9
46+
10
47+
-0.7071067827963323 0.7071067795767627 0
48+
-0.3826834332336513 0.9238795321515167 0
49+
-0.9238795330035807 0.3826834311765871 0
50+
1 3 0 3
51+
11
52+
12
53+
13
54+
-0.7071067795767627 -0.7071067827963323 0
55+
-0.9238795321515167 -0.3826834332336513 0
56+
-0.3826834311765871 -0.9238795330035807 0
57+
1 4 0 3
58+
14
59+
15
60+
16
61+
0.7071067827963323 -0.7071067795767627 0
62+
0.3826834332336513 -0.9238795321515167 0
63+
0.9238795330035807 -0.3826834311765871 0
64+
2 1 0 21
65+
17
66+
18
67+
19
68+
20
69+
21
70+
22
71+
23
72+
24
73+
25
74+
26
75+
27
76+
28
77+
29
78+
30
79+
31
80+
32
81+
33
82+
34
83+
35
84+
36
85+
37
86+
0.268765817223823 0.1113264469548191 0
87+
-0.3632776934576478 -0.1504745480222367 0
88+
-0.1902402587220213 0.4476830150213186 0
89+
0.1820395197735081 -0.4510798723262105 0
90+
0.6343829086119115 0.05566322347740954 0
91+
0.2254026684986655 -0.1698767126856957 0
92+
0.591019759886754 -0.2255399361631052 0
93+
0.4879362984002928 0.4092166148755757 0
94+
0.2584332604273707 0.5773948989088254 0
95+
0.03926277925090085 0.2795047309880688 0
96+
0.4445731512849203 -0.5790933259514865 0
97+
-0.09512012936101064 0.7238415075106593 0
98+
-0.5951201293610107 0.2238415075106593 0
99+
-0.4486735207591768 0.5773948972990407 0
100+
0.09101975988675405 -0.7255399361631052 0
101+
-0.2625336299016273 -0.5790933275612714 0
102+
-0.5351922365172053 -0.4287906654092845 0
103+
-0.09061908684206985 -0.3007772101742236 0
104+
-0.6816388467288239 -0.07523727401111835 0
105+
-0.2767589760898345 0.148604233499541 0
106+
-0.04725593811691242 -0.01957405053370881 0
107+
$EndNodes
108+
$Elements
109+
2 16 1 16
110+
1 1 8 2
111+
1 1 5 6
112+
2 5 2 7
113+
2 1 9 14
114+
3 1 17 20 21 22 23
115+
4 17 5 19 24 25 26
116+
5 14 1 20 16 23 27
117+
6 5 2 19 7 28 25
118+
7 8 3 19 10 29 30
119+
8 11 4 20 13 31 32
120+
9 18 11 20 33 32 34
121+
10 3 18 19 35 36 29
122+
11 1 5 17 6 24 21
123+
12 3 11 18 12 33 35
124+
13 2 8 19 9 30 28
125+
14 4 14 20 15 27 31
126+
15 17 18 20 37 34 22
127+
16 18 17 19 37 26 36
128+
$EndElements

0 commit comments

Comments
 (0)