-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the hyperelastic foam model also for JAX
- Loading branch information
Showing
3 changed files
with
42 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,20 @@ | ||
from ._miehe_goektepe_lulei import miehe_goektepe_lulei | ||
from ._mooney_rivlin import mooney_rivlin | ||
from ._storakers import storakers | ||
from ._third_order_deformation import third_order_deformation | ||
from ._yeoh import yeoh | ||
|
||
__all__ = [ | ||
"miehe_goektepe_lulei", | ||
"mooney_rivlin", | ||
"storakers", | ||
"third_order_deformation", | ||
"yeoh", | ||
] | ||
|
||
# default (stable) material parameters | ||
miehe_goektepe_lulei.kwargs = dict(mu=0, N=100, U=0, p=2, q=2) | ||
mooney_rivlin.kwargs = dict(C10=0, C01=0) | ||
storakers.kwargs = dict(mu=[0], alpha=[2], beta=[1]) | ||
third_order_deformation.kwargs = dict(C10=0, C01=0, C11=0, C20=0, C30=0) | ||
yeoh.kwargs = dict(C10=0, C20=0, C30=0) |
34 changes: 34 additions & 0 deletions
34
src/felupe/constitution/jax/models/hyperelastic/_storakers.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
This file is part of FElupe. | ||
FElupe is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
FElupe is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with FElupe. If not, see <http://www.gnu.org/licenses/>. | ||
""" | ||
from functools import wraps | ||
from jax.numpy import array, sum as asum, sqrt | ||
from jax.numpy.linalg import eigvalsh | ||
|
||
from ....tensortrax.models.hyperelastic import storakers as storakers_docstring | ||
|
||
|
||
@wraps(storakers_docstring) | ||
def storakers(C, mu, alpha, beta): | ||
λ1, λ2, λ3 = sqrt(eigvalsh(C)) | ||
J = λ1 * λ2 * λ3 | ||
|
||
μ = array(mu) | ||
α = array(alpha) | ||
β = array(beta) | ||
|
||
return asum(2 * μ / α**2 * (λ1**α + λ2**α + λ3**α - 3 + (J ** (-α * β) - 1) / β)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters