Skip to content

Commit

Permalink
constition: fix linearelastic elasticity
Browse files Browse the repository at this point in the history
add initial stress elasticitiy if stress is passed
  • Loading branch information
adtzlr committed Jul 29, 2021
1 parent 7b8028b commit 4a2b8e6
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions felupe/constitution/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,17 @@ def __init__(self, E, nu):
def stress(self, strain):
return 2 * self.mu * strain + self.gamma * trace(strain) * identity(strain)

def elasticity(self, strain):
def elasticity(self, strain, stress=None):
I = identity(strain)
return 2 * self.mu * cdya(I, I) + self.gamma * dya(I, I)

elast = 2 * self.mu * cdya(I, I) + self.gamma * dya(I, I)

if stress is not None:
elast_stress = cdya_ik(stress, I)
else:
elast_stress = 0

return elast + elast_stress

def lame(self, E, nu):
mu = E / (2 * (1 + nu))
Expand Down

0 comments on commit 4a2b8e6

Please sign in to comment.