-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add more hyperelastic models SVK-ortho (tensortrax), extended-tube (JAX), neo-hooke (JAX) * Aktualisieren von CHANGELOG.md * Aktualisieren von test_constitution_jax.py
- Loading branch information
Showing
20 changed files
with
256 additions
and
17 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
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
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
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
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
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
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
36 changes: 36 additions & 0 deletions
36
src/felupe/constitution/jax/models/hyperelastic/_extended_tube.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,36 @@ | ||
# -*- 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, diag, log, sqrt, trace | ||
from jax.numpy.linalg import det, eigvalsh | ||
|
||
from ....tensortrax.models.hyperelastic import extended_tube as extended_tube_docstring | ||
|
||
|
||
@wraps(extended_tube_docstring) | ||
def extended_tube(C, Gc, delta, Ge, beta): | ||
J3 = det(C) ** (-1 / 3) | ||
D = J3 * trace(C) | ||
λ1, λ2, λ3 = sqrt(J3 * eigvalsh(C + diag(array([0, 1e-4, -1e-4])))) | ||
β = beta | ||
δ = delta | ||
γ = (1 - δ**2) * (D - 3) / (1 - δ**2 * (D - 3)) | ||
Wc = Gc / 2 * (γ + log(1 - δ**2 * (D - 3))) | ||
We = 2 * Ge / β**2 * (λ1**-β + λ2**-β + λ3**-β - 3) | ||
return Wc + We |
28 changes: 28 additions & 0 deletions
28
src/felupe/constitution/jax/models/hyperelastic/_neo_hooke.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,28 @@ | ||
# -*- 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 trace | ||
from jax.numpy.linalg import det | ||
|
||
from ....tensortrax.models.hyperelastic import neo_hooke as neo_hooke_docstring | ||
|
||
|
||
@wraps(neo_hooke_docstring) | ||
def neo_hooke(C, mu): | ||
return mu / 2 * (det(C) ** (-1 / 3) * trace(C) - 3) |
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
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
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
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
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
Oops, something went wrong.