Skip to content

Commit f37646e

Browse files
authored
Merge pull request #3195 from RBergua/SubDyn_JSON_rectangular
SubDyn: add rectangular beam properties to JSON output
2 parents 216a72e + 2a88132 commit f37646e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

modules/subdyn/src/SubDyn.f90

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4208,7 +4208,13 @@ SUBROUTINE WriteJSONCommon(FileName, Init, p, m, InitInput, FileKind, UnSum, Err
42084208
! --- Elem props
42094209
write(UnSum, '(A)') '"ElemProps": ['
42104210
do i = 1, size(p%ElemProps)
4211-
write(UnSum, '(A,I0,A,F8.4,A)', advance='no') ' {"shape": "cylinder", "type": ',p%ElemProps(i)%eType, ', "Diam":',p%ElemProps(i)%D(1),'}'
4211+
if (p%ElemProps(i)%eType == idMemberBeamRect) then
4212+
! Rectangular beam: MType = 1r. eType = -1
4213+
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),']}'
4214+
else
4215+
! Cylindrical shapes (MType = 1 or 1c [cylindrical beam], 2 [cable element], 3 [rigid link]. eType = 1, 2, 3)
4216+
write(UnSum, '(A,I0,A,F8.4,A)', advance='no') ' {"shape": "cylinder", "type": ',p%ElemProps(i)%eType, ', "Diam":',p%ElemProps(i)%D(1),'}'
4217+
endif
42124218
if (i<size(p%ElemProps)) write(UnSum, '(A)', advance='no')','//NewLine
42134219
enddo
42144220
write(UnSum, '(A)') ']'

0 commit comments

Comments
 (0)