1 """Copyright (C) 2016 Joakim A. Taby 3 This program is free software: you can redistribute it and/or modify 4 it under the terms of the GNU General Public License as published by 5 the Free Software Foundation, either version 3 of the License. 7 This program is distributed in the hope that it will be useful, 8 but WITHOUT ANY WARRANTY; without even the implied warranty of 9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 GNU General Public License for more details. 12 You should have received a copy of the GNU General Public License 13 along with this program. If not, see <http://www.gnu.org/licenses/>.""" 18 """ A class defining a slender cross section""" 20 def __init__(self, layer_radii=None, layer_type=None,
21 thickness=
None, gap_ini=
None, youngs_modulus=
None, poisson=
None, fric_fac=
None,
22 lay_angle=
None, comp_number=0, width=
None,
23 intpresslayer=
None, extpresslayer=
None, typical_tension=
None, typical_curvature=
None):
26 :param layer_radii: Radius of a layer 27 :param layer_type: Type of a layer wires or sheath 28 :param thickness: Thickness of a layer 29 :param gap_ini: Initial gap on the inside of a layer 30 :param youngs_modulus: Young's modulus for the material of a layer 31 :param poisson: Poissons ratio for the material of layer 32 :param fric_fac: Friction factor on the inside of a layer 33 :param lay_angle: Lay angle of a wire layer, dummy for sheath layer 34 :param comp_number: number of tendons in a wire layer, dummy for sheath layer 35 :param width: Width of the tendons in a layer, dummy for sheath layer 36 :param typical_tension: Typical tension, used for preliminary analysis 37 :param typical_curvature: Typical curvature, used for preliminary analysis 38 :param intpresslayer: The layer on which internal pressure is applied 39 :param extpresslayer: The layer on which external pressure is applied 40 :return: Object of type slender 53 if len(layer_type) == len(layer_type):
58 print(
"Cannot interpret the layer type. It is either sheath or wire and has to" 59 "given for each layer.")
72 elif len(thickness) == 1:
74 tmp.append(float(thickness[0]))
77 print(
"Cannot interpret the thickness. either it has to be defined " 78 "with the length equal to the number of layers, or it has " 92 elif len(gap_ini) == 1:
94 tmp.append(float(gap_ini[0]))
97 print(
"Cannot interpret the thickness. either it has to be defined " 98 "with the length equal to the number of layers, or it has " 106 if not youngs_modulus:
110 self.youngs_modulus.append(0.0)
111 self.youngs_modulusDefault.append(207 * 10 ** 9)
112 elif len(youngs_modulus) == 1:
115 self.youngs_modulus.append(float(youngs_modulus[0]))
119 print(
"Wrong format on Youngs modulus given.")
127 elif len(poisson) == 1:
129 tmp.append(float(poisson[0]))
132 print(
"Cannot interpret the thickness. either it has to be defined " 133 "with the length equal to the number of layers, or it has " 134 "to be of length 1.")
145 self.fricfacDefault.append(0.15)
146 self.fricfac.append(0.0)
147 elif isinstance(fric_fac, float):
150 self.fricfac.append(fric_fac)
151 elif len(fric_fac) == 1:
154 self.fricfac.append(fric_fac)
158 print(
"If specified the friction factor should either" 159 " be defined as one number to be used for each interface," 160 "or for the inner interface of each given layer")
169 elif len(width) == 1:
171 tmp.append(float(width[0]))
174 print(
"Cannot interpret the width. either it has to be defined " 175 "with the length equal to the number of layers, or it has " 176 "to be of length 1.")
187 tmp.append(float(i) * np.pi / 180.0)
189 elif len(lay_angle) == 1:
191 tmp.append(float(lay_angle[0]) * np.pi / 180.0 * float((1 - 2 * (i % 2))))
194 print(
"Cannot interpret the layangle. either it has to be defined " 195 "with the length equal to the number of layers, or it has " 196 "to be of length 1.")
207 print(
"Length of comp_number taken to be %d which is different from the number of " 208 "layers found to be %d." % len(comp_number), len(self.
layer_radii))
212 self.comp_number.append(0.0)
230 if typical_curvature:
238 """A method for calculating the tendon area if tendon, or layer area if sheath 241 :return:The area of the tendons defined 252 print(
'Layer type for layer ',i+1,
' read as "',self.
layer_type[i],
'", must be wires or sheath.' )
256 """Method for finding the number of layers of the model""" 263 num = max(len(self.
fricfac), num)
269 num = max(len(self.
width), num)
def calc_tendon_area(self)
def __init__(self, layer_radii=None, layer_type=None, thickness=None, gap_ini=None, youngs_modulus=None, poisson=None, fric_fac=None, lay_angle=None, comp_number=0, width=None, intpresslayer=None, extpresslayer=None, typical_tension=None, typical_curvature=None)