Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dg
dg
Commits
985fcaec
Commit
985fcaec
authored
Nov 14, 2016
by
Jonathan Lambrechts
Committed by
Philippe Delandmeter
Nov 14, 2016
Browse files
update mesh.py to new 3.0 mesh format
parent
1bd9dd71
Pipeline
#1347
failed with stage
in 37 minutes and 19 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
dgpy/scripts/mesh.py
View file @
985fcaec
...
...
@@ -46,9 +46,15 @@ class mesh() :
for
name
,
tag
in
plist
.
items
()
:
output
.
write
(
"%i %i
\"
%s
\"\n
"
%
(
dim
,
tag
,
name
))
output
.
write
(
"$EndPhysicalNames
\n
"
)
output
.
write
(
"$Entities
\n
%i
\n
"
%
(
len
(
self
.
entities
)))
output
.
write
(
"$Entities
\n
"
)
ebydim
=
[[],[],[],[]]
for
e
in
self
.
entities
:
output
.
write
(
"%i %i %i %s
\n
"
%
(
e
.
tag
,
e
.
dimension
,
len
(
e
.
physicals
),
" "
.
join
(
repr
(
ip
)
for
ip
in
e
.
physicals
)))
ebydim
[
e
.
dimension
].
append
(
e
)
for
es
in
ebydim
:
output
.
write
(
"%i
\n
"
%
len
(
es
))
for
es
in
ebydim
:
for
e
in
es
:
output
.
write
(
"%i 0 %i %s
\n
"
%
(
e
.
tag
,
len
(
e
.
physicals
),
" "
.
join
(
repr
(
ip
)
for
ip
in
e
.
physicals
)))
output
.
write
(
"$EndEntities
\n
"
)
output
.
write
(
"$Nodes
\n
%d
\n
"
%
len
(
self
.
vertices
))
for
(
x
,
y
,
z
,
j
)
in
self
.
vertices
:
...
...
@@ -104,12 +110,14 @@ class mesh() :
self
.
physicals
[
int
(
dim
)][
name
[
1
:
-
1
]]
=
int
(
tag
)
fin
.
readline
()
elif
w
[
0
]
==
"$Entities"
and
self
.
useFormat3
:
n
=
int
(
fin
.
readline
())
for
i
in
range
(
n
)
:
l
=
fin
.
readline
().
split
()
j
,
dim
,
nphys
=
int
(
l
[
0
]),
int
(
l
[
1
]),
int
(
l
[
2
])
self
.
entities
.
append
(
mesh
.
entity
(
j
,
dim
,
[
int
(
ip
)
for
ip
in
l
[
3
:
3
+
nphys
]]))
entitymap
[(
dim
,
j
)]
=
self
.
entities
[
-
1
]
n
=
[
int
(
fin
.
readline
())
for
i
in
range
(
4
)]
for
dim
in
range
(
4
)
:
for
i
in
range
(
n
[
dim
])
:
l
=
fin
.
readline
().
split
()
j
,
nbnd
=
int
(
l
[
0
]),
int
(
l
[
1
])
nphys
=
int
(
l
[
2
+
nbnd
])
self
.
entities
.
append
(
mesh
.
entity
(
j
,
dim
,
[
int
(
ip
)
for
ip
in
l
[
3
+
nbnd
:
3
+
nbnd
+
nphys
]]))
entitymap
[(
dim
,
j
)]
=
self
.
entities
[
-
1
]
fin
.
readline
()
elif
w
[
0
]
==
"$Nodes"
:
n
=
int
(
fin
.
readline
())
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment