From a7fb74b5d7daada67122ab19701dc233b6e35232 Mon Sep 17 00:00:00 2001
From: Stefan Neukamm <stefan.neukamm@tu-dresden.de>
Date: Thu, 7 Jul 2022 19:13:06 +0200
Subject: [PATCH] beispiel

---
 geometries/material_neukamm.py   | 17 ++++++++++++-----
 inputs/cellsolver.parset         | 12 ++++++------
 microstructure_testsuite/plot.py | 10 +++++-----
 src/CMakeLists.txt               |  5 +----
 4 files changed, 24 insertions(+), 20 deletions(-)

diff --git a/geometries/material_neukamm.py b/geometries/material_neukamm.py
index 60e8156d..d6d38a76 100644
--- a/geometries/material_neukamm.py
+++ b/geometries/material_neukamm.py
@@ -6,9 +6,16 @@ import math
 # x[1] : y2-component
 # x[2] : x3-component
 def f(x):
-    theta=0.5
-    factor=.9
+    theta=0.25
+    factor=1
     # --- replace with your definition of indicatorFunction:
+    #
+    # if ((abs(x[0]) < theta/2) and x[2]<0):
+    #     return 1    #Phase1
+    # else :
+    #     return 0    #Phase3
+    
+    # 
     if ((abs(x[0]) < theta/2) and x[2]<-1/2+theta):
         return 1    #Phase1
     elif ((abs(x[1]) < factor*theta/2) and x[2]>1/2-factor*theta):
@@ -18,10 +25,10 @@ def f(x):
 
 
 def b1(x):
-    return [[1, 4, 5], [-5, 8, 9], [-5, 8, 0]]
+    return [[1, 0, 0], [0,1,0], [0,0,1]]
 
 def b2(x):
-    return [[9, 1, 9], [1, 9, 1], [1, 1, 9]]
+    return [[1, 0, 0], [0,1,0], [0,0,1]]
 
 def b3(x):
-    return [[0,0,0], [0, 0, 0], [0, 8, 0]]
+    return [[0, 0, 0], [0,0,0], [0,0,0]]
diff --git a/inputs/cellsolver.parset b/inputs/cellsolver.parset
index 51584a3b..5ac539f1 100644
--- a/inputs/cellsolver.parset
+++ b/inputs/cellsolver.parset
@@ -27,7 +27,7 @@ cellDomain=1
 ## {start,finish} computes on all grid from 2^(start) to 2^finish refinement
 #----------------------------------------------------
 
-numLevels=4 4
+numLevels=2 4
 #numLevels =  1 1   # computes all levels from first to second entry
 #numLevels =  2 2   # computes all levels from first to second entry
 #numLevels =  1 3   # computes all levels from first to second entry
@@ -64,9 +64,9 @@ lambda1=1.0
 
 
 # better: pass material parameters as a vector
-mu=80 60 20
-lambda=80 25 10
-rho=1.0 0
+mu=80 80 60
+lambda=80 80 25
+#rho=1.0 0
 
 
 # ---volume fraction  (default value = 1.0/4.0)
@@ -96,8 +96,8 @@ material_prestrain_imp= "material_neukamm"   #(Python-indicator-function with sa
 
 
 # --- (Optional output) write Material / prestrain / Corrector functions to .vtk-Files (default=false):
-write_materialFunctions = true
-write_prestrainFunctions = true  # VTK norm of B ,
+#write_materialFunctions = true
+#write_prestrainFunctions = true  # VTK norm of B ,
 #write_VTK = true
 
 
diff --git a/microstructure_testsuite/plot.py b/microstructure_testsuite/plot.py
index 677a1aaf..00bea1be 100644
--- a/microstructure_testsuite/plot.py
+++ b/microstructure_testsuite/plot.py
@@ -7,6 +7,7 @@ Created on Wed Jul  6 13:17:28 2022
 """
 import numpy as np
 import matplotlib.pyplot as plt
+import matplotlib.colors as colors
 from helper_functions import *
 
 
@@ -50,11 +51,12 @@ elif case==-1: # Read from outputs
     QFilePath = os.path.dirname(os.getcwd()) + '/outputs/QMatrix.txt'
     BFilePath = os.path.dirname(os.getcwd())+ '/outputs/BMatrix.txt'
     Q, B = ReadEffectiveQuantities(QFilePath,BFilePath)
+    Q=0.5*(np.transpose(Q)+Q) # symmetrize
     B=np.transpose([B])
 # 
 
 #    
-length=2
+length=80
 N=200
 h=length/N
 E=np.zeros([N,N])
@@ -62,11 +64,9 @@ X=np.zeros([N,N])
 Y=np.zeros([N,N])
 for i in range(0,N): 
     for j in range(0,N):     
-        x=(i-N/2)*h
-        y=(j-N/2)*h
         X[i,j]=(i-N/2)*h
         Y[i,j]=(j-N/2)*h
-        K=xytokappaalpha(x,y)
+        K=xytokappaalpha(X[i,j],Y[i,j])
         E[i,j]=energy(K[0],K[1],Q,B)
 
 fig = plt.figure(figsize=(7,6))
@@ -75,7 +75,7 @@ ax.set_aspect(1)
 ax.set_xticks([-length/4,0,length/4])
 ax.set_yticks([])
 #pcm = plt.pcolor(X,Y,E, norm=colors.LogNorm(vmin=E.min(), vmax=E.max()), cmap='winter', shading='auto')
-pcm = plt.pcolor(X,Y,E, norm=colors.PowerNorm(gamma=0.3), cmap='winter', shading='auto')
+pcm = plt.pcolor(X,Y,E, norm=colors.PowerNorm(gamma=0.25), cmap='brg')
 plt.colorbar(pcm, extend='max')
 #plt.imshow(np.log(E-np.min(E)+0.0001)) # normalize to min = 0 and log scale to emphasize energy landscape
 # TODO: Beschriftung der Axen sollte von [-h*N/2, h*N/2] sein!
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index d099d57b..3264ac4d 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -3,10 +3,7 @@
 #set(CMAKE_BUILD_TYPE Debug)#
 
 
-set(programs Cell-Problem
-	     Cell-Problem_muGamma
-	     Compute_MuGamma
-             )
+set(programs Cell-Problem)
 
 
 foreach(_program ${programs})
-- 
GitLab