Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xbeam changes for sharpy branch dev_xbeam_ramp #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/cbeam3_interface.f90
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ subroutine cbeam3_solv_nlnstatic_python(n_elem,&
integer(c_int), intent(IN) :: vdof(n_node)
integer(c_int), intent(IN) :: fdof(n_node)


type(xbelem) :: elements(n_elem)
type(xbnode) :: nodes(n_node)
type(xbopts), intent(INOUT) :: options
Expand Down Expand Up @@ -124,8 +125,8 @@ subroutine cbeam3_solv_nlnstatic_python(n_elem,&
psi_ini,&
pos_def,&
psi_def,&
options&
)
options)

call correct_gravity_forces(n_node, n_elem, gravity_forces, psi_def, elements, nodes)
end subroutine cbeam3_solv_nlnstatic_python

Expand Down
33 changes: 26 additions & 7 deletions src/cbeam3_solv.f90
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ subroutine cbeam3_solv_nlnstatic_old (NumDof,n_elem,n_node,Elem,Node,AppForces,n
real(8), intent(in) :: Psi0 (n_elem,3,3) ! Initial CRV of the nodes in the elements.
real(8), intent(inout):: PosDefor (n_node, 3) ! Current coordinates of the grid points
real(8), intent(inout):: PsiDefor (n_elem, 3, 3) ! Current CRV of the nodes in the elements.
type(xbopts),intent(in) :: Options ! Solver parameters.
type(xbopts),intent(inout) :: Options ! Solver parameters.

! Local variables.
real(8):: Delta ! Flag for convergence in iterations.
Expand Down Expand Up @@ -171,7 +171,7 @@ subroutine cbeam3_solv_nlnstatic_old (NumDof,n_elem,n_node,Elem,Node,AppForces,n
! TaPos = Possc *Options%MinDelta
! TaPsi = Psisc *Options%MinDelta

DX_old = 1.0d0*options%mindelta
DX_old = 1.0d0*options%mindelta

! Initialize geometric constants and system state.
ListIN = 0
Expand All @@ -193,11 +193,25 @@ subroutine cbeam3_solv_nlnstatic_old (NumDof,n_elem,n_node,Elem,Node,AppForces,n

! Iteration until convergence.
converged=.false.
! print*, 'before asgn1 Conv is: ', Options%load_ramping_conv

Options%load_ramping_conv = .true.

! print*, 'after asgn1 Conv is: ', Options%load_ramping_conv
do while (converged .eqv. .false.)!(Delta.gt.Options%MinDelta)
Iter= Iter+1
if (Iter.gt.Options%MaxIterations) then

Options%load_ramping_conv = .false.

print*, 'Residual is: ', maxval(abs(DeltaX))
STOP 'Static equations did not converge (17235)'
print*, 'Static equations did not converge (17235), current number of load steps = ' , Options%NumLoadSteps
print*, 'Doubling load step. conv = ' , Options%load_ramping_conv


converged = .TRUE.
cycle
! STOP 'Static equations did not converge (17235)'
end if

if ((Options%PrintInfo) .AND. (Iter.eq.1)) then
Expand Down Expand Up @@ -273,18 +287,23 @@ subroutine cbeam3_solv_nlnstatic_old (NumDof,n_elem,n_node,Elem,Node,AppForces,n
call cbeam3_solv_update_static (Elem,Node,Psi0,DeltaX,PosDefor,PsiDefor)

if (iter > 1) then
! print*, 'Current iter is ', iter
if (maxval(abs(DeltaX)) < DX_old) then
! print*, 'before conv asgn Conv is: ', Options%load_ramping_conv

Options%load_ramping_conv = .true.

converged = .TRUE.

! print*, 'after conv asgn Conv is: ', Options%load_ramping_conv
! print*, 'APPFORCES = ', sum(appforces, dim=1)
! print*, 'gravity_forces = ', sum(gravity_forces, dim=1)
! print*, sum(gravity_forces + AppForces, dim=1)
end if
end if

if (iter == 1) then
DX_old = max(1.0d0, maxval(abs(DeltaX)))*options%mindelta
end if
if (iter == 1) then
DX_old = max(1.0d0, maxval(abs(DeltaX)))*options%mindelta
end if
! Convergence parameter delta (original):
! call delta_check(Qglobal,DeltaX,Delta,passed_delta,Options%MinDelta,Options%PrintInfo)
! ! Check convergence using the residual:
Expand Down
1 change: 1 addition & 0 deletions src/xbeam_shared.f90
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ module xbeam_shared
real(c_double):: gravity_dir_z = 1
logical(c_bool):: balancing = .false.
real(c_double):: relaxation_factor = 0.3
logical(c_bool):: load_ramping_conv = .false.
end type

end module xbeam_shared