def setUp(self): self.L = crystallography.CubicLattice(1.0) self.L.add_slip_system([1, 1, 0], [1, 1, 1]) self.nslip = self.L.ntotal self.Q = rotations.Orientation(35.0, 17.0, 14.0, angle_type="degrees") self.S = tensors.Symmetric( np.array([[100.0, -25.0, 10.0], [-25.0, -17.0, 15.0], [10.0, 15.0, 35.0]])) * 2 self.static = 20.0 self.s0 = [self.static] * self.nslip self.k = 1000.0 self.sat = 40.0 self.m = 1.5 self.hmodel = slipharden.VocePerSystemHardening( self.s0, [self.k] * self.nslip, [self.sat] * self.nslip, [self.m] * self.nslip) self.g0 = 1.0 self.n = 3.0 self.sliprule = sliprules.PowerLawSlipRule(self.hmodel, self.g0, self.n) self.T = 300.0 self.c = 10.0 self.beta = 2.0 self.dmodel = crystaldamage.WorkPlaneDamage() self.nfunc = crystaldamage.SigmoidTransformation(self.c, self.beta) self.sfunc = crystaldamage.SigmoidTransformation(self.c, self.beta) self.model = crystaldamage.PlanarDamageModel(self.dmodel, self.sfunc, self.nfunc, self.L) self.huse = history.History() self.hmodel.populate_history(self.huse) self.model.populate_history(self.huse) for i in range(12): self.huse.set_scalar("strength" + str(i), 2.0) for j in range(4): self.huse.set_scalar("slip_damage_" + str(j), self.c * 0.4) self.hbase = self.huse.subset(["strength" + str(i) for i in range(12)]) self.hdmg = self.huse.subset( ["slip_damage_" + str(i) for i in range(4)]) self.fixed = history.History()
def setUp(self): self.L = crystallography.CubicLattice(1.0) self.L.add_slip_system([1, 1, 0], [1, 1, 1]) self.nslip = self.L.ntotal self.Q = rotations.Orientation(35.0, 17.0, 14.0, angle_type="degrees") self.S = tensors.Symmetric( np.array([[100.0, -25.0, 10.0], [-25.0, -17.0, 15.0], [10.0, 15.0, 35.0]])) self.static = 20.0 self.s0 = [self.static] * self.nslip self.k = 1000.0 self.sat = 40.0 self.m = 1.5 self.hmodel = slipharden.VocePerSystemHardening( self.s0, [self.k] * self.nslip, [self.sat] * self.nslip, [self.m] * self.nslip) self.g0 = 1.0 self.n = 3.0 self.sliprule = sliprules.PowerLawSlipRule(self.hmodel, self.g0, self.n) self.T = 300.0 self.model = crystaldamage.NilDamageModel() self.huse = history.History() self.hmodel.populate_history(self.huse) self.model.populate_history(self.huse) for i in range(12): self.huse.set_scalar("strength" + str(i), 25.0) self.huse.set_scalar("whatever", 0.5) self.hbase = self.huse.subset(["strength" + str(i) for i in range(12)]) self.hdmg = self.huse.subset(["whatever"]) self.fixed = history.History()
def setUp(self): self.L = crystallography.CubicLattice(1.0) self.L.add_slip_system([1, 1, 0], [1, 1, 1]) self.Q = rotations.Orientation(35.0, 17.0, 14.0, angle_type="degrees") self.S = tensors.Symmetric( np.array([[100.0, -25.0, 10.0], [-25.0, -17.0, 15.0], [10.0, 15.0, 35.0]])) self.nslip = self.L.ntotal self.static = 20.0 self.current = 35.0 self.H = history.History() for i in range(self.nslip): self.H.add_scalar("strength" + str(i)) self.H.set_scalar("strength" + str(i), self.current) self.T = 300.0 self.s0 = [self.static] * self.nslip self.s = np.array([self.current] * self.nslip) self.k = 1000.0 self.sat = 40.0 self.m = 1.5 self.model = slipharden.VocePerSystemHardening(self.s0, [self.k] * self.nslip, [self.sat] * self.nslip, [self.m] * self.nslip) self.g0 = 1.0 self.n = 3.0 self.sliprule = sliprules.PowerLawSlipRule(self.model, self.g0, self.n) self.fixed = history.History()
sat = 100.0 m = 1.0 g0 = 1.0 n = 6.0 mu = 29000.0 E = 120000.0 nu = 0.3 c = 40 beta = 3.0 emodel = elasticity.CubicLinearElasticModel(E, nu, mu, "moduli") strengthmodel = slipharden.VocePerSystemHardening( [s0] * nslip, [k] * nslip, [sat] * nslip, [m] * nslip) slipmodel = sliprules.PowerLawSlipRule(strengthmodel, g0, n) imodel = inelasticity.AsaroInelasticity(slipmodel) base_kin = kinematics.StandardKinematicModel(emodel, imodel) base_model = singlecrystal.SingleCrystalModel(base_kin, lattice) dmodel = crystaldamage.WorkPlaneDamage() func = crystaldamage.SigmoidTransformation(c, beta) dmg_odel = crystaldamage.PlanarDamageModel(dmodel, func, func, lattice) dmg_kin = kinematics.DamagedStandardKinematicModel(emodel, imodel, dmg_odel) dmg_model = singlecrystal.SingleCrystalModel(dmg_kin, lattice) D1, S1 = drive(base_model, orientations, erate, steps, L)
def setUp(self): self.L = crystallography.CubicLattice(1.0) self.L.add_slip_system([1, 1, 0], [1, 1, 1]) self.nslip = self.L.ntotal self.strength = 35.0 self.c = 10.0 self.beta = 2.0 self.H = history.History() for i in range(12): self.H.add_scalar("strength" + str(i)) self.H.set_scalar("strength" + str(i), self.strength) for j in range(4): self.H.add_scalar("slip_damage_" + str(j)) self.H.set_scalar("slip_damage_" + str(j), self.c * 0.4) self.static = 20.0 self.s0 = [self.static] * self.nslip self.k = 1000.0 self.sat = 40.0 self.m = 1.5 self.strengthmodel = slipharden.VocePerSystemHardening( self.s0, [self.k] * self.nslip, [self.sat] * self.nslip, [self.m] * self.nslip) self.g0 = 1.0 self.n = 3.0 self.slipmodel = sliprules.PowerLawSlipRule(self.strengthmodel, self.g0, self.n) self.imodel = inelasticity.AsaroInelasticity(self.slipmodel) self.Q = rotations.Orientation(35.0, 17.0, 14.0, angle_type="degrees") self.S = tensors.Symmetric( np.array([[100.0, -25.0, 10.0], [-25.0, -17.0, 15.0], [10.0, 15.0, 35.0]])) self.T = 300.0 self.mu = 29000.0 self.E = 120000.0 self.nu = 0.3 self.emodel = elasticity.CubicLinearElasticModel( self.E, self.nu, self.mu, "moduli") self.dn = np.array([[4.1, 2.8, -1.2], [3.1, 7.1, 0.2], [4, 2, 3]]) self.dn = 0.5 * (self.dn + self.dn.T) self.d = tensors.Symmetric(self.dn) self.wn = np.array([[-9.36416517, 2.95527444, 8.70983194], [-1.54693052, 8.7905658, -5.10895168], [-8.52740468, -0.7741642, 2.89544992]]) self.wn = 0.5 * (self.wn - self.wn.T) self.w = tensors.Skew(self.wn) self.dmodel = crystaldamage.WorkPlaneDamage() self.nfunc = crystaldamage.SigmoidTransformation(self.c, self.beta) self.sfunc = crystaldamage.SigmoidTransformation(self.c, self.beta) self.dmodel = crystaldamage.PlanarDamageModel(self.dmodel, self.nfunc, self.sfunc, self.L) self.model = kinematics.DamagedStandardKinematicModel( self.emodel, self.imodel, self.dmodel) self.fspin = self.model.spin(self.S, self.d, self.w, self.Q, self.H, self.L, self.T, history.History()) self.fixed = self.model.decouple(self.S, self.d, self.w, self.Q, self.H, self.L, self.T, history.History())