Skip to content
Snippets Groups Projects
Commit d332e64c authored by Boman Romain's avatar Boman Romain
Browse files

add postpro

parent 5c0a0efe
No related branches found
No related tags found
No related merge requests found
......@@ -96,7 +96,10 @@ if __name__ == "__main__":
post.build_views()
post.show_views( [ "stress_tensor", "force_vector" ] )
post.deform(5)
post.probe("force_vector", 1)
post.view()
post.probe("force_vector", 1)
args = fem.parseargs()
if not args.nogui:
post.view()
\ No newline at end of file
......@@ -69,5 +69,8 @@ if __name__ == "__main__":
post.set_camera_3D()
# post.write()
post.deform()
post.view()
args = fem.parseargs()
if not args.nogui:
post.view()
......@@ -110,6 +110,7 @@ if __name__ == "__main__":
# ask for a file if not given
if not args.file:
# QApplication.setAttribute(Qt.AA_EnableHighDpiScaling)
app = QApplication(sys.argv)
app.setOrganizationName("ULiege")
app.setApplicationName("fossils")
......@@ -125,7 +126,7 @@ if __name__ == "__main__":
testname = os.path.abspath(args.file)
print(f'action={action}')
if action=='run':
if action=='run' or action=='post':
testname = os.path.normcase(testname) # F:/ => f:/ on Windows
print(f'testname = {testname}')
......@@ -135,13 +136,45 @@ if __name__ == "__main__":
resdir, ext = os.path.splitext(resdir)
wdir = os.path.join('workspace', resdir)
print('workspace=', wdir)
if not os.path.isdir(wdir):
os.makedirs(wdir)
os.chdir(wdir)
tee = cxxfem.Tee('stdout.txt') # split streams
if ext == '.py':
# run python script
__file__ = testname
exec(open(testname, encoding='utf-8').read())
if action == 'run':
if ext == '.py':
# run python script
__file__ = testname
exec(open(testname, encoding='utf-8').read())
elif action == 'post':
import gmsh
gmsh.initialize()
# gmsh.merge('mesh.msh')
# print('loading options...')
# gmsh.merge('mesh.opt')
gmsh.option.setNumber("General.Verbosity", 3)
views = []
with open('mesh.opt') as f:
import re
viewregex = re.compile('View\[(.+)\].FileName = "(.+)";')
for l in f.readlines():
match = viewregex.search(l)
if match:
g = match.groups()
views.append(g)
for v in views:
print(f'loading "{v[1]}"')
gmsh.merge(v[1])
# gmsh.view.combine("elements",
# "all",
# True,
# True)
print('loading options...')
gmsh.merge('mesh.opt')
print('please wait...')
# for f in os.listdir():
# print(f)
gmsh.fltk.run()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment