Skip to content

Commit df7101a

Browse files
committed
improved mdpa handler
1 parent 3f33296 commit df7101a

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

pygem/mdpahandler.py

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -80,18 +80,11 @@ def write(self, mesh_points, filename):
8080
if num == index + 1:
8181
if line.startswith('End Nodes'):
8282
index = -9
83-
output_file.write(line)
8483
else:
85-
output_file.write(3 * ' ' + '{:5d}'.format(i+1))
86-
for j in range(0, 3):
87-
output_file.write(3 * ' ' + '{:.16E}'.format(
88-
mesh_points[i][j]))
89-
output_file.write('\n')
90-
#
91-
# line = (line[:5 + 15 * (j)] +
92-
# '{:15.10f}'.format(mesh_points[i][j]) +
93-
# line[5 + 15 * (j + 1):])
84+
line = (" {:6d} {:23.16E} {:23.16E} {:23.16E}\n"
85+
.format(i+1, mesh_points[i][0],
86+
mesh_points[i][1],
87+
mesh_points[i][2]))
9488
i += 1
9589
index = num
96-
else:
97-
output_file.write(line)
90+
output_file.write(line)

0 commit comments

Comments
 (0)