-
Notifications
You must be signed in to change notification settings - Fork 1
/
sectprop.f
189 lines (189 loc) · 6.93 KB
/
sectprop.f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
************************************************************************
* S E C T P R O P *
* D. Everhart *
* 06 SEP 2018 *
************************************************************************
* The MIT License (MIT)
*
* Copyright (c) 2018 Daniel Everhart
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject
* to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*************************************************************************
* This program is to demonstrate the calculation of section properties
* of a general polygon. To test this, the following closed form
* solution of a right triangle is used.
*
*
* ^ |\
* | | \
* | | \ B*H**3 B*H**3
* | | \ Ix = ------ - ------
* | | \ 12 18
* | | \
* | | \
* | | \ H*B**3 H*B**3
* | \ Iy = ------ - ------
* H | \ 12 18
* | \
* | | | \
* | |<-->|<---- 1/3 B
* | | | \ B**2 * H**2
* | | +----- \ Ixy = - ------------
* | | CENT ^ \ 72
* | | | \
* | | | \
* | | \
* | | 1/3 H \
* | | \
* | | | \
* v |________v_____________\
* <------- B --------->
*
************************************************************************
PROGRAM SECTPROP
IMPLICIT NONE
INTEGER SIZE,STDOUT,STDIN,STDERR,I,J
REAL B,H,ANG
PARAMETER(SIZE=3,B=1.0,H=1.0,ANG=.78540,STDOUT=6,STDIN=5,STDERR=0)
REAL POINTS(2,SIZE)
REAL AREA,XCEN,YCEN,IXX,IYY,IXY
REAL AINC,XI,XIP1,YI,YIP1
DATA POINTS /
& 0., 0.,
& B, 0.,
& 0., H
& /
DATA AREA,XCEN,YCEN,IXX,IYY,IXY/6*0.0/
WRITE(STDOUT,9001)
*
DO 1001 I=1,SIZE
1001 WRITE(STDOUT,9002)(POINTS(J,I),J=1,2)
*
DO 2001 I=1,SIZE
*
XI = POINTS(1,I)
YI = POINTS(2,I)
IF (I.EQ.SIZE) THEN
XIP1 = POINTS(1,1)
YIP1 = POINTS(2,1)
ELSE
XIP1 = POINTS(1,I+1)
YIP1 = POINTS(2,I+1)
ENDIF
*
AINC = XI * YIP1 - XIP1 * YI
AREA = AREA + AINC
XCEN = XCEN + AINC * (XI + XIP1)
YCEN = YCEN + AINC * (YI + YIP1)
IXX = IXX + AINC * (YI**2.0 + YI*YIP1 + YIP1**2.0)
IYY = IYY + AINC * (XI**2.0 + XI*XIP1 + XIP1**2.0)
IXY = IXY + AINC * (XI*YIP1+2.0*XI*YI+2.0*XIP1*YIP1+XIP1*YI)
*
2001 CONTINUE
*
AREA = AREA / 2.0
XCEN = XCEN / 6.0 / AREA
YCEN = YCEN / 6.0 / AREA
IXX = IXX / 12.0
IYY = IYY / 12.0
IXY = IXY / 24.0
*
WRITE(STDOUT,9003)
WRITE(STDOUT,9004)
WRITE(STDOUT,9002) AREA,XCEN,YCEN,IXX,IYY,IXY
*
CALL INRTR2(AREA,XCEN,YCEN,IXX,IYY,IXY,0.0,0.0,XCEN,YCEN)
*
WRITE(STDOUT,9005)
WRITE(STDOUT,9004)
WRITE(STDOUT,9002) AREA,XCEN,YCEN,IXX,IYY,IXY
*
CALL T2DROT(IXX,IYY,IXY,ANG)
*
WRITE(STDOUT,9006) ANG
WRITE(STDOUT,9004)
WRITE(STDOUT,9002) AREA,XCEN,YCEN,IXX,IYY,IXY
*
AREA = 0.5 * B * H
XCEN = B / 3.0
YCEN = H / 3.0
IXX = 0.02777778 * B * H ** 3.0
IYY = 0.02777778 * H * B ** 3.0
IXY = - B ** 2.0 * H ** 2.0 / 72.0
*
WRITE(STDOUT,9007)
WRITE(STDOUT,9004)
WRITE(STDOUT,9002) AREA,XCEN,YCEN,IXX,IYY,IXY
*
*
8999 STOP
9001 FORMAT(/'$**** VERTEX DATA')
9002 FORMAT(5X,6F12.5)
9003 FORMAT(/'$**** SECTION PROPERTY DATA')
9004 FORMAT(5X,' AREA ',' XCEN ',' YCEN ',
& ' IXX ',' IYY ',' IXY ')
9005 FORMAT(/'$**** TRANSLATED SECTION PROPERTY DATA')
9006 FORMAT(/'$**** ROTATED SECTION PROPERTY DATA, ',F6.4,' RADIANS')
9007 FORMAT(/'$**** CLOSED FORM SECTION PROPERTY DATA')
END PROGRAM SECTPROP
************************************************************************
* I N R T R 2
************************************************************************
* Translates inertias from one axis system to another.
*
************************************************************************
SUBROUTINE INRTR2(AREA,XCEN,YCEN,IXX,IYY,IXY,XOLD,YOLD,XNEW,YNEW)
IMPLICIT NONE
REAL AREA,XCEN,YCEN,IXX,IYY,IXY,XOLD,YOLD,XNEW,YNEW
REAL X,XP,Y,YP
*
X = XOLD - XCEN
Y = YOLD - YCEN
XP = XNEW - XCEN
YP = YNEW - YCEN
* Ixy'= Ixy + A * ( x' * y' - x * y )
IXY = IXY + AREA * ( XP * YP - X * Y )
*
* Ixy'= Ixy + A * ( d' ** 2.0 - d ** 2.0 )
IXX = IXX + AREA * ( YP ** 2.0 - Y ** 2.0 )
IYY = IYY + AREA * ( XP ** 2.0 - X ** 2.0 )
8999 RETURN
END SUBROUTINE INRTR2
************************************************************************
* T 2 D R O T
************************************************************************
* Rotates a 2D tensor (eg: stress or inertia...)
*
************************************************************************
SUBROUTINE T2DROT(TXX,TYY,TXY,RAD)
IMPLICIT NONE
REAL TXX,TYY,TXY,RAD
REAL TMPP,TMPM,C2,S2
TMPP = ( TXX + TYY ) / 2.0
TMPM = ( TXX - TYY ) / 2.0
C2 = COS( 2.0 * RAD )
S2 = SIN( 2.0 * RAD )
TXX = TMPP + TMPM * C2 - TXY * S2
TYY = TMPP - TMPM * C2 + TXY * S2
TXY = TMPM * S2 + TXY * C2
8999 RETURN
END SUBROUTINE T2DROT
************************************************************************