From 2640c26282c8e6abaaf5edd150ca99f379987cbd Mon Sep 17 00:00:00 2001 From: farid <farid.mohammadi@iws.uni-stuttgart.de> Date: Tue, 19 Jan 2021 11:55:23 +0100 Subject: [PATCH] [PA-A] modified the system path and increased the meashing size for the stokesdarcy model. --- BayesValidRox/tests/PA-A/Benchmark_PAA.py | 9 +---- .../tests/PA-A/ffpm_validation_stokesdarcy.py | 6 +-- .../tests/PA-A/ffpm_validation_stokespnm.py | 7 +--- BayesValidRox/tests/PA-A/ref_stokesdarcy.py | 33 +++------------- BayesValidRox/tests/PA-A/ref_stokespnm.py | 39 ++++--------------- .../PA-A/stokesdarcy_BJ_params.tpl.input | 4 +- .../PA-A/stokesdarcy_ER_params.tpl.input | 4 +- 7 files changed, 22 insertions(+), 80 deletions(-) diff --git a/BayesValidRox/tests/PA-A/Benchmark_PAA.py b/BayesValidRox/tests/PA-A/Benchmark_PAA.py index 728d334e2..6697bc361 100644 --- a/BayesValidRox/tests/PA-A/Benchmark_PAA.py +++ b/BayesValidRox/tests/PA-A/Benchmark_PAA.py @@ -33,18 +33,13 @@ plt.rc('legend', fontsize=SIZE) # legend fontsize plt.rc('figure', titlesize=SIZE) # fontsize of the figure title - try: import cPickle as pickle except ModuleNotFoundError: import pickle -# Anaconda -#sys.path.insert(0,'./../../../../bayesian-validation/BayesValidRox') -sys.path.insert(0,'./../bayesian-validation/BayesValidRox/') - -# Batch script -# sys.path.insert(0,'./../../BayesValidRox') +# Add BayesValidRox path +sys.path.insert(0,'./../../../BayesValidRox/') # Import the scripts diff --git a/BayesValidRox/tests/PA-A/ffpm_validation_stokesdarcy.py b/BayesValidRox/tests/PA-A/ffpm_validation_stokesdarcy.py index 3f69e4cbe..d44983b98 100755 --- a/BayesValidRox/tests/PA-A/ffpm_validation_stokesdarcy.py +++ b/BayesValidRox/tests/PA-A/ffpm_validation_stokesdarcy.py @@ -30,11 +30,9 @@ plt.rc('grid', linestyle="-") import matplotlib matplotlib.use('agg') -# Local -sys.path.insert(0,'./../bayesian-validation/BayesValidRox/') -# Batch script -# sys.path.insert(0,'./../../bayesian-validation/BayesValidRox/') +# Add BayesValidRox path +sys.path.insert(0,'./../../../BayesValidRox/') from PyLink.PyLinkForwardModel import PyLinkForwardModel from surrogate_models.Input import Input diff --git a/BayesValidRox/tests/PA-A/ffpm_validation_stokespnm.py b/BayesValidRox/tests/PA-A/ffpm_validation_stokespnm.py index f4d6e81b7..ea1f0d7ef 100755 --- a/BayesValidRox/tests/PA-A/ffpm_validation_stokespnm.py +++ b/BayesValidRox/tests/PA-A/ffpm_validation_stokespnm.py @@ -32,11 +32,8 @@ plt.rc('grid', linestyle="-") import matplotlib matplotlib.use('agg') -# Local -sys.path.insert(0,'./../bayesian-validation/BayesValidRox/') - -# Batch script -# sys.path.insert(0,'./../../bayesian-validation/BayesValidRox/') +# Add BayesValidRox path +sys.path.insert(0,'./../../../BayesValidRox/') from PyLink.PyLinkForwardModel import PyLinkForwardModel from surrogate_models.Input import Input diff --git a/BayesValidRox/tests/PA-A/ref_stokesdarcy.py b/BayesValidRox/tests/PA-A/ref_stokesdarcy.py index 24e3ab042..bd1759bb8 100755 --- a/BayesValidRox/tests/PA-A/ref_stokesdarcy.py +++ b/BayesValidRox/tests/PA-A/ref_stokesdarcy.py @@ -8,34 +8,15 @@ Created on Thu Aug 13 09:53:11 2020 import sys, os import numpy as np import scipy.stats as stats -import pandas as pd -import shutil +import matplotlib +matplotlib.use('agg') try: import cPickle as pickle except ModuleNotFoundError: import pickle -from matplotlib.backends.backend_pdf import PdfPages -import matplotlib.pyplot as plt -plt.rcParams.update({'font.size': 24}) -plt.rc('figure', figsize = (24, 16)) -plt.rc('font', family='serif', serif='Arial') -plt.rc('axes', grid = True) -plt.rc('text', usetex=True) -plt.rc('xtick', labelsize=24) -plt.rc('ytick', labelsize=24) -plt.rc('axes', labelsize=24) -plt.rc('axes', linewidth=2) -plt.rc('axes', grid=True) -plt.rc('grid', linestyle="-") - -import matplotlib -matplotlib.use('agg') -# Local -sys.path.insert(0,'./../bayesian-validation/BayesValidRox/') - -# Batch script -# sys.path.insert(0,'./../../bayesian-validation/BayesValidRox/') +# Add BayesValidRox path +sys.path.insert(0,'./../../../BayesValidRox/') from PyLink.PyLinkForwardModel import PyLinkForwardModel @@ -55,16 +36,12 @@ Model.ExecutionPath = os.getcwd() Model.Output.Parser = 'read_ffpm' Model.Output.Names = ['velocity [m/s]', 'p'] Model.Output.FileNames = ["ffpm_stokesdarcy_velocity.csv","ffpm_stokesdarcy_p.csv"] -# # For Bayesian inversion -# Model.MeasurementFile = 'data/stokesDataCalib.csv' -# # Include the validation observation data -# Model.MeasurementFileValid = 'data/stokesDataValid.csv' #===================================================== #========= PROBABILISTIC INPUT MODEL ============== #===================================================== -NrSamples = 300 +NrSamples = 10 allParams = [(0.0 , 4.0), # '$\\alpha_{BJ}$' (0.00475,0.005125), # '$\\Gamma$' diff --git a/BayesValidRox/tests/PA-A/ref_stokespnm.py b/BayesValidRox/tests/PA-A/ref_stokespnm.py index a3c4b2924..55de8de2f 100755 --- a/BayesValidRox/tests/PA-A/ref_stokespnm.py +++ b/BayesValidRox/tests/PA-A/ref_stokespnm.py @@ -8,38 +8,19 @@ Created on Thu Aug 13 09:53:11 2020 import sys, os import numpy as np import scipy.stats as stats -import pandas as pd -import shutil import chaospy +import matplotlib +matplotlib.use('agg') try: import cPickle as pickle except ModuleNotFoundError: import pickle -from matplotlib.backends.backend_pdf import PdfPages -import matplotlib.pyplot as plt -plt.rcParams.update({'font.size': 24}) -plt.rc('figure', figsize = (24, 16)) -plt.rc('font', family='serif', serif='Arial') -plt.rc('axes', grid = True) -plt.rc('text', usetex=True) -plt.rc('xtick', labelsize=24) -plt.rc('ytick', labelsize=24) -plt.rc('axes', labelsize=24) -plt.rc('axes', linewidth=2) -plt.rc('axes', grid=True) -plt.rc('grid', linestyle="-") - -import matplotlib -matplotlib.use('agg') -# Local -sys.path.insert(0,'./../bayesian-validation/BayesValidRox/') - -# Batch script -# sys.path.insert(0,'./../../bayesian-validation/BayesValidRox/') +# Add BayesValidRox path +sys.path.insert(0,'./../../../BayesValidRox/') from PyLink.PyLinkForwardModel import PyLinkForwardModel - + #===================================================== #============ COMPUTATIONAL MODEL ================ #===================================================== @@ -56,12 +37,6 @@ Model.Output.Parser = 'read_ffpm' Model.Output.Names = ['velocity [m/s]', 'p'] Model.Output.FileNames = ["ffpm_stokespnm_velocity.csv","ffpm_stokespnm_p.csv"] -# # For Bayesian inversion -# Model.MeasurementFile = 'data/stokesDataCalib.csv' - -# # Include the validation observation data -# Model.MeasurementFileValid = 'data/stokesDataValid.csv' - #===================================================== #========= PROBABILISTIC INPUT MODEL ============== #===================================================== @@ -79,7 +54,7 @@ origSpaceDist = chaospy.J(*origJoints) #============= RUN THE SIMULATIONS ================= #===================================================== SamplingMethod = 'random' -NrSamples = 200 +NrSamples = 10#200 # Generate samples with chaospy parametersets = chaospy.generate_samples(NrSamples, domain=origSpaceDist , rule=SamplingMethod).T @@ -96,4 +71,4 @@ try: key = Model.Name + '_' Model.zip_subdirs(dir_name, key) except: - pass \ No newline at end of file + pass diff --git a/BayesValidRox/tests/PA-A/stokesdarcy_BJ_params.tpl.input b/BayesValidRox/tests/PA-A/stokesdarcy_BJ_params.tpl.input index b68a97c45..52d717a7e 100644 --- a/BayesValidRox/tests/PA-A/stokesdarcy_BJ_params.tpl.input +++ b/BayesValidRox/tests/PA-A/stokesdarcy_BJ_params.tpl.input @@ -1,8 +1,8 @@ [Grid] Positions0 = -125e-6 0.010125 Positions1 = 0 0.6e-2 -Cells0 = 1025 -Cells1 = 600 +Cells0 = 512 #1025 +Cells1 = 300 #600 [Stokes.Grid] InletLength = 0.0 diff --git a/BayesValidRox/tests/PA-A/stokesdarcy_ER_params.tpl.input b/BayesValidRox/tests/PA-A/stokesdarcy_ER_params.tpl.input index 89f8f4b86..41d8df010 100644 --- a/BayesValidRox/tests/PA-A/stokesdarcy_ER_params.tpl.input +++ b/BayesValidRox/tests/PA-A/stokesdarcy_ER_params.tpl.input @@ -1,8 +1,8 @@ [Grid] Positions0 = -125e-6 0.010125 Positions1 = 0 0.6e-2 -Cells0 = 1025 -Cells1 = 600 +Cells0 = 512 #1025 +Cells1 = 300 #600 [Stokes.Grid] InletLength = 0.0 -- GitLab