Skip to content
Snippets Groups Projects
Commit 1bf76206 authored by noels's avatar noels
Browse files

clean

parent 6fb9e37d
No related branches found
No related tags found
No related merge requests found
......@@ -23,19 +23,38 @@ import matplotlib.pyplot as plt
from Auto_geometry_parametric import *
###################################################
#############Can be changed##########################
cellType = "3" # from "2", "3", "4", "5", "6", "7", "8", "9", "91"
typeRand = "a" # "a" for random volume fraction and "b" for random radius
VmFrMax = 0.2 #bound of random volume fraction, for geometry 8: 0.15 is a maximum, for other geometry 0.3 is a maximum
nx =2 #number of cell along x
ny =2 #number of cell along y
nz =2 #number of cell along z
sizemin=0.2 #minimum size of unit cell
sizemax=2.5 # maximum size of unit cell
#############Cannot be changed##############################
vf_tpye=["a", "b"]
GeoID = []
GeoID.append(["2", "3", "4", "5", "6", "7", "8", "9", "91"])
GeoID.append(["2", "3", "4", "5", "6", "7", "8", "9", "91", "92"])
cell_num = np.array([1,1,1])
cell_num = np.array([nx,ny,nz])
####################################################
Nsim=200
i=0
j=1
index=[ind for (ind, ele) in enumerate(vf_tpye) if ele==typeRand]
if(len(index)<1):
print("You need to choose among ",vf_tpye," for typeRans")
exit()
i=index[0]
vfr= vf_tpye[i]
cell_name= GeoID[i][j]
index=[ind for (ind, ele) in enumerate(GeoID[i]) if ele==cellType]
if(len(index)<1):
print("You need to choose among", GeoID[i], " for cellType")
exit()
j=index[0]
cell_name= GeoID[i][j]
rho=str(128) # defaut
length = cell_num[0]
......@@ -45,10 +64,15 @@ height = cell_num[2]
####################################################
if cell_name!="8":
VmFr = 0.3*np.random.uniform()
if(VmFrMax>0.3):
VmFrMax=0.3
if cell_name=="8":
VmFr=0.15*np.random.uniform()
sb = np.random.uniform(0.5, 2.5) #Set size of unit cell
if(VmFrMax>0.15):
VmFrMax=0.15
VmFr=VmFrMax*np.random.uniform()
sb = np.random.uniform(sizemin, sizemax) #Set size of unit cell
Radius = np.random.uniform()*sb
Geo, Radi = Geo_generator(cell_name, rho, vfr, length, width, height, sb, Radius, VmFr)
V_R_S = [VmFr, Radi, sb]
......
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