@@ -12,27 +12,27 @@ def get_bulkmodul_voigt(elastic_matrix: np.ndarray) -> float:
1212 ) / 9
1313
1414
15- def get_shearmodul_voigt (elastic_matrix ) :
15+ def get_shearmodul_voigt (elastic_matrix : np . ndarray ) -> float :
1616 return (
1717 (elastic_matrix [0 , 0 ] + elastic_matrix [1 , 1 ] + elastic_matrix [2 , 2 ])
1818 - (elastic_matrix [0 , 1 ] + elastic_matrix [0 , 2 ] + elastic_matrix [1 , 2 ])
1919 + 3 * (elastic_matrix [3 , 3 ] + elastic_matrix [4 , 4 ] + elastic_matrix [5 , 5 ])
2020 ) / 15
2121
2222
23- def get_youngsmodul_voigt (bulkmodul_voigt , shearmodul_voigt ) :
23+ def get_youngsmodul_voigt (bulkmodul_voigt : float , shearmodul_voigt : float ) -> float :
2424 return (9 * bulkmodul_voigt * shearmodul_voigt ) / (
2525 3 * bulkmodul_voigt + shearmodul_voigt
2626 )
2727
2828
29- def get_poissonsratio_voigt (bulkmodul_voigt , shearmodul_voigt ) :
29+ def get_poissonsratio_voigt (bulkmodul_voigt : float , shearmodul_voigt : float ) -> float :
3030 return (1.5 * bulkmodul_voigt - shearmodul_voigt ) / (
3131 3 * bulkmodul_voigt + shearmodul_voigt
3232 )
3333
3434
35- def get_bulkmodul_reuss (elastic_matrix_inverse ) :
35+ def get_bulkmodul_reuss (elastic_matrix_inverse : np . ndarray ) -> float :
3636 return 1 / (
3737 elastic_matrix_inverse [0 , 0 ]
3838 + elastic_matrix_inverse [1 , 1 ]
@@ -46,7 +46,7 @@ def get_bulkmodul_reuss(elastic_matrix_inverse):
4646 )
4747
4848
49- def get_shearmodul_reuss (elastic_matrix_inverse ) :
49+ def get_shearmodul_reuss (elastic_matrix_inverse : np . ndarray ) -> float :
5050 return 15 / (
5151 4
5252 * (
@@ -69,143 +69,143 @@ def get_shearmodul_reuss(elastic_matrix_inverse):
6969 )
7070
7171
72- def get_youngsmodul_reuss (bulkmodul_reuss , shearmodul_reuss ) :
72+ def get_youngsmodul_reuss (bulkmodul_reuss : float , shearmodul_reuss : float ) -> float :
7373 return (9 * bulkmodul_reuss * shearmodul_reuss ) / (
7474 3 * bulkmodul_reuss + shearmodul_reuss
7575 )
7676
7777
78- def get_poissonsratio_reuss (bulkmodul_reuss , shearmodul_reuss ) :
78+ def get_poissonsratio_reuss (bulkmodul_reuss : float , shearmodul_reuss : float ) -> float :
7979 return (1.5 * bulkmodul_reuss - shearmodul_reuss ) / (
8080 3 * bulkmodul_reuss + shearmodul_reuss
8181 )
8282
8383
84- def get_bulkmodul_hill (bulkmodul_voigt , bulkmodul_reuss ) :
84+ def get_bulkmodul_hill (bulkmodul_voigt : float , bulkmodul_reuss : float ) -> float :
8585 return _hill_approximation (voigt = bulkmodul_voigt , reuss = bulkmodul_reuss )
8686
8787
88- def get_shearmodul_hill (shearmodul_voigt , shearmodul_reuss ) :
88+ def get_shearmodul_hill (shearmodul_voigt : float , shearmodul_reuss : float ) -> float :
8989 return _hill_approximation (voigt = shearmodul_voigt , reuss = shearmodul_reuss )
9090
9191
92- def get_youngsmodul_hill (bulkmodul_hill , shearmodul_hill ) :
92+ def get_youngsmodul_hill (bulkmodul_hill : float , shearmodul_hill : float ) -> float :
9393 return (9.0 * bulkmodul_hill * shearmodul_hill ) / (
9494 3.0 * bulkmodul_hill + shearmodul_hill
9595 )
9696
9797
98- def get_poissonsratio_hill (bulkmodul_hill , shearmodul_hill ) :
98+ def get_poissonsratio_hill (bulkmodul_hill : float , shearmodul_hill : float ) -> float :
9999 return (1.5 * bulkmodul_hill - shearmodul_hill ) / (
100100 3.0 * bulkmodul_hill + shearmodul_hill
101101 )
102102
103103
104- def get_AVR (shearmodul_voigt , shearmodul_reuss ) :
104+ def get_AVR (shearmodul_voigt : float , shearmodul_reuss : float ) -> float :
105105 return (
106106 100.0
107107 * (shearmodul_voigt - shearmodul_reuss )
108108 / (shearmodul_voigt + shearmodul_reuss )
109109 )
110110
111111
112- def get_elastic_matrix_eigval (elastic_matrix ):
112+ def get_elastic_matrix_eigval (elastic_matrix : np . ndarray ):
113113 return np .linalg .eig (elastic_matrix )
114114
115115
116- def get_elastic_matrix_inverse (elastic_matrix ) :
116+ def get_elastic_matrix_inverse (elastic_matrix : np . ndarray ) -> np . ndarray :
117117 return np .linalg .inv (elastic_matrix )
118118
119119
120- def _hill_approximation (voigt , reuss ) :
120+ def _hill_approximation (voigt : float , reuss : float ) -> float :
121121 return 0.50 * (voigt + reuss )
122122
123123
124124class ElasticProperties :
125125 def __init__ (self , elastic_matrix ):
126126 self ._elastic_matrix = elastic_matrix
127127
128- def elastic_matrix (self ):
128+ def elastic_matrix (self ) -> np . ndarray :
129129 return self ._elastic_matrix
130130
131131 @cache
132- def elastic_matrix_inverse (self ):
132+ def elastic_matrix_inverse (self ) -> np . ndarray :
133133 return get_elastic_matrix_inverse (elastic_matrix = self .elastic_matrix ())
134134
135135 @cache
136- def bulkmodul_voigt (self ):
136+ def bulkmodul_voigt (self ) -> float :
137137 return get_bulkmodul_voigt (elastic_matrix = self .elastic_matrix ())
138138
139139 @cache
140- def shearmodul_voigt (self ):
140+ def shearmodul_voigt (self ) -> float :
141141 return get_shearmodul_voigt (elastic_matrix = self .elastic_matrix ())
142142
143143 @cache
144- def bulkmodul_reuss (self ):
144+ def bulkmodul_reuss (self ) -> float :
145145 return get_bulkmodul_reuss (elastic_matrix_inverse = self .elastic_matrix_inverse ())
146146
147147 @cache
148- def shearmodul_reuss (self ):
148+ def shearmodul_reuss (self ) -> float :
149149 return get_shearmodul_reuss (
150150 elastic_matrix_inverse = self .elastic_matrix_inverse ()
151151 )
152152
153153 @cache
154- def bulkmodul_hill (self ):
154+ def bulkmodul_hill (self ) -> float :
155155 return get_bulkmodul_hill (
156156 bulkmodul_voigt = self .bulkmodul_voigt (),
157157 bulkmodul_reuss = self .bulkmodul_reuss (),
158158 )
159159
160160 @cache
161- def shearmodul_hill (self ):
161+ def shearmodul_hill (self ) -> float :
162162 return get_shearmodul_hill (
163163 shearmodul_voigt = self .shearmodul_voigt (),
164164 shearmodul_reuss = self .shearmodul_reuss (),
165165 )
166166
167167 @cache
168- def youngsmodul_voigt (self ):
168+ def youngsmodul_voigt (self ) -> float :
169169 return get_youngsmodul_voigt (
170170 bulkmodul_voigt = self .bulkmodul_voigt (),
171171 shearmodul_voigt = self .shearmodul_voigt (),
172172 )
173173
174174 @cache
175- def poissonsratio_voigt (self ):
175+ def poissonsratio_voigt (self ) -> float :
176176 return get_poissonsratio_voigt (
177177 bulkmodul_voigt = self .bulkmodul_voigt (),
178178 shearmodul_voigt = self .shearmodul_voigt (),
179179 )
180180
181181 @cache
182- def youngsmodul_reuss (self ):
182+ def youngsmodul_reuss (self ) -> float :
183183 return get_youngsmodul_reuss (
184184 bulkmodul_reuss = self .bulkmodul_reuss (),
185185 shearmodul_reuss = self .shearmodul_reuss (),
186186 )
187187
188188 @cache
189- def poissonsratio_reuss (self ):
189+ def poissonsratio_reuss (self ) -> float :
190190 return get_poissonsratio_reuss (
191191 bulkmodul_reuss = self .bulkmodul_reuss (),
192192 shearmodul_reuss = self .shearmodul_reuss (),
193193 )
194194
195195 @cache
196- def youngsmodul_hill (self ):
196+ def youngsmodul_hill (self ) -> float :
197197 return get_youngsmodul_hill (
198198 bulkmodul_hill = self .bulkmodul_hill (), shearmodul_hill = self .shearmodul_hill ()
199199 )
200200
201201 @cache
202- def poissonsratio_hill (self ):
202+ def poissonsratio_hill (self ) -> float :
203203 return get_poissonsratio_hill (
204204 bulkmodul_hill = self .bulkmodul_hill (), shearmodul_hill = self .shearmodul_hill ()
205205 )
206206
207207 @cache
208- def AVR (self ):
208+ def AVR (self ) -> float :
209209 return get_AVR (
210210 shearmodul_voigt = self .shearmodul_voigt (),
211211 shearmodul_reuss = self .shearmodul_reuss (),
0 commit comments