From e6bdff9e92ff48c52f3b509ad1ea0ad8448e9753 Mon Sep 17 00:00:00 2001
From: Romain Boman <romain.boman@gmail.com>
Date: Wed, 8 Jun 2022 15:54:34 +0200
Subject: [PATCH] change option filename

---
 cxxfem/src/femPost.cpp | 5 ++++-
 fossils.py             | 8 ++++----
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/cxxfem/src/femPost.cpp b/cxxfem/src/femPost.cpp
index 2c84481..1c4119e 100644
--- a/cxxfem/src/femPost.cpp
+++ b/cxxfem/src/femPost.cpp
@@ -305,7 +305,10 @@ void Post::write()
 {
     gmsh::option::setNumber("Mesh.Binary", 1); // writes files in binary format
 
-    gmsh::write("mesh.opt"); //  save the options
+    gmsh::write("post.opt"); //  save the options
+    // some data is missing in mesh.opt (mesh deformation)
+    //      View[i].UseGeneralizedRaise = 1;
+    //      View[i].GeneralizedRaiseView = 3;
     gmsh::write("mesh.msh"); //  only save the mesh
 
     // save the views (without the mesh)
diff --git a/fossils.py b/fossils.py
index ced959d..c8767a7 100644
--- a/fossils.py
+++ b/fossils.py
@@ -111,7 +111,7 @@ def view_results():
     gmsh.option.setNumber("General.Verbosity", 3)
     # load views from the option file
     views = []
-    with open('mesh.opt') as f:
+    with open('post.opt') as f:
         import re
         viewregex = re.compile('View\[(.+)\].FileName = "(.+)";')
         for l in f.readlines():
@@ -123,7 +123,7 @@ def view_results():
         print(f'loading "{v[1]}"')
         gmsh.merge(v[1])
     print('loading options...')
-    gmsh.merge('mesh.opt')
+    gmsh.merge('post.opt')
     print('starting Gmsh GUI, please wait...')
     gmsh.fltk.run()
 
@@ -267,12 +267,12 @@ if __name__ == "__main__":
         
         create_workspace(workspace, testname)
 
-        tee = cxxfem.Tee('stdout.txt')  # split streams (stdout + logfile)
-
         try:
             if action == 'run':
+                tee = cxxfem.Tee('stdout.txt')  # split streams (stdout + logfile)
                 run_simulation(testname)
             elif action == 'post':
+                tee = cxxfem.Tee('post.txt')
                 view_results()
         except Exception as err:
             print(f'\n** ERROR: {err}\n')
-- 
GitLab