liblaf.apple.jax
¤
Modules:
-
energies– -
fem– -
model–
Classes:
-
Dirichlet– -
DirichletBuilder– -
Element–Base-class for a finite element which provides methods for plotting.
-
ElementTetra– -
Geometry– -
GeometryTetra– -
GeometryTriangle– -
JaxEnergy– -
JaxEnergyState– -
JaxMassSpring– -
JaxMassSpringPrestrain– -
JaxModel– -
JaxModelBuilder– -
JaxModelState– -
JaxPointForce– -
QuadratureTetra– -
Region– -
Scheme–
Dirichlet
¤
Parameters:
-
(dim¤int) – -
(dirichlet_index¤Integer[Array, dirichlet]) – -
(dirichlet_value¤Float[Array, dirichlet]) – -
(fixed_mask¤Bool[Array, 'points dim']) – -
(free_index¤Integer[Array, free]) – -
(n_points¤int) –
Methods:
-
get_fixed– -
get_free– -
set_fixed– -
set_free– -
to_full–
Attributes:
-
dim(int) – -
dirichlet_index(Integer[Array, ' dirichlet']) – -
dirichlet_value(Float[Array, ' dirichlet']) – -
fixed_mask(Bool[Array, 'points dim']) – -
free_index(Integer[Array, ' free']) – -
n_dirichlet(int) – -
n_free(int) – -
n_full(int) – -
n_points(int) –
get_fixed
¤
get_fixed(
full: Float[Array, "points dim"],
) -> Float[Array, " dirichlet"]
Source code in src/liblaf/apple/jax/model/dirichlet/_dirichlet.py
27 28 29 | |
get_free
¤
get_free(
full: Float[Array, "points dim"],
) -> Float[Array, " free"]
Source code in src/liblaf/apple/jax/model/dirichlet/_dirichlet.py
31 32 33 | |
set_fixed
¤
set_fixed(
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
35 36 37 38 39 40 41 42 43 | |
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
45 46 47 48 49 | |
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
51 52 53 54 55 56 57 58 59 60 61 62 | |
DirichletBuilder
¤
DirichletBuilder(dim: int = 3)
Parameters:
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 54 | |
resize
¤
resize(n_points: int) -> None
Source code in src/liblaf/apple/jax/model/dirichlet/_builder.py
56 57 58 59 60 61 | |
Element
¤
Base-class for a finite element which provides methods for plotting.
References
Methods:
-
function–Return the shape functions at given coordinates.
-
gradient– -
hessian–
Attributes:
-
cells(Integer[Array, ' points']) – -
dim(int) – -
n_points(int) – -
points(Float[Array, 'points dim']) – -
quadrature(Scheme) –
function
¤
function(
coords: Float[Array, " dim"],
) -> Float[Array, " points"]
Return the shape functions at given coordinates.
Source code in src/liblaf/apple/jax/fem/element/_element.py
38 39 40 | |
gradient
¤
gradient(
coords: Float[Array, " dim"],
) -> Float[Array, "points dim"]
Source code in src/liblaf/apple/jax/fem/element/_element.py
42 43 | |
hessian
¤
hessian(
coords: Float[Array, " dim"],
) -> Float[Array, "points dim dim"]
Source code in src/liblaf/apple/jax/fem/element/_element.py
45 46 | |
ElementTetra
¤
Bases: Element
flowchart TD
liblaf.apple.jax.ElementTetra[ElementTetra]
liblaf.apple.jax.fem.element._element.Element[Element]
liblaf.apple.jax.fem.element._element.Element --> liblaf.apple.jax.ElementTetra
click liblaf.apple.jax.ElementTetra href "" "liblaf.apple.jax.ElementTetra"
click liblaf.apple.jax.fem.element._element.Element href "" "liblaf.apple.jax.fem.element._element.Element"
Methods:
-
function–Return the shape functions at given coordinates.
-
gradient– -
hessian–
Attributes:
-
cells(Integer[Array, ' points']) – -
dim(int) – -
n_points(int) – -
points(Float[Array, 'points dim']) – -
quadrature(QuadratureTetra) –
function
¤
function(
coords: Float[Array, " dim"],
) -> Float[Array, "points=4"]
Return the shape functions at given coordinates.
Source code in src/liblaf/apple/jax/fem/element/_tetra.py
31 32 33 34 | |
gradient
¤
gradient(
coords: Float[Array, " dim"],
) -> Float[Array, "points dim"]
Source code in src/liblaf/apple/jax/fem/element/_tetra.py
36 37 38 39 40 41 42 43 44 45 | |
hessian
¤
hessian(
coords: Float[Array, " dim"],
) -> Float[Array, "points dim dim"]
Source code in src/liblaf/apple/jax/fem/element/_tetra.py
47 48 49 | |
Geometry
¤
Parameters:
Methods:
-
from_pyvista–
Attributes:
-
cell_data(DataSetAttributes) – -
cells_global(Integer[Array, 'c a']) – -
cells_local(Integer[Array, 'c a']) – -
element(Element) – -
global_point_id(Integer[Array, 'p J']) – -
mesh(DataSet) – -
n_cells(int) – -
point_data(DataSetAttributes) – -
points(Float[Array, 'p J']) –
from_pyvista
classmethod
¤
from_pyvista(mesh: DataObject) -> Geometry
Source code in src/liblaf/apple/jax/fem/geometry/_geometry.py
16 17 18 19 20 21 22 23 24 25 | |
GeometryTetra
¤
Bases: Geometry
flowchart TD
liblaf.apple.jax.GeometryTetra[GeometryTetra]
liblaf.apple.jax.fem.geometry._geometry.Geometry[Geometry]
liblaf.apple.jax.fem.geometry._geometry.Geometry --> liblaf.apple.jax.GeometryTetra
click liblaf.apple.jax.GeometryTetra href "" "liblaf.apple.jax.GeometryTetra"
click liblaf.apple.jax.fem.geometry._geometry.Geometry href "" "liblaf.apple.jax.fem.geometry._geometry.Geometry"
Parameters:
-
(mesh¤UnstructuredGrid) –
Methods:
-
from_pyvista–
Attributes:
-
cell_data(DataSetAttributes) – -
cells_global(Integer[Array, 'c a']) – -
cells_local(Integer[Array, 'c a']) – -
element(ElementTetra) – -
global_point_id(Integer[Array, 'p J']) – -
mesh(UnstructuredGrid) – -
n_cells(int) – -
point_data(DataSetAttributes) – -
points(Float[Array, 'p J']) –
from_pyvista
classmethod
¤
from_pyvista(mesh: UnstructuredGrid) -> Self
Source code in src/liblaf/apple/jax/fem/geometry/_tetra.py
17 18 19 20 21 | |
GeometryTriangle
¤
Bases: Geometry
flowchart TD
liblaf.apple.jax.GeometryTriangle[GeometryTriangle]
liblaf.apple.jax.fem.geometry._geometry.Geometry[Geometry]
liblaf.apple.jax.fem.geometry._geometry.Geometry --> liblaf.apple.jax.GeometryTriangle
click liblaf.apple.jax.GeometryTriangle href "" "liblaf.apple.jax.GeometryTriangle"
click liblaf.apple.jax.fem.geometry._geometry.Geometry href "" "liblaf.apple.jax.fem.geometry._geometry.Geometry"
Parameters:
-
(mesh¤PolyData) –
Methods:
-
from_pyvista–
Attributes:
-
cell_data(DataSetAttributes) – -
cells_global(Integer[Array, 'c a']) – -
cells_local(Integer[Array, 'c a']) – -
element(Element) – -
global_point_id(Integer[Array, 'p J']) – -
mesh(PolyData) – -
n_cells(int) – -
point_data(DataSetAttributes) – -
points(Float[Array, 'p J']) –
from_pyvista
classmethod
¤
Source code in src/liblaf/apple/jax/fem/geometry/_triangle.py
15 16 17 18 19 20 | |
JaxEnergy
¤
Parameters:
Methods:
-
fun– -
grad– -
grad_and_hess_diag– -
hess_diag– -
hess_prod– -
hess_quad– -
init_state– -
mixed_derivative_prod– -
update– -
update_materials– -
value_and_grad–
Attributes:
requires_grad
class-attribute
instance-attribute
¤
fun
¤
fun(state: JaxEnergyState, u: Vector) -> Scalar
Source code in src/liblaf/apple/jax/model/_energy.py
34 35 | |
grad
¤
grad(state: JaxEnergyState, u: Vector) -> Updates
Source code in src/liblaf/apple/jax/model/_energy.py
37 38 39 40 | |
grad_and_hess_diag
¤
grad_and_hess_diag(
state: JaxEnergyState, u: Vector
) -> tuple[Updates, Updates]
Source code in src/liblaf/apple/jax/model/_energy.py
67 68 69 70 71 | |
hess_diag
¤
hess_diag(state: JaxEnergyState, u: Vector) -> Updates
Source code in src/liblaf/apple/jax/model/_energy.py
42 43 | |
hess_prod
¤
hess_prod(
state: JaxEnergyState, u: Vector, p: Vector
) -> Updates
Source code in src/liblaf/apple/jax/model/_energy.py
45 46 47 48 49 | |
hess_quad
¤
hess_quad(
state: JaxEnergyState, u: Vector, p: Vector
) -> Scalar
Source code in src/liblaf/apple/jax/model/_energy.py
51 52 53 54 55 56 | |
init_state
¤
init_state(u: Vector) -> JaxEnergyState
Source code in src/liblaf/apple/jax/model/_energy.py
25 26 | |
mixed_derivative_prod
¤
Source code in src/liblaf/apple/jax/model/_energy.py
73 74 75 76 77 78 79 80 | |
update
¤
update(state: JaxEnergyState, u: Vector) -> JaxEnergyState
Source code in src/liblaf/apple/jax/model/_energy.py
28 29 | |
update_materials
¤
update_materials(materials: EnergyMaterials) -> None
Source code in src/liblaf/apple/jax/model/_energy.py
31 32 | |
value_and_grad
¤
value_and_grad(
state: JaxEnergyState, u: Vector
) -> tuple[Scalar, Updates]
Source code in src/liblaf/apple/jax/model/_energy.py
58 59 60 61 62 63 64 65 | |
JaxEnergyState
¤
JaxMassSpring
¤
Bases: JaxEnergy
flowchart TD
liblaf.apple.jax.JaxMassSpring[JaxMassSpring]
liblaf.apple.jax.model._energy.JaxEnergy[JaxEnergy]
liblaf.apple.jax.model._energy.JaxEnergy --> liblaf.apple.jax.JaxMassSpring
click liblaf.apple.jax.JaxMassSpring href "" "liblaf.apple.jax.JaxMassSpring"
click liblaf.apple.jax.model._energy.JaxEnergy href "" "liblaf.apple.jax.model._energy.JaxEnergy"
Parameters:
-
(name¤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– -
init_state– -
mixed_derivative_prod– -
update– -
update_materials– -
value_and_grad–
Attributes:
-
edges(Integer[Array, ' edges 2']) – -
length(Float[Array, ' edges']) – -
n_edges(int) – -
name(str) – -
points(Float[Array, 'edges 2 3']) – -
requires_grad(frozenset[str]) – -
stiffness(Float[Array, ' edges']) –
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(state: JaxEnergyState, 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(state: JaxEnergyState, 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(
state: JaxEnergyState, u: Vector
) -> tuple[Updates, Updates]
Source code in src/liblaf/apple/jax/model/_energy.py
67 68 69 70 71 | |
hess_diag
¤
hess_diag(state: JaxEnergyState, u: Vector) -> Updates
Source code in src/liblaf/apple/jax/energies/_mass_spring.py
76 77 78 79 80 81 | |
hess_prod
¤
hess_prod(
state: JaxEnergyState, u: Vector, p: Vector
) -> Updates
Source code in src/liblaf/apple/jax/model/_energy.py
45 46 47 48 49 | |
hess_quad
¤
hess_quad(
state: JaxEnergyState, u: Vector, p: Vector
) -> Scalar
Source code in src/liblaf/apple/jax/model/_energy.py
51 52 53 54 55 56 | |
init_state
¤
init_state(u: Vector) -> JaxEnergyState
Source code in src/liblaf/apple/jax/model/_energy.py
25 26 | |
mixed_derivative_prod
¤
Source code in src/liblaf/apple/jax/model/_energy.py
73 74 75 76 77 78 79 80 | |
update
¤
update(state: JaxEnergyState, u: Vector) -> JaxEnergyState
Source code in src/liblaf/apple/jax/model/_energy.py
28 29 | |
update_materials
¤
update_materials(materials: EnergyMaterials) -> None
Source code in src/liblaf/apple/jax/model/_energy.py
31 32 | |
value_and_grad
¤
value_and_grad(
state: JaxEnergyState, u: Vector
) -> tuple[Scalar, Updates]
Source code in src/liblaf/apple/jax/model/_energy.py
58 59 60 61 62 63 64 65 | |
JaxMassSpringPrestrain
¤
Bases: JaxMassSpring
flowchart TD
liblaf.apple.jax.JaxMassSpringPrestrain[JaxMassSpringPrestrain]
liblaf.apple.jax.energies._mass_spring.JaxMassSpring[JaxMassSpring]
liblaf.apple.jax.model._energy.JaxEnergy[JaxEnergy]
liblaf.apple.jax.energies._mass_spring.JaxMassSpring --> liblaf.apple.jax.JaxMassSpringPrestrain
liblaf.apple.jax.model._energy.JaxEnergy --> liblaf.apple.jax.energies._mass_spring.JaxMassSpring
click liblaf.apple.jax.JaxMassSpringPrestrain href "" "liblaf.apple.jax.JaxMassSpringPrestrain"
click liblaf.apple.jax.energies._mass_spring.JaxMassSpring href "" "liblaf.apple.jax.energies._mass_spring.JaxMassSpring"
click liblaf.apple.jax.model._energy.JaxEnergy href "" "liblaf.apple.jax.model._energy.JaxEnergy"
Parameters:
-
(name¤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– -
init_state– -
mixed_derivative_prod– -
update– -
update_materials– -
value_and_grad–
Attributes:
-
edges(Integer[Array, ' edges 2']) – -
length(Float[Array, ' edges']) – -
n_edges(int) – -
name(str) – -
points(Float[Array, 'edges 2 3']) – -
requires_grad(frozenset[str]) – -
stiffness(Float[Array, ' edges']) –
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(state: JaxEnergyState, 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(state: JaxEnergyState, 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(
state: JaxEnergyState, u: Vector
) -> tuple[Updates, Updates]
Source code in src/liblaf/apple/jax/model/_energy.py
67 68 69 70 71 | |
hess_diag
¤
hess_diag(state: JaxEnergyState, u: Vector) -> Updates
Source code in src/liblaf/apple/jax/energies/_mass_spring.py
76 77 78 79 80 81 | |
hess_prod
¤
hess_prod(
state: JaxEnergyState, u: Vector, p: Vector
) -> Updates
Source code in src/liblaf/apple/jax/model/_energy.py
45 46 47 48 49 | |
hess_quad
¤
hess_quad(
state: JaxEnergyState, u: Vector, p: Vector
) -> Scalar
Source code in src/liblaf/apple/jax/model/_energy.py
51 52 53 54 55 56 | |
init_state
¤
init_state(u: Vector) -> JaxEnergyState
Source code in src/liblaf/apple/jax/model/_energy.py
25 26 | |
mixed_derivative_prod
¤
Source code in src/liblaf/apple/jax/model/_energy.py
73 74 75 76 77 78 79 80 | |
update
¤
update(state: JaxEnergyState, u: Vector) -> JaxEnergyState
Source code in src/liblaf/apple/jax/model/_energy.py
28 29 | |
update_materials
¤
update_materials(materials: EnergyMaterials) -> None
Source code in src/liblaf/apple/jax/model/_energy.py
31 32 | |
value_and_grad
¤
value_and_grad(
state: JaxEnergyState, u: Vector
) -> tuple[Scalar, Updates]
Source code in src/liblaf/apple/jax/model/_energy.py
58 59 60 61 62 63 64 65 | |
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– -
init_state– -
mixed_derivative_prod– -
update– -
update_materials– -
value_and_grad–
Attributes:
fun
¤
fun(state: JaxModelState, u: Vector) -> Scalar
Source code in src/liblaf/apple/jax/model/_model.py
38 39 40 41 42 43 | |
grad
¤
grad(state: JaxModelState, u: Vector) -> Vector
Source code in src/liblaf/apple/jax/model/_model.py
45 46 47 48 49 50 51 52 53 | |
grad_and_hess_diag
¤
grad_and_hess_diag(
state: JaxModelState, u: Vector
) -> tuple[Vector, Vector]
Source code in src/liblaf/apple/jax/model/_model.py
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | |
hess_diag
¤
hess_diag(state: JaxModelState, u: Vector) -> Vector
Source code in src/liblaf/apple/jax/model/_model.py
55 56 57 58 59 60 61 62 63 | |
hess_prod
¤
hess_prod(
state: JaxModelState, u: Vector, p: Vector
) -> Vector
Source code in src/liblaf/apple/jax/model/_model.py
65 66 67 68 69 70 71 72 73 | |
hess_quad
¤
hess_quad(
state: JaxModelState, u: Vector, p: Vector
) -> Scalar
Source code in src/liblaf/apple/jax/model/_model.py
75 76 77 78 79 80 | |
init_state
¤
init_state(u: Vector) -> JaxModelState
Source code in src/liblaf/apple/jax/model/_model.py
22 23 24 25 26 | |
mixed_derivative_prod
¤
Source code in src/liblaf/apple/jax/model/_model.py
82 83 84 85 86 87 88 89 | |
update
¤
update(state: JaxModelState, u: Vector) -> JaxModelState
Source code in src/liblaf/apple/jax/model/_model.py
28 29 30 31 32 | |
update_materials
¤
update_materials(materials: ModelMaterials) -> None
Source code in src/liblaf/apple/jax/model/_model.py
34 35 36 | |
value_and_grad
¤
value_and_grad(
state: JaxModelState, u: Vector
) -> tuple[Scalar, Vector]
Source code in src/liblaf/apple/jax/model/_model.py
91 92 93 94 95 96 97 98 99 100 101 | |
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)
Methods:
-
add_energy– -
finalize–
Attributes:
energies
class-attribute
instance-attribute
¤
add_energy
¤
add_energy(energy: JaxEnergy) -> None
Source code in src/liblaf/apple/jax/model/_builder.py
11 12 | |
finalize
¤
finalize() -> JaxModel
Source code in src/liblaf/apple/jax/model/_builder.py
14 15 | |
JaxModelState
¤
Bases: MutableMapping[str, JaxEnergyState]
flowchart TD
liblaf.apple.jax.JaxModelState[JaxModelState]
click liblaf.apple.jax.JaxModelState href "" "liblaf.apple.jax.JaxModelState"
Parameters:
-
(u¤Vector) – -
(data¤dict[str, JaxEnergyState], 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:
-
__delitem__– -
__getitem__– -
__iter__– -
__len__– -
__setitem__–
Attributes:
__delitem__
¤
__delitem__(key: str) -> None
Source code in src/liblaf/apple/jax/model/_state.py
25 26 | |
__getitem__
¤
__getitem__(key: str) -> JaxEnergyState
Source code in src/liblaf/apple/jax/model/_state.py
19 20 | |
__iter__
¤
Source code in src/liblaf/apple/jax/model/_state.py
28 29 | |
JaxPointForce
¤
Bases: JaxEnergy
flowchart TD
liblaf.apple.jax.JaxPointForce[JaxPointForce]
liblaf.apple.jax.model._energy.JaxEnergy[JaxEnergy]
liblaf.apple.jax.model._energy.JaxEnergy --> liblaf.apple.jax.JaxPointForce
click liblaf.apple.jax.JaxPointForce href "" "liblaf.apple.jax.JaxPointForce"
click liblaf.apple.jax.model._energy.JaxEnergy href "" "liblaf.apple.jax.model._energy.JaxEnergy"
Parameters:
-
(name¤str, default:<dynamic>) – -
(requires_grad¤frozenset[str], default:frozenset()) – -
(force¤Vector) – -
(indices¤Index) –
Methods:
-
from_pyvista– -
fun– -
grad– -
grad_and_hess_diag– -
hess_diag– -
hess_prod– -
hess_quad– -
init_state– -
mixed_derivative_prod– -
update– -
update_materials– -
value_and_grad–
Attributes:
requires_grad
class-attribute
instance-attribute
¤
from_pyvista
classmethod
¤
Source code in src/liblaf/apple/jax/energies/_force.py
22 23 24 25 26 27 | |
fun
¤
fun(state: JaxEnergyState, u: Vector) -> Scalar
Source code in src/liblaf/apple/jax/energies/_force.py
29 30 31 32 | |
grad
¤
grad(state: JaxEnergyState, u: Vector) -> Updates
Source code in src/liblaf/apple/jax/model/_energy.py
37 38 39 40 | |
grad_and_hess_diag
¤
grad_and_hess_diag(
state: JaxEnergyState, u: Vector
) -> tuple[Updates, Updates]
Source code in src/liblaf/apple/jax/model/_energy.py
67 68 69 70 71 | |
hess_diag
¤
hess_diag(state: JaxEnergyState, u: Vector) -> Updates
Source code in src/liblaf/apple/jax/energies/_force.py
34 35 36 37 | |
hess_prod
¤
hess_prod(
state: JaxEnergyState, u: Vector, p: Vector
) -> Updates
Source code in src/liblaf/apple/jax/model/_energy.py
45 46 47 48 49 | |
hess_quad
¤
hess_quad(
state: JaxEnergyState, u: Vector, p: Vector
) -> Scalar
Source code in src/liblaf/apple/jax/model/_energy.py
51 52 53 54 55 56 | |
init_state
¤
init_state(u: Vector) -> JaxEnergyState
Source code in src/liblaf/apple/jax/model/_energy.py
25 26 | |
mixed_derivative_prod
¤
Source code in src/liblaf/apple/jax/model/_energy.py
73 74 75 76 77 78 79 80 | |
update
¤
update(state: JaxEnergyState, u: Vector) -> JaxEnergyState
Source code in src/liblaf/apple/jax/model/_energy.py
28 29 | |
update_materials
¤
update_materials(materials: EnergyMaterials) -> None
Source code in src/liblaf/apple/jax/model/_energy.py
31 32 | |
value_and_grad
¤
value_and_grad(
state: JaxEnergyState, u: Vector
) -> tuple[Scalar, Updates]
Source code in src/liblaf/apple/jax/model/_energy.py
58 59 60 61 62 63 64 65 | |
QuadratureTetra
¤
Bases: Scheme
flowchart TD
liblaf.apple.jax.QuadratureTetra[QuadratureTetra]
liblaf.apple.jax.fem.quadrature._scheme.Scheme[Scheme]
liblaf.apple.jax.fem.quadrature._scheme.Scheme --> liblaf.apple.jax.QuadratureTetra
click liblaf.apple.jax.QuadratureTetra href "" "liblaf.apple.jax.QuadratureTetra"
click liblaf.apple.jax.fem.quadrature._scheme.Scheme href "" "liblaf.apple.jax.fem.quadrature._scheme.Scheme"
Parameters:
-
(points¤Float[Array, 'quadrature dim'], default:Array([[0.25, 0.25, 0.25]], dtype=float32)) – -
(weights¤Float[Array, quadrature], default:Array([0.16666667], dtype=float32)) –
Methods:
-
from_felupe– -
from_order–
Attributes:
-
dim(int) – -
n_points(int) – -
points(Float[Array, 'quadrature dim']) – -
weights(Float[Array, ' quadrature']) –
points
class-attribute
instance-attribute
¤
points: Float[Array, "quadrature dim"] = array(
factory=lambda: ones((1, 3)) / 4.0
)
weights
class-attribute
instance-attribute
¤
weights: Float[Array, " quadrature"] = array(
factory=lambda: ones((1,)) / 6.0
)
from_felupe
classmethod
¤
Source code in src/liblaf/apple/jax/fem/quadrature/_scheme.py
14 15 16 17 18 | |
Region
¤
Parameters:
-
(geometry¤Geometry) – -
(quadrature¤Scheme) – -
(h¤Float[Array, 'q a'], default:None) – -
(dhdr¤Float[Array, 'q a J'], default:None) – -
(dXdr¤Float[Array, 'c q J J'], default:None) – -
(drdX¤Float[Array, 'c q J J'], default:None) – -
(dV¤Float[Array, 'c q'], default:None) – -
(dhdX¤Float[Array, 'c q a J'], default:None) –
Methods:
-
compute_grad– -
deformation_gradient– -
from_geometry– -
from_pyvista– -
gradient– -
integrate– -
scatter–
Attributes:
-
cell_data(DataSetAttributes) – -
cells_global(Integer[Array, 'c a']) – -
cells_local(Integer[Array, 'c a']) – -
dV(Float[Array, 'c q']) – -
dXdr(Float[Array, 'c q J J']) – -
dhdX(Float[Array, 'c q a J']) – -
dhdr(Float[Array, 'q a J']) – -
drdX(Float[Array, 'c q J J']) – -
element(Element) – -
geometry(Geometry) – -
h(Float[Array, 'q a']) – -
mesh(DataSet) – -
n_cells(int) – -
point_data(DataSetAttributes) – -
points(Float[Array, 'p J']) – -
quadrature(Scheme) –
compute_grad
¤
compute_grad() -> None
Source code in src/liblaf/apple/jax/fem/region/_region.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | |
deformation_gradient
¤
deformation_gradient(
u: Float[Array, "p J"],
) -> Float[Array, "c q J J"]
Source code in src/liblaf/apple/jax/fem/region/_region.py
110 111 112 113 114 115 | |
from_geometry
classmethod
¤
from_geometry(
geometry: Geometry,
*,
grad: bool = False,
quadrature: Scheme | None = None,
) -> Self
Source code in src/liblaf/apple/jax/fem/region/_region.py
29 30 31 32 33 34 35 36 37 38 | |
from_pyvista
classmethod
¤
from_pyvista(
mesh: DataObject,
*,
grad: bool = False,
quadrature: Scheme | None = None,
) -> Self
Source code in src/liblaf/apple/jax/fem/region/_region.py
40 41 42 43 44 45 46 47 48 49 50 | |
gradient
¤
gradient(
u: Float[Array, " points *shape"],
) -> Float[Array, "c q *shape J"]
Source code in src/liblaf/apple/jax/fem/region/_region.py
117 118 119 120 121 122 123 | |
integrate
¤
integrate(
a: Float[Array, "c q *shape"],
) -> Float[Array, " c *shape"]
Source code in src/liblaf/apple/jax/fem/region/_region.py
125 126 | |
scatter
¤
scatter(
u: Float[Array, " points *shape"],
) -> Float[Array, "c a *shape"]
Source code in src/liblaf/apple/jax/fem/region/_region.py
128 129 | |