@@ -643,7 +643,7 @@ def calc_seq(self, sig):
643643 d0 = np .zeros (3 )
644644 else :
645645 hp = self .hill
646- if self .lhs :
646+ if self .lhs is not None :
647647 d0 = self .lhs
648648 else :
649649 d0 = np .ones (3 ) * self .drucker
@@ -658,7 +658,7 @@ def calc_seq(self, sig):
658658 6. * hp [3 ] * np .square (sig [:, 3 ]) + \
659659 6. * hp [4 ] * np .square (sig [:, 4 ]) + \
660660 6. * hp [5 ] * np .square (sig [:, 5 ])
661- I2 *= 0.5
661+ I2 *= 0.5 # corresponds to 3 * second invariant of stress deviator
662662 self .msg ['equiv' ] = '6-parameter Hill, full Voigt stress'
663663 # print('Full stress', np.sqrt(I2))
664664 else :
@@ -699,6 +699,10 @@ def calc_seqB(self, sv):
699699 np .abs (Stp1 [1 ] - Stp2 [0 ]) ** a + np .abs (Stp1 [1 ] - Stp2 [1 ]) ** a + np .abs (Stp1 [1 ] - Stp2 [2 ]) ** a + \
700700 np .abs (Stp1 [2 ] - Stp2 [0 ]) ** a + np .abs (Stp1 [2 ] - Stp2 [1 ]) ** a + np .abs (Stp1 [2 ] - Stp2 [2 ]) ** a
701701 seq = (0.25 * seq ) ** (1. / a )
702+ if self .lhs is not None :
703+ d0 = self .lhs
704+ I1 = (sv [0 ] * d0 [0 ] + sv [1 ] * d0 [1 ] + sv [2 ] * d0 [2 ]) / 3. # hydrostatic stress as 1st invariant
705+ seq += I1
702706 return seq
703707
704708 def calc_fgrad (self , sig , epl = None , seq = None ,
@@ -827,7 +831,7 @@ def Jac(sig):
827831 h1 = self .hill [1 ]
828832 h2 = self .hill [2 ]
829833 if self .lhs is not None :
830- d3 = self .lhs
834+ d3 = self .lhs / 3.
831835 else :
832836 d3 = np .ones (3 ) * self .drucker / 3.
833837 if seq is None :
@@ -2523,9 +2527,6 @@ def plasticity(self, sy=None, sdim=6, drucker=0., khard=0.,
25232527 self .sdim = sdim
25242528 if hill is None and rv is None :
25252529 hill = np .ones (self .sdim )
2526- if lhs is not None :
2527- raise ValueError ('LHS parameters for anisotropic yield asymmetry provided, '
2528- 'but no anisotropy parameters for plastic yielding have been given.' )
25292530 elif hill is None :
25302531 # compute Hill parameters from rv values
25312532 hill = np .ones (self .sdim )
@@ -2592,12 +2593,17 @@ def plasticity(self, sy=None, sdim=6, drucker=0., khard=0.,
25922593 self .barlat_exp = barlat_exp
25932594 else :
25942595 self .barlat = False
2596+ #if lhs is not None:
2597+ # print(f'Using LHS parameters: {lhs}')
2598+ # print(f'Using LHS with hill parameters: {hill}')
2599+ # if self.barlat:
2600+ # print(f'Using LHS with Barlat parameters: {barlat}')
25952601
25962602 def from_data (self , param ):
25972603 """Define material properties from data sets generated in module `Data`:
25982604 contains data on elastic and plastic behavior, including work hardening,
25992605 for different crystallographic textures. Possible to extend to grain sizes,
2600- grain shapes and porosities. Will invoke definition of elastic and plastic
2606+ grain shapes and porosities. Subroutine invokes definition of elastic and plastic
26012607 parameters by calls to the methods `Material.elasticity` and `Material.plasticity`
26022608 with the parameters provided in the data set.
26032609 Also initializes current texture to first one in list and resets work hardening
0 commit comments