Skip to content
Snippets Groups Projects
Commit b380b89d authored by Klaus Böhnlein's avatar Klaus Böhnlein
Browse files

Update plot-q12

parent bd3a2eff
No related branches found
No related tags found
No related merge requests found
......@@ -38,8 +38,8 @@ cellDomain = 1
########################################################################
#numLevels = 1 3 # computes all levels from first to second entry
numLevels = 3 3 # computes all levels from first to second entry
#numLevels = 4 4 # computes all levels from first to second entry
#numLevels = 3 3 # computes all levels from first to second entry
numLevels = 4 4 # computes all levels from first to second entry
#numLevels = 1 6
......@@ -68,7 +68,7 @@ gamma=1.0
beta = 2.0 # ratio between material parameters mu1 & mu2 .... beta = 1.0 corresponds to homogeneous case
mu1=1.0
lambda1=10.0
lambda1=5.0
......@@ -88,8 +88,8 @@ theta = 0.125
#material_prestrain_imp= "parametrized_Laminate"
material_prestrain_imp= "analytical_Example"
material_prestrain_imp= "parametrized_Laminate"
#material_prestrain_imp= "analytical_Example"
#material_prestrain_imp ="isotropic_bilayer"
#material_prestrain_imp= "circle_fiber" #TEST
......
......@@ -49,23 +49,52 @@ RUN = True
# RUN = False
# make_Plot = False
# make_Plot = True # vll besser : Plot_muGamma
counter = 0
#material_prestrain_imp= "analytical_Example"
material_prestrain_imp= "parametrized_Laminate"
if RUN:
for lambda1 in Lambda_Values:
print("Run Cell-Problem for Lambda = ", lambda1)
# LOGFILE = "./harmonicmaps_intoR"+ str(targetDim) + "_" + str(order) + "_" + str(numLevels) + ".log"
LOGFILE = path + "/outputs/out_lambda" + str(counter) + ".log"
print("LOGFILE: ", LOGFILE)
counter += 1
# print('gamma='+str(gamma))
with open(InputFilePath, 'r') as file:
filedata = file.read()
filedata = re.sub('(?m)^lambda1=.*','lambda1='+str(lambda1),filedata)
f = open(InputFilePath,'w')
f.write(filedata)
f.close()
# with open(InputFilePath, 'r') as file:
# filedata = file.read()
# filedata = re.sub('(?m)^lambda1=.*','lambda1='+str(lambda1),filedata)
# f = open(InputFilePath,'w')
# f.write(filedata)
# f.close()
executable = './build-cmake/src/Cell-Problem'
# Run Cell-Problem
subprocess.run(['./build-cmake/src/Cell-Problem', './inputs/cellsolver.parset'],
capture_output=True, text=True)
#Extract mu_gamma from Output-File
with open(OutputFilePath, 'r') as file:
output = file.read()
# p = subprocess.Popen(executable + " cellsolver.parset"
# + " -lambda1 " + str(lambda1)
# + " | tee " + LOGFILE, shell=True)
p = subprocess.Popen(executable + " " +path + "/inputs/cellsolver.parset"
+ " -lambda1 " + str(lambda1)
+ " -material_prestrain_imp " + str(material_prestrain_imp)
+ " | tee " + LOGFILE, shell=True)
p.wait() # wait
# subprocess.run(['./build-cmake/src/Cell-Problem', './inputs/cellsolver.parset'],
# capture_output=True, text=True)
with open(LOGFILE, 'r') as file:
output = file.read()
###Extract q12 from Output-File
# with open(OutputFilePath, 'r') as file:
# output = file.read()
tmp = re.search(r'(?m)^q_onetwo=.*',output).group()
s = re.findall(r"[-+]?\d*\.\d+|\d+", tmp)
q12Value = float(s[0])
......
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