SubDyn Subroutines ReduceKMdofs / ApplyConstr

Hello everybody!

I have begun to implement a soil-structure-interaction in the current SubDyn code. For this purpose I want to modify the handling of constraints.

In so doing, I’ve stumbled over the two subroutines ReduceKMdofs (SubDyn.f90) and ApplyConstr (SD_FEM.f90) and I don’t see a difference in functionality, but just ReduceKMdofs is called from the SubDyn code. Is the subroutine ApplyConstr obsolete or didn’t I catch its purpose? I know that there is also a subroutine ReduceKMdofs_Old, but it seems that this has been replaced by ReduceKMdofs.

Thanks in advance for your help and best regards,


Dear Bonnie (you seem to be the developer of the mentioned subroutine),

I’ve regarded the subroutine ReduceKMdofs intensively now and I think that there is a little issue in this passage:

Jj = 0 DO J = 1, NReactDOFs !Cycle on reaction DOFs IF (Init%BCs(J, 2) /= 1) THEN !this is a row/column to keep Jj = Jj + 1 idx(Jj) = Init%BCs(J, 2) END IF ! row/column of reduced matrix END DO ! row/column of full matrix

This cycles over the number of reaction DOF’s, but this is just working when the reaction DOF’s correspond to the first DOF’s or the reaction joints are the first joints, respectively and all DOF’s are constrained (like Test19, OC3 Monopile). Otherwise the wrong DOF’s will be eliminated here:

DO J = 1, DOF_reduced !Cycle on reaction DOFs DO I = 1, DOF_reduced !Cycle on reaction DOFs Kred(I,J) = REAL( K( idx(I), idx(J) ), LAKi ) END DO END DO

I’ve calculated some examples and I’m quite sure about this.

Best regards,


Hi, Jan.

While I did write the ReduceKMdofs routine that is being used, I was merely trying to make something logically equivalent to ReduceKMdofs_Old (which I didn’t write) without using the variable NaN and without using a WHERE statement. Have you checked that ReduceKMdofs_old produces the same problem?

If ReduceKMdofs_Old has a problem, I’ll let our SubDyn theory guys know and have them take a look at it.

Thanks for checking this out.

Hello Bonnie,

I’ve checked this tomorrow and the problem is that ReduceKMdofs doesn’t produce the same output (Kred) as ReduceKMdofs_old. Unfortunately, in some test cases (when the reaction DOF’s are not the DOF’s 1…6*NReact) this might lead to wrong results.

I’ve attached a sample SubDyn input file, where this problem is occuring. To reconstruct this problem write out Kred from ReduceKMdofs and ReduceKMdofs_old with Test19 and this SubDyn input and you’ll see different results.

I wonder why you don’t use the subroutine ApplyConstr from SD_FEM.f90 for the purpose of reducing the DOF’s. This seems to be the most computational-efficient solution and works fine just using one DO-loop. The only difference is to remove the desired rows and columns instead of setting them to zero but that shouldn’t be a big deal. If it’s desired, I can propose a solution for this.

Best regards,

Jan (2.83 KB)