二分法求弹塑性比 elastic plastic ratio using Bi-section

我的Fortran 源程序:
subroutine UWAPIPE_epp(p, force, forcen, dforcee, epp)
!
!! the elastic-plastic portion
use UWAPIPE_module
implicit none

type(propUWAPIPE), intent(in) :: p
real(kind=gp), dimension(3), intent(in) :: force, dforcee
real(kind=gp), dimension(2), intent(in) :: forcen
real(kind=gp), intent(out) :: epp

real(kind=gp), dimension(3) :: forceyd
real(kind=gp) :: a, b, f
integer(kind=8) :: n
a = 0.0_gp
b = 1.0_gp
n = 0
if (p%model == ‘ep’) then
do
epp = (a+b)/2.0_gp
forceyd = force + epp*dforcee
call UWAPIPE_yield(p, forceyd, p%V0, p%h0, f)
if (abs(f).LT.ftol) then
exit
else if (f.LT.-ftol) then
a = epp
else
b = epp
end if
n = n + 1
if (n.GE.1e6) then
print *, ‘error. Can not find the epp. set to 0’
epp = 0.0_gp
exit
end if
end do
else if (p%model == ‘bm’) then
do
epp = (a+b)/2.0_gp
forceyd = force + epp*dforcee
call UWAPIPE_bubyield(p, forceyd, forcen, p%V0, p%h0, f)
if (abs(f).LT.ftol) then
exit
else if (f.LT.-ftol) then
a = epp
else
b = epp
end if
n = n + 1
if (n.GE.1e6) then
print *, ‘error. Can not find the epp. set to 0’
epp = 0.0_gp
exit
end if
end do
end if

end subroutine UWAPIPE_epp

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s