Skip to content
Open
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
8 changes: 7 additions & 1 deletion modules/subdyn/src/SubDyn.f90
Original file line number Diff line number Diff line change
Expand Up @@ -4208,7 +4208,13 @@ SUBROUTINE WriteJSONCommon(FileName, Init, p, m, InitInput, FileKind, UnSum, Err
! --- Elem props
write(UnSum, '(A)') '"ElemProps": ['
do i = 1, size(p%ElemProps)
write(UnSum, '(A,I0,A,F8.4,A)', advance='no') ' {"shape": "cylinder", "type": ',p%ElemProps(i)%eType, ', "Diam":',p%ElemProps(i)%D(1),'}'
if (p%ElemProps(i)%eType == idMemberBeamRect) then
! Rectangular beam: MType = 1r. eType = -1
write(UnSum, '(A,I0,A,F8.4,A,F8.4,A, F10.6,A,F10.6,A,F10.6,A)', advance='no') ' {"shape": "rectangle", "type": ',p%ElemProps(i)%eType, ', "SideA":',p%ElemProps(i)%Sa(1), ', "SideB":',p%ElemProps(i)%Sb(1), ', "SideA_dir":[',p%ElemProps(i)%DirCos(1,1), ',',p%ElemProps(i)%DirCos(2,1), ',',p%ElemProps(i)%DirCos(3,1),']}'
else
! Cylindrical shapes (MType = 1 or 1c [cylindrical beam], 2 [cable element], 3 [rigid link]. eType = 1, 2, 3)
write(UnSum, '(A,I0,A,F8.4,A)', advance='no') ' {"shape": "cylinder", "type": ',p%ElemProps(i)%eType, ', "Diam":',p%ElemProps(i)%D(1),'}'
endif
if (i<size(p%ElemProps)) write(UnSum, '(A)', advance='no')','//NewLine
enddo
write(UnSum, '(A)') ']'
Expand Down