Transition mesh with equal ratio serial

lenL=xPoint[5]-C2[0]
lenR=C3[0]-xPoint[5]
hmax=2.
hmin=0.5
ratio=hmax/hmin
NL=int(np.log(ratio)/np.log((lenL-hmin)/(lenL-hmin*ratio))+1.)
NR=int(np.log(ratio)/np.log((lenR-hmin)/(lenR-hmin*ratio))+1.)
hminL=lenL*(ratio**(1./(NL-1))-1.)/(ratio**(NL/(NL-1.))-1.)
hminR=lenR*(ratio**(1./(NR-1))-1.)/(ratio**(NR/(NR-1.))-1.)
qL=ratio**(1./(NL-1.))
qR=ratio**(1./(NR-1.))
xpt=xPoint[5]
for j in range(NL-1):
hstep=hminL*qL**j
mdb.models[‘Model-1’].sketches[‘__profile__’].Line(point1=(xpt,C2[1]), point2=(xpt-hstep,C2[1]))
xpt=xpt-hstep

mdb.models[‘Model-1’].sketches[‘__profile__’].Line(point1=(xpt,C2[1]), point2=C2)
xpt=xPoint[5]
for j in range(NR-1):
hstep=hminR*qR**j
mdb.models[‘Model-1’].sketches[‘__profile__’].Line(point1=(xpt,C2[1]), point2=(xpt+hstep,C2[1]))
xpt=xpt+hstep

mdb.models[‘Model-1’].sketches[‘__profile__’].Line(point1=(xpt,C2[1]), point2=(C3[0],C3[1]))

Advertisements

About yhtian

I am an academic researcher working on Offshore Geotechnical Engineering. My blog aims to write down some work related trivial things and tricks about software, programming. It is basically a memo for me to back up some thoughts and small details. But I am more than happy if someone would visit and discuss.
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s