diff --git a/inputs/cellsolver.parset b/inputs/cellsolver.parset index 7b723865c77fb2277d1226c73780c3470b448996..d18133722a982be657dbec630e5a83eeea87f573 100644 --- a/inputs/cellsolver.parset +++ b/inputs/cellsolver.parset @@ -29,7 +29,7 @@ nElements = 32 32 -gamma=0.25 +gamma=0.75 ############################################# diff --git a/inputs/computeMuGamma.parset b/inputs/computeMuGamma.parset index 02ee3c47d0ec3c22cb4436aa9a4ce595ea50e677..defbd13acb87a7a73009c85559a95f9347f66011 100644 --- a/inputs/computeMuGamma.parset +++ b/inputs/computeMuGamma.parset @@ -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 diff --git a/src/CellScript.py b/src/CellScript.py index 73f1b046d56f16c7158b165c32b44f17c187a31c..89757eabfe6163dbc6dd11242fe291d1eed1e530 100644 --- a/src/CellScript.py +++ b/src/CellScript.py @@ -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) diff --git a/src/HelperFunctions.py b/src/HelperFunctions.py index 7007d5de2ee64059746a5a4470d0f0ed55391ef1..a346d21339d1ec5537aba04ef9e5753b66b9fabe 100644 --- a/src/HelperFunctions.py +++ b/src/HelperFunctions.py @@ -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() diff --git a/src/PhaseDiagram.py b/src/PhaseDiagram.py index 51ccbc0b7af4d0ba47be6c5fef898e09f29c75fc..19d9e9bfd454b6614df2cf883af19711da7ee9c6 100644 --- a/src/PhaseDiagram.py +++ b/src/PhaseDiagram.py @@ -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) diff --git a/src/makePlot.py b/src/makePlot.py index 48d7dd155c2680e30e2930c28de2e19c4f777fdb..d6caac4944125f988ec67dee2776d6a6bfe158d2 100644 --- a/src/makePlot.py +++ b/src/makePlot.py @@ -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()