liblaf.apple
¤
Modules:
Classes:
-
Arap– -
ArapActive– -
ArapMuscle– -
Dirichlet– -
DirichletBuilder– -
Forward– -
Gravity– -
Hyperelastic– -
Inverse– -
JaxEnergy– -
JaxModel– -
JaxModelBuilder– -
MassSpring– -
MassSpringPrestrain– -
Model– -
ModelBuilder– -
Phace– -
WarpEnergy– -
WarpModel– -
WarpModelBuilder–
Attributes:
-
__version__(str) – -
__version_tuple__(tuple[int | str, ...]) –
Arap
¤
Bases: Hyperelastic
flowchart TD
liblaf.apple.Arap[Arap]
liblaf.apple.warp.energies.elastic.hyperelastic._base.Hyperelastic[Hyperelastic]
liblaf.apple.warp.model._energy.WarpEnergy[WarpEnergy]
liblaf.apple.utils._id_mixin.IdMixin[IdMixin]
liblaf.apple.warp.energies.elastic.hyperelastic._base.Hyperelastic --> liblaf.apple.Arap
liblaf.apple.warp.model._energy.WarpEnergy --> liblaf.apple.warp.energies.elastic.hyperelastic._base.Hyperelastic
liblaf.apple.utils._id_mixin.IdMixin --> liblaf.apple.warp.model._energy.WarpEnergy
click liblaf.apple.Arap href "" "liblaf.apple.Arap"
click liblaf.apple.warp.energies.elastic.hyperelastic._base.Hyperelastic href "" "liblaf.apple.warp.energies.elastic.hyperelastic._base.Hyperelastic"
click liblaf.apple.warp.model._energy.WarpEnergy href "" "liblaf.apple.warp.model._energy.WarpEnergy"
click liblaf.apple.utils._id_mixin.IdMixin href "" "liblaf.apple.utils._id_mixin.IdMixin"
Parameters:
-
(id¤str, default:<dynamic>) – -
(requires_grad¤Sequence[str], default:()) – -
(cells¤Integer[array, 'c a']) – -
(dhdX¤Integer[array, 'c q a J']) – -
(dV¤Integer[array, 'c q']) – -
(params¤Struct) – -
(clamp_hess_diag¤bool, default:True) – -
(clamp_hess_quad¤bool, default:True) – -
(clamp_lambda¤bool, default:True) –
-
Reference
Liblaf
apple
warp
-
warpArapMuscle -
energies
-
energiesArapMuscle -
elastic
-
elasticArapMuscle -
hyperelastic
hyperelasticArapMuscle
-
-
-
Classes:
-
Params– -
ParamsElem–
Methods:
-
energy_density_func– -
energy_density_hess_diag_func– -
energy_density_hess_prod_func– -
energy_density_hess_quad_func– -
first_piola_kirchhoff_stress_func– -
from_pyvista– -
from_region– -
fun– -
get_cell_params– -
grad– -
grad_and_hess_diag– -
hess_diag– -
hess_prod– -
hess_quad– -
make_params– -
mixed_derivative_prod– -
update– -
update_params– -
value_and_grad–
Attributes:
-
cells(Integer[array, 'c a']) – -
clamp_hess_diag(bool) – -
clamp_hess_quad(bool) – -
clamp_lambda(bool) – -
dV(Integer[array, 'c q']) – -
dhdX(Integer[array, 'c q a J']) – -
fun_kernel(Kernel) – -
grad_and_hess_diag_kernel(Kernel) – -
grad_kernel(Kernel) – -
hess_diag_kernel(Kernel) – -
hess_prod_kernel(Kernel) – -
hess_quad_kernel(Kernel) – -
id(str) – -
n_cells(int) – -
n_quadrature_points(int) – -
params(Params) – -
requires_grad(Sequence[str]) – -
value_and_grad_kernel(Kernel) –
id
class-attribute
instance-attribute
¤
requires_grad
class-attribute
instance-attribute
¤
Params
¤
-
Reference
Liblaf
apple
warp
-
warpArapget_cell_params -
energies
-
energiesArapget_cell_params -
elastic
-
elasticArapget_cell_params -
hyperelastic
hyperelasticArapget_cell_params
-
-
-
Attributes:
ParamsElem
¤
-
Reference
Liblaf
apple
-
appleArapget_cell_params -
warp
-
warpArapget_cell_params -
energies
-
energiesArapget_cell_params -
elastic
-
elasticArapget_cell_params -
hyperelastic
hyperelasticArapget_cell_params
-
-
-
-
Attributes:
energy_density_func
staticmethod
¤
energy_density_func(
F: mat33, params: ParamsElem
) -> scalar
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_arap.py
39 40 41 42 43 44 45 46 | |
energy_density_hess_diag_func
staticmethod
¤
energy_density_hess_diag_func(
F: mat33,
dhdX: mat43,
params: ParamsElem,
*,
clamp: bool = True,
) -> mat33
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_arap.py
61 62 63 64 65 66 67 68 69 70 71 72 | |
energy_density_hess_prod_func
staticmethod
¤
energy_density_hess_prod_func(
F: mat33,
p: mat43,
dhdX: mat43,
params: ParamsElem,
*,
clamp: bool = True,
) -> mat33
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_arap.py
74 75 76 77 78 79 80 81 82 83 84 85 | |
energy_density_hess_quad_func
staticmethod
¤
energy_density_hess_quad_func(
F: mat33,
p: mat43,
dhdX: mat43,
params: ParamsElem,
*,
clamp: bool = True,
) -> scalar
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_arap.py
87 88 89 90 91 92 93 94 95 96 97 98 | |
first_piola_kirchhoff_stress_func
staticmethod
¤
first_piola_kirchhoff_stress_func(
F: mat33, params: ParamsElem, *, clamp: bool = False
) -> mat33
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_arap.py
48 49 50 51 52 53 54 55 56 57 58 59 | |
from_pyvista
classmethod
¤
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
59 60 61 62 | |
from_region
classmethod
¤
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
76 77 78 79 80 81 82 83 84 85 86 87 88 | |
fun
¤
fun(u: Vector, output: Scalar) -> None
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
110 111 112 113 114 115 116 117 | |
get_cell_params
staticmethod
¤
get_cell_params(params: Params, cid: int) -> ParamsElem
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_arap.py
32 33 34 35 36 37 | |
grad
¤
grad(u: Vector, output: Vector) -> None
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
119 120 121 122 123 124 125 126 | |
grad_and_hess_diag
¤
grad_and_hess_diag(
u: Vector, grad: Vector, hess_diag: Vector
) -> None
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
179 180 181 182 183 184 185 186 | |
hess_diag
¤
hess_diag(u: Vector, output: Vector) -> None
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
128 129 130 131 132 133 134 135 | |
hess_prod
¤
hess_prod(u: Vector, p: Vector, output: Vector) -> None
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
137 138 139 140 141 142 143 144 | |
hess_quad
¤
hess_quad(u: Vector, p: Vector, output: Scalar) -> None
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
146 147 148 149 150 151 152 153 | |
make_params
classmethod
¤
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
90 91 92 93 94 | |
mixed_derivative_prod
¤
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
155 156 157 158 159 160 161 162 163 164 165 166 167 168 | |
update
¤
update(u: Vector) -> None
Source code in src/liblaf/apple/warp/model/_energy.py
19 20 | |
update_params
¤
update_params(params: EnergyParams) -> None
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
104 105 106 107 108 | |
value_and_grad
¤
value_and_grad(
u: Vector, value: Scalar, grad: Vector
) -> None
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
170 171 172 173 174 175 176 177 | |
ArapActive
¤
Bases: Hyperelastic
flowchart TD
liblaf.apple.ArapActive[ArapActive]
liblaf.apple.warp.energies.elastic.hyperelastic._base.Hyperelastic[Hyperelastic]
liblaf.apple.warp.model._energy.WarpEnergy[WarpEnergy]
liblaf.apple.utils._id_mixin.IdMixin[IdMixin]
liblaf.apple.warp.energies.elastic.hyperelastic._base.Hyperelastic --> liblaf.apple.ArapActive
liblaf.apple.warp.model._energy.WarpEnergy --> liblaf.apple.warp.energies.elastic.hyperelastic._base.Hyperelastic
liblaf.apple.utils._id_mixin.IdMixin --> liblaf.apple.warp.model._energy.WarpEnergy
click liblaf.apple.ArapActive href "" "liblaf.apple.ArapActive"
click liblaf.apple.warp.energies.elastic.hyperelastic._base.Hyperelastic href "" "liblaf.apple.warp.energies.elastic.hyperelastic._base.Hyperelastic"
click liblaf.apple.warp.model._energy.WarpEnergy href "" "liblaf.apple.warp.model._energy.WarpEnergy"
click liblaf.apple.utils._id_mixin.IdMixin href "" "liblaf.apple.utils._id_mixin.IdMixin"
Parameters:
-
(id¤str, default:<dynamic>) – -
(requires_grad¤Sequence[str], default:()) – -
(cells¤Integer[array, 'c a']) – -
(dhdX¤Integer[array, 'c q a J']) – -
(dV¤Integer[array, 'c q']) – -
(params¤Struct) – -
(clamp_hess_diag¤bool, default:True) – -
(clamp_hess_quad¤bool, default:True) – -
(clamp_lambda¤bool, default:True) –
Classes:
-
Params– -
ParamsElem–
Methods:
-
energy_density_func– -
energy_density_hess_diag_func– -
energy_density_hess_prod_func– -
energy_density_hess_quad_func– -
first_piola_kirchhoff_stress_func– -
from_pyvista– -
from_region– -
fun– -
get_cell_params– -
grad– -
grad_and_hess_diag– -
hess_diag– -
hess_prod– -
hess_quad– -
make_params– -
mixed_derivative_prod– -
update– -
update_params– -
value_and_grad–
Attributes:
-
cells(Integer[array, 'c a']) – -
clamp_hess_diag(bool) – -
clamp_hess_quad(bool) – -
clamp_lambda(bool) – -
dV(Integer[array, 'c q']) – -
dhdX(Integer[array, 'c q a J']) – -
fun_kernel(Kernel) – -
grad_and_hess_diag_kernel(Kernel) – -
grad_kernel(Kernel) – -
hess_diag_kernel(Kernel) – -
hess_prod_kernel(Kernel) – -
hess_quad_kernel(Kernel) – -
id(str) – -
n_cells(int) – -
n_quadrature_points(int) – -
params(Params) – -
requires_grad(Sequence[str]) – -
value_and_grad_kernel(Kernel) –
id
class-attribute
instance-attribute
¤
requires_grad
class-attribute
instance-attribute
¤
Params
¤
-
Reference
Liblaf
apple
warp
-
warpArapActiveget_cell_params -
energies
-
energiesArapActiveget_cell_params -
elastic
-
elasticArapActiveget_cell_params -
hyperelastic
hyperelasticArapActiveget_cell_params
-
-
-
Attributes:
-
activation(array(dtype=vec6)) – -
mu(array(dtype=float_)) – -
muscle_fraction(array(dtype=float_)) –
ParamsElem
¤
-
Reference
Liblaf
apple
-
appleArapActiveget_cell_params -
warp
-
warpArapActiveget_cell_params -
energies
-
energiesArapActiveget_cell_params -
elastic
-
elasticArapActiveget_cell_params -
hyperelastic
hyperelasticArapActiveget_cell_params
-
-
-
-
-
Reference
Liblaf
apple
-
appleArapActive -
warp
-
warpArapActive -
energies
-
energiesArapActive -
elastic
-
elasticArapActive -
hyperelastic
hyperelasticArapActive
-
-
-
-
Attributes:
-
activation(vec6) – -
mu(float_) – -
muscle_fraction(float_) –
energy_density_func
staticmethod
¤
energy_density_func(
F: mat33, params: ParamsElem
) -> scalar
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_arap_active.py
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | |
energy_density_hess_diag_func
staticmethod
¤
energy_density_hess_diag_func(
F: mat33,
dhdX: mat43,
params: ParamsElem,
*,
clamp: bool = True,
) -> mat33
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_arap_active.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 | |
energy_density_hess_prod_func
staticmethod
¤
energy_density_hess_prod_func(
F: mat33,
p: mat43,
dhdX: mat43,
params: ParamsElem,
*,
clamp: bool = True,
) -> mat33
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_arap_active.py
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 | |
energy_density_hess_quad_func
staticmethod
¤
energy_density_hess_quad_func(
F: mat33,
p: mat43,
dhdX: mat43,
params: ParamsElem,
*,
clamp: bool = True,
) -> scalar
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_arap_active.py
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 | |
first_piola_kirchhoff_stress_func
staticmethod
¤
first_piola_kirchhoff_stress_func(
F: mat33, params: ParamsElem, *, clamp: bool = False
) -> mat33
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_arap_active.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | |
from_pyvista
classmethod
¤
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
59 60 61 62 | |
from_region
classmethod
¤
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
76 77 78 79 80 81 82 83 84 85 86 87 88 | |
fun
¤
fun(u: Vector, output: Scalar) -> None
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
110 111 112 113 114 115 116 117 | |
get_cell_params
staticmethod
¤
get_cell_params(params: Params, cid: int) -> ParamsElem
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_arap_active.py
37 38 39 40 41 42 43 44 45 46 | |
grad
¤
grad(u: Vector, output: Vector) -> None
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
119 120 121 122 123 124 125 126 | |
grad_and_hess_diag
¤
grad_and_hess_diag(
u: Vector, grad: Vector, hess_diag: Vector
) -> None
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
179 180 181 182 183 184 185 186 | |
hess_diag
¤
hess_diag(u: Vector, output: Vector) -> None
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
128 129 130 131 132 133 134 135 | |
hess_prod
¤
hess_prod(u: Vector, p: Vector, output: Vector) -> None
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
137 138 139 140 141 142 143 144 | |
hess_quad
¤
hess_quad(u: Vector, p: Vector, output: Scalar) -> None
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
146 147 148 149 150 151 152 153 | |
make_params
classmethod
¤
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
90 91 92 93 94 | |
mixed_derivative_prod
¤
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
155 156 157 158 159 160 161 162 163 164 165 166 167 168 | |
update
¤
update(u: Vector) -> None
Source code in src/liblaf/apple/warp/model/_energy.py
19 20 | |
update_params
¤
update_params(params: EnergyParams) -> None
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
104 105 106 107 108 | |
value_and_grad
¤
value_and_grad(
u: Vector, value: Scalar, grad: Vector
) -> None
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
170 171 172 173 174 175 176 177 | |
ArapMuscle
¤
Bases: Arap
flowchart TD
liblaf.apple.ArapMuscle[ArapMuscle]
liblaf.apple.warp.energies.elastic.hyperelastic._arap.Arap[Arap]
liblaf.apple.warp.energies.elastic.hyperelastic._base.Hyperelastic[Hyperelastic]
liblaf.apple.warp.model._energy.WarpEnergy[WarpEnergy]
liblaf.apple.utils._id_mixin.IdMixin[IdMixin]
liblaf.apple.warp.energies.elastic.hyperelastic._arap.Arap --> liblaf.apple.ArapMuscle
liblaf.apple.warp.energies.elastic.hyperelastic._base.Hyperelastic --> liblaf.apple.warp.energies.elastic.hyperelastic._arap.Arap
liblaf.apple.warp.model._energy.WarpEnergy --> liblaf.apple.warp.energies.elastic.hyperelastic._base.Hyperelastic
liblaf.apple.utils._id_mixin.IdMixin --> liblaf.apple.warp.model._energy.WarpEnergy
click liblaf.apple.ArapMuscle href "" "liblaf.apple.ArapMuscle"
click liblaf.apple.warp.energies.elastic.hyperelastic._arap.Arap href "" "liblaf.apple.warp.energies.elastic.hyperelastic._arap.Arap"
click liblaf.apple.warp.energies.elastic.hyperelastic._base.Hyperelastic href "" "liblaf.apple.warp.energies.elastic.hyperelastic._base.Hyperelastic"
click liblaf.apple.warp.model._energy.WarpEnergy href "" "liblaf.apple.warp.model._energy.WarpEnergy"
click liblaf.apple.utils._id_mixin.IdMixin href "" "liblaf.apple.utils._id_mixin.IdMixin"
Parameters:
-
(id¤str, default:<dynamic>) – -
(requires_grad¤Sequence[str], default:()) – -
(cells¤Integer[array, 'c a']) – -
(dhdX¤Integer[array, 'c q a J']) – -
(dV¤Integer[array, 'c q']) – -
(params¤Struct) – -
(clamp_hess_diag¤bool, default:True) – -
(clamp_hess_quad¤bool, default:True) – -
(clamp_lambda¤bool, default:True) –
Classes:
-
Params– -
ParamsElem–
Methods:
-
energy_density_func– -
energy_density_hess_diag_func– -
energy_density_hess_prod_func– -
energy_density_hess_quad_func– -
first_piola_kirchhoff_stress_func– -
from_pyvista– -
from_region– -
fun– -
get_cell_params– -
grad– -
grad_and_hess_diag– -
hess_diag– -
hess_prod– -
hess_quad– -
make_params– -
mixed_derivative_prod– -
update– -
update_params– -
value_and_grad–
Attributes:
-
cells(Integer[array, 'c a']) – -
clamp_hess_diag(bool) – -
clamp_hess_quad(bool) – -
clamp_lambda(bool) – -
dV(Integer[array, 'c q']) – -
dhdX(Integer[array, 'c q a J']) – -
fun_kernel(Kernel) – -
grad_and_hess_diag_kernel(Kernel) – -
grad_kernel(Kernel) – -
hess_diag_kernel(Kernel) – -
hess_prod_kernel(Kernel) – -
hess_quad_kernel(Kernel) – -
id(str) – -
n_cells(int) – -
n_quadrature_points(int) – -
params(Params) – -
requires_grad(Sequence[str]) – -
value_and_grad_kernel(Kernel) –
id
class-attribute
instance-attribute
¤
requires_grad
class-attribute
instance-attribute
¤
Params
¤
-
Reference
Liblaf
apple
warp
-
warpArapMuscleget_cell_params -
energies
-
energiesArapMuscleget_cell_params -
elastic
-
elasticArapMuscleget_cell_params -
hyperelastic
hyperelasticArapMuscleget_cell_params
-
-
-
Attributes:
ParamsElem
¤
-
Reference
Liblaf
apple
-
appleArapMuscleget_cell_params -
warp
-
warpArapMuscleget_cell_params -
energies
-
energiesArapMuscleget_cell_params -
elastic
-
elasticArapMuscleget_cell_params -
hyperelastic
hyperelasticArapMuscleget_cell_params
-
-
-
-
-
Reference
Liblaf
apple
-
appleArapMuscle -
warp
-
warpArapMuscle -
energies
-
energiesArapMuscle -
elastic
-
elasticArapMuscle -
hyperelastic
hyperelasticArapMuscle
-
-
-
-
Attributes:
-
activation(vec6) – -
mu(float_) –
energy_density_func
staticmethod
¤
energy_density_func(
F: mat33, params: ParamsElem
) -> scalar
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_arap_muscle.py
43 44 45 46 47 48 49 50 51 | |
energy_density_hess_diag_func
staticmethod
¤
energy_density_hess_diag_func(
F: mat33,
dhdX: mat43,
params: ParamsElem,
*,
clamp: bool = True,
) -> mat33
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_arap_muscle.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 | |
energy_density_hess_prod_func
staticmethod
¤
energy_density_hess_prod_func(
F: mat33,
p: mat43,
dhdX: mat43,
params: ParamsElem,
*,
clamp: bool = True,
) -> mat33
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_arap_muscle.py
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 | |
energy_density_hess_quad_func
staticmethod
¤
energy_density_hess_quad_func(
F: mat33,
p: mat43,
dhdX: mat43,
params: ParamsElem,
*,
clamp: bool = True,
) -> scalar
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_arap_muscle.py
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 | |
first_piola_kirchhoff_stress_func
staticmethod
¤
first_piola_kirchhoff_stress_func(
F: mat33, params: ParamsElem, *, clamp: bool = False
) -> mat33
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_arap_muscle.py
53 54 55 56 57 58 59 60 61 62 63 | |
from_pyvista
classmethod
¤
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
59 60 61 62 | |
from_region
classmethod
¤
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
76 77 78 79 80 81 82 83 84 85 86 87 88 | |
fun
¤
fun(u: Vector, output: Scalar) -> None
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
110 111 112 113 114 115 116 117 | |
get_cell_params
staticmethod
¤
get_cell_params(params: Params, cid: int) -> ParamsElem
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_arap_muscle.py
34 35 36 37 38 39 40 41 | |
grad
¤
grad(u: Vector, output: Vector) -> None
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
119 120 121 122 123 124 125 126 | |
grad_and_hess_diag
¤
grad_and_hess_diag(
u: Vector, grad: Vector, hess_diag: Vector
) -> None
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
179 180 181 182 183 184 185 186 | |
hess_diag
¤
hess_diag(u: Vector, output: Vector) -> None
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
128 129 130 131 132 133 134 135 | |
hess_prod
¤
hess_prod(u: Vector, p: Vector, output: Vector) -> None
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
137 138 139 140 141 142 143 144 | |
hess_quad
¤
hess_quad(u: Vector, p: Vector, output: Scalar) -> None
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
146 147 148 149 150 151 152 153 | |
make_params
classmethod
¤
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
90 91 92 93 94 | |
mixed_derivative_prod
¤
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
155 156 157 158 159 160 161 162 163 164 165 166 167 168 | |
update
¤
update(u: Vector) -> None
Source code in src/liblaf/apple/warp/model/_energy.py
19 20 | |
update_params
¤
update_params(params: EnergyParams) -> None
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
104 105 106 107 108 | |
value_and_grad
¤
value_and_grad(
u: Vector, value: Scalar, grad: Vector
) -> None
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
170 171 172 173 174 175 176 177 | |
Dirichlet
¤
Parameters:
-
(dim¤int) – -
(dirichlet_index¤Integer[Array, dirichlet]) – -
(dirichlet_value¤Float[Array, dirichlet]) – -
(free_index¤Integer[Array, free]) – -
(n_points¤int) –
Methods:
-
get_dirichlet– -
get_free– -
set_dirichlet– -
set_free– -
to_full–
Attributes:
-
dim(int) – -
dirichlet_index(Integer[Array, ' dirichlet']) – -
dirichlet_value(Float[Array, ' dirichlet']) – -
free_index(Integer[Array, ' free']) – -
n_dirichlet(int) – -
n_free(int) – -
n_full(int) – -
n_points(int) –
get_dirichlet
¤
get_dirichlet(
full: Float[Array, "points dim"],
) -> Float[Array, " dirichlet"]
Source code in src/liblaf/apple/jax/model/dirichlet/_dirichlet.py
27 28 29 30 31 | |
get_free
¤
get_free(
full: Float[Array, "points dim"],
) -> Float[Array, " free"]
Source code in src/liblaf/apple/jax/model/dirichlet/_dirichlet.py
33 34 35 | |
set_dirichlet
¤
set_dirichlet(
full: Float[Array, "points dim"],
values: Float[ArrayLike, " dirichlet"] | None = None,
) -> Float[Array, "points dim"]
Source code in src/liblaf/apple/jax/model/dirichlet/_dirichlet.py
37 38 39 40 41 42 43 44 45 | |
set_free
¤
set_free(
full: Float[Array, "points dim"],
values: Float[ArrayLike, " free"],
) -> Float[Array, "points dim"]
Source code in src/liblaf/apple/jax/model/dirichlet/_dirichlet.py
47 48 49 50 51 | |
to_full
¤
to_full(
free: Float[Array, " free"],
dirichlet: Float[ArrayLike, " dirichlet"] | None = None,
) -> Float[Array, "points dim"]
Source code in src/liblaf/apple/jax/model/dirichlet/_dirichlet.py
53 54 55 56 57 58 59 60 61 62 63 64 | |
DirichletBuilder
¤
DirichletBuilder(dim: int = 3)
Parameters:
- Reference Liblaf apple
- Reference Liblaf apple
Methods:
-
add_pyvista– -
finalize– -
resize–
Attributes:
-
dim(int) – -
mask(Bool[ndarray, 'points dim']) – -
n_points(int) – -
value(Float[ndarray, 'points dim']) –
Source code in src/liblaf/apple/jax/model/dirichlet/_builder.py
19 20 21 22 | |
add_pyvista
¤
add_pyvista(obj: DataSet) -> None
Source code in src/liblaf/apple/jax/model/dirichlet/_builder.py
32 33 34 35 36 37 38 39 40 41 42 | |
finalize
¤
finalize() -> Dirichlet
Source code in src/liblaf/apple/jax/model/dirichlet/_builder.py
44 45 46 47 48 49 50 51 52 53 | |
resize
¤
resize(n_points: int) -> None
Source code in src/liblaf/apple/jax/model/dirichlet/_builder.py
55 56 57 58 59 60 | |
Forward
¤
Parameters:
-
(model¤Model) – -
(optimizer¤Optimizer, default:PNCG(jit=False, timer=False, max_steps=1000, norm=None, atol=Array(1.e-28, dtype=float32, weak_type=True), rtol=Array(1.e-05, dtype=float32, weak_type=True), d_hat=Array(inf, dtype=float32, weak_type=True))) –
Methods:
-
step– -
update_params–
Attributes:
optimizer
class-attribute
instance-attribute
¤
optimizer: Optimizer = field(
factory=lambda: PNCG(max_steps=1000)
)
step
¤
step(callback: Callback | None = None) -> Solution
Source code in src/liblaf/apple/model/_forward.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | |
update_params
¤
update_params(params: ModelParams) -> None
Source code in src/liblaf/apple/model/_forward.py
26 27 | |
Gravity
¤
Bases: JaxEnergy
flowchart TD
liblaf.apple.Gravity[Gravity]
liblaf.apple.jax.model._energy.JaxEnergy[JaxEnergy]
liblaf.apple.utils._id_mixin.IdMixin[IdMixin]
liblaf.apple.jax.model._energy.JaxEnergy --> liblaf.apple.Gravity
liblaf.apple.utils._id_mixin.IdMixin --> liblaf.apple.jax.model._energy.JaxEnergy
click liblaf.apple.Gravity href "" "liblaf.apple.Gravity"
click liblaf.apple.jax.model._energy.JaxEnergy href "" "liblaf.apple.jax.model._energy.JaxEnergy"
click liblaf.apple.utils._id_mixin.IdMixin href "" "liblaf.apple.utils._id_mixin.IdMixin"
Parameters:
-
(id¤str, default:<dynamic>) – -
(requires_grad¤frozenset[str], default:frozenset()) – -
(gravity¤Float[Array, dim]) – -
(indices¤Integer[Array, points]) – -
(mass¤Float[Array, points]) –
Methods:
-
from_pyvista– -
fun– -
grad– -
grad_and_hess_diag– -
hess_diag– -
hess_prod– -
hess_quad– -
mixed_derivative_prod– -
update– -
update_params– -
value_and_grad–
Attributes:
-
gravity(Float[Array, ' dim']) – -
id(str) – -
indices(Integer[Array, ' points']) – -
mass(Float[Array, ' points']) – -
requires_grad(frozenset[str]) –
id
class-attribute
instance-attribute
¤
requires_grad
class-attribute
instance-attribute
¤
from_pyvista
classmethod
¤
Source code in src/liblaf/apple/jax/energies/_gravity.py
23 24 25 26 27 28 29 30 31 32 33 | |
fun
¤
fun(u: Vector) -> Scalar
Source code in src/liblaf/apple/jax/energies/_gravity.py
35 36 37 38 | |
grad
¤
grad(u: Vector) -> Updates
Source code in src/liblaf/apple/jax/model/_energy.py
33 34 35 36 | |
grad_and_hess_diag
¤
grad_and_hess_diag(u: Vector) -> tuple[Updates, Updates]
Source code in src/liblaf/apple/jax/model/_energy.py
61 62 63 | |
hess_diag
¤
hess_diag(u: Vector) -> Updates
Source code in src/liblaf/apple/jax/energies/_gravity.py
40 41 42 | |
hess_prod
¤
hess_prod(u: Vector, p: Vector) -> Updates
Source code in src/liblaf/apple/jax/model/_energy.py
41 42 43 44 45 | |
hess_quad
¤
hess_quad(u: Vector, p: Vector) -> Scalar
Source code in src/liblaf/apple/jax/model/_energy.py
47 48 49 50 51 52 | |
mixed_derivative_prod
¤
mixed_derivative_prod(
u: Vector, p: Vector
) -> EnergyParams
Source code in src/liblaf/apple/jax/model/_energy.py
65 66 67 68 69 70 71 | |
update
¤
update(u: Vector) -> None
Source code in src/liblaf/apple/jax/model/_energy.py
22 23 24 | |
update_params
¤
Source code in src/liblaf/apple/jax/model/_energy.py
26 27 28 | |
value_and_grad
¤
value_and_grad(u: Vector) -> tuple[Scalar, Updates]
Source code in src/liblaf/apple/jax/model/_energy.py
54 55 56 57 58 59 | |
Hyperelastic
¤
Bases: WarpEnergy
flowchart TD
liblaf.apple.Hyperelastic[Hyperelastic]
liblaf.apple.warp.model._energy.WarpEnergy[WarpEnergy]
liblaf.apple.utils._id_mixin.IdMixin[IdMixin]
liblaf.apple.warp.model._energy.WarpEnergy --> liblaf.apple.Hyperelastic
liblaf.apple.utils._id_mixin.IdMixin --> liblaf.apple.warp.model._energy.WarpEnergy
click liblaf.apple.Hyperelastic href "" "liblaf.apple.Hyperelastic"
click liblaf.apple.warp.model._energy.WarpEnergy href "" "liblaf.apple.warp.model._energy.WarpEnergy"
click liblaf.apple.utils._id_mixin.IdMixin href "" "liblaf.apple.utils._id_mixin.IdMixin"
Parameters:
-
(id¤str, default:<dynamic>) – -
(requires_grad¤Sequence[str], default:()) – -
(cells¤Integer[array, 'c a']) – -
(dhdX¤Integer[array, 'c q a J']) – -
(dV¤Integer[array, 'c q']) – -
(params¤Struct) – -
(clamp_hess_diag¤bool, default:True) – -
(clamp_hess_quad¤bool, default:True) – -
(clamp_lambda¤bool, default:True) –
Classes:
-
Params– -
ParamsElem–
Methods:
-
energy_density_func– -
energy_density_hess_diag_func– -
energy_density_hess_prod_func– -
energy_density_hess_quad_func– -
first_piola_kirchhoff_stress_func– -
from_pyvista– -
from_region– -
fun– -
get_cell_params– -
grad– -
grad_and_hess_diag– -
hess_diag– -
hess_prod– -
hess_quad– -
make_params– -
mixed_derivative_prod– -
update– -
update_params– -
value_and_grad–
Attributes:
-
cells(Integer[array, 'c a']) – -
clamp_hess_diag(bool) – -
clamp_hess_quad(bool) – -
clamp_lambda(bool) – -
dV(Integer[array, 'c q']) – -
dhdX(Integer[array, 'c q a J']) – -
fun_kernel(Kernel) – -
grad_and_hess_diag_kernel(Kernel) – -
grad_kernel(Kernel) – -
hess_diag_kernel(Kernel) – -
hess_prod_kernel(Kernel) – -
hess_quad_kernel(Kernel) – -
id(str) – -
n_cells(int) – -
n_quadrature_points(int) – -
params(Params) – -
requires_grad(Sequence[str]) – -
value_and_grad_kernel(Kernel) –
id
class-attribute
instance-attribute
¤
requires_grad
class-attribute
instance-attribute
¤
Params
¤
ParamsElem
¤
energy_density_func
staticmethod
¤
energy_density_func(
F: mat33, params: ParamsElem
) -> scalar
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
450 451 452 453 454 | |
energy_density_hess_diag_func
staticmethod
¤
energy_density_hess_diag_func(
F: mat33,
dhdX: mat43,
params: ParamsElem,
*,
clamp: bool = True,
) -> mat33
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
464 465 466 467 468 469 470 | |
energy_density_hess_prod_func
staticmethod
¤
energy_density_hess_prod_func(
F: mat33,
p: mat43,
dhdX: mat43,
params: ParamsElem,
*,
clamp: bool = True,
) -> mat33
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
472 473 474 475 476 477 478 | |
energy_density_hess_quad_func
staticmethod
¤
energy_density_hess_quad_func(
F: mat33,
p: mat43,
dhdX: mat43,
params: ParamsElem,
*,
clamp: bool = True,
) -> scalar
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
480 481 482 483 484 485 486 | |
first_piola_kirchhoff_stress_func
staticmethod
¤
first_piola_kirchhoff_stress_func(
F: mat33, params: ParamsElem, *, clamp: bool = False
) -> mat33
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
456 457 458 459 460 461 462 | |
from_pyvista
classmethod
¤
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
59 60 61 62 | |
from_region
classmethod
¤
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
76 77 78 79 80 81 82 83 84 85 86 87 88 | |
fun
¤
fun(u: Vector, output: Scalar) -> None
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
110 111 112 113 114 115 116 117 | |
get_cell_params
staticmethod
¤
get_cell_params(params: Params, cid: int) -> ParamsElem
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
444 445 446 447 448 | |
grad
¤
grad(u: Vector, output: Vector) -> None
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
119 120 121 122 123 124 125 126 | |
grad_and_hess_diag
¤
grad_and_hess_diag(
u: Vector, grad: Vector, hess_diag: Vector
) -> None
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
179 180 181 182 183 184 185 186 | |
hess_diag
¤
hess_diag(u: Vector, output: Vector) -> None
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
128 129 130 131 132 133 134 135 | |
hess_prod
¤
hess_prod(u: Vector, p: Vector, output: Vector) -> None
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
137 138 139 140 141 142 143 144 | |
hess_quad
¤
hess_quad(u: Vector, p: Vector, output: Scalar) -> None
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
146 147 148 149 150 151 152 153 | |
make_params
classmethod
¤
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
90 91 92 93 94 | |
mixed_derivative_prod
¤
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
155 156 157 158 159 160 161 162 163 164 165 166 167 168 | |
update
¤
update(u: Vector) -> None
Source code in src/liblaf/apple/warp/model/_energy.py
19 20 | |
update_params
¤
update_params(params: EnergyParams) -> None
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
104 105 106 107 108 | |
value_and_grad
¤
value_and_grad(
u: Vector, value: Scalar, grad: Vector
) -> None
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
170 171 172 173 174 175 176 177 | |
Inverse
¤
Bases: ABC
flowchart TD
liblaf.apple.Inverse[Inverse]
click liblaf.apple.Inverse href "" "liblaf.apple.Inverse"
Parameters:
-
(forward¤Forward) – -
(adjoint_solver¤LinearSolver, default:<dynamic>) – -
(optimizer¤Optimizer, default:ScipyOptimizer(max_steps=256, jit=False, timer=False, method='L-BFGS-B', tol=1e-05, options=None)) –
Methods:
-
adjoint– -
fun– -
loss– -
loss_and_grad– -
make_params– -
solve– -
value_and_grad–
Attributes:
adjoint_solver
class-attribute
instance-attribute
¤
adjoint_solver: LinearSolver = field(
factory=CompositeSolver, kw_only=True
)
optimizer
class-attribute
instance-attribute
¤
optimizer: Optimizer = field(
factory=lambda: ScipyOptimizer(
method="L-BFGS-B", tol=1e-05
),
kw_only=True,
)
adjoint
¤
adjoint(u: Full, dLdu: Full) -> Full
Source code in src/liblaf/apple/inverse/_inverse.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | |
fun
¤
fun(params: ParamsT) -> tuple[Scalar, AuxT]
Source code in src/liblaf/apple/inverse/_inverse.py
67 68 69 70 71 72 | |
loss
abstractmethod
¤
loss(u: Full, params: ModelParams) -> tuple[Scalar, AuxT]
Source code in src/liblaf/apple/inverse/_inverse.py
74 75 76 | |
loss_and_grad
¤
loss_and_grad(
u: Full, params: ModelParams
) -> tuple[Scalar, Full, ModelParams, AuxT]
Source code in src/liblaf/apple/inverse/_inverse.py
78 79 80 81 82 83 84 85 86 87 88 89 | |
make_params
abstractmethod
¤
make_params(params: ParamsT) -> ModelParams
Source code in src/liblaf/apple/inverse/_inverse.py
91 92 93 | |
solve
¤
solve(
params: ParamsT, callback: Callback | None = None
) -> Solution
Source code in src/liblaf/apple/inverse/_inverse.py
95 96 97 98 99 100 101 102 103 104 | |
value_and_grad
¤
value_and_grad(
params: ParamsT,
) -> tuple[Scalar, ParamsT, AuxT]
Source code in src/liblaf/apple/inverse/_inverse.py
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 | |
JaxEnergy
¤
Bases: IdMixin
flowchart TD
liblaf.apple.JaxEnergy[JaxEnergy]
liblaf.apple.utils._id_mixin.IdMixin[IdMixin]
liblaf.apple.utils._id_mixin.IdMixin --> liblaf.apple.JaxEnergy
click liblaf.apple.JaxEnergy href "" "liblaf.apple.JaxEnergy"
click liblaf.apple.utils._id_mixin.IdMixin href "" "liblaf.apple.utils._id_mixin.IdMixin"
Parameters:
- Reference Liblaf apple
Methods:
-
fun– -
grad– -
grad_and_hess_diag– -
hess_diag– -
hess_prod– -
hess_quad– -
mixed_derivative_prod– -
update– -
update_params– -
value_and_grad–
Attributes:
-
id(str) – -
requires_grad(frozenset[str]) –
id
class-attribute
instance-attribute
¤
requires_grad
class-attribute
instance-attribute
¤
fun
¤
fun(u: Vector) -> Scalar
Source code in src/liblaf/apple/jax/model/_energy.py
30 31 | |
grad
¤
grad(u: Vector) -> Updates
Source code in src/liblaf/apple/jax/model/_energy.py
33 34 35 36 | |
grad_and_hess_diag
¤
grad_and_hess_diag(u: Vector) -> tuple[Updates, Updates]
Source code in src/liblaf/apple/jax/model/_energy.py
61 62 63 | |
hess_diag
¤
hess_diag(u: Vector) -> Updates
Source code in src/liblaf/apple/jax/model/_energy.py
38 39 | |
hess_prod
¤
hess_prod(u: Vector, p: Vector) -> Updates
Source code in src/liblaf/apple/jax/model/_energy.py
41 42 43 44 45 | |
hess_quad
¤
hess_quad(u: Vector, p: Vector) -> Scalar
Source code in src/liblaf/apple/jax/model/_energy.py
47 48 49 50 51 52 | |
mixed_derivative_prod
¤
mixed_derivative_prod(
u: Vector, p: Vector
) -> EnergyParams
Source code in src/liblaf/apple/jax/model/_energy.py
65 66 67 68 69 70 71 | |
update
¤
update(u: Vector) -> None
Source code in src/liblaf/apple/jax/model/_energy.py
22 23 24 | |
update_params
¤
Source code in src/liblaf/apple/jax/model/_energy.py
26 27 28 | |
value_and_grad
¤
value_and_grad(u: Vector) -> tuple[Scalar, Updates]
Source code in src/liblaf/apple/jax/model/_energy.py
54 55 56 57 58 59 | |
JaxModel
¤
Parameters:
-
(energies¤dict[str, JaxEnergy], default:<class 'dict'>) –dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2)
Methods:
-
fun– -
grad– -
grad_and_hess_diag– -
hess_diag– -
hess_prod– -
hess_quad– -
mixed_derivative_prod– -
update– -
update_params– -
value_and_grad–
Attributes:
energies
class-attribute
instance-attribute
¤
fun
¤
fun(x: Vector) -> Scalar
Source code in src/liblaf/apple/jax/model/_model.py
29 30 31 32 33 34 | |
grad
¤
grad(x: Vector) -> Vector
Source code in src/liblaf/apple/jax/model/_model.py
36 37 38 39 40 41 42 43 44 | |
grad_and_hess_diag
¤
grad_and_hess_diag(x: Vector) -> tuple[Vector, Vector]
Source code in src/liblaf/apple/jax/model/_model.py
92 93 94 95 96 97 98 99 100 101 102 103 104 | |
hess_diag
¤
hess_diag(x: Vector) -> Vector
Source code in src/liblaf/apple/jax/model/_model.py
46 47 48 49 50 51 52 53 54 | |
hess_prod
¤
hess_prod(x: Vector, p: Vector) -> Vector
Source code in src/liblaf/apple/jax/model/_model.py
56 57 58 59 60 61 62 63 64 | |
hess_quad
¤
hess_quad(x: Vector, p: Vector) -> Scalar
Source code in src/liblaf/apple/jax/model/_model.py
66 67 68 69 70 71 | |
mixed_derivative_prod
¤
mixed_derivative_prod(
x: Vector, p: Vector
) -> ModelParams
Source code in src/liblaf/apple/jax/model/_model.py
73 74 75 76 77 78 | |
update
¤
update(x: Vector) -> None
Source code in src/liblaf/apple/jax/model/_model.py
21 22 23 | |
update_params
¤
update_params(params: ModelParams) -> None
Source code in src/liblaf/apple/jax/model/_model.py
25 26 27 | |
value_and_grad
¤
value_and_grad(x: Vector) -> tuple[Scalar, Vector]
Source code in src/liblaf/apple/jax/model/_model.py
80 81 82 83 84 85 86 87 88 89 90 | |
JaxModelBuilder
¤
Parameters:
-
(energies¤dict[str, JaxEnergy], default:<class 'dict'>) –dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2)
-
Reference
Liblaf
apple
-
appleModelBuilderjax -
model
modelModelBuilderjax
-
-
Reference
Liblaf
apple
-
appleModelBuilder -
model
modelModelBuilderjax
-
Methods:
-
add_energy– -
finalize–
Attributes:
MassSpring
¤
Bases: JaxEnergy
flowchart TD
liblaf.apple.MassSpring[MassSpring]
liblaf.apple.jax.model._energy.JaxEnergy[JaxEnergy]
liblaf.apple.utils._id_mixin.IdMixin[IdMixin]
liblaf.apple.jax.model._energy.JaxEnergy --> liblaf.apple.MassSpring
liblaf.apple.utils._id_mixin.IdMixin --> liblaf.apple.jax.model._energy.JaxEnergy
click liblaf.apple.MassSpring href "" "liblaf.apple.MassSpring"
click liblaf.apple.jax.model._energy.JaxEnergy href "" "liblaf.apple.jax.model._energy.JaxEnergy"
click liblaf.apple.utils._id_mixin.IdMixin href "" "liblaf.apple.utils._id_mixin.IdMixin"
Parameters:
-
(id¤str, default:<dynamic>) – -
(requires_grad¤frozenset[str], default:frozenset()) – -
(edges¤Integer[Array, 'edges 2']) – -
(length¤Float[Array, edges]) – -
(points¤Float[Array, 'edges 2 3']) – -
(stiffness¤Float[Array, edges]) –
Methods:
-
from_pyvista– -
fun– -
grad– -
grad_and_hess_diag– -
hess_diag– -
hess_prod– -
hess_quad– -
mixed_derivative_prod– -
update– -
update_params– -
value_and_grad–
Attributes:
-
edges(Integer[Array, ' edges 2']) – -
id(str) – -
length(Float[Array, ' edges']) – -
n_edges(int) – -
points(Float[Array, 'edges 2 3']) – -
requires_grad(frozenset[str]) – -
stiffness(Float[Array, ' edges']) –
id
class-attribute
instance-attribute
¤
requires_grad
class-attribute
instance-attribute
¤
from_pyvista
classmethod
¤
Source code in src/liblaf/apple/jax/energies/_mass_spring.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | |
fun
¤
fun(u: Vector) -> Scalar
Source code in src/liblaf/apple/jax/energies/_mass_spring.py
49 50 51 52 53 54 55 56 57 58 | |
grad
¤
grad(u: Vector) -> Updates
Source code in src/liblaf/apple/jax/energies/_mass_spring.py
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | |
grad_and_hess_diag
¤
grad_and_hess_diag(u: Vector) -> tuple[Updates, Updates]
Source code in src/liblaf/apple/jax/model/_energy.py
61 62 63 | |
hess_diag
¤
hess_diag(u: Vector) -> Updates
Source code in src/liblaf/apple/jax/energies/_mass_spring.py
76 77 78 79 80 81 | |
hess_prod
¤
hess_prod(u: Vector, p: Vector) -> Updates
Source code in src/liblaf/apple/jax/model/_energy.py
41 42 43 44 45 | |
hess_quad
¤
hess_quad(u: Vector, p: Vector) -> Scalar
Source code in src/liblaf/apple/jax/model/_energy.py
47 48 49 50 51 52 | |
mixed_derivative_prod
¤
mixed_derivative_prod(
u: Vector, p: Vector
) -> EnergyParams
Source code in src/liblaf/apple/jax/model/_energy.py
65 66 67 68 69 70 71 | |
update
¤
update(u: Vector) -> None
Source code in src/liblaf/apple/jax/model/_energy.py
22 23 24 | |
update_params
¤
Source code in src/liblaf/apple/jax/model/_energy.py
26 27 28 | |
value_and_grad
¤
value_and_grad(u: Vector) -> tuple[Scalar, Updates]
Source code in src/liblaf/apple/jax/model/_energy.py
54 55 56 57 58 59 | |
MassSpringPrestrain
¤
Bases: MassSpring
flowchart TD
liblaf.apple.MassSpringPrestrain[MassSpringPrestrain]
liblaf.apple.jax.energies._mass_spring.MassSpring[MassSpring]
liblaf.apple.jax.model._energy.JaxEnergy[JaxEnergy]
liblaf.apple.utils._id_mixin.IdMixin[IdMixin]
liblaf.apple.jax.energies._mass_spring.MassSpring --> liblaf.apple.MassSpringPrestrain
liblaf.apple.jax.model._energy.JaxEnergy --> liblaf.apple.jax.energies._mass_spring.MassSpring
liblaf.apple.utils._id_mixin.IdMixin --> liblaf.apple.jax.model._energy.JaxEnergy
click liblaf.apple.MassSpringPrestrain href "" "liblaf.apple.MassSpringPrestrain"
click liblaf.apple.jax.energies._mass_spring.MassSpring href "" "liblaf.apple.jax.energies._mass_spring.MassSpring"
click liblaf.apple.jax.model._energy.JaxEnergy href "" "liblaf.apple.jax.model._energy.JaxEnergy"
click liblaf.apple.utils._id_mixin.IdMixin href "" "liblaf.apple.utils._id_mixin.IdMixin"
Parameters:
-
(id¤str, default:<dynamic>) – -
(requires_grad¤frozenset[str], default:frozenset()) – -
(edges¤Integer[Array, 'edges 2']) – -
(length¤Float[Array, edges]) – -
(points¤Float[Array, 'edges 2 3']) – -
(stiffness¤Float[Array, edges]) –
Methods:
-
from_pyvista– -
fun– -
grad– -
grad_and_hess_diag– -
hess_diag– -
hess_prod– -
hess_quad– -
mixed_derivative_prod– -
update– -
update_params– -
value_and_grad–
Attributes:
-
edges(Integer[Array, ' edges 2']) – -
id(str) – -
length(Float[Array, ' edges']) – -
n_edges(int) – -
points(Float[Array, 'edges 2 3']) – -
requires_grad(frozenset[str]) – -
stiffness(Float[Array, ' edges']) –
id
class-attribute
instance-attribute
¤
requires_grad
class-attribute
instance-attribute
¤
from_pyvista
classmethod
¤
Source code in src/liblaf/apple/jax/energies/_mass_spring_prestrain.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | |
fun
¤
fun(u: Vector) -> Scalar
Source code in src/liblaf/apple/jax/energies/_mass_spring.py
49 50 51 52 53 54 55 56 57 58 | |
grad
¤
grad(u: Vector) -> Updates
Source code in src/liblaf/apple/jax/energies/_mass_spring.py
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | |
grad_and_hess_diag
¤
grad_and_hess_diag(u: Vector) -> tuple[Updates, Updates]
Source code in src/liblaf/apple/jax/model/_energy.py
61 62 63 | |
hess_diag
¤
hess_diag(u: Vector) -> Updates
Source code in src/liblaf/apple/jax/energies/_mass_spring.py
76 77 78 79 80 81 | |
hess_prod
¤
hess_prod(u: Vector, p: Vector) -> Updates
Source code in src/liblaf/apple/jax/model/_energy.py
41 42 43 44 45 | |
hess_quad
¤
hess_quad(u: Vector, p: Vector) -> Scalar
Source code in src/liblaf/apple/jax/model/_energy.py
47 48 49 50 51 52 | |
mixed_derivative_prod
¤
mixed_derivative_prod(
u: Vector, p: Vector
) -> EnergyParams
Source code in src/liblaf/apple/jax/model/_energy.py
65 66 67 68 69 70 71 | |
update
¤
update(u: Vector) -> None
Source code in src/liblaf/apple/jax/model/_energy.py
22 23 24 | |
update_params
¤
Source code in src/liblaf/apple/jax/model/_energy.py
26 27 28 | |
value_and_grad
¤
value_and_grad(u: Vector) -> tuple[Scalar, Updates]
Source code in src/liblaf/apple/jax/model/_energy.py
54 55 56 57 58 59 | |
Model
¤
Parameters:
Methods:
-
fun– -
grad– -
grad_and_hess_diag– -
hess_diag– -
hess_prod– -
hess_quad– -
mixed_derivative_prod– -
to_free– -
to_full– -
to_shape_like– -
update– -
update_params– -
value_and_grad–
Attributes:
-
dim(int) – -
dirichlet(Dirichlet) – -
jax(JaxModel) – -
n_free(int) – -
n_full(int) – -
n_points(int) – -
u_free(Free) – -
u_full(Full) – -
warp(WarpModelAdapter) –
fun
¤
fun(u: FreeOrFull) -> Scalar
Source code in src/liblaf/apple/model/_model.py
84 85 86 87 88 89 90 | |
grad
¤
grad(u: FreeOrFull) -> FreeOrFull
Source code in src/liblaf/apple/model/_model.py
92 93 94 95 96 97 98 | |
grad_and_hess_diag
¤
grad_and_hess_diag(
u: FreeOrFull,
) -> tuple[FreeOrFull, FreeOrFull]
Source code in src/liblaf/apple/model/_model.py
148 149 150 151 152 153 154 155 156 157 158 159 | |
hess_diag
¤
hess_diag(u: FreeOrFull) -> FreeOrFull
Source code in src/liblaf/apple/model/_model.py
100 101 102 103 104 105 106 | |
hess_prod
¤
hess_prod(u: FreeOrFull, p: FreeOrFull) -> FreeOrFull
Source code in src/liblaf/apple/model/_model.py
108 109 110 111 112 113 114 115 | |
hess_quad
¤
hess_quad(u: FreeOrFull, p: FreeOrFull) -> Scalar
Source code in src/liblaf/apple/model/_model.py
117 118 119 120 121 122 123 124 | |
mixed_derivative_prod
¤
mixed_derivative_prod(
u: FreeOrFull, p: FreeOrFull
) -> ModelParams
Source code in src/liblaf/apple/model/_model.py
126 127 128 129 130 131 132 133 | |
to_free
¤
to_free(u: FreeOrFull) -> Free
Source code in src/liblaf/apple/model/_model.py
50 51 52 53 | |
to_full
¤
to_full(
u: FreeOrFull,
dirichlet: Float[ArrayLike, " dirichlet"] | None = None,
) -> Full
Source code in src/liblaf/apple/model/_model.py
55 56 57 58 59 60 | |
to_shape_like
¤
to_shape_like(u_full: Full, like: FreeOrFull) -> FreeOrFull
Source code in src/liblaf/apple/model/_model.py
62 63 64 65 | |
update
¤
update(u: FreeOrFull) -> None
Source code in src/liblaf/apple/model/_model.py
67 68 69 70 71 72 73 | |
update_params
¤
update_params(params: ModelParams) -> None
Source code in src/liblaf/apple/model/_model.py
75 76 77 78 79 80 81 82 | |
value_and_grad
¤
value_and_grad(u: FreeOrFull) -> tuple[Scalar, FreeOrFull]
Source code in src/liblaf/apple/model/_model.py
135 136 137 138 139 140 141 142 143 144 145 146 | |
ModelBuilder
¤
ModelBuilder(dim: int = 3)
Parameters:
-
(dirichlet¤DirichletBuilder, default:<dynamic>) – -
(jax¤JaxModelBuilder, default:<dynamic>) – -
(warp¤WarpModelBuilder, default:<dynamic>) –
Methods:
Attributes:
-
dirichlet(DirichletBuilder) – -
jax(JaxModelBuilder) – -
n_points(int) – -
warp(WarpModelBuilder) –
Source code in src/liblaf/apple/model/_builder.py
27 28 29 | |
dirichlet
class-attribute
instance-attribute
¤
dirichlet: DirichletBuilder = field(
factory=DirichletBuilder
)
add_dirichlet
¤
add_dirichlet(obj: DataSet) -> None
Source code in src/liblaf/apple/model/_builder.py
35 36 | |
add_energy
¤
add_energy(energy: JaxEnergy | WarpEnergy) -> None
Source code in src/liblaf/apple/model/_builder.py
38 39 40 41 42 43 44 | |
assign_global_ids
¤
assign_global_ids[T: DataSet](obj: T) -> T
Source code in src/liblaf/apple/model/_builder.py
46 47 48 49 50 51 | |
finalize
¤
finalize() -> Model
Source code in src/liblaf/apple/model/_builder.py
53 54 55 56 57 58 59 60 61 62 | |
Phace
¤
Bases: Hyperelastic
flowchart TD
liblaf.apple.Phace[Phace]
liblaf.apple.warp.energies.elastic.hyperelastic._base.Hyperelastic[Hyperelastic]
liblaf.apple.warp.model._energy.WarpEnergy[WarpEnergy]
liblaf.apple.utils._id_mixin.IdMixin[IdMixin]
liblaf.apple.warp.energies.elastic.hyperelastic._base.Hyperelastic --> liblaf.apple.Phace
liblaf.apple.warp.model._energy.WarpEnergy --> liblaf.apple.warp.energies.elastic.hyperelastic._base.Hyperelastic
liblaf.apple.utils._id_mixin.IdMixin --> liblaf.apple.warp.model._energy.WarpEnergy
click liblaf.apple.Phace href "" "liblaf.apple.Phace"
click liblaf.apple.warp.energies.elastic.hyperelastic._base.Hyperelastic href "" "liblaf.apple.warp.energies.elastic.hyperelastic._base.Hyperelastic"
click liblaf.apple.warp.model._energy.WarpEnergy href "" "liblaf.apple.warp.model._energy.WarpEnergy"
click liblaf.apple.utils._id_mixin.IdMixin href "" "liblaf.apple.utils._id_mixin.IdMixin"
Parameters:
-
(id¤str, default:<dynamic>) – -
(requires_grad¤Sequence[str], default:()) – -
(cells¤Integer[array, 'c a']) – -
(dhdX¤Integer[array, 'c q a J']) – -
(dV¤Integer[array, 'c q']) – -
(params¤Struct) – -
(clamp_hess_diag¤bool, default:True) – -
(clamp_hess_quad¤bool, default:True) – -
(clamp_lambda¤bool, default:True) –
Classes:
-
Params– -
ParamsElem–
Methods:
-
energy_density_func– -
energy_density_hess_diag_func– -
energy_density_hess_prod_func– -
energy_density_hess_quad_func– -
first_piola_kirchhoff_stress_func– -
from_pyvista– -
from_region– -
fun– -
get_cell_params– -
grad– -
grad_and_hess_diag– -
hess_diag– -
hess_prod– -
hess_quad– -
make_params– -
mixed_derivative_prod– -
update– -
update_params– -
value_and_grad–
Attributes:
-
cells(Integer[array, 'c a']) – -
clamp_hess_diag(bool) – -
clamp_hess_quad(bool) – -
clamp_lambda(bool) – -
dV(Integer[array, 'c q']) – -
dhdX(Integer[array, 'c q a J']) – -
fun_kernel(Kernel) – -
grad_and_hess_diag_kernel(Kernel) – -
grad_kernel(Kernel) – -
hess_diag_kernel(Kernel) – -
hess_prod_kernel(Kernel) – -
hess_quad_kernel(Kernel) – -
id(str) – -
n_cells(int) – -
n_quadrature_points(int) – -
params(Params) – -
requires_grad(Sequence[str]) – -
value_and_grad_kernel(Kernel) –
id
class-attribute
instance-attribute
¤
requires_grad
class-attribute
instance-attribute
¤
Params
¤
-
Reference
Liblaf
apple
warp
-
warpPhaceget_cell_params -
energies
-
energiesPhaceget_cell_params -
elastic
-
elasticPhaceget_cell_params -
hyperelastic
hyperelasticPhaceget_cell_params
-
-
-
Attributes:
ParamsElem
¤
-
Reference
Liblaf
apple
-
applePhaceget_cell_params -
warp
-
warpPhaceget_cell_params -
energies
-
energiesPhaceget_cell_params -
elastic
-
elasticPhaceget_cell_params -
hyperelastic
hyperelasticPhaceget_cell_params
-
-
-
-
Attributes:
-
activation(vec6) – -
lambda_(float_) – -
mu(float_) – -
muscle_fraction(float_) –
energy_density_func
staticmethod
¤
energy_density_func(
F: mat33, params: ParamsElem
) -> scalar
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_phace.py
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | |
energy_density_hess_diag_func
staticmethod
¤
energy_density_hess_diag_func(
F: mat33,
dhdX: mat43,
params: ParamsElem,
*,
clamp: bool = True,
) -> mat33
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_phace.py
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 | |
energy_density_hess_prod_func
staticmethod
¤
energy_density_hess_prod_func(
F: mat33,
p: mat43,
dhdX: mat43,
params: ParamsElem,
*,
clamp: bool = True,
) -> mat33
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_phace.py
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 | |
energy_density_hess_quad_func
staticmethod
¤
energy_density_hess_quad_func(
F: mat33,
p: mat43,
dhdX: mat43,
params: ParamsElem,
*,
clamp: bool = True,
) -> scalar
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_phace.py
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 | |
first_piola_kirchhoff_stress_func
staticmethod
¤
first_piola_kirchhoff_stress_func(
F: mat33, params: ParamsElem, *, clamp: bool = False
) -> mat33
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_phace.py
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | |
from_pyvista
classmethod
¤
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
59 60 61 62 | |
from_region
classmethod
¤
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
76 77 78 79 80 81 82 83 84 85 86 87 88 | |
fun
¤
fun(u: Vector, output: Scalar) -> None
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
110 111 112 113 114 115 116 117 | |
get_cell_params
staticmethod
¤
get_cell_params(params: Params, cid: int) -> ParamsElem
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_phace.py
40 41 42 43 44 45 46 47 48 49 50 | |
grad
¤
grad(u: Vector, output: Vector) -> None
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
119 120 121 122 123 124 125 126 | |
grad_and_hess_diag
¤
grad_and_hess_diag(
u: Vector, grad: Vector, hess_diag: Vector
) -> None
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
179 180 181 182 183 184 185 186 | |
hess_diag
¤
hess_diag(u: Vector, output: Vector) -> None
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
128 129 130 131 132 133 134 135 | |
hess_prod
¤
hess_prod(u: Vector, p: Vector, output: Vector) -> None
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
137 138 139 140 141 142 143 144 | |
hess_quad
¤
hess_quad(u: Vector, p: Vector, output: Scalar) -> None
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
146 147 148 149 150 151 152 153 | |
make_params
classmethod
¤
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
90 91 92 93 94 | |
mixed_derivative_prod
¤
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
155 156 157 158 159 160 161 162 163 164 165 166 167 168 | |
update
¤
update(u: Vector) -> None
Source code in src/liblaf/apple/warp/model/_energy.py
19 20 | |
update_params
¤
update_params(params: EnergyParams) -> None
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
104 105 106 107 108 | |
value_and_grad
¤
value_and_grad(
u: Vector, value: Scalar, grad: Vector
) -> None
Source code in src/liblaf/apple/warp/energies/elastic/hyperelastic/_base.py
170 171 172 173 174 175 176 177 | |
WarpEnergy
¤
Bases: IdMixin
flowchart TD
liblaf.apple.WarpEnergy[WarpEnergy]
liblaf.apple.utils._id_mixin.IdMixin[IdMixin]
liblaf.apple.utils._id_mixin.IdMixin --> liblaf.apple.WarpEnergy
click liblaf.apple.WarpEnergy href "" "liblaf.apple.WarpEnergy"
click liblaf.apple.utils._id_mixin.IdMixin href "" "liblaf.apple.utils._id_mixin.IdMixin"
Parameters:
-
Reference
Liblaf
apple
-
appleHyperelastic -
warp
-
warpHyperelastic -
energies
-
energiesHyperelastic -
elastic
-
elasticHyperelastic -
hyperelastic
hyperelasticHyperelastic
-
-
-
-
- Reference Liblaf apple
Methods:
-
fun– -
grad– -
grad_and_hess_diag– -
hess_diag– -
hess_prod– -
hess_quad– -
mixed_derivative_prod– -
update– -
update_params– -
value_and_grad–
Attributes:
-
id(str) – -
requires_grad(Sequence[str]) –
id
class-attribute
instance-attribute
¤
requires_grad
class-attribute
instance-attribute
¤
fun
¤
fun(u: Vector, output: Scalar) -> None
Source code in src/liblaf/apple/warp/model/_energy.py
27 28 | |
grad
¤
grad(u: Vector, output: Vector) -> None
Source code in src/liblaf/apple/warp/model/_energy.py
30 31 | |
grad_and_hess_diag
¤
grad_and_hess_diag(
u: Vector, grad: Vector, hess_diag: Vector
) -> None
Source code in src/liblaf/apple/warp/model/_energy.py
49 50 51 | |
hess_diag
¤
hess_diag(u: Vector, output: Vector) -> None
Source code in src/liblaf/apple/warp/model/_energy.py
33 34 | |
hess_prod
¤
hess_prod(u: Vector, p: Vector, output: Vector) -> None
Source code in src/liblaf/apple/warp/model/_energy.py
36 37 | |
hess_quad
¤
hess_quad(u: Vector, p: Vector, output: Scalar) -> None
Source code in src/liblaf/apple/warp/model/_energy.py
39 40 | |
mixed_derivative_prod
¤
Source code in src/liblaf/apple/warp/model/_energy.py
42 43 | |
update
¤
update(u: Vector) -> None
Source code in src/liblaf/apple/warp/model/_energy.py
19 20 | |
update_params
¤
update_params(params: EnergyParams) -> None
Source code in src/liblaf/apple/warp/model/_energy.py
22 23 24 25 | |
value_and_grad
¤
value_and_grad(
u: Vector, value: Scalar, grad: Vector
) -> None
Source code in src/liblaf/apple/warp/model/_energy.py
45 46 47 | |
WarpModel
¤
Parameters:
-
(energies¤dict[str, WarpEnergy], default:<class 'dict'>) –dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2)
Methods:
-
fun– -
grad– -
grad_and_hess_diag– -
hess_diag– -
hess_prod– -
hess_quad– -
mixed_derivative_prod– -
update– -
update_params– -
value_and_grad–
Attributes:
-
energies(dict[str, WarpEnergy]) –
fun
¤
fun(u: Vector, output: Scalar) -> None
Source code in src/liblaf/apple/warp/model/_model.py
27 28 29 | |
grad
¤
grad(u: Vector, output: Vector) -> None
Source code in src/liblaf/apple/warp/model/_model.py
31 32 33 | |
grad_and_hess_diag
¤
grad_and_hess_diag(
u: Vector, grad: Vector, hess_diag: Vector
) -> None
Source code in src/liblaf/apple/warp/model/_model.py
60 61 62 | |
hess_diag
¤
hess_diag(u: Vector, output: Vector) -> None
Source code in src/liblaf/apple/warp/model/_model.py
35 36 37 | |
hess_prod
¤
hess_prod(u: Vector, p: Vector, output: Vector) -> None
Source code in src/liblaf/apple/warp/model/_model.py
39 40 41 | |
hess_quad
¤
hess_quad(u: Vector, p: Vector, output: Scalar) -> None
Source code in src/liblaf/apple/warp/model/_model.py
43 44 45 | |
mixed_derivative_prod
¤
Source code in src/liblaf/apple/warp/model/_model.py
47 48 49 50 51 52 53 54 | |
update
¤
update(u: Vector) -> None
Source code in src/liblaf/apple/warp/model/_model.py
19 20 21 | |
update_params
¤
update_params(params: ModelParams) -> None
Source code in src/liblaf/apple/warp/model/_model.py
23 24 25 | |
value_and_grad
¤
value_and_grad(
u: Vector, value: Scalar, grad: Vector
) -> None
Source code in src/liblaf/apple/warp/model/_model.py
56 57 58 | |
WarpModelBuilder
¤
Parameters:
-
(energies¤dict[str, WarpEnergy], default:<class 'dict'>) –dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2)
-
Reference
Liblaf
apple
-
appleModelBuilderwarp -
model
modelModelBuilderwarp
-
-
Reference
Liblaf
apple
-
appleModelBuilder -
model
modelModelBuilder
-
Methods:
-
add_energy– -
finalize–
Attributes:
-
energies(dict[str, WarpEnergy]) –
add_energy
¤
add_energy(energy: WarpEnergy) -> None
Source code in src/liblaf/apple/warp/model/_builder.py
11 12 | |