From d42d3b89f4a8e7a2d37ae45e0ffb6f0326f0cfe1 Mon Sep 17 00:00:00 2001 From: Roger Bergua Date: Fri, 1 Dec 2023 08:34:05 +0100 Subject: [PATCH 1/2] SubDyn summary file: fixes --- modules/subdyn/src/SubDyn.f90 | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/modules/subdyn/src/SubDyn.f90 b/modules/subdyn/src/SubDyn.f90 index 0f24e5a000..2398a3851d 100644 --- a/modules/subdyn/src/SubDyn.f90 +++ b/modules/subdyn/src/SubDyn.f90 @@ -3567,6 +3567,7 @@ SUBROUTINE OutSummary(Init, p, m, InitInput, CBparams, Modes, Omega, Omega_Gy, E INTEGER(IntKi) :: i, j, k, propIDs(2), Iprop(2) !counter and temporary holders INTEGER(IntKi) :: iNode1, iNode2 ! Node indices INTEGER(IntKi) :: mType ! Member Type + INTEGER :: iDirCos REAL(ReKi) :: mMass, mLength ! Member mass and length REAL(ReKi) :: M_O(6,6) ! Equivalent mass matrix at origin REAL(ReKi) :: M_P(6,6) ! Equivalent mass matrix at P (ref point) @@ -3835,11 +3836,25 @@ SUBROUTINE OutSummary(Init, p, m, InitInput, CBparams, Modes, Omega, Omega_Gy, E WRITE(UnSum, '(A, I6)') '#Direction Cosine Matrices for all Members: GLOBAL-2-LOCAL. No. of 3x3 matrices=', p%NMembers WRITE(UnSum, '(A9,9(A15))') '#Member ID', 'DC(1,1)', 'DC(1,2)', 'DC(1,3)', 'DC(2,1)','DC(2,2)','DC(2,3)','DC(3,1)','DC(3,2)','DC(3,3)' DO i=1,p%NMembers - iNode1 = FINDLOCI(Init%Joints(:,1), Init%Members(i,2)) ! index of joint 1 of member i + mType = Init%Members(I, iMType) + iNode1 = FINDLOCI(Init%Joints(:,1), Init%Members(i,2)) ! index of joint 1 of member i iNode2 = FINDLOCI(Init%Joints(:,1), Init%Members(i,3)) ! index of joint 2 of member i XYZ1 = Init%Joints(iNode1,2:4) XYZ2 = Init%Joints(iNode2,2:4) - CALL GetDirCos(XYZ1(1:3), XYZ2(1:3), mType, DirCos, mLength, ErrStat, ErrMsg) + if ((mType == idMemberSpring) .or. (mType == idMemberBeamArb)) then ! The direction cosine for these member types must be provided by the user + iDirCos = p%Elems(i, iMDirCosID) + DirCos(1, 1) = Init%COSMs(iDirCos, 2) + DirCos(2, 1) = Init%COSMs(iDirCos, 3) + DirCos(3, 1) = Init%COSMs(iDirCos, 4) + DirCos(1, 2) = Init%COSMs(iDirCos, 5) + DirCos(2, 2) = Init%COSMs(iDirCos, 6) + DirCos(3, 2) = Init%COSMs(iDirCos, 7) + DirCos(1, 3) = Init%COSMs(iDirCos, 8) + DirCos(2, 3) = Init%COSMs(iDirCos, 9) + DirCos(3, 3) = Init%COSMs(iDirCos, 10) + else + CALL GetDirCos(XYZ1(1:3), XYZ2(1:3), mType, DirCos, mLength, ErrStat, ErrMsg) + endif DirCos=TRANSPOSE(DirCos) !This is now global to local WRITE(UnSum, '("#",I9,9(ES28.18E2))') Init%Members(i,1), ((DirCos(k,j),j=1,3),k=1,3) ENDDO From 1e2014ca5c14240124cc743a2b3ef1d2f0719737 Mon Sep 17 00:00:00 2001 From: Roger Bergua Date: Sun, 3 Dec 2023 11:25:38 -0700 Subject: [PATCH 2/2] SubDyn.f90 spaces instead of tabs --- modules/subdyn/src/SubDyn.f90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/subdyn/src/SubDyn.f90 b/modules/subdyn/src/SubDyn.f90 index 2398a3851d..d1b576e33d 100644 --- a/modules/subdyn/src/SubDyn.f90 +++ b/modules/subdyn/src/SubDyn.f90 @@ -3837,12 +3837,12 @@ SUBROUTINE OutSummary(Init, p, m, InitInput, CBparams, Modes, Omega, Omega_Gy, E WRITE(UnSum, '(A9,9(A15))') '#Member ID', 'DC(1,1)', 'DC(1,2)', 'DC(1,3)', 'DC(2,1)','DC(2,2)','DC(2,3)','DC(3,1)','DC(3,2)','DC(3,3)' DO i=1,p%NMembers mType = Init%Members(I, iMType) - iNode1 = FINDLOCI(Init%Joints(:,1), Init%Members(i,2)) ! index of joint 1 of member i + iNode1 = FINDLOCI(Init%Joints(:,1), Init%Members(i,2)) ! index of joint 1 of member i iNode2 = FINDLOCI(Init%Joints(:,1), Init%Members(i,3)) ! index of joint 2 of member i XYZ1 = Init%Joints(iNode1,2:4) XYZ2 = Init%Joints(iNode2,2:4) - if ((mType == idMemberSpring) .or. (mType == idMemberBeamArb)) then ! The direction cosine for these member types must be provided by the user - iDirCos = p%Elems(i, iMDirCosID) + if ((mType == idMemberSpring) .or. (mType == idMemberBeamArb)) then ! The direction cosine for these member types must be provided by the user + iDirCos = p%Elems(i, iMDirCosID) DirCos(1, 1) = Init%COSMs(iDirCos, 2) DirCos(2, 1) = Init%COSMs(iDirCos, 3) DirCos(3, 1) = Init%COSMs(iDirCos, 4)