Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
e157b2d0
Commit
e157b2d0
authored
21 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
Small changes for skeletton of new mesh format
parent
cdb64fe9
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Mesh/Print_Mesh.cpp
+74
-29
74 additions, 29 deletions
Mesh/Print_Mesh.cpp
Mesh/Read_Mesh.cpp
+44
-16
44 additions, 16 deletions
Mesh/Read_Mesh.cpp
Parser/OpenFile.cpp
+3
-2
3 additions, 2 deletions
Parser/OpenFile.cpp
with
121 additions
and
47 deletions
Mesh/Print_Mesh.cpp
+
74
−
29
View file @
e157b2d0
// $Id: Print_Mesh.cpp,v 1.4
4
2003-1
1-27 07:14:29
geuzaine Exp $
// $Id: Print_Mesh.cpp,v 1.4
5
2003-1
2-07 02:56:34
geuzaine Exp $
//
//
// Copyright (C) 1997-2003 C. Geuzaine, J.-F. Remacle
// Copyright (C) 1997-2003 C. Geuzaine, J.-F. Remacle
//
//
...
@@ -49,6 +49,7 @@ static FILE *meshfile;
...
@@ -49,6 +49,7 @@ static FILE *meshfile;
#define PYRAMID_2 14
#define PYRAMID_2 14
#define POINT 15
#define POINT 15
static
double
MSH_VERSION
=
1.0
;
static
int
MSH_VOL_NUM
,
MSH_SUR_NUM
,
MSH_LIN_NUM
;
static
int
MSH_VOL_NUM
,
MSH_SUR_NUM
,
MSH_LIN_NUM
;
static
int
MSH_NODE_NUM
,
MSH_ELEMENT_NUM
,
MSH_3D
,
MSH_ADD
;
static
int
MSH_NODE_NUM
,
MSH_ELEMENT_NUM
,
MSH_3D
,
MSH_ADD
;
static
int
MSH_PHYSICAL_NUM
,
MSH_PHYSICAL_ORI
;
static
int
MSH_PHYSICAL_NUM
,
MSH_PHYSICAL_ORI
;
...
@@ -89,10 +90,16 @@ void process_msh_nodes(Mesh * M)
...
@@ -89,10 +90,16 @@ void process_msh_nodes(Mesh * M)
MSH_NODE_NUM
=
Tree_Nbr
(
M
->
Vertices
);
MSH_NODE_NUM
=
Tree_Nbr
(
M
->
Vertices
);
fprintf
(
meshfile
,
"$NOD
\n
"
);
if
(
MSH_VERSION
>
1.0
)
fprintf
(
meshfile
,
"$Nodes
\n
"
);
else
fprintf
(
meshfile
,
"$NOD
\n
"
);
fprintf
(
meshfile
,
"%d
\n
"
,
MSH_NODE_NUM
);
fprintf
(
meshfile
,
"%d
\n
"
,
MSH_NODE_NUM
);
Tree_Action
(
M
->
Vertices
,
print_msh_node
);
Tree_Action
(
M
->
Vertices
,
print_msh_node
);
fprintf
(
meshfile
,
"$ENDNOD
\n
"
);
if
(
MSH_VERSION
>
1.0
)
fprintf
(
meshfile
,
"$ENDNOD
\n
"
);
else
fprintf
(
meshfile
,
"$EndNodes
\n
"
);
}
}
void
print_msh_simplex
(
void
*
a
,
void
*
b
)
void
print_msh_simplex
(
void
*
a
,
void
*
b
)
...
@@ -161,11 +168,16 @@ void print_msh_simplex(void *a, void *b)
...
@@ -161,11 +168,16 @@ void print_msh_simplex(void *a, void *b)
}
}
}
}
fprintf
(
meshfile
,
"%d %d %d %d %d"
,
if
(
MSH_VERSION
>
1.0
)
//MSH_PHYSICAL_NUM ? MSH_ELEMENT_NUM++ : (*S)->Num, type,
fprintf
(
meshfile
,
"%d %d %d %d 0 %d"
,
MSH_ELEMENT_NUM
++
,
type
,
MSH_ELEMENT_NUM
++
,
type
,
MSH_PHYSICAL_NUM
?
MSH_PHYSICAL_NUM
:
(
*
S
)
->
iEnt
,
(
*
S
)
->
iEnt
,
MSH_PHYSICAL_NUM
?
MSH_PHYSICAL_NUM
:
(
*
S
)
->
iEnt
,
(
*
S
)
->
iEnt
,
nbn
+
nbs
);
nbn
+
nbs
);
else
fprintf
(
meshfile
,
"%d %d %d %d %d"
,
MSH_ELEMENT_NUM
++
,
type
,
MSH_PHYSICAL_NUM
?
MSH_PHYSICAL_NUM
:
(
*
S
)
->
iEnt
,
(
*
S
)
->
iEnt
,
nbn
+
nbs
);
if
(
MSH_PHYSICAL_ORI
>
0
)
{
if
(
MSH_PHYSICAL_ORI
>
0
)
{
for
(
i
=
0
;
i
<
nbn
;
i
++
)
for
(
i
=
0
;
i
<
nbn
;
i
++
)
...
@@ -206,11 +218,16 @@ void print_msh_hexahedron(void *a, void *b)
...
@@ -206,11 +218,16 @@ void print_msh_hexahedron(void *a, void *b)
else
else
type
=
HEXAHEDRON
;
type
=
HEXAHEDRON
;
fprintf
(
meshfile
,
"%d %d %d %d %d"
,
if
(
MSH_VERSION
>
1.0
)
//MSH_PHYSICAL_NUM ? MSH_ELEMENT_NUM++ : (*H)->Num, type,
fprintf
(
meshfile
,
"%d %d %d %d 0 %d"
,
MSH_ELEMENT_NUM
++
,
type
,
MSH_ELEMENT_NUM
++
,
type
,
MSH_PHYSICAL_NUM
?
MSH_PHYSICAL_NUM
:
(
*
H
)
->
iEnt
,
(
*
H
)
->
iEnt
,
MSH_PHYSICAL_NUM
?
MSH_PHYSICAL_NUM
:
(
*
H
)
->
iEnt
,
(
*
H
)
->
iEnt
,
nbn
+
nbs
);
nbn
+
nbs
);
else
fprintf
(
meshfile
,
"%d %d %d %d %d"
,
MSH_ELEMENT_NUM
++
,
type
,
MSH_PHYSICAL_NUM
?
MSH_PHYSICAL_NUM
:
(
*
H
)
->
iEnt
,
(
*
H
)
->
iEnt
,
nbn
+
nbs
);
for
(
i
=
0
;
i
<
nbn
;
i
++
)
for
(
i
=
0
;
i
<
nbn
;
i
++
)
fprintf
(
meshfile
,
" %d"
,
(
*
H
)
->
V
[
i
]
->
Num
);
fprintf
(
meshfile
,
" %d"
,
(
*
H
)
->
V
[
i
]
->
Num
);
...
@@ -244,11 +261,16 @@ void print_msh_prism(void *a, void *b)
...
@@ -244,11 +261,16 @@ void print_msh_prism(void *a, void *b)
type
=
PRISM
;
type
=
PRISM
;
}
}
fprintf
(
meshfile
,
"%d %d %d %d %d"
,
if
(
MSH_VERSION
>
1.0
)
//MSH_PHYSICAL_NUM ? MSH_ELEMENT_NUM++ : (*P)->Num, type,
fprintf
(
meshfile
,
"%d %d %d %d 0 %d"
,
MSH_ELEMENT_NUM
++
,
type
,
MSH_ELEMENT_NUM
++
,
type
,
MSH_PHYSICAL_NUM
?
MSH_PHYSICAL_NUM
:
(
*
P
)
->
iEnt
,
(
*
P
)
->
iEnt
,
MSH_PHYSICAL_NUM
?
MSH_PHYSICAL_NUM
:
(
*
P
)
->
iEnt
,
(
*
P
)
->
iEnt
,
nbn
+
nbs
);
nbn
+
nbs
);
else
fprintf
(
meshfile
,
"%d %d %d %d %d"
,
MSH_ELEMENT_NUM
++
,
type
,
MSH_PHYSICAL_NUM
?
MSH_PHYSICAL_NUM
:
(
*
P
)
->
iEnt
,
(
*
P
)
->
iEnt
,
nbn
+
nbs
);
for
(
i
=
0
;
i
<
nbn
;
i
++
)
for
(
i
=
0
;
i
<
nbn
;
i
++
)
fprintf
(
meshfile
,
" %d"
,
(
*
P
)
->
V
[
i
]
->
Num
);
fprintf
(
meshfile
,
" %d"
,
(
*
P
)
->
V
[
i
]
->
Num
);
...
@@ -282,11 +304,16 @@ void print_msh_pyramid(void *a, void *b)
...
@@ -282,11 +304,16 @@ void print_msh_pyramid(void *a, void *b)
type
=
PYRAMID
;
type
=
PYRAMID
;
}
}
fprintf
(
meshfile
,
"%d %d %d %d %d"
,
if
(
MSH_VERSION
>
1.0
)
//MSH_PHYSICAL_NUM ? MSH_ELEMENT_NUM++ : (*P)->Num, type,
fprintf
(
meshfile
,
"%d %d %d %d 0 %d"
,
MSH_ELEMENT_NUM
++
,
type
,
MSH_ELEMENT_NUM
++
,
type
,
MSH_PHYSICAL_NUM
?
MSH_PHYSICAL_NUM
:
(
*
P
)
->
iEnt
,
(
*
P
)
->
iEnt
,
MSH_PHYSICAL_NUM
?
MSH_PHYSICAL_NUM
:
(
*
P
)
->
iEnt
,
(
*
P
)
->
iEnt
,
nbn
+
nbs
);
nbn
+
nbs
);
else
fprintf
(
meshfile
,
"%d %d %d %d %d"
,
MSH_ELEMENT_NUM
++
,
type
,
MSH_PHYSICAL_NUM
?
MSH_PHYSICAL_NUM
:
(
*
P
)
->
iEnt
,
(
*
P
)
->
iEnt
,
nbn
+
nbs
);
for
(
i
=
0
;
i
<
nbn
;
i
++
)
for
(
i
=
0
;
i
<
nbn
;
i
++
)
fprintf
(
meshfile
,
" %d"
,
(
*
P
)
->
V
[
i
]
->
Num
);
fprintf
(
meshfile
,
" %d"
,
(
*
P
)
->
V
[
i
]
->
Num
);
...
@@ -303,10 +330,14 @@ void print_msh_point(Vertex * V)
...
@@ -303,10 +330,14 @@ void print_msh_point(Vertex * V)
return
;
return
;
}
}
fprintf
(
meshfile
,
"%d %d %d %d 1 %d
\n
"
,
if
(
MSH_VERSION
>
1.0
)
//MSH_PHYSICAL_NUM ? MSH_ELEMENT_NUM++ : V->Num, POINT,
fprintf
(
meshfile
,
"%d %d %d %d 0 1 %d
\n
"
,
MSH_ELEMENT_NUM
++
,
POINT
,
MSH_ELEMENT_NUM
++
,
POINT
,
MSH_PHYSICAL_NUM
?
MSH_PHYSICAL_NUM
:
V
->
Num
,
V
->
Num
,
V
->
Num
);
MSH_PHYSICAL_NUM
?
MSH_PHYSICAL_NUM
:
V
->
Num
,
V
->
Num
,
V
->
Num
);
else
fprintf
(
meshfile
,
"%d %d %d %d 1 %d
\n
"
,
MSH_ELEMENT_NUM
++
,
POINT
,
MSH_PHYSICAL_NUM
?
MSH_PHYSICAL_NUM
:
V
->
Num
,
V
->
Num
,
V
->
Num
);
}
}
void
print_msh_elements
(
Mesh
*
M
)
void
print_msh_elements
(
Mesh
*
M
)
...
@@ -471,7 +502,11 @@ void process_msh_elements(Mesh * M)
...
@@ -471,7 +502,11 @@ void process_msh_elements(Mesh * M)
else
else
print_msh_elements
(
M
);
print_msh_elements
(
M
);
fprintf
(
meshfile
,
"$ELM
\n
"
);
if
(
MSH_VERSION
>
1.0
)
fprintf
(
meshfile
,
"$Elements
\n
"
);
else
fprintf
(
meshfile
,
"$ELM
\n
"
);
fprintf
(
meshfile
,
"%d
\n
"
,
MSH_ELEMENT_NUM
-
1
);
fprintf
(
meshfile
,
"%d
\n
"
,
MSH_ELEMENT_NUM
-
1
);
if
(
MSH_ELEMENT_NUM
==
1
)
if
(
MSH_ELEMENT_NUM
==
1
)
...
@@ -483,7 +518,11 @@ void process_msh_elements(Mesh * M)
...
@@ -483,7 +518,11 @@ void process_msh_elements(Mesh * M)
print_all_msh_elements
(
M
);
print_all_msh_elements
(
M
);
else
else
print_msh_elements
(
M
);
print_msh_elements
(
M
);
fprintf
(
meshfile
,
"$ENDELM
\n
"
);
if
(
MSH_VERSION
>
1.0
)
fprintf
(
meshfile
,
"$EndElements
\n
"
);
else
fprintf
(
meshfile
,
"$ENDELM
\n
"
);
}
}
...
@@ -1360,6 +1399,12 @@ void Print_Mesh(Mesh * M, char *c, int Type)
...
@@ -1360,6 +1399,12 @@ void Print_Mesh(Mesh * M, char *c, int Type)
switch
(
Type
){
switch
(
Type
){
case
FORMAT_MSH
:
case
FORMAT_MSH
:
MSH_VERSION
=
0.0
;
if
(
MSH_VERSION
>
1.0
){
fprintf
(
meshfile
,
"$MeshFormat
\n
"
);
fprintf
(
meshfile
,
"%g %d %d
\n
"
,
MSH_VERSION
,
LIST_FORMAT_ASCII
,
sizeof
(
double
));
fprintf
(
meshfile
,
"$EndMeshFormat
\n
"
);
}
process_msh_nodes
(
M
);
process_msh_nodes
(
M
);
process_msh_elements
(
M
);
process_msh_elements
(
M
);
Msg
(
INFO
,
"%d nodes"
,
MSH_NODE_NUM
);
Msg
(
INFO
,
"%d nodes"
,
MSH_NODE_NUM
);
...
...
This diff is collapsed.
Click to expand it.
Mesh/Read_Mesh.cpp
+
44
−
16
View file @
e157b2d0
// $Id: Read_Mesh.cpp,v 1.6
0
2003-12-07 0
0:23:07
geuzaine Exp $
// $Id: Read_Mesh.cpp,v 1.6
1
2003-12-07 0
2:56:34
geuzaine Exp $
//
//
// Copyright (C) 1997-2003 C. Geuzaine, J.-F. Remacle
// Copyright (C) 1997-2003 C. Geuzaine, J.-F. Remacle
//
//
...
@@ -89,8 +89,10 @@ void addPhysicalGroup(Mesh * M, int Type, int Physical, int Elementary)
...
@@ -89,8 +89,10 @@ void addPhysicalGroup(Mesh * M, int Type, int Physical, int Elementary)
void
Read_Mesh_MSH
(
Mesh
*
M
,
FILE
*
fp
)
void
Read_Mesh_MSH
(
Mesh
*
M
,
FILE
*
fp
)
{
{
char
String
[
256
];
char
String
[
256
];
double
version
=
1.0
;
int
format
=
LIST_FORMAT_ASCII
,
size
=
sizeof
(
double
);
int
Nbr_Nodes
,
Nbr_Elements
,
i_Node
,
i_Element
;
int
Nbr_Nodes
,
Nbr_Elements
,
i_Node
,
i_Element
;
int
Num
,
Type
,
Physical
,
Elementary
,
i
,
j
;
int
Num
,
Type
,
Physical
,
Elementary
,
Partition
,
i
,
j
;
double
x
,
y
,
z
,
lc1
,
lc2
;
double
x
,
y
,
z
,
lc1
,
lc2
;
Vertex
*
vert
,
verts
[
NB_NOD_MAX_ELM
],
*
vertsp
[
NB_NOD_MAX_ELM
],
**
vertspp
;
Vertex
*
vert
,
verts
[
NB_NOD_MAX_ELM
],
*
vertsp
[
NB_NOD_MAX_ELM
],
**
vertspp
;
Simplex
*
simp
;
Simplex
*
simp
;
...
@@ -112,9 +114,25 @@ void Read_Mesh_MSH(Mesh * M, FILE * fp)
...
@@ -112,9 +114,25 @@ void Read_Mesh_MSH(Mesh * M, FILE * fp)
if
(
feof
(
fp
))
if
(
feof
(
fp
))
break
;
break
;
/* F o r m a t */
if
(
!
strncmp
(
&
String
[
1
],
"MeshFormat"
,
10
))
{
fscanf
(
fp
,
"%lf %d %d
\n
"
,
&
version
,
&
format
,
&
size
);
Msg
(
INFO
,
"Detected mesh file format %g"
,
version
);
if
(
format
==
0
)
format
=
LIST_FORMAT_ASCII
;
else
if
(
format
==
1
)
format
=
LIST_FORMAT_BINARY
;
else
{
Msg
(
GERROR
,
"Unknown data format for mesh"
);
return
;
}
}
/* P T S */
/* P T S */
if
(
!
strncmp
(
&
String
[
1
],
"PTS"
,
3
))
{
if
(
!
strncmp
(
&
String
[
1
],
"PTS"
,
3
)
||
!
strncmp
(
&
String
[
1
],
"Points"
,
6
))
{
fscanf
(
fp
,
"%d"
,
&
Nbr_Nodes
);
fscanf
(
fp
,
"%d"
,
&
Nbr_Nodes
);
Msg
(
INFO
,
"%d points"
,
Nbr_Nodes
);
Msg
(
INFO
,
"%d points"
,
Nbr_Nodes
);
...
@@ -132,7 +150,9 @@ void Read_Mesh_MSH(Mesh * M, FILE * fp)
...
@@ -132,7 +150,9 @@ void Read_Mesh_MSH(Mesh * M, FILE * fp)
/* N O E */
/* N O E */
if
(
!
strncmp
(
&
String
[
1
],
"NO"
,
2
))
{
/* $NOE or $NOD */
if
(
!
strncmp
(
&
String
[
1
],
"NOD"
,
3
)
||
!
strncmp
(
&
String
[
1
],
"NOE"
,
3
)
||
!
strncmp
(
&
String
[
1
],
"Nodes"
,
5
))
{
fscanf
(
fp
,
"%d"
,
&
Nbr_Nodes
);
fscanf
(
fp
,
"%d"
,
&
Nbr_Nodes
);
Msg
(
INFO
,
"%d nodes"
,
Nbr_Nodes
);
Msg
(
INFO
,
"%d nodes"
,
Nbr_Nodes
);
...
@@ -160,7 +180,8 @@ void Read_Mesh_MSH(Mesh * M, FILE * fp)
...
@@ -160,7 +180,8 @@ void Read_Mesh_MSH(Mesh * M, FILE * fp)
/* ELEMENTS */
/* ELEMENTS */
else
if
(
!
strncmp
(
&
String
[
1
],
"ELM"
,
3
))
{
else
if
(
!
strncmp
(
&
String
[
1
],
"ELM"
,
3
)
||
!
strncmp
(
&
String
[
1
],
"Elements"
,
8
))
{
fscanf
(
fp
,
"%d"
,
&
Nbr_Elements
);
fscanf
(
fp
,
"%d"
,
&
Nbr_Elements
);
Msg
(
INFO
,
"%d elements"
,
Nbr_Elements
);
Msg
(
INFO
,
"%d elements"
,
Nbr_Elements
);
...
@@ -169,9 +190,16 @@ void Read_Mesh_MSH(Mesh * M, FILE * fp)
...
@@ -169,9 +190,16 @@ void Read_Mesh_MSH(Mesh * M, FILE * fp)
Duplicates
=
Tree_Create
(
sizeof
(
Vertex
*
),
comparePosition
);
Duplicates
=
Tree_Create
(
sizeof
(
Vertex
*
),
comparePosition
);
for
(
i_Element
=
0
;
i_Element
<
Nbr_Elements
;
i_Element
++
)
{
for
(
i_Element
=
0
;
i_Element
<
Nbr_Elements
;
i_Element
++
)
{
fscanf
(
fp
,
"%d %d %d %d %d"
,
if
(
version
<=
1.0
){
&
Num
,
&
Type
,
&
Physical
,
&
Elementary
,
&
Nbr_Nodes
);
fscanf
(
fp
,
"%d %d %d %d %d"
,
&
Num
,
&
Type
,
&
Physical
,
&
Elementary
,
&
Nbr_Nodes
);
Partition
=
Physical
;
}
else
{
fscanf
(
fp
,
"%d %d %d %d %d %d"
,
&
Num
,
&
Type
,
&
Physical
,
&
Elementary
,
&
Partition
,
&
Nbr_Nodes
);
}
for
(
j
=
0
;
j
<
Nbr_Nodes
;
j
++
)
for
(
j
=
0
;
j
<
Nbr_Nodes
;
j
++
)
fscanf
(
fp
,
"%d"
,
&
verts
[
j
].
Num
);
fscanf
(
fp
,
"%d"
,
&
verts
[
j
].
Num
);
...
@@ -232,7 +260,7 @@ void Read_Mesh_MSH(Mesh * M, FILE * fp)
...
@@ -232,7 +260,7 @@ void Read_Mesh_MSH(Mesh * M, FILE * fp)
// JF, why did you add this?
// JF, why did you add this?
addPhysicalGroup
(
M
,
MSH_PHYSICAL_POINT
,
Physical
,
Elementary
);
addPhysicalGroup
(
M
,
MSH_PHYSICAL_POINT
,
Physical
,
Elementary
);
break
;
break
;
}
}
for
(
i
=
0
;
i
<
Nbr_Nodes
;
i
++
)
{
for
(
i
=
0
;
i
<
Nbr_Nodes
;
i
++
)
{
vertsp
[
i
]
=
&
verts
[
i
];
vertsp
[
i
]
=
&
verts
[
i
];
...
@@ -265,7 +293,7 @@ void Read_Mesh_MSH(Mesh * M, FILE * fp)
...
@@ -265,7 +293,7 @@ void Read_Mesh_MSH(Mesh * M, FILE * fp)
simp
=
Create_Simplex
(
vertsp
[
0
],
vertsp
[
1
],
NULL
,
NULL
);
simp
=
Create_Simplex
(
vertsp
[
0
],
vertsp
[
1
],
NULL
,
NULL
);
simp
->
Num
=
Num
;
simp
->
Num
=
Num
;
simp
->
iEnt
=
Elementary
;
simp
->
iEnt
=
Elementary
;
simp
->
iPart
=
Add_MeshPartition
(
P
hysical
,
M
);
simp
->
iPart
=
Add_MeshPartition
(
P
artition
,
M
);
if
(
Type
==
LGN2
){
if
(
Type
==
LGN2
){
simp
->
VSUP
=
(
Vertex
**
)
Malloc
(
1
*
sizeof
(
Vertex
*
));
simp
->
VSUP
=
(
Vertex
**
)
Malloc
(
1
*
sizeof
(
Vertex
*
));
simp
->
VSUP
[
0
]
=
vertsp
[
2
];
simp
->
VSUP
[
0
]
=
vertsp
[
2
];
...
@@ -281,7 +309,7 @@ void Read_Mesh_MSH(Mesh * M, FILE * fp)
...
@@ -281,7 +309,7 @@ void Read_Mesh_MSH(Mesh * M, FILE * fp)
simp
=
Create_Simplex
(
vertsp
[
0
],
vertsp
[
1
],
vertsp
[
2
],
NULL
);
simp
=
Create_Simplex
(
vertsp
[
0
],
vertsp
[
1
],
vertsp
[
2
],
NULL
);
simp
->
Num
=
Num
;
simp
->
Num
=
Num
;
simp
->
iEnt
=
Elementary
;
simp
->
iEnt
=
Elementary
;
simp
->
iPart
=
Add_MeshPartition
(
P
hysical
,
M
);
simp
->
iPart
=
Add_MeshPartition
(
P
artition
,
M
);
if
(
Type
==
TRI2
){
if
(
Type
==
TRI2
){
simp
->
VSUP
=
(
Vertex
**
)
Malloc
(
3
*
sizeof
(
Vertex
*
));
simp
->
VSUP
=
(
Vertex
**
)
Malloc
(
3
*
sizeof
(
Vertex
*
));
for
(
i
=
0
;
i
<
3
;
i
++
){
for
(
i
=
0
;
i
<
3
;
i
++
){
...
@@ -301,7 +329,7 @@ void Read_Mesh_MSH(Mesh * M, FILE * fp)
...
@@ -301,7 +329,7 @@ void Read_Mesh_MSH(Mesh * M, FILE * fp)
simp
=
Create_Quadrangle
(
vertsp
[
0
],
vertsp
[
1
],
vertsp
[
2
],
vertsp
[
3
]);
simp
=
Create_Quadrangle
(
vertsp
[
0
],
vertsp
[
1
],
vertsp
[
2
],
vertsp
[
3
]);
simp
->
Num
=
Num
;
simp
->
Num
=
Num
;
simp
->
iEnt
=
Elementary
;
simp
->
iEnt
=
Elementary
;
simp
->
iPart
=
Add_MeshPartition
(
P
hysical
,
M
);
simp
->
iPart
=
Add_MeshPartition
(
P
artition
,
M
);
if
(
Type
==
QUA2
){
if
(
Type
==
QUA2
){
simp
->
VSUP
=
(
Vertex
**
)
Malloc
(
4
*
sizeof
(
Vertex
*
));
simp
->
VSUP
=
(
Vertex
**
)
Malloc
(
4
*
sizeof
(
Vertex
*
));
for
(
i
=
0
;
i
<
4
;
i
++
){
for
(
i
=
0
;
i
<
4
;
i
++
){
...
@@ -322,7 +350,7 @@ void Read_Mesh_MSH(Mesh * M, FILE * fp)
...
@@ -322,7 +350,7 @@ void Read_Mesh_MSH(Mesh * M, FILE * fp)
simp
=
Create_Simplex
(
vertsp
[
0
],
vertsp
[
1
],
vertsp
[
2
],
vertsp
[
3
]);
simp
=
Create_Simplex
(
vertsp
[
0
],
vertsp
[
1
],
vertsp
[
2
],
vertsp
[
3
]);
simp
->
Num
=
Num
;
simp
->
Num
=
Num
;
simp
->
iEnt
=
Elementary
;
simp
->
iEnt
=
Elementary
;
simp
->
iPart
=
Add_MeshPartition
(
P
hysical
,
M
);
simp
->
iPart
=
Add_MeshPartition
(
P
artition
,
M
);
if
(
Type
==
TET2
){
if
(
Type
==
TET2
){
simp
->
VSUP
=
(
Vertex
**
)
Malloc
(
6
*
sizeof
(
Vertex
*
));
simp
->
VSUP
=
(
Vertex
**
)
Malloc
(
6
*
sizeof
(
Vertex
*
));
for
(
i
=
0
;
i
<
6
;
i
++
){
for
(
i
=
0
;
i
<
6
;
i
++
){
...
@@ -343,7 +371,7 @@ void Read_Mesh_MSH(Mesh * M, FILE * fp)
...
@@ -343,7 +371,7 @@ void Read_Mesh_MSH(Mesh * M, FILE * fp)
vertsp
[
4
],
vertsp
[
5
],
vertsp
[
6
],
vertsp
[
7
]);
vertsp
[
4
],
vertsp
[
5
],
vertsp
[
6
],
vertsp
[
7
]);
hex
->
Num
=
Num
;
hex
->
Num
=
Num
;
hex
->
iEnt
=
Elementary
;
hex
->
iEnt
=
Elementary
;
hex
->
iPart
=
Add_MeshPartition
(
P
hysical
,
M
);
hex
->
iPart
=
Add_MeshPartition
(
P
artition
,
M
);
if
(
Type
==
HEX2
){
if
(
Type
==
HEX2
){
hex
->
VSUP
=
(
Vertex
**
)
Malloc
(
12
*
sizeof
(
Vertex
*
));
hex
->
VSUP
=
(
Vertex
**
)
Malloc
(
12
*
sizeof
(
Vertex
*
));
for
(
i
=
0
;
i
<
12
;
i
++
){
for
(
i
=
0
;
i
<
12
;
i
++
){
...
@@ -364,7 +392,7 @@ void Read_Mesh_MSH(Mesh * M, FILE * fp)
...
@@ -364,7 +392,7 @@ void Read_Mesh_MSH(Mesh * M, FILE * fp)
vertsp
[
3
],
vertsp
[
4
],
vertsp
[
5
]);
vertsp
[
3
],
vertsp
[
4
],
vertsp
[
5
]);
pri
->
Num
=
Num
;
pri
->
Num
=
Num
;
pri
->
iEnt
=
Elementary
;
pri
->
iEnt
=
Elementary
;
pri
->
iPart
=
Add_MeshPartition
(
P
hysical
,
M
);
pri
->
iPart
=
Add_MeshPartition
(
P
artition
,
M
);
if
(
Type
==
PRI2
){
if
(
Type
==
PRI2
){
pri
->
VSUP
=
(
Vertex
**
)
Malloc
(
9
*
sizeof
(
Vertex
*
));
pri
->
VSUP
=
(
Vertex
**
)
Malloc
(
9
*
sizeof
(
Vertex
*
));
for
(
i
=
0
;
i
<
9
;
i
++
){
for
(
i
=
0
;
i
<
9
;
i
++
){
...
@@ -385,7 +413,7 @@ void Read_Mesh_MSH(Mesh * M, FILE * fp)
...
@@ -385,7 +413,7 @@ void Read_Mesh_MSH(Mesh * M, FILE * fp)
vertsp
[
3
],
vertsp
[
4
]);
vertsp
[
3
],
vertsp
[
4
]);
pyr
->
Num
=
Num
;
pyr
->
Num
=
Num
;
pyr
->
iEnt
=
Elementary
;
pyr
->
iEnt
=
Elementary
;
pyr
->
iPart
=
Add_MeshPartition
(
P
hysical
,
M
);
pyr
->
iPart
=
Add_MeshPartition
(
P
artition
,
M
);
if
(
Type
==
PYR2
){
if
(
Type
==
PYR2
){
pyr
->
VSUP
=
(
Vertex
**
)
Malloc
(
8
*
sizeof
(
Vertex
*
));
pyr
->
VSUP
=
(
Vertex
**
)
Malloc
(
8
*
sizeof
(
Vertex
*
));
for
(
i
=
0
;
i
<
8
;
i
++
){
for
(
i
=
0
;
i
<
8
;
i
++
){
...
...
This diff is collapsed.
Click to expand it.
Parser/OpenFile.cpp
+
3
−
2
View file @
e157b2d0
// $Id: OpenFile.cpp,v 1.4
5
2003-1
1-2
7 02:
33
:3
5
geuzaine Exp $
// $Id: OpenFile.cpp,v 1.4
6
2003-1
2-0
7 02:
56
:3
4
geuzaine Exp $
//
//
// Copyright (C) 1997-2003 C. Geuzaine, J.-F. Remacle
// Copyright (C) 1997-2003 C. Geuzaine, J.-F. Remacle
//
//
...
@@ -142,7 +142,8 @@ int MergeProblem(char *name)
...
@@ -142,7 +142,8 @@ int MergeProblem(char *name)
if
(
!
strncmp
(
tmp
,
"$PTS"
,
4
)
||
if
(
!
strncmp
(
tmp
,
"$PTS"
,
4
)
||
!
strncmp
(
tmp
,
"$NO"
,
3
)
||
!
strncmp
(
tmp
,
"$NO"
,
3
)
||
!
strncmp
(
tmp
,
"$ELM"
,
4
))
{
!
strncmp
(
tmp
,
"$ELM"
,
4
)
||
!
strncmp
(
tmp
,
"$MeshFormat"
,
4
))
{
if
(
THEM
->
status
<
0
)
if
(
THEM
->
status
<
0
)
mai3d
(
THEM
,
0
);
mai3d
(
THEM
,
0
);
Read_Mesh
(
THEM
,
fp
,
name
,
FORMAT_MSH
);
Read_Mesh
(
THEM
,
fp
,
name
,
FORMAT_MSH
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment