Skip to content

Commit

Permalink
upgrade to python 3
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Kraska committed Mar 6, 2022
1 parent a494244 commit c9912ab
Show file tree
Hide file tree
Showing 29 changed files with 42 additions and 98 deletions.
1 change: 0 additions & 1 deletion Drahtbiegen/Biegung/Animation.fbd
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,3 @@ anim real on
movi frames auto
ds 3 8 a 1

quit
Binary file modified Drahtbiegen/Biegung/Biegung-history.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 9 additions & 9 deletions Drahtbiegen/Biegung/Biegung.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/usr/bin/python
#!/usr/bin/env python

import pylab
import matplotlib.pyplot as plt
import numpy

de = numpy.genfromtxt("total internal energy_EDRAHT.txt")
dm = numpy.genfromtxt("forces fx,fy,fz_NROT.txt")
pylab.plot(de[:,0],de[:,1],'b',dm[:,0],dm[:,3],'r')
pylab.grid(True)
pylab.xlim([0,1])
pylab.xlabel("t")
pylab.ylabel("y")
pylab.legend(["Energy","Moment"],loc=0)
pylab.savefig("Biegung-history")
plt.plot(de[:,0],de[:,1],'b',dm[:,0],dm[:,3],'r')
plt.grid(True)
plt.xlim([0,1])
plt.xlabel("t")
plt.ylabel("y")
plt.legend(["Energy","Moment"],loc=0)
plt.savefig("Biegung-history")
71 changes: 7 additions & 64 deletions Drahtbiegen/Biegung/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,67 +16,6 @@ def modify_path():
os.environ['PATH'] += os.pathsep + scripts_dir
print('\nPATH = {}\n'.format(os.environ['PATH']))


# preprocessing
def pre():
toRemovePre = (
"*.nam",
"*.bou",
"*.sur",
"hcpy*.png",
"symy.png",
"wfix.png",
"parts.png",
"contact.png",
"all.msh",
"rb1.inp")

print("removing files")
for spec in toRemovePre:
files=glob.glob(spec)
for f in files:
print(f)
os.remove(f)
os.system("cgx -b pre.fbd")


# solve, can take a while
def solve():
try: os.remove("Biegung.frd")
except: pass
try: os.remove("Biegung.dat")
except: pass
try: os.remove("Biegung.sta")
except: pass
try: os.remove("Biegung.cvg")
except: pass
os.system("ccx Biegung >>Biegung.log")


# convergence plot, reaction-time-plot
def post():
try:
os.remove("Biegung.png")
except:
0
os.remove("Biegung-history.png")
files=glob.glob("force*.txt")
for f in files:
os.remove(f)
files=glob.glob("total*.txt")
for f in files:
os.remove(f)
os.remove("movie.gif")
os.remove("deform.png")
os.remove("PE.png")

os.system("monitor.py Biegung")
os.system("dat2txt.py Biegung")
os.system("./Biegung.py")
os.system("cgx -b Animation.fbd")
os.system("cgx -b post.fbd")


# Move new files and folders to 'Refs'
def move(old_snap):
new_snap = os.listdir(os.curdir)
Expand Down Expand Up @@ -104,7 +43,11 @@ def move(old_snap):
# Run the example
modify_path()
snap = os.listdir(os.curdir)
pre()
solve()
post()
os.system("cgx -b pre.fbd")
os.system("ccx Biegung >>Biegung.log")
os.system("monitor.py Biegung")
os.system("dat2txt.py Biegung")
os.system("./Biegung.py")
os.system("cgx -b Animation.fbd")
os.system("cgx -b post.fbd")
#move(snap)
2 changes: 1 addition & 1 deletion Dynamics/Discrete/MSM.inp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ NALL,2,3
*Mass, Elset=Emass
7.8e-9
*STEP
*frequency,storage=yes, solver=matrixstorage
*frequency,storage=yes
2
*cload
3,1,0
Expand Down
6 changes: 4 additions & 2 deletions Dynamics/Discrete/runM.fbd
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
sys ccx MSM > MSM.log
read MSM.frd
read MSM.inp nom
# read MSM.frd
read MSM.inp
# plot model
seta ! all
seta fix n 1
plot e all k
plus n all k 6
plus n fix r 6
hcpy png meshM

break
# plot mode shapes
seta path n 1 2 3
ds 1 e 1
Expand Down
Binary file modified NonLinear/Cut/Refs/blech-pe-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified NonLinear/Cut/Refs/blech-pe-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified NonLinear/Cut/Refs/parts.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified NonLinear/Cut/Refs/rand1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified NonLinear/Cut/Refs/rand2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified NonLinear/Cut/Refs/randb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified NonLinear/Cut/Refs/surf1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified NonLinear/Cut/Refs/surfb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified NonLinear/Cut/Refs/tool1-s1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified NonLinear/Cut/Refs/tool1-se.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified NonLinear/Cut/Refs/tool2-s1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified NonLinear/Cut/Refs/tool2-se.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified NonLinear/Rohrknie/solid-static.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions RVE/Periodic/test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python
import os
import multiprocessing
import shutil
Expand All @@ -12,7 +12,7 @@ def modify_path():
scripts_dir = os.path.join(scripts_dir, 'Scripts')
if not scripts_dir in os.environ['PATH']:
os.environ['PATH'] += os.pathsep + scripts_dir
print '\nPATH = {}\n'.format(os.environ['PATH'])
print('\nPATH = {}\n'.format(os.environ['PATH']))


# Move new files and folders to 'Refs'
Expand Down Expand Up @@ -46,4 +46,4 @@ def move(old_snap):
os.system("periodic.py all.msh")
os.system("ccx Solve")
os.system("cgx -b post.fbd")
move(snap)
#move(snap)
6 changes: 3 additions & 3 deletions RVE/PlanarSlide/test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python
import os
import multiprocessing
import shutil
Expand All @@ -12,7 +12,7 @@ def modify_path():
scripts_dir = os.path.join(scripts_dir, 'Scripts')
if not scripts_dir in os.environ['PATH']:
os.environ['PATH'] += os.pathsep + scripts_dir
print '\nPATH = {}\n'.format(os.environ['PATH'])
print('\nPATH = {}\n'.format(os.environ['PATH']))


# Move new files and folders to 'Refs'
Expand Down Expand Up @@ -46,4 +46,4 @@ def move(old_snap):
os.system("ccx Zug")
os.system("monitor.py Zug")
os.system("cgx -b post.fbd")
move(snap)
#move(snap)
6 changes: 3 additions & 3 deletions RVE/PlaneOrtho1/test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python
import os
import multiprocessing
import shutil
Expand All @@ -12,7 +12,7 @@ def modify_path():
scripts_dir = os.path.join(scripts_dir, 'Scripts')
if not scripts_dir in os.environ['PATH']:
os.environ['PATH'] += os.pathsep + scripts_dir
print '\nPATH = {}\n'.format(os.environ['PATH'])
print('\nPATH = {}\n'.format(os.environ['PATH']))


# Move new files and folders to 'Refs'
Expand Down Expand Up @@ -47,4 +47,4 @@ def move(old_snap):
os.system("monitor.py Zug")
os.system("cgx -b verify.fbd")
os.system("cgx -b post.fbd")
move(snap)
#move(snap)
Binary file modified Streifen/b-def.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Streifen/b-mesh.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Streifen/sh-def.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions Streifen/test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python
import os
import multiprocessing
import shutil
Expand All @@ -12,7 +12,7 @@ def modify_path():
scripts_dir = os.path.join(scripts_dir, 'Scripts')
if not scripts_dir in os.environ['PATH']:
os.environ['PATH'] += os.pathsep + scripts_dir
print '\nPATH = {}\n'.format(os.environ['PATH'])
print('\nPATH = {}\n'.format(os.environ['PATH']))


# Move new files and folders to 'Refs'
Expand Down Expand Up @@ -48,4 +48,4 @@ def move(old_snap):
os.system("cgx -b sr.fbd")
os.system("cgx -b scd.fbd")
os.system("cgx -b sck.fbd")
move(snap)
#move(snap)
6 changes: 3 additions & 3 deletions Test/Beam/test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python
import os
import multiprocessing
import shutil
Expand All @@ -12,7 +12,7 @@ def modify_path():
scripts_dir = os.path.join(scripts_dir, 'Scripts')
if not scripts_dir in os.environ['PATH']:
os.environ['PATH'] += os.pathsep + scripts_dir
print '\nPATH = {}\n'.format(os.environ['PATH'])
print('\nPATH = {}\n'.format(os.environ['PATH']))


# Move new files and folders to 'Refs'
Expand Down Expand Up @@ -43,4 +43,4 @@ def move(old_snap):
modify_path()
snap = os.listdir(os.curdir)
os.system("cgx -b test.fbl")
move(snap)
#move(snap)
6 changes: 3 additions & 3 deletions Test/BeamSections/test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python
import os
import multiprocessing
import shutil
Expand All @@ -12,7 +12,7 @@ def modify_path():
scripts_dir = os.path.join(scripts_dir, 'Scripts')
if not scripts_dir in os.environ['PATH']:
os.environ['PATH'] += os.pathsep + scripts_dir
print '\nPATH = {}\n'.format(os.environ['PATH'])
print('\nPATH = {}\n'.format(os.environ['PATH']))


# Move new files and folders to 'Refs'
Expand Down Expand Up @@ -47,4 +47,4 @@ def move(old_snap):
os.system("sed -n '4,14 p' u1General.dat > u1-3.txt")
os.system("sed -n '41,51 p' u1General.dat > u1-2.txt")
os.system("gnuplot u1.plt")
move(snap)
#move(snap)
6 changes: 3 additions & 3 deletions Test/Distributing/test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python
import os
import multiprocessing
import shutil
Expand All @@ -12,7 +12,7 @@ def modify_path():
scripts_dir = os.path.join(scripts_dir, 'Scripts')
if not scripts_dir in os.environ['PATH']:
os.environ['PATH'] += os.pathsep + scripts_dir
print '\nPATH = {}\n'.format(os.environ['PATH'])
print('\nPATH = {}\n'.format(os.environ['PATH']))


# Move new files and folders to 'Refs'
Expand Down Expand Up @@ -43,4 +43,4 @@ def move(old_snap):
modify_path()
snap = os.listdir(os.curdir)
os.system("cgx -b run.fbl")
move(snap)
#move(snap)

0 comments on commit c9912ab

Please sign in to comment.