general definition for strain tensors

This commit is contained in:
Martin Diehl 2019-10-19 16:02:48 +02:00
parent a665d5726d
commit 64731369e3
2 changed files with 28 additions and 22 deletions

View File

@ -630,7 +630,7 @@ class DADF5():
self.__add_generic_pointwise(__add_calculation,requested,pass_through) self.__add_generic_pointwise(__add_calculation,requested,pass_through)
def add_strain_tensor(self,F='F',t='U',ord=0): def add_strain_tensor(self,F='F',t='U',m=0):
""" """
Add strain tensor calculated from a deformation gradient. Add strain tensor calculated from a deformation gradient.
@ -643,15 +643,15 @@ class DADF5():
t : {V, U}, optional t : {V, U}, optional
Type of the polar decomposition, V for right stretch tensor and U for left stretch tensor. Type of the polar decomposition, V for right stretch tensor and U for left stretch tensor.
Defaults value is U. Defaults value is U.
ord : float, optional m : float, optional
Order of the strain calculation. Default value is 0.0. Order of the strain calculation. Default value is 0.0.
""" """
def __add_strain_tensor(F,t,ord): def __add_strain_tensor(F,t,m):
return { return {
'data': mechanics.strain_tensor(F['data'],t,ord), 'data': mechanics.strain_tensor(F['data'],t,m),
'label': 'epsilon_{}^{}({})'.format(t,ord,F['label']), 'label': 'epsilon_{}^{}({})'.format(t,m,F['label']),
'meta': { 'meta': {
'Unit': F['meta']['Unit'], 'Unit': F['meta']['Unit'],
'Description': 'Strain tensor of {} ({})'.format(F['label'],F['meta']['Description']), 'Description': 'Strain tensor of {} ({})'.format(F['label'],F['meta']['Description']),
@ -661,7 +661,7 @@ class DADF5():
requested = [{'label':F,'arg':'F'}] requested = [{'label':F,'arg':'F'}]
self.__add_generic_pointwise(__add_strain_tensor,requested,{'t':t,'ord':ord}) self.__add_generic_pointwise(__add_strain_tensor,requested,{'t':t,'m':m})
def add_principal_components(self,x): def add_principal_components(self,x):

View File

@ -21,12 +21,12 @@ def Cauchy(F,P):
return symmetric(sigma) return symmetric(sigma)
def strain_tensor(F,t,ord): def strain_tensor(F,t,m):
""" """
Return strain tensor calculated from deformation gradient. Return strain tensor calculated from deformation gradient.
For details refer to Albrecht Bertram: Elasticity and Plasticity of Large Deformations: For details refer to https://en.wikipedia.org/wiki/Finite_strain_theory and
An Introduction (3rd Edition, 2012), p. 102. https://de.wikipedia.org/wiki/Verzerrungstensor
Parameters Parameters
---------- ----------
@ -34,23 +34,29 @@ def strain_tensor(F,t,ord):
Deformation gradient. Deformation gradient.
t : {V, U} t : {V, U}
Type of the polar decomposition, V for right stretch tensor and U for left stretch tensor. Type of the polar decomposition, V for right stretch tensor and U for left stretch tensor.
ord : float m : float
Order of the strain. Order of the strain.
""" """
F_ = F.reshape((1,3,3)) if F.shape == (3,3) else F
if t == 'U': if t == 'U':
B = np.matmul(F,transpose(F)) B = np.matmul(F_,transpose(F_))
U,n = np.linalg.eigh(B) w,n = np.linalg.eigh(B)
lmd = np.log(U) if ord == 0 else \
U**ord - (np.broadcast_to(np.ones(3),[U.shape[0],3]) if len(F.shape) == 3 else np.ones(3))
elif t == 'V': elif t == 'V':
C = np.matmul(transpose(F),F) C = np.matmul(transpose(F_),F_)
V,n = np.linalg.eigh(C) w,n = np.linalg.eigh(C)
lmd = np.log(V) if ord == 0 else \
- 1.0/V**ord + (np.broadcast_to(np.ones(3),[V.shape[0],3]) if len(F.shape) == 3 else np.ones(3)) if m > 0.0:
eps = 1.0/(2.0*abs(m)) * (+ np.matmul(n,np.einsum('ij,ikj->ijk',w**m,n))
return np.dot(n,np.dot(np.diag(l),n.T)) if np.shape(F) == (3,3) else \ - np.broadcast_to(np.ones(3),[F_.shape[0],3]))
np.matmul(n,np.einsum('ij,ikj->ijk',lmd,n)) elif m < 0.0:
eps = 1.0/(2.0*abs(m)) * (- np.matmul(n,np.einsum('ij,ikj->ijk',w**m,n))
+ np.broadcast_to(np.ones(3),[F_.shape[0],3]))
else:
eps = np.matmul(n,np.einsum('ij,ikj->ijk',0.5*np.log(w),n))
return eps.reshape((3,3)) if np.shape(F) == (3,3) else \
eps
def deviatoric_part(x): def deviatoric_part(x):