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

Add lambda1 as input Parameter

parent 78ce2695
No related branches found
No related tags found
No related merge requests found
......@@ -29,7 +29,7 @@
nElements = 32 32
gamma=0.25
gamma=0.75
#############################################
......
......@@ -44,9 +44,7 @@ mu1=10.0
#lambda1=10.0
#lambda1 = 20.0
#lambda1 = 20.0
#lambda1 = 5.0
#### material_implementation("analytical_Example") ?
......@@ -65,9 +63,9 @@ write_prestrainFunctions = true # VTK norm of B ,
rho1=1.0
alpha=2.0
alpha=9.0
theta=0.2
theta=0.075
#theta = 0.3 # volume fraction #default = 1.0/4.0
#theta = 0.25 # volume fraction
......
......@@ -45,6 +45,8 @@ beta = 2.0
theta = 1.0/4.0
gamma = 0.75
lambda1= 10.0
print('mu1: ', mu1)
print('rho1: ', rho1)
print('alpha: ', alpha)
......@@ -56,7 +58,7 @@ print('----------------------------')
print('RunCellProblem...')
RunCellProblem(alpha,beta,theta,gamma,mu1,rho1,InputFilePath)
RunCellProblem(alpha,beta,theta,gamma,mu1,rho1,lambda1, InputFilePath)
print('Read effective quantities...')
Q, B = ReadEffectiveQuantities()
......@@ -66,8 +68,8 @@ print('B:', B)
# Compare symbolicMinimization with Classification 'ClassifyMin' :
# print('Compare_Classification...')
# Compare_Classification(alpha,beta,theta,gamma,mu1,rho1,InputFilePath)
print('Compare_Classification...')
Compare_Classification(alpha,beta,theta,gamma,mu1,rho1,lambda1, InputFilePath)
......
......@@ -40,7 +40,7 @@ def ReadEffectiveQuantities(QFilePath = os.path.dirname(os.getcwd()) + '/outputs
def SetParametersCellProblem(alpha,beta,theta,gamma,mu1,rho1, InputFilePath = os.path.dirname(os.getcwd()) +"/inputs/computeMuGamma.parset"):
def SetParametersCellProblem(alpha,beta,theta,gamma,mu1,rho1,lambda1, InputFilePath = os.path.dirname(os.getcwd()) +"/inputs/computeMuGamma.parset"):
with open(InputFilePath, 'r') as file:
filedata = file.read()
filedata = re.sub('(?m)^alpha=.*','alpha='+str(alpha),filedata)
......@@ -49,6 +49,7 @@ def SetParametersCellProblem(alpha,beta,theta,gamma,mu1,rho1, InputFilePath = os
filedata = re.sub('(?m)^gamma=.*','gamma='+str(gamma),filedata)
filedata = re.sub('(?m)^mu1=.*','mu1='+str(mu1),filedata)
filedata = re.sub('(?m)^rho1=.*','rho1='+str(rho1),filedata)
filedata = re.sub('(?m)^lambda1=.*','lambda1='+str(lambda1),filedata)
f = open(InputFilePath,'w')
f.write(filedata)
f.close()
......@@ -70,7 +71,7 @@ def SetParametersComputeMuGamma(beta,theta,gamma,mu1,rho1, InputFilePath = os.pa
def RunCellProblem(alpha,beta,theta,gamma,mu1,rho1, InputFilePath = os.path.dirname(os.getcwd()) +"/inputs/computeMuGamma.parset"):
def RunCellProblem(alpha,beta,theta,gamma,mu1,rho1,lambda1, InputFilePath = os.path.dirname(os.getcwd()) +"/inputs/computeMuGamma.parset"):
# with open(InputFilePath, 'r') as file:
# filedata = file.read()
# filedata = re.sub('(?m)^gamma=.*','gamma='+str(gamma),filedata)
......@@ -82,7 +83,7 @@ def RunCellProblem(alpha,beta,theta,gamma,mu1,rho1, InputFilePath = os.path.dirn
# f = open(InputFilePath,'w')
# f.write(filedata)
# f.close()
SetParametersCellProblem(alpha,beta,theta,gamma,mu1,rho1, InputFilePath)
SetParametersCellProblem(alpha,beta,theta,gamma,mu1,rho1,lambda1, InputFilePath)
# --- Run Cell-Problem
# Optional: Check Time
# t = time.time()
......@@ -99,9 +100,9 @@ def RunCellProblem(alpha,beta,theta,gamma,mu1,rho1, InputFilePath = os.path.dirn
def GetCellOutput(alpha,beta,theta,gamma,mu1,rho1, InputFilePath = os.path.dirname(os.getcwd()) +"/inputs/computeMuGamma.parset",
def GetCellOutput(alpha,beta,theta,gamma,mu1,rho1,lambda1, InputFilePath = os.path.dirname(os.getcwd()) +"/inputs/computeMuGamma.parset",
OutputFilePath = os.path.dirname(os.getcwd()) + "/outputs/outputMuGamma.txt" ):
RunCellProblem(alpha,beta,theta,gamma,mu1,rho1, InputFilePath)
RunCellProblem(alpha,beta,theta,gamma,mu1,rho1,lambda1, InputFilePath)
print('Read effective quantities...')
Q, B = ReadEffectiveQuantities()
# print('Q:', Q)
......@@ -168,7 +169,7 @@ def GetMuGamma(beta,theta,gamma,mu1,rho1, InputFilePath = os.path.dirname(os.get
def Compare_Classification(alpha,beta,theta,gamma,mu1,rho1, InputFilePath = os.path.dirname(os.getcwd()) +"/inputs/computeMuGamma.parset"):
def Compare_Classification(alpha,beta,theta,gamma,mu1,rho1,lambda1, InputFilePath = os.path.dirname(os.getcwd()) +"/inputs/computeMuGamma.parset"):
# ---------------------------------------------------------------
# Comparison of the analytical Classification 'ClassifyMin'
# and the symbolic Minimizatio + Classification 'symMinimization'
......@@ -185,6 +186,7 @@ def Compare_Classification(alpha,beta,theta,gamma,mu1,rho1, InputFilePath = os.p
filedata = re.sub('(?m)^theta=.*','theta='+str(theta),filedata)
filedata = re.sub('(?m)^mu1=.*','mu1='+str(mu1),filedata)
filedata = re.sub('(?m)^rho1=.*','rho1='+str(rho1),filedata)
filedata = re.sub('(?m)^lambda1=.*','lambda1='+str(lambda1),filedata)
f = open(InputFilePath,'w')
f.write(filedata)
f.close()
......
......@@ -123,6 +123,9 @@ gamma = '0'
gamma = 0.25
# gamma = 1.0
#added
lambda1 = 10.0
print('---- Input parameters: -----')
print('mu1: ', mu1)
print('rho1: ', rho1)
......@@ -130,6 +133,8 @@ print('alpha: ', alpha)
print('beta: ', beta)
print('theta: ', theta)
print('gamma:', gamma)
print('lambda1: ', lambda1)
print('----------------------------')
# ----------------------------------------------------------------
......@@ -228,8 +233,8 @@ if make_3D_PhaseDiagram:
# Out = classifyMin_anaVec(alphas,betas,thetas)
# T = Out[2]
# --- Write to VTK
GammaString = str(gamma)
GammaString = str(gamma)
VTKOutputName = "outputs/PhaseDiagram3D" + "Gamma" + GammaString
gridToVTK(VTKOutputName , alphas, betas, thetas, pointData = {'Type': Types, 'angles': angles, 'curvature': curvature} )
print('Written to VTK-File:', VTKOutputName )
......@@ -251,9 +256,8 @@ if make_2D_PhaseDiagram:
if generalCase: #TODO
classifyMin_matVec = np.vectorize(classifyMin_mat)
GetCellOutputVec = np.vectorize(GetCellOutput, otypes=[np.ndarray, np.ndarray])
Q, B = GetCellOutputVec(alphas,betas,thetas,gamma,mu1,rho1,InputFilePath ,OutputFilePath )
Q, B = GetCellOutputVec(alphas,betas,thetas,gamma,mu1,rho1,lamba1, InputFilePath ,OutputFilePath )
# output = output.astype(object)
# print('type of Q:', type(Q))
# print('Q:', Q)
......
......@@ -140,7 +140,7 @@ if RUN:
Y_Values.append(float(s[0]))
else : # Run full Cell-Problem...
# fist replace old parameters in parset
SetParametersCellProblem(alpha,beta,theta,gamma,mu1,rho1,InputFilePath)
SetParametersCellProblem(alpha,beta,theta,gamma,mu1,rho1,lambda1,InputFilePath)
with open(InputFilePath, 'r') as file:
filedata = file.read()
......
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