def rebuild(self): cc = self.impconf.conecyl self.name = 'MSI_{0:02d}_SF_{1:05d}'.format(self.index, int(round(100*self.scaling_factor))) self.thetadegs = [] self.pts = [] imps, imps_theta_z, t_measured, R_best_fit, H_measured = update_imps() if self.use_theta_z_format: if self.imp_ms in imps_theta_z.keys(): self.path = imps_theta_z[self.imp_ms]['msi'] else: if self.imp_ms in imps.keys(): self.path = imps[self.imp_ms]['msi'] if self.imp_ms in H_measured.keys(): self.H_measured = H_measured[self.imp_ms] if self.imp_ms in R_best_fit.keys(): self.R_best_fit = R_best_fit[self.imp_ms] if self.stretch_H: self.ignore_bot_h = False self.ignore_top_h = False if self.ignore_bot_h is True: if cc.resin_add_BIR or cc.resin_add_BOR: self.ignore_bot_h = cc.resin_bot_h else: self.ignore_bot_h = False if self.ignore_top_h is True: if cc.resin_add_TIR or cc.resin_add_TOR: self.ignore_top_h = cc.resin_top_h else: self.ignore_top_h = False
def create(self, force=False): """Creates the thickness imperfection The thickness imperfection is created assuming that each ply has the same contribution to the measured laminate thickness. Thus, a scaling factor is applied to the nominal thickness of each ply in order to macth the measured imperfection field. Parameters ---------- force : bool, optional If ``True`` the thickness imperfection is applied even when it is already created. """ if self.created: if force: cc = self.impconf.conecyl cc.created = False cc.rebuilt = False cc.create_model() else: return cc = self.impconf.conecyl imps, imps_theta_z, t_measured, R_best_fit, H_measured = update_imps() if self.use_theta_z_format: imperfection_file_name = imps_theta_z[self.imp_thick]['ti'] else: imperfection_file_name = imps[self.imp_thick]['ti'] H_measured = H_measured[self.imp_thick] R_best_fit = R_best_fit[self.imp_thick] t_measured = t_measured[self.imp_thick] cc = self.impconf.conecyl self.elems_t, self.t_set = change_thickness_ABAQUS( imperfection_file_name = imperfection_file_name, model_name = cc.model_name, part_name = cc.part_name_shell, stack = cc.stack, t_model = sum(cc.plyts), t_measured = t_measured, H_model = cc.H, H_measured = H_measured, R_model = cc.rbot, R_best_fit = R_best_fit, number_of_sets = self.number_of_sets, semi_angle = cc.alphadeg, stretch_H = self.stretch_H, scaling_factor = self.scaling_factor, num_closest_points = self.ncp, power_parameter = self.power_parameter, num_sec_z = self.num_sec_z, elems_t = self.elems_t, t_set = self.t_set, use_theta_z_format = self.use_theta_z_format) from desicos.abaqus.abaqus_functions import set_colors_ti set_colors_ti(cc) self.created = True print '%s amplitude = %f' % (self.name, self.calc_amplitude()) ffi = self.impconf.ffi if ffi is not None and ffi.created: # There is already a FFI, let it know about us ffi.update_after_tis() return self.elems_t, self.t_set