浏览代码

Bug fixed.

Snow 8 年之前
父节点
当前提交
4b5842a8aa

+ 1 - 0
.gitignore

@@ -0,0 +1 @@
+__pycache__/

二进制
dist/hdpg1d-1.0.tar.gz


二进制
hdpg1d/__pycache__/__init__.cpython-36.pyc


二进制
hdpg1d/__pycache__/coefficients.cpython-35.pyc


二进制
hdpg1d/__pycache__/coefficients.cpython-36.pyc


二进制
hdpg1d/__pycache__/discretization.cpython-36.pyc


二进制
hdpg1d/__pycache__/hdpg1d.cpython-36.pyc


二进制
hdpg1d/__pycache__/menu.cpython-35.pyc


二进制
hdpg1d/__pycache__/menu.cpython-36.pyc


二进制
hdpg1d/__pycache__/postprocess.cpython-36.pyc


二进制
hdpg1d/__pycache__/solver.cpython-36.pyc


+ 1 - 1
hdpg1d/postprocess.py

@@ -1,5 +1,5 @@
 """
-A module for postprocessing the numerical results.
+A module for postprocessing the numerical results from HDPG1d solver.
 """
 import matplotlib.pyplot as plt
 import numpy as np

+ 24 - 24
hdpg1d/solve.py

@@ -1,6 +1,6 @@
-from coefficients import coefficients
-from discretization import HDPG1d
-from postprocess import convHistory
+from .coefficients import coefficients
+from .discretization import HDPG1d
+from .postprocess import convHistory
 import sys
 
 
@@ -38,24 +38,24 @@ def getCoefficients():
     return Coeff
 
 
-menu = {}
-menu['1.'] = "Solve with HDG."
-menu['2.'] = "Solve with HDPG."
-menu['3.'] = "Exit."
-
-options = menu.keys()
-for entry in options:
-    print(entry, menu[entry])
-
-selection = input("Please Select:")
-if selection == '1':
-    hdgCoeff = getCoefficients()
-    hdgSolution = HDPG1d(hdgCoeff.nele, hdgCoeff.porder)
-    trueError, estError = hdgSolution.adaptive()
-    convHistory(trueError, estError)
-elif selection == '2':
-    print("In development...")
-elif selection == '3':
-    print("Bye.")
-else:
-    print("Unknown Option Selected!")
+def run():
+    menu = {}
+    menu['1.'] = "Solve with HDG."
+    menu['2.'] = "Solve with HDPG."
+    menu['3.'] = "Exit."
+
+    for key, value in sorted(menu.items()):
+        print(key, value)
+
+    selection = input("Please Select:")
+    if selection == '1':
+        hdgCoeff = getCoefficients()
+        hdgSolution = HDPG1d(hdgCoeff.nele, hdgCoeff.porder)
+        trueError, estError = hdgSolution.adaptive()
+        convHistory(trueError, estError)
+    elif selection == '2':
+        print("In development...")
+    elif selection == '3':
+        print("Bye.")
+    else:
+        print("Unknown Option Selected!")