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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
91f4d260
Commit
91f4d260
authored
23 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
*** empty log message ***
parent
296daed3
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Mesh/Print_Mesh.cpp
+46
-41
46 additions, 41 deletions
Mesh/Print_Mesh.cpp
with
46 additions
and
41 deletions
Mesh/Print_Mesh.cpp
+
46
−
41
View file @
91f4d260
// $Id: Print_Mesh.cpp,v 1.
29
2001-09-0
5 19:22:28
geuzaine Exp $
// $Id: Print_Mesh.cpp,v 1.
30
2001-09-0
6 07:12:16
geuzaine Exp $
#include
"Gmsh.h"
#include
"Numeric.h"
...
...
@@ -76,7 +76,7 @@ void process_msh_nodes (Mesh * M){
fprintf
(
mshfile
,
"$ENDNOD
\n
"
);
}
void
add
_msh_simplex
(
void
*
a
,
void
*
b
){
void
print
_msh_simplex
(
void
*
a
,
void
*
b
){
Simplex
**
S
;
int
i
,
type
,
nbn
,
nbs
=
0
;
...
...
@@ -142,6 +142,7 @@ void add_msh_simplex (void *a, void *b){
}
fprintf
(
mshfile
,
"%d %d %d %d %d"
,
//MSH_PHYSICAL_NUM ? MSH_ELEMENT_NUM++ : (*S)->Num, type,
MSH_ELEMENT_NUM
++
,
type
,
MSH_PHYSICAL_NUM
?
MSH_PHYSICAL_NUM
:
(
*
S
)
->
iEnt
,
(
*
S
)
->
iEnt
,
nbn
+
nbs
);
...
...
@@ -162,7 +163,7 @@ void add_msh_simplex (void *a, void *b){
fprintf
(
mshfile
,
"
\n
"
);
}
void
add
_msh_hexahedron
(
void
*
a
,
void
*
b
){
void
print
_msh_hexahedron
(
void
*
a
,
void
*
b
){
Hexahedron
**
H
;
int
i
,
type
,
nbn
,
nbs
=
0
;
...
...
@@ -185,6 +186,7 @@ void add_msh_hexahedron (void *a, void *b){
type
=
HEXAHEDRON
;
fprintf
(
mshfile
,
"%d %d %d %d %d"
,
//MSH_PHYSICAL_NUM ? MSH_ELEMENT_NUM++ : (*H)->Num, type,
MSH_ELEMENT_NUM
++
,
type
,
MSH_PHYSICAL_NUM
?
MSH_PHYSICAL_NUM
:
(
*
H
)
->
iEnt
,
(
*
H
)
->
iEnt
,
nbn
+
nbs
);
...
...
@@ -197,7 +199,7 @@ void add_msh_hexahedron (void *a, void *b){
fprintf
(
mshfile
,
"
\n
"
);
}
void
add
_msh_prism
(
void
*
a
,
void
*
b
){
void
print
_msh_prism
(
void
*
a
,
void
*
b
){
Prism
**
P
;
int
i
,
type
,
nbn
,
nbs
=
0
;
...
...
@@ -221,6 +223,7 @@ void add_msh_prism (void *a, void *b){
}
fprintf
(
mshfile
,
"%d %d %d %d %d"
,
//MSH_PHYSICAL_NUM ? MSH_ELEMENT_NUM++ : (*P)->Num, type,
MSH_ELEMENT_NUM
++
,
type
,
MSH_PHYSICAL_NUM
?
MSH_PHYSICAL_NUM
:
(
*
P
)
->
iEnt
,
(
*
P
)
->
iEnt
,
nbn
+
nbs
);
...
...
@@ -233,7 +236,7 @@ void add_msh_prism (void *a, void *b){
fprintf
(
mshfile
,
"
\n
"
);
}
void
add
_msh_pyramid
(
void
*
a
,
void
*
b
){
void
print
_msh_pyramid
(
void
*
a
,
void
*
b
){
Pyramid
**
P
;
int
i
,
type
,
nbn
,
nbs
=
0
;
...
...
@@ -257,6 +260,7 @@ void add_msh_pyramid (void *a, void *b){
}
fprintf
(
mshfile
,
"%d %d %d %d %d"
,
//MSH_PHYSICAL_NUM ? MSH_ELEMENT_NUM++ : (*P)->Num, type,
MSH_ELEMENT_NUM
++
,
type
,
MSH_PHYSICAL_NUM
?
MSH_PHYSICAL_NUM
:
(
*
P
)
->
iEnt
,
(
*
P
)
->
iEnt
,
nbn
+
nbs
);
...
...
@@ -269,7 +273,7 @@ void add_msh_pyramid (void *a, void *b){
fprintf
(
mshfile
,
"
\n
"
);
}
void
add
_msh_point
(
Vertex
*
V
){
void
print
_msh_point
(
Vertex
*
V
){
if
(
!
MSH_ADD
){
MSH_ELEMENT_NUM
++
;
...
...
@@ -277,11 +281,12 @@ void add_msh_point (Vertex * V){
}
fprintf
(
mshfile
,
"%d %d %d %d 1 %d
\n
"
,
//MSH_PHYSICAL_NUM ? MSH_ELEMENT_NUM++ : V->Num, POINT,
MSH_ELEMENT_NUM
++
,
POINT
,
MSH_PHYSICAL_NUM
?
MSH_PHYSICAL_NUM
:
V
->
Num
,
V
->
Num
,
V
->
Num
);
}
void
add
_msh_elements
(
Mesh
*
M
){
void
print
_msh_elements
(
Mesh
*
M
){
int
i
,
j
,
k
,
Num
;
PhysicalGroup
*
p
;
...
...
@@ -307,7 +312,7 @@ void add_msh_elements (Mesh * M){
pv
->
Num
=
abs
(
Num
);
MSH_PHYSICAL_ORI
=
sign
(
Num
);
if
(
Tree_Query
(
M
->
Vertices
,
&
pv
))
add
_msh_point
(
pv
);
print
_msh_point
(
pv
);
}
break
;
...
...
@@ -319,7 +324,7 @@ void add_msh_elements (Mesh * M){
List_Read
(
p
->
Entities
,
j
,
&
Num
);
MSH_LIN_NUM
=
abs
(
Num
);
MSH_PHYSICAL_ORI
=
sign
(
Num
);
Tree_Action
(
pV
->
Simp_Surf
,
add
_msh_simplex
);
Tree_Action
(
pV
->
Simp_Surf
,
print
_msh_simplex
);
}
}
break
;
//done
...
...
@@ -331,7 +336,7 @@ void add_msh_elements (Mesh * M){
pc
->
Num
=
abs
(
Num
);
MSH_PHYSICAL_ORI
=
sign
(
Num
);
if
(
Tree_Query
(
M
->
Curves
,
&
pc
))
Tree_Action
(
pc
->
Simplexes
,
add
_msh_simplex
);
Tree_Action
(
pc
->
Simplexes
,
print
_msh_simplex
);
}
break
;
...
...
@@ -343,7 +348,7 @@ void add_msh_elements (Mesh * M){
List_Read
(
p
->
Entities
,
j
,
&
Num
);
MSH_SUR_NUM
=
abs
(
Num
);
MSH_PHYSICAL_ORI
=
sign
(
Num
);
Tree_Action
(
pV
->
Simp_Surf
,
add
_msh_simplex
);
Tree_Action
(
pV
->
Simp_Surf
,
print
_msh_simplex
);
}
}
break
;
//done
...
...
@@ -355,7 +360,7 @@ void add_msh_elements (Mesh * M){
ps
->
Num
=
abs
(
Num
);
MSH_PHYSICAL_ORI
=
sign
(
Num
);
if
(
Tree_Query
(
M
->
Surfaces
,
&
ps
))
Tree_Action
(
ps
->
Simplexes
,
add
_msh_simplex
);
Tree_Action
(
ps
->
Simplexes
,
print
_msh_simplex
);
}
break
;
...
...
@@ -367,10 +372,10 @@ void add_msh_elements (Mesh * M){
MSH_3D
=
1
;
MSH_VOL_NUM
=
abs
(
Num
);
MSH_PHYSICAL_ORI
=
sign
(
Num
);
Tree_Action
(
pV
->
Simplexes
,
add
_msh_simplex
);
Tree_Action
(
pV
->
Hexahedra
,
add
_msh_hexahedron
);
Tree_Action
(
pV
->
Prisms
,
add
_msh_prism
);
Tree_Action
(
pV
->
Pyramids
,
add
_msh_pyramid
);
Tree_Action
(
pV
->
Simplexes
,
print
_msh_simplex
);
Tree_Action
(
pV
->
Hexahedra
,
print
_msh_hexahedron
);
Tree_Action
(
pV
->
Prisms
,
print
_msh_prism
);
Tree_Action
(
pV
->
Pyramids
,
print
_msh_pyramid
);
}
}
break
;
...
...
@@ -384,45 +389,45 @@ void add_msh_elements (Mesh * M){
}
void
add
_all_msh_curves
(
void
*
a
,
void
*
b
){
void
print
_all_msh_curves
(
void
*
a
,
void
*
b
){
Curve
*
c
=
*
(
Curve
**
)
a
;
Tree_Action
(
c
->
Simplexes
,
add
_msh_simplex
);
Tree_Action
(
c
->
Simplexes
,
print
_msh_simplex
);
}
void
add
_all_msh_surfaces
(
void
*
a
,
void
*
b
){
void
print
_all_msh_surfaces
(
void
*
a
,
void
*
b
){
Surface
*
s
=
*
(
Surface
**
)
a
;
Tree_Action
(
s
->
Simplexes
,
add
_msh_simplex
);
Tree_Action
(
s
->
Simplexes
,
print
_msh_simplex
);
}
void
add
_all_msh_simpsurf
(
void
*
a
,
void
*
b
){
void
print
_all_msh_simpsurf
(
void
*
a
,
void
*
b
){
Volume
*
v
=
*
(
Volume
**
)
a
;
Tree_Action
(
v
->
Simp_Surf
,
add
_msh_simplex
);
Tree_Action
(
v
->
Simp_Surf
,
print
_msh_simplex
);
}
void
add
_all_msh_volumes
(
void
*
a
,
void
*
b
){
void
print
_all_msh_volumes
(
void
*
a
,
void
*
b
){
Volume
*
v
=
*
(
Volume
**
)
a
;
Tree_Action
(
v
->
Simplexes
,
add
_msh_simplex
);
Tree_Action
(
v
->
Hexahedra
,
add
_msh_hexahedron
);
Tree_Action
(
v
->
Prisms
,
add
_msh_prism
);
Tree_Action
(
v
->
Pyramids
,
add
_msh_pyramid
);
Tree_Action
(
v
->
Simplexes
,
print
_msh_simplex
);
Tree_Action
(
v
->
Hexahedra
,
print
_msh_hexahedron
);
Tree_Action
(
v
->
Prisms
,
print
_msh_prism
);
Tree_Action
(
v
->
Pyramids
,
print
_msh_pyramid
);
}
void
add
_all_msh_elements
(
Mesh
*
M
){
void
print
_all_msh_elements
(
Mesh
*
M
){
MSH_PHYSICAL_NUM
=
0
;
MSH_PHYSICAL_ORI
=
1
;
MSH_LIN_NUM
=
MSH_SUR_NUM
=
MSH_VOL_NUM
=
0
;
MSH_3D
=
0
;
if
(
CTX
.
mesh
.
oldxtrude
){
Tree_Action
(
M
->
Volumes
,
add
_all_msh_simpsurf
);
Tree_Action
(
M
->
Volumes
,
print
_all_msh_simpsurf
);
}
else
{
Tree_Action
(
M
->
Curves
,
add
_all_msh_curves
);
Tree_Action
(
M
->
Surfaces
,
add
_all_msh_surfaces
);
Tree_Action
(
M
->
Curves
,
print
_all_msh_curves
);
Tree_Action
(
M
->
Surfaces
,
print
_all_msh_surfaces
);
}
MSH_3D
=
1
;
Tree_Action
(
M
->
Volumes
,
add
_all_msh_volumes
);
Tree_Action
(
M
->
Volumes
,
print
_all_msh_volumes
);
}
void
process_msh_elements
(
Mesh
*
M
){
...
...
@@ -431,10 +436,10 @@ void process_msh_elements (Mesh * M){
if
(
!
List_Nbr
(
M
->
PhysicalGroups
)
||
CTX
.
mesh
.
save_all
){
Msg
(
INFO
,
"Saving all elements (discarding physical groups)"
);
add
_all_msh_elements
(
M
);
print
_all_msh_elements
(
M
);
}
else
add
_msh_elements
(
M
);
print
_msh_elements
(
M
);
fprintf
(
mshfile
,
"$ELM
\n
"
);
fprintf
(
mshfile
,
"%d
\n
"
,
MSH_ELEMENT_NUM
-
1
);
...
...
@@ -445,9 +450,9 @@ void process_msh_elements (Mesh * M){
MSH_ADD
=
1
;
MSH_ELEMENT_NUM
=
1
;
if
(
!
List_Nbr
(
M
->
PhysicalGroups
)
||
CTX
.
mesh
.
save_all
)
add
_all_msh_elements
(
M
);
print
_all_msh_elements
(
M
);
else
add
_msh_elements
(
M
);
print
_msh_elements
(
M
);
fprintf
(
mshfile
,
"$ENDELM
\n
"
);
}
...
...
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