# ----------------------------------------------------------
# ComPoLyX Example
# Copyright (C) 2010 by
# EVEN - Evolutionary Engineering AG
# www.even-ag.ch
# ----------------------------------------------------------

### Get reference to loaded model
model=db.models.values()[0]

### Extended material definitions with out-of-plane engineering constants and stress/strain limit values
if 'E-Glas' in model.material_data.materials.keys():
  key = 'E-Glas'
else:
  key = 'UD300_GLAS'

m  = model.material_data.materials[key]
sl = m.stress_limits
sl.Xt = 780.e6; sl.Xc = -480.0e6;
sl.Yt = 31.0e6; sl.Yc = -100.0e6;
sl.Zt = 31.0e6; sl.Zc = -100.0e6;
sl.Sxy = 60.0e6; sl.Sxz = 60.0e6; sl.Syz = 10.0e6
el = m.strain_limits
el.eXt = 0.0244; el.eXc = -0.015
el.eYt = 0.0038; el.eYc = -0.0125
el.eSxy = 0.015;
# Define puck ply type
m.puck_constants=compolyx.PuckConstants(mat_type = 'glass')
m.puck_constants.s = 0.5
m.puck_constants.M = 0.5
m.puck_constants.interface_weakening_factor = 0.8

# Define tsai wu coupling coefficients
m.tsai_wu_constants=compolyx.TsaiWuConstants()
m.tsai_wu_constants.XY = -0.75
m.tsai_wu_constants.XZ = -0.75
m.tsai_wu_constants.YZ = -0.75

### Identify core\ignored materials and define shear strength limit values to evaluate sandwich core shear criterion
m= model.material_data.materials['Corecell_A450']
m.ply_type = 'orthotropic_homogeneous_core'
m.stress_limits.Sxz= m.stress_limits.Syz= 0.8e6
m.stress_limits.Zt=1.1e6
m=model.material_data.materials['Corecell_A550']
m.ply_type = 'orthotropic_homogeneous_core'
m.stress_limits.Sxz= m.stress_limits.Syz= 1.1e6
m.stress_limits.Zt=1.6e6
