def _get_fn_sig_cf_eps(self): sig_c, eps = self.sig_c_eps eps_f_max = eps[-1] sig_cf_max = self.E_cf * eps_f_max delta_sig_c = sig_c[-1] - sig_cf_max if delta_sig_c < 0: sig_cf_max += delta_sig_c E_c_secant = np.fabs(sig_c / eps) argmin_E_c_secant = np.argmin(E_c_secant) sig_c_lambda = sig_c[argmin_E_c_secant] eps_lambda = eps[argmin_E_c_secant] E_cf0 = sig_c_lambda / eps_lambda eps_cf_eta = -delta_sig_c / (self.E_cf - E_cf0) sig_cf_eta = E_cf0 * eps_cf_eta fn_sig_cf_eps = MFnLineArray(xdata=[0, eps_cf_eta, eps_f_max], ydata=[0, sig_cf_eta, sig_cf_max]) else: fn_sig_cf_eps = MFnLineArray(xdata=[0, eps_f_max], ydata=[0, sig_cf_max]) return fn_sig_cf_eps
def _get_cached_cdf( self ): if len( self.cdf_values ) == 0: cdf = [] for i in range( len( self.x_values ) ): cdf.append( np.trapz( self.pdf_values[:i], self.x_values[:i] ) ) return MFnLineArray( xdata = self.x_values, ydata = cdf ) else: return MFnLineArray( xdata = self.x_values, ydata = self.cdf_values )
def _get_cached_pdf( self ): if len( self.pdf_values ) == 0: cdf_line = MFnLineArray( xdata = self.x_values, ydata = self.cdf_values ) pdf = [] for x in self.x_values: pdf.append( cdf_line.get_diff( x ) ) return MFnLineArray( xdata = self.x_values, ydata = pdf ) else: return MFnLineArray( xdata = self.x_values, ydata = self.pdf_values )
def _refresh_fired(self): #creates an empty plot data container as a list of MFnLineArray classes self.mfn.lines = self.No_of_all_curves * [MFnLineArray()] xdata = linspace(0, 10, 100) fneval1 = frompyfunc(lambda x: eval(self.expression1), 1, 1) fneval2 = frompyfunc(lambda x: eval(self.expression2), 1, 1) fneval3 = frompyfunc(lambda x: eval(self.expression3), 1, 1) self.mfn.lines[0] = MFnLineArray(xdata=xdata, ydata=fneval1(xdata)) self.mfn.lines[1] = MFnLineArray(xdata=xdata, ydata=fneval2(xdata)) self.mfn.lines[2] = MFnLineArray(xdata=xdata, ydata=fneval3(xdata)) self.mfn.data_changed = True
def _get_bc_lateral_pressure_dofs(self): tf = MFnLineArray(xdata=[0, 1], ydata=[1, 1]) mesh_slice = self.xd_concrete.mesh[:, -1, :, -1] dofs = np.unique(mesh_slice.dofs[:, :, 1].flatten()) return [BCDof(dof=dof, var='f', value=self.f_lateral, time_function=tf) for dof in dofs]
def _get_mfn(self): '''quadratic stress-strain-diagram of the concrete ''' # (for all concretes up to f_cm=88 N/mm2) #max epislon_c1u f_cm = self.f_ck + 8 E_tan = 22. * (f_cm / 10) ** 0.3 * 1000. eps_c1 = min(0.7 * f_cm ** 0.31, 2.8) / 1000. #EC2 # @todo: with constant value this yields negative values for strains close to 'eps_c1u' # eps_c1 = 0.0022 #Brockmann E_sec = f_cm / eps_c1 if self.f_ck <= self.high_strength_level: eps_c1u = self.eps_c_u eps_arr = np.linspace(0., eps_c1u, num=100.) elif self.f_ck > self.high_strength_level: eps_c1u = (2.8 + 27. * (((98. - f_cm) / 100.) ** 4.)) / 1000. eps_arr = np.linspace(0., eps_c1u, num=100.) k = E_tan / E_sec sig_c_arr = ((k * eps_arr / eps_c1 - (eps_arr / eps_c1) ** 2.) / (1. + (k - 2.) * eps_arr / eps_c1)) * f_cm xdata = eps_arr ydata = sig_c_arr print 'cc', xdata print 'cc', ydata return MFnLineArray(xdata=xdata, ydata=ydata)
def _get_mfn(self): '''bilinear stress-strain-diagram of the concrete ''' #(for standard concrete) eps_c3 = self.f_ck / self.E_c xdata = np.array([0.0, eps_c3, self.eps_c_u]) ydata = np.array([0.0, self.f_ck, self.f_ck]) return MFnLineArray(xdata=xdata, ydata=ydata, extrapolate='zero')
def ppf( self, x ): self.check() if len( self.cdf_values ) != 0: xx, cdf = self.x_values, self.cdf_values else: xx, cdf = self.x_values, self.cdf( self.x_values ) ppf_mfn_line = MFnLineArray( xdata = cdf, ydata = xx ) return ppf_mfn_line.get_values( x )
def strains(self): mfn = MFnLineArray() mfn.xdata, mfn.ydata = self.values strains_fn = frompyfunc(mfn.get_diff, 1, 1) strains = strains_fn(mfn.xdata) strains[0] = strains[1] strains[-2] = strains[-1] return strains
def verify_sig_m_eps(self, ax, **kw): e_phi_data = np.loadtxt(self.phi_file) e_data, phi_data = e_phi_data.T E_c = self.get_E_c() rt = RTDofGraph(name='stress - strain', var_x='eps_app', idx_x=0, var_y='sig_app', idx_y=0, record_on='update') ec = { # overload the default configuration 'bcond_list': [BCDofProportional(max_strain=np.max(e_data), alpha_rad=0.0)], 'rtrace_list': [rt], } mats_eval = MATS2DMicroplaneDamage( n_mp=30, E=E_c, nu=0.2, elastic_debug=False, stress_state='plane_stress', symmetrization='sum-type', model_version='compliance', phi_fn=PhiFnGeneral( mfn=MFnLineArray(xdata=e_data, ydata=phi_data)), ) me = MATSExplore( KMAX=300, tolerance=5e-4, # 0.01, RESETMAX=0, dim=MATS2DExplore( mats_eval=mats_eval, explorer_config=ec, ), store_fitted_phi_fn=True, log=False) #------------------------------------------------------------------ # specify the parameters used within the calibration #------------------------------------------------------------------ # me.n_steps = 200 me.tloop.tline.step = 0.01 me.format_ticks = True me.tloop.eval() rt.redraw() eps_m = rt.trace.xdata sig_m = rt.trace.ydata ax.plot(eps_m, sig_m, **kw)
def _get_PDFy(self): x, y = self.transf_inv_vect(self.y_values) xdata = [] PDFy = [] for i, xi in enumerate(x): if np.abs(self.transf_diff(np.array(xi))).all() > 1e-15: PDFy_arr = self.PDFx.get_values(np.array(xi), k=1) / np.abs( self.transf_diff(np.array(xi))) PDFy.append(np.sum(PDFy_arr)) xdata.append(y[i]) return MFnLineArray(xdata=xdata, ydata=PDFy)
def _get_polynom(self): p_c = self.p_c p_s = self.p_s k_s = self.k_s k_c = self.k_c a = min(self.p_s, self.p_c) b = max(self.p_s, self.p_c) xi = linspace(-0.2, 1.2, 1000) x = (p_c - p_s) * ((k_s + k_c - 2) * xi**3 + (3 - 2 * k_s - k_c) * xi**2 + k_s * xi) + p_s x = sort(x) xi = sort(xi) return MFnLineArray(xdata=x, ydata=xi)
def _get_mfn(self): '''quadratic stress-strain-diagram of the concrete ''' quad_fn = a_ * x_ ** 2 + b_ * x_ + c_ eq1 = quad_fn.subs(x_, 0) eq2 = quad_fn.subs(x_, self.eps_c_u) - self.f_ck eq3 = sp.diff(quad_fn, x_).subs(x_, 0) - self.E_c sol = sp.solve([eq1, eq2, eq3], a_, b_, c_) sig_eps_fn = sp.lambdify([x_], quad_fn.subs(sol)) eps_arr = np.linspace(0., self.eps_c_u , num=100.) xdata = eps_arr ydata = sig_eps_fn(eps_arr) return MFnLineArray(xdata=xdata, ydata=ydata)
def _get_mfn(self): '''bilinear stress-strain-diagram of the concrete ''' #(for standard concrete) f_ck = self.f_ck + 8. if f_ck <= self.high_strength_level: eps_c3 = 0.00175 eps_cu3 = self.eps_c_u #(for high strength concrete) else : eps_c3 = (1.75 + 0.55 * (f_ck - 50.) / 40.) / 1000. eps_cu3 = (2.6 + 35 * (90 - f_ck) ** 4.) / 1000. # concrete law with limit for eps_c xdata = np.hstack([0., eps_c3, eps_cu3]) ydata = np.hstack([0., (f_ck), (f_ck)]) return MFnLineArray(xdata=xdata, ydata=ydata)
def _get_fn_sig_cm_eps(self): fn_sig_c_eps = self.fn_sig_c_eps eps_c = fn_sig_c_eps.xdata sig_c = fn_sig_c_eps.ydata fn_sig_cf_eps = self.fn_sig_cf_eps sig_cf = fn_sig_cf_eps(eps_c) eps_cm = eps_c sig_cm = sig_c - sig_cf smooth_from = np.argmax(sig_cm) s_r_asc = int(smooth_from * 0.1) s_r_desc = int((len(sig_cm) - smooth_from) * 0.3) eps_cm_asc = smooth_array(eps_cm[:smooth_from], s_r_asc, 'flat') sig_cm_asc = smooth_array(sig_cm[:smooth_from], s_r_asc, 'flat') eps_cm_desc = smooth_array(eps_cm[smooth_from:], s_r_desc, 'flat') sig_cm_desc = smooth_array(sig_cm[smooth_from:], s_r_desc, 'flat') eps_cm = np.hstack([eps_cm_asc, eps_cm_desc]) sig_cm = np.hstack([sig_cm_asc, sig_cm_desc]) return MFnLineArray(xdata=eps_cm, ydata=sig_cm)
def _get_elastomer_law(self): elastomer_path = os.path.join(simdb.exdata_dir, 'bending_tests', 'three_point', '2011-06-10_BT-3PT-12c-6cm-0-TU_ZiE', 'elastomer_f-w.raw') _data_array_elastomer = loadtxt_bending(elastomer_path) # force [kN]: # NOTE: after conversion 'F_elastomer' is a positive value # F_elastomer = -0.001 * _data_array_elastomer[:, 2].flatten() # displacement [mm]: # NOTE: after conversion 'w_elastomer' is a positive value # w_elastomer = -1.0 * _data_array_elastomer[:, 0].flatten() mfn_displacement_elastomer = MFnLineArray(xdata=F_elastomer, ydata=w_elastomer) return frompyfunc(mfn_displacement_elastomer.get_value, 1, 1)
def _get_mfn(self): '''simplified constant stress-strain-diagram of the concrete (EC2) ''' #(for standard concrete) f_ck = self.f_ck + 8. if f_ck <= 50: lamda = 0.8 eta = 1.0 eps_cu3 = self.eps_c_u # (for high strength concrete) # else: eta = 1.0 - (f_ck / 50.) / 200. # factor [-] to calculate the height of the compressive zone lamda = 0.8 - (f_ck - 50.) / 400. eps_cu3 = (2.6 + 35. * ((90. - f_ck) / 100) ** 4.) / 1000. xdata = np.hstack([0., (1. - lamda) * eps_cu3 - 0.00001, (1 - lamda) * eps_cu3, eps_cu3 ]) ydata = np.hstack([0., 0., eta * (f_ck), eta * (f_ck), ]) return MFnLineArray(xdata=xdata, ydata=ydata)
def _bond_fn_default(self): return MFnLineArray(xdata=[0., 1.], ydata=[0., 1.])
def _get_bond_fn(self): return MFnLineArray(ydata=[ 0., self.T_max, self.T_fr, self.T_fr ], xdata=[ 0., self.s_cr, self.s_cr, self.s_cr * 10])
def _time_fn_load_default(self): eta = 0.27 * 1.2 return MFnLineArray(xdata=[0.0, 1.0, 3.0, 5.0, 8.0, 15.0], ydata=[0.0, 1.0, 1.0 / eta, 1.78 / eta, 8.0, 9.05])
def example_with_new_domain(): from ibvpy.api import \ TStepper as TS, RTraceGraph, RTraceDomainListField, \ RTraceDomainListInteg, TLoop, \ TLine, BCDof, IBVPSolve as IS, DOTSEval from ibvpy.mats.mats2D.mats2D_elastic.mats2D_elastic import MATS2DElastic from ibvpy.mats.mats2D.mats2D_sdamage.mats2D_sdamage import MATS2DScalarDamage from ibvpy.api import BCDofGroup mats_eval = MATS2DElastic() fets_eval = FETS2D4Q(mats_eval=mats_eval) #fets_eval = FETS2D4Q(mats_eval = MATS2DScalarDamage()) print fets_eval.vtk_node_cell_data from ibvpy.mesh.fe_grid import FEGrid from ibvpy.mesh.fe_refinement_grid import FERefinementGrid from ibvpy.mesh.fe_domain import FEDomain from mathkit.mfn import MFnLineArray # Discretization fe_grid = FEGrid(coord_max=(10., 4., 0.), shape=(10, 3), fets_eval=fets_eval) bcg = BCDofGroup(var='u', value=0., dims=[0], get_dof_method=fe_grid.get_left_dofs) bcg.setup(None) print 'labels', bcg._get_labels() print 'points', bcg._get_mvpoints() mf = MFnLineArray( # xdata = arange(10), ydata=array([0, 1, 2, 3])) right_dof = 2 tstepper = TS( sdomain=fe_grid, bcond_list=[ BCDofGroup(var='u', value=0., dims=[0, 1], get_dof_method=fe_grid.get_left_dofs), # BCDofGroup( var='u', value = 0., dims = [1], # get_dof_method = fe_grid.get_bottom_dofs ), BCDofGroup(var='u', value=.005, dims=[1], time_function=mf.get_value, get_dof_method=fe_grid.get_right_dofs) ], rtrace_list=[ RTraceGraph(name='Fi,right over u_right (iteration)', var_y='F_int', idx_y=right_dof, var_x='U_k', idx_x=right_dof, record_on='update'), RTraceDomainListField(name='Stress', var='sig_app', idx=0, position='int_pnts', record_on='update'), # RTraceDomainListField(name = 'Damage' , # var = 'omega', idx = 0, # # record_on = 'update', # warp = True), RTraceDomainListField(name='Displacement', var='u', idx=0, record_on='update', warp=True), RTraceDomainListField(name='Strain energy', var='strain_energy', idx=0, record_on='update', warp=False), RTraceDomainListInteg(name='Integ strain energy', var='strain_energy', idx=0, record_on='update', warp=False), # RTraceDomainListField(name = 'N0' , # var = 'N_mtx', idx = 0, # record_on = 'update') ]) # Add the time-loop control #global tloop tloop = TLoop(tstepper=tstepper, KMAX=300, tolerance=1e-4, tline=TLine(min=0.0, step=1.0, max=1.0)) #import cProfile #cProfile.run('tloop.eval()', 'tloop_prof' ) # print tloop.eval() #import pstats #p = pstats.Stats('tloop_prof') # p.strip_dirs() # print 'cumulative' # p.sort_stats('cumulative').print_stats(20) # print 'time' # p.sort_stats('time').print_stats(20) tloop.eval() # Put the whole thing into the simulation-framework to map the # individual pieces of definition into the user interface. # from ibvpy.plugins.ibvpy_app import IBVPyApp app = IBVPyApp(ibv_resource=tloop) app.main()
def app(): avg_radius = 0.03 md = MATS2DScalarDamage(E=20.0e3, nu=0.2, epsilon_0=1.0e-4, epsilon_f=8.0e-4, #epsilon_f = 12.0e-4, #test doubling the e_f stress_state="plane_strain", stiffness="secant", #stiffness = "algorithmic", strain_norm=Rankine()) # me = MATS2DElastic( E = 20.0e3, # nu = 0.2, # stress_state = "plane_strain" ) fets_eval = FETS2D4Q(mats_eval=md)#, ngp_r = 3, ngp_s = 3) n_el_x = 60 # Discretization fe_grid = FEGrid(coord_max=(.6, .15, 0.), shape=(n_el_x, 15), fets_eval=fets_eval) mf = MFnLineArray(xdata=array([0, 1, 2, 7, 8 , 28]), ydata=array([0, 3., 3.2, 3.3, 3.32, 3.72 ])) #averaging function avg_processor = RTNonlocalAvg(avg_fn=QuarticAF(radius=avg_radius, correction=True)) ts = TS(sdomain=fe_grid, u_processor=avg_processor, bcond_list=[ # constraint for all left dofs in y-direction: BCSlice(var='u', slice=fe_grid[0, 0, 0, 0], dims=[0, 1], value=0.), BCSlice(var='u', slice=fe_grid[-1, 0, -1, 0], dims=[1], value=0.), BCSlice(var='u', slice=fe_grid[n_el_x / 2, -1, 0, -1], dims=[1], time_function=mf.get_value, value= -2.0e-5), ], rtrace_list=[ # RTDofGraph(name = 'Fi,right over u_right (iteration)' , # var_y = 'F_int', idx_y = right_dof, # var_x = 'U_k', idx_x = right_dof, # record_on = 'update'), RTraceDomainListField(name='Deformation' , var='eps_app', idx=0, record_on='update'), RTraceDomainListField(name='Displacement' , var='u', idx=1, record_on='update', warp=True), RTraceDomainListField(name='Damage' , var='omega', idx=0, record_on='update', warp=True), # RTraceDomainField(name = 'Stress' , # var = 'sig', idx = 0, # record_on = 'update'), # RTraceDomainField(name = 'N0' , # var = 'N_mtx', idx = 0, # record_on = 'update') ] ) # Add the time-loop control # tl = TLoop(tstepper=ts, tolerance=5.0e-4, KMAX=100, tline=TLine(min=0.0, step=.25, max=10.0)) tl.eval() # Put the whole stuff into the simulation-framework to map the # individual pieces of definition into the user interface. # from ibvpy.plugins.ibvpy_app import IBVPyApp ibvpy_app = IBVPyApp(ibv_resource=ts) ibvpy_app.main()
def _trace_default(self): return MFnLineArray()
def example_with_new_domain(): from ibvpy.api import \ TStepper as TS, RTraceDomainListField, TLoop, TLine from ibvpy.tmodel.mats2D5.mats2D5_bond.mats2D_bond import MATS2D5Bond from ibvpy.api import BCDofGroup from ibvpy.fets.fets2D.fets2D4q import FETS2D4Q fets_eval = FETS2DTF(parent_fets=FETS2D4Q(), mats_eval=MATS2D5Bond(E_m=30, nu_m=0.2, E_f=10, nu_f=0.1, G=10.)) from ibvpy.mesh.fe_grid import FEGrid from mathkit.mfn import MFnLineArray # Discretization fe_grid = FEGrid(coord_max=(10., 4., 0.), n_elems=(10, 3), fets_eval=fets_eval) mf = MFnLineArray( # xdata = arange(10), ydata=array([0, 1, 2, 3])) tstepper = TS(sdomain=fe_grid, bcond_list=[BCDofGroup(var='u', value=0., dims=[0, 1], get_dof_method=fe_grid.get_left_dofs), # BCDofGroup( var='u', value = 0., dims = [1], # get_dof_method = fe_grid.get_bottom_dofs ), BCDofGroup(var='u', value=.005, dims=[0], time_function=mf.get_value, get_dof_method=fe_grid.get_right_dofs)], rtrace_list=[ # RTDofGraph(name = 'Fi,right over u_right (iteration)' , # var_y = 'F_int', idx_y = right_dof, # var_x = 'U_k', idx_x = right_dof, # record_on = 'update'), # RTraceDomainListField(name = 'Stress' , # var = 'sig_app', idx = 0, # #position = 'int_pnts', # record_on = 'update'), # RTraceDomainListField(name = 'Damage' , # var = 'omega', idx = 0, # record_on = 'update', # warp = True), RTraceDomainListField(name='Displ matrix', var='u_m', idx=0, record_on='update', warp=True), RTraceDomainListField(name='Displ reinf', var='u_f', idx=0, record_on='update', warp=True), # RTraceDomainListField(name = 'N0' , # var = 'N_mtx', idx = 0, # record_on = 'update') ] ) # Add the time-loop control #global tloop tloop = TLoop(tstepper=tstepper, KMAX=300, tolerance=1e-4, tline=TLine(min=0.0, step=1.0, max=1.0)) #import cProfile #cProfile.run('tloop.eval()', 'tloop_prof' ) print(tloop.eval()) #import pstats #p = pstats.Stats('tloop_prof') # p.strip_dirs() # print 'cumulative' # p.sort_stats('cumulative').print_stats(20) # print 'time' # p.sort_stats('time').print_stats(20) # Put the whole thing into the simulation-framework to map the # individual pieces of definition into the user interface. # from ibvpy.plugins.ibvpy_app import IBVPyApp app = IBVPyApp(ibv_resource=tloop) app.main()
def _time_function_default(self): return MFnLineArray(xdata=[0, 1], ydata=[0, 1], extrapolate='diff')
def correct_sig_eps_f_3300_800(): a_f_800 = calib_series_800.test_params['a_f'] a_f_3300 = calib_series_3300.test_params['a_f'] a_f = a_f_800 + a_f_3300 print('a_f_800', a_f_800) print('a_f_3300', a_f_3300) print('a_f', a_f) thickness = 0.01 rho_800 = a_f_800 / thickness rho_3300 = a_f_3300 / thickness rho_3300_800 = a_f / thickness print('rho_3300', rho_3300) print('rho_3300_800', rho_3300_800) eta_800 = a_f_800 / a_f eta_3300 = a_f_3300 / a_f print('eta_800', eta_800) sig_f_800, eps_f_800 = calib_series_800.avg_calibrator.sig_f_eps sig_f_3300, eps_f_3300 = calib_series_3300.avg_calibrator.sig_f_eps eps_fbar = np.sort(np.unique(np.hstack([eps_f_800, eps_f_3300]))) sig_fbar_x800 = np.interp(eps_fbar, eps_f_800, sig_f_800) sig_fbar_x3300 = np.interp(eps_fbar, eps_f_3300, sig_f_3300) print('eps_f_800', eps_f_800) print('sig_f_3300', sig_f_800) print('eps_f_800', eps_f_3300) print('sig_f_3300', sig_f_3300) print('eps_f', eps_fbar) print('sig_f_800', sig_fbar_x800) print('sig_f_3300', sig_fbar_x3300) sig_fbar = eta_800 * sig_fbar_x800 + eta_3300 * sig_fbar_x3300 E_f_800 = sig_f_800[-1] / eps_f_800[-1] print('E_f_800', E_f_800) E_f_3300 = ((sig_f_3300[-1] - sig_f_3300[-2]) / (eps_f_3300[-1] - eps_f_3300[-2])) print('E_f_3300', E_f_3300) eps_f_3300_800 = eps_f_3300 sig_f_3300_800 = np.array([ 0, eta_3300 * sig_f_3300[1] + eta_800 * E_f_800 * eps_f_3300[1], eta_3300 * sig_f_3300[2] + eta_800 * E_f_800 * eps_f_3300[2] ]) print('eps', eps_f_3300_800) print('sig', sig_f_3300_800) test_file = join(get_test_data_dir(), 'tt-dk-3300+800tex_sig_f_eps' + '.txt') np.savetxt(test_file, np.c_[eps_f_3300_800, sig_f_3300_800]) E_f_3300_800 = ((sig_f_3300_800[-1] - sig_f_3300_800[-2]) / (eps_f_3300_800[-1] - eps_f_3300_800[-2])) print('E_f', E_f_3300_800) print('E_c_800', rho_800 * E_f_800) print('E_c_3300', rho_3300 * E_f_3300) print('E_c_3300_800', rho_3300_800 * E_f_3300_800) ax = p.subplot(131) ax.plot(eps_f_800, sig_f_800, color='red') ax.plot(eps_f_3300, sig_f_3300, color='blue') ax.plot(eps_fbar, sig_fbar, label='a_f=%g' % a_f, color='orange') ax.plot(eps_f_3300_800, sig_f_3300_800, label='a_f=%g' % a_f, color='green') ax.legend() ax = p.subplot(132) ax.plot(eps_f_800, rho_800 * np.array(sig_f_800), color='red') ax.plot(eps_f_3300, rho_3300 * np.array(sig_f_3300), color='blue') ax.plot(eps_f_3300_800, rho_3300_800 * sig_f_3300_800, color='green') ax.plot(eps_f_3300, rho_3300_800 * np.array(sig_f_3300), color='orange') ax.legend() ax = p.subplot(133) fn_sig_m_eps_3300 = calib_series_3300.avg_calibrator.fn_sig_m_eps eps_c = np.linspace(0, np.max(eps_f_3300_800)) fn_sig_m_eps_800 = calib_series_800.avg_calibrator.fn_sig_m_eps sig_m_3300 = fn_sig_m_eps_3300(eps_c) sig_m_800 = fn_sig_m_eps_800(eps_c) sig_m_3300_800 = (sig_m_3300 + sig_m_800) / 2.0 fn_f_3300_800 = MFnLineArray(xdata=eps_f_3300_800, ydata=sig_f_3300_800) sig_f_3300_800 = fn_f_3300_800(eps_c) sig_c_3300_800 = ((1.0 - rho_3300_800) * sig_m_3300_800 + rho_3300_800 * sig_f_3300_800) p.plot(eps_c, sig_c_3300_800, lw=5, color='green') ax.plot(eps_f_800, rho_800 * np.array(sig_f_800), color='red') calib_series_800.avg_calibrator.fn_sig_c_eps.mpl_plot(ax, color='red') ax.plot(eps_f_3300, rho_3300 * np.array(sig_f_3300), '.', color='blue') calib_series_3300.avg_calibrator.fn_sig_c_eps.mpl_plot(ax, color='blue') p.show()
def _get_tloop(self): domain = self.fe_grid_roof #---------------------------------------------------- # loading and boundaries #---------------------------------------------------- #--- LC1: dead load # g = 22.4 kN/m^3 # orientation: global z-direction; material_density_roof = -22.43e-3 # [MN/m^3] #--- LC2 additional dead load # gA = 0,20 kN/m^2 # orientation: global z-direction (following the curved structure); additional_dead_load = -0.20e-3 # [MN/m^2] #--- LC2 additional boundary load # gA = 0,35 kN/m^2 # orientation: global z-direction (following the curved structure); boundary_dead_load = -0.35e-3 # [MN/m] #--- LC3 snow # s = 0,79 kN/m^2 # orientation: global z-direction (projection); surface_load_s = -0.85e-3 # [MN/m^2] #--- LC4 wind (pressure) # w = 0,13 kN/m^2 # orientation: local t-direction (surface normal); surface_load_w = -0.13e-3 # [MN/m^2] # NOTE: additional line-loads at the edge of the roof need to be considered! upper_surface = domain[:, :, -1, :, :, -1] whole_domain = domain[:, :, :, :, :, :] boundary_x1 = domain[-1, :, -1, -1, :, -1] boundary_y1 = domain[:, -1, -1, :, -1, -1] time_fn_load = self.time_fn_load time_fn_permanent_load = MFnLineArray(xdata=[0.0, 1.0], ydata=[0.0, 1.0]) time_fn_snow_load = MFnLineArray(xdata=[0.0, 1.0], ydata=[0.0, 0.0]) force_bc = [ # own weight BCSlice(name='self weight', var='f', value=material_density_roof, dims=[2], integ_domain='global', time_function=time_fn_load.get_value, slice=whole_domain), # LC2: additional dead-load BCSlice(name='additional load', var='f', value=additional_dead_load, dims=[2], integ_domain='global', time_function=time_fn_load.get_value, slice=upper_surface), # LC2: additional boundary-load BCSlice(name='additional boundary load 1', var='f', value=boundary_dead_load, dims=[2], integ_domain='global', time_function=time_fn_load.get_value, slice=boundary_x1), # LC2: additional boundary-load BCSlice(name='additional boundary load 2', var='f', value=boundary_dead_load, dims=[2], integ_domain='global', time_function=time_fn_load.get_value, slice=boundary_y1), # LC3: snow load BCSlice(name='snow load', var='f', value=surface_load_s, dims=[2], integ_domain='global', time_function=time_fn_snow_load.get_value, slice=upper_surface), # # LC3: wind # BCSlice( var = 'f', value = surface_load_w, dims = [2], # integ_domain = 'global', # slice = upper_surface ) ] bc_symplane_yz = BCSlice(var='u', value=0., dims=[0], slice=domain[0, :, :, 0, :, :]) bc_symplane_xz = BCSlice(var='u', value=0., dims=[1], slice=domain[:, 0, :, :, 0, :]) bc_support_000 = BCSlice(var='u', value=0., dims=[2], slice=domain[0, 0, 0, :, :, 0]) # bc_column = [ # BCSlice( var = 'u' , dims = [0, 1, 2], # slice = domain[self.n_elems_xy_quarter - 1, # self.n_elems_xy_quarter - 1, # 0, # 0, -1, 0 ], # value = 0. ), # BCSlice( var = 'u' , dims = [0, 1, 2], # slice = domain[self.n_elems_xy_quarter - 1, # self.n_elems_xy_quarter - 1 , # 0, # - 1, 0, 0], # value = 0. )] # bc_corner_load = BCSlice( var = 'f', value = -nodal_load, dims = [2], slice = domain[-1,-1,-1,-1,-1,-1] ) # bc_topface_load = BCSlice( var = 'f', value = -nodal_load, dims = [2], slice = domain[:,:,-1,:,:,-1] ) # support_z_dofs = domain[0, 0, 0, :, : , 0].dofs[:, :, 2] # support_f_w = RTraceGraph(name='force - corner deflection', # var_x='time', idx_x=0, # transform_x='x * %g' % lambda_failure, # var_y='F_int', idx_y_arr=np.unique(support_z_dofs.flatten()), # transform_y='-y', # record_on='update') rtrace_list = [self.f_w_diagram] + self.rtrace_list ts = TS(sdomain=[domain], dof_resultants=True, bcond_list=[bc_symplane_yz, bc_symplane_xz, bc_support_000] + force_bc, rtrace_list=rtrace_list) step = 1.0 # self.n_steps # Add the time-loop control tloop = TLoop(tstepper=ts, RESETMAX=0, KMAX=70, tolerance=0.5e-3, tline=TLine(min=0.0, step=step, max=1.0)) # self.max_lambda)) return tloop
def _get_fn_sig_m_eps(self): sig_cm = self.fn_sig_cm_eps.ydata eps = self.fn_sig_cm_eps.xdata return MFnLineArray(xdata=eps, ydata=sig_cm / (1 - self.rho))
def _get_fn_sig_c_eps(self): sig_c, eps = self.sig_c_eps return MFnLineArray(xdata=eps, ydata=sig_c)
def _get_fn_sig_f_eps(self): sig_cf = self.fn_sig_cf_eps.ydata eps = self.fn_sig_cf_eps.xdata return MFnLineArray(xdata=eps, ydata=sig_cf / self.rho)